@webex/plugin-meetings 3.10.0-next.8 → 3.10.0-webex-services-ready.1

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 (265) hide show
  1. package/dist/annotation/annotation.types.js.map +1 -1
  2. package/dist/annotation/constants.js.map +1 -1
  3. package/dist/annotation/index.js +19 -22
  4. package/dist/annotation/index.js.map +1 -1
  5. package/dist/breakouts/breakout.js +6 -6
  6. package/dist/breakouts/breakout.js.map +1 -1
  7. package/dist/breakouts/collection.js.map +1 -1
  8. package/dist/breakouts/edit-lock-error.js +9 -11
  9. package/dist/breakouts/edit-lock-error.js.map +1 -1
  10. package/dist/breakouts/events.js.map +1 -1
  11. package/dist/breakouts/index.js +126 -127
  12. package/dist/breakouts/index.js.map +1 -1
  13. package/dist/breakouts/request.js +6 -8
  14. package/dist/breakouts/request.js.map +1 -1
  15. package/dist/breakouts/utils.js.map +1 -1
  16. package/dist/common/browser-detection.js.map +1 -1
  17. package/dist/common/collection.js +1 -2
  18. package/dist/common/collection.js.map +1 -1
  19. package/dist/common/config.js.map +1 -1
  20. package/dist/common/errors/captcha-error.js +9 -11
  21. package/dist/common/errors/captcha-error.js.map +1 -1
  22. package/dist/common/errors/intent-to-join.js +10 -12
  23. package/dist/common/errors/intent-to-join.js.map +1 -1
  24. package/dist/common/errors/join-forbidden-error.js +10 -12
  25. package/dist/common/errors/join-forbidden-error.js.map +1 -1
  26. package/dist/common/errors/join-meeting.js +10 -12
  27. package/dist/common/errors/join-meeting.js.map +1 -1
  28. package/dist/common/errors/join-webinar-error.js +9 -11
  29. package/dist/common/errors/join-webinar-error.js.map +1 -1
  30. package/dist/common/errors/media.js +9 -11
  31. package/dist/common/errors/media.js.map +1 -1
  32. package/dist/common/errors/multistream-not-supported-error.js +9 -11
  33. package/dist/common/errors/multistream-not-supported-error.js.map +1 -1
  34. package/dist/common/errors/no-meeting-info.js +9 -11
  35. package/dist/common/errors/no-meeting-info.js.map +1 -1
  36. package/dist/common/errors/parameter.js +11 -14
  37. package/dist/common/errors/parameter.js.map +1 -1
  38. package/dist/common/errors/password-error.js +9 -11
  39. package/dist/common/errors/password-error.js.map +1 -1
  40. package/dist/common/errors/permission.js +9 -11
  41. package/dist/common/errors/permission.js.map +1 -1
  42. package/dist/common/errors/reclaim-host-role-errors.js +32 -38
  43. package/dist/common/errors/reclaim-host-role-errors.js.map +1 -1
  44. package/dist/common/errors/reconnection-not-started.js +5 -6
  45. package/dist/common/errors/reconnection-not-started.js.map +1 -1
  46. package/dist/common/errors/reconnection.js +9 -11
  47. package/dist/common/errors/reconnection.js.map +1 -1
  48. package/dist/common/errors/stats.js +9 -11
  49. package/dist/common/errors/stats.js.map +1 -1
  50. package/dist/common/errors/webex-errors.js +20 -29
  51. package/dist/common/errors/webex-errors.js.map +1 -1
  52. package/dist/common/errors/webex-meetings-error.js +9 -12
  53. package/dist/common/errors/webex-meetings-error.js.map +1 -1
  54. package/dist/common/events/events-scope.js +9 -10
  55. package/dist/common/events/events-scope.js.map +1 -1
  56. package/dist/common/events/events.js +9 -10
  57. package/dist/common/events/events.js.map +1 -1
  58. package/dist/common/events/trigger-proxy.js.map +1 -1
  59. package/dist/common/events/util.js.map +1 -1
  60. package/dist/common/logs/logger-config.js.map +1 -1
  61. package/dist/common/logs/logger-proxy.js.map +1 -1
  62. package/dist/common/logs/request.js +17 -17
  63. package/dist/common/logs/request.js.map +1 -1
  64. package/dist/common/queue.js +1 -2
  65. package/dist/common/queue.js.map +1 -1
  66. package/dist/config.js +0 -1
  67. package/dist/config.js.map +1 -1
  68. package/dist/constants.js +11 -8
  69. package/dist/constants.js.map +1 -1
  70. package/dist/controls-options-manager/constants.js.map +1 -1
  71. package/dist/controls-options-manager/enums.js.map +1 -1
  72. package/dist/controls-options-manager/index.js +1 -2
  73. package/dist/controls-options-manager/index.js.map +1 -1
  74. package/dist/controls-options-manager/types.js.map +1 -1
  75. package/dist/controls-options-manager/util.js +1 -2
  76. package/dist/controls-options-manager/util.js.map +1 -1
  77. package/dist/hashTree/constants.js +20 -0
  78. package/dist/hashTree/constants.js.map +1 -0
  79. package/dist/hashTree/hashTree.js +515 -0
  80. package/dist/hashTree/hashTree.js.map +1 -0
  81. package/dist/hashTree/hashTreeParser.js +1266 -0
  82. package/dist/hashTree/hashTreeParser.js.map +1 -0
  83. package/dist/hashTree/types.js +21 -0
  84. package/dist/hashTree/types.js.map +1 -0
  85. package/dist/hashTree/utils.js +48 -0
  86. package/dist/hashTree/utils.js.map +1 -0
  87. package/dist/index.js +1 -2
  88. package/dist/index.js.map +1 -1
  89. package/dist/interceptors/index.js.map +1 -1
  90. package/dist/interceptors/locusRetry.js +6 -8
  91. package/dist/interceptors/locusRetry.js.map +1 -1
  92. package/dist/interceptors/locusRouteToken.js +6 -8
  93. package/dist/interceptors/locusRouteToken.js.map +1 -1
  94. package/dist/interpretation/collection.js.map +1 -1
  95. package/dist/interpretation/index.js +1 -2
  96. package/dist/interpretation/index.js.map +1 -1
  97. package/dist/interpretation/siLanguage.js +1 -1
  98. package/dist/interpretation/siLanguage.js.map +1 -1
  99. package/dist/locus-info/controlsUtils.js.map +1 -1
  100. package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
  101. package/dist/locus-info/fullState.js.map +1 -1
  102. package/dist/locus-info/hostUtils.js.map +1 -1
  103. package/dist/locus-info/index.js +551 -94
  104. package/dist/locus-info/index.js.map +1 -1
  105. package/dist/locus-info/infoUtils.js.map +1 -1
  106. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  107. package/dist/locus-info/parser.js +3 -4
  108. package/dist/locus-info/parser.js.map +1 -1
  109. package/dist/locus-info/selfUtils.js.map +1 -1
  110. package/dist/locus-info/types.js +7 -0
  111. package/dist/locus-info/types.js.map +1 -0
  112. package/dist/media/MediaConnectionAwaiter.js +1 -2
  113. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  114. package/dist/media/index.js +0 -2
  115. package/dist/media/index.js.map +1 -1
  116. package/dist/media/properties.js +15 -17
  117. package/dist/media/properties.js.map +1 -1
  118. package/dist/media/util.js.map +1 -1
  119. package/dist/meeting/brbState.js +8 -9
  120. package/dist/meeting/brbState.js.map +1 -1
  121. package/dist/meeting/connectionStateHandler.js +10 -13
  122. package/dist/meeting/connectionStateHandler.js.map +1 -1
  123. package/dist/meeting/in-meeting-actions.js.map +1 -1
  124. package/dist/meeting/index.js +1555 -1527
  125. package/dist/meeting/index.js.map +1 -1
  126. package/dist/meeting/locusMediaRequest.js +13 -17
  127. package/dist/meeting/locusMediaRequest.js.map +1 -1
  128. package/dist/meeting/muteState.js +11 -12
  129. package/dist/meeting/muteState.js.map +1 -1
  130. package/dist/meeting/request.js +101 -104
  131. package/dist/meeting/request.js.map +1 -1
  132. package/dist/meeting/request.type.js.map +1 -1
  133. package/dist/meeting/state.js.map +1 -1
  134. package/dist/meeting/type.js.map +1 -1
  135. package/dist/meeting/util.js +24 -23
  136. package/dist/meeting/util.js.map +1 -1
  137. package/dist/meeting/voicea-meeting.js +3 -3
  138. package/dist/meeting/voicea-meeting.js.map +1 -1
  139. package/dist/meeting-info/collection.js +7 -10
  140. package/dist/meeting-info/collection.js.map +1 -1
  141. package/dist/meeting-info/index.js +1 -2
  142. package/dist/meeting-info/index.js.map +1 -1
  143. package/dist/meeting-info/meeting-info-v2.js +135 -146
  144. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  145. package/dist/meeting-info/request.js +1 -2
  146. package/dist/meeting-info/request.js.map +1 -1
  147. package/dist/meeting-info/util.js +36 -37
  148. package/dist/meeting-info/util.js.map +1 -1
  149. package/dist/meeting-info/utilv2.js +30 -31
  150. package/dist/meeting-info/utilv2.js.map +1 -1
  151. package/dist/meetings/collection.js +6 -8
  152. package/dist/meetings/collection.js.map +1 -1
  153. package/dist/meetings/index.js +179 -141
  154. package/dist/meetings/index.js.map +1 -1
  155. package/dist/meetings/meetings.types.js.map +1 -1
  156. package/dist/meetings/request.js +6 -8
  157. package/dist/meetings/request.js.map +1 -1
  158. package/dist/meetings/util.js +25 -23
  159. package/dist/meetings/util.js.map +1 -1
  160. package/dist/member/index.js +1 -2
  161. package/dist/member/index.js.map +1 -1
  162. package/dist/member/types.js +6 -3
  163. package/dist/member/types.js.map +1 -1
  164. package/dist/member/util.js.map +1 -1
  165. package/dist/members/collection.js +1 -2
  166. package/dist/members/collection.js.map +1 -1
  167. package/dist/members/index.js +18 -21
  168. package/dist/members/index.js.map +1 -1
  169. package/dist/members/request.js +8 -11
  170. package/dist/members/request.js.map +1 -1
  171. package/dist/members/types.js.map +1 -1
  172. package/dist/members/util.js.map +1 -1
  173. package/dist/metrics/constants.js +3 -1
  174. package/dist/metrics/constants.js.map +1 -1
  175. package/dist/metrics/index.js +3 -4
  176. package/dist/metrics/index.js.map +1 -1
  177. package/dist/multistream/mediaRequestManager.js +1 -2
  178. package/dist/multistream/mediaRequestManager.js.map +1 -1
  179. package/dist/multistream/receiveSlot.js +34 -45
  180. package/dist/multistream/receiveSlot.js.map +1 -1
  181. package/dist/multistream/receiveSlotManager.js +8 -9
  182. package/dist/multistream/receiveSlotManager.js.map +1 -1
  183. package/dist/multistream/remoteMedia.js +12 -15
  184. package/dist/multistream/remoteMedia.js.map +1 -1
  185. package/dist/multistream/remoteMediaGroup.js +1 -2
  186. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  187. package/dist/multistream/remoteMediaManager.js +122 -123
  188. package/dist/multistream/remoteMediaManager.js.map +1 -1
  189. package/dist/multistream/sendSlotManager.js +29 -30
  190. package/dist/multistream/sendSlotManager.js.map +1 -1
  191. package/dist/personal-meeting-room/index.js +16 -19
  192. package/dist/personal-meeting-room/index.js.map +1 -1
  193. package/dist/personal-meeting-room/request.js +7 -10
  194. package/dist/personal-meeting-room/request.js.map +1 -1
  195. package/dist/personal-meeting-room/util.js.map +1 -1
  196. package/dist/reachability/clusterReachability.js +56 -373
  197. package/dist/reachability/clusterReachability.js.map +1 -1
  198. package/dist/reachability/index.js +203 -205
  199. package/dist/reachability/index.js.map +1 -1
  200. package/dist/reachability/reachability.types.js +14 -1
  201. package/dist/reachability/reachability.types.js.map +1 -1
  202. package/dist/reachability/reachabilityPeerConnection.js +445 -0
  203. package/dist/reachability/reachabilityPeerConnection.js.map +1 -0
  204. package/dist/reachability/request.js.map +1 -1
  205. package/dist/reachability/util.js.map +1 -1
  206. package/dist/reactions/constants.js.map +1 -1
  207. package/dist/reactions/reactions.js.map +1 -1
  208. package/dist/reactions/reactions.type.js.map +1 -1
  209. package/dist/reconnection-manager/index.js +178 -176
  210. package/dist/reconnection-manager/index.js.map +1 -1
  211. package/dist/recording-controller/enums.js.map +1 -1
  212. package/dist/recording-controller/index.js +1 -2
  213. package/dist/recording-controller/index.js.map +1 -1
  214. package/dist/recording-controller/util.js.map +1 -1
  215. package/dist/roap/index.js +12 -15
  216. package/dist/roap/index.js.map +1 -1
  217. package/dist/roap/request.js +24 -26
  218. package/dist/roap/request.js.map +1 -1
  219. package/dist/roap/turnDiscovery.js +75 -76
  220. package/dist/roap/turnDiscovery.js.map +1 -1
  221. package/dist/roap/types.js.map +1 -1
  222. package/dist/transcription/index.js +4 -5
  223. package/dist/transcription/index.js.map +1 -1
  224. package/dist/types/constants.d.ts +26 -21
  225. package/dist/types/hashTree/constants.d.ts +8 -0
  226. package/dist/types/hashTree/hashTree.d.ts +129 -0
  227. package/dist/types/hashTree/hashTreeParser.d.ts +260 -0
  228. package/dist/types/hashTree/types.d.ts +25 -0
  229. package/dist/types/hashTree/utils.d.ts +9 -0
  230. package/dist/types/locus-info/index.d.ts +91 -42
  231. package/dist/types/locus-info/types.d.ts +46 -0
  232. package/dist/types/meeting/index.d.ts +22 -9
  233. package/dist/types/meetings/index.d.ts +9 -2
  234. package/dist/types/metrics/constants.d.ts +2 -0
  235. package/dist/types/reachability/clusterReachability.d.ts +10 -88
  236. package/dist/types/reachability/reachability.types.d.ts +12 -1
  237. package/dist/types/reachability/reachabilityPeerConnection.d.ts +111 -0
  238. package/dist/webinar/collection.js +1 -2
  239. package/dist/webinar/collection.js.map +1 -1
  240. package/dist/webinar/index.js +148 -158
  241. package/dist/webinar/index.js.map +1 -1
  242. package/package.json +22 -21
  243. package/src/constants.ts +13 -1
  244. package/src/hashTree/constants.ts +9 -0
  245. package/src/hashTree/hashTree.ts +463 -0
  246. package/src/hashTree/hashTreeParser.ts +1161 -0
  247. package/src/hashTree/types.ts +30 -0
  248. package/src/hashTree/utils.ts +42 -0
  249. package/src/locus-info/index.ts +556 -85
  250. package/src/locus-info/types.ts +48 -0
  251. package/src/meeting/index.ts +58 -26
  252. package/src/meeting/util.ts +1 -0
  253. package/src/meetings/index.ts +104 -51
  254. package/src/metrics/constants.ts +2 -0
  255. package/src/reachability/clusterReachability.ts +50 -347
  256. package/src/reachability/reachability.types.ts +15 -1
  257. package/src/reachability/reachabilityPeerConnection.ts +416 -0
  258. package/test/unit/spec/hashTree/hashTree.ts +655 -0
  259. package/test/unit/spec/hashTree/hashTreeParser.ts +1532 -0
  260. package/test/unit/spec/hashTree/utils.ts +103 -0
  261. package/test/unit/spec/locus-info/index.js +667 -1
  262. package/test/unit/spec/meeting/index.js +91 -20
  263. package/test/unit/spec/meeting/utils.js +77 -0
  264. package/test/unit/spec/meetings/index.js +71 -26
  265. package/test/unit/spec/reachability/clusterReachability.ts +281 -138
@@ -1849,7 +1849,7 @@ describe('plugin-meetings', () => {
1849
1849
  setCorrelationIdSpy = sinon.spy(meeting, 'setCorrelationId');
1850
1850
  meeting.setLocus = sinon.stub().returns(true);
1851
1851
  webex.meetings.registered = true;
1852
- meeting.updateLLMConnection = sinon.stub().returns(Promise.resolve());
1852
+ sinon.stub(meeting, 'updateLLMConnection').returns(Promise.resolve());
1853
1853
  });
1854
1854
 
1855
1855
  describe('successful', () => {
@@ -2040,7 +2040,7 @@ describe('plugin-meetings', () => {
2040
2040
  const defer = new Defer();
2041
2041
 
2042
2042
  meeting.config.enableAutomaticLLM = true;
2043
- meeting.updateLLMConnection = sinon.stub().returns(defer.promise);
2043
+ meeting.updateLLMConnection.returns(defer.promise);
2044
2044
 
2045
2045
  const result = await meeting.join();
2046
2046
 
@@ -2051,7 +2051,7 @@ describe('plugin-meetings', () => {
2051
2051
 
2052
2052
  it('should call updateLLMConnection as part of joining if config value is set', async () => {
2053
2053
  meeting.config.enableAutomaticLLM = true;
2054
- meeting.updateLLMConnection = sinon.stub().resolves();
2054
+ meeting.updateLLMConnection.resolves();
2055
2055
 
2056
2056
  await meeting.join();
2057
2057
 
@@ -2059,7 +2059,7 @@ describe('plugin-meetings', () => {
2059
2059
  });
2060
2060
 
2061
2061
  it('should not call updateLLMConnection as part of joining if config value is not set', async () => {
2062
- meeting.updateLLMConnection = sinon.stub().resolves();
2062
+ meeting.updateLLMConnection.resolves();
2063
2063
  await meeting.join();
2064
2064
 
2065
2065
  assert.notCalled(meeting.updateLLMConnection);
@@ -2069,7 +2069,7 @@ describe('plugin-meetings', () => {
2069
2069
  const defer = new Defer();
2070
2070
 
2071
2071
  meeting.config.enableAutomaticLLM = true;
2072
- meeting.updateLLMConnection = sinon.stub().returns(defer.promise);
2072
+ meeting.updateLLMConnection.returns(defer.promise);
2073
2073
 
2074
2074
  const result = await meeting.join();
2075
2075
 
@@ -2095,6 +2095,42 @@ describe('plugin-meetings', () => {
2095
2095
  ]);
2096
2096
  }
2097
2097
  });
2098
+
2099
+ it('handles Locus LLM events', async () => {
2100
+ const locusInfoParseStub = sinon.stub(meeting.locusInfo, 'parse');
2101
+ sinon.stub(meeting, 'isJoined').returns(true);
2102
+
2103
+ // Set up llm.on stub to capture the registered listener when updateLLMConnection is called
2104
+ let locusLLMEventListener;
2105
+ meeting.webex.internal.llm.on = sinon.stub().callsFake((eventName, callback) => {
2106
+ if (eventName === 'event:locus.state_message') {
2107
+ locusLLMEventListener = callback;
2108
+ }
2109
+ });
2110
+ meeting.webex.internal.llm.off = sinon.stub();
2111
+
2112
+ // we need the real meeting.updateLLMConnection not the mock
2113
+ meeting.updateLLMConnection.restore();
2114
+
2115
+ // Call updateLLMConnection to register the listener
2116
+ await meeting.updateLLMConnection();
2117
+
2118
+ // Verify the listener was registered and we captured it
2119
+ assert.isDefined(locusLLMEventListener, 'LLM event listener should be registered');
2120
+
2121
+ // Now trigger the event
2122
+ const eventData = {
2123
+ eventType: 'locus.state_message',
2124
+ stateElementsMessage: {
2125
+ header: {messageId: 'msg-1'},
2126
+ elements: [],
2127
+ },
2128
+ };
2129
+
2130
+ locusLLMEventListener({data: eventData});
2131
+
2132
+ assert.calledOnceWithExactly(locusInfoParseStub, meeting, eventData);
2133
+ });
2098
2134
  });
2099
2135
 
2100
2136
  describe('refreshPermissionToken', () => {
@@ -4749,6 +4785,7 @@ describe('plugin-meetings', () => {
4749
4785
  id: 'fake locus from mocked join request',
4750
4786
  locusUrl: 'fake locus url',
4751
4787
  mediaId: 'fake media id',
4788
+ locus: {fullState: {}},
4752
4789
  });
4753
4790
  sinon.stub(meeting.meetingRequest, 'joinMeeting').resolves({
4754
4791
  headers: {
@@ -12291,16 +12328,26 @@ describe('plugin-meetings', () => {
12291
12328
  assert.notCalled(webex.internal.llm.disconnectLLM);
12292
12329
  assert.calledWith(webex.internal.llm.registerAndConnect, 'a url', 'a datachannel url');
12293
12330
  assert.equal(result, 'something');
12294
- assert.calledOnceWithExactly(
12331
+ assert.calledWithExactly(
12295
12332
  meeting.webex.internal.llm.off,
12296
12333
  'event:relay.event',
12297
12334
  meeting.processRelayEvent
12298
12335
  );
12299
- assert.calledOnceWithExactly(
12336
+ assert.calledWithExactly(
12337
+ meeting.webex.internal.llm.off,
12338
+ 'event:locus.state_message',
12339
+ meeting.processLocusLLMEvent
12340
+ );
12341
+ assert.calledWithExactly(
12300
12342
  meeting.webex.internal.llm.on,
12301
12343
  'event:relay.event',
12302
12344
  meeting.processRelayEvent
12303
12345
  );
12346
+ assert.calledWithExactly(
12347
+ meeting.webex.internal.llm.on,
12348
+ 'event:locus.state_message',
12349
+ meeting.processLocusLLMEvent
12350
+ );
12304
12351
  });
12305
12352
 
12306
12353
  it('disconnects if first if the locus url has changed', async () => {
@@ -12328,15 +12375,25 @@ describe('plugin-meetings', () => {
12328
12375
  'event:relay.event',
12329
12376
  meeting.processRelayEvent
12330
12377
  );
12331
- assert.calledTwice(meeting.webex.internal.llm.off);
12332
- assert.calledOnceWithExactly(
12378
+ assert.calledWithExactly(
12379
+ meeting.webex.internal.llm.off,
12380
+ 'event:locus.state_message',
12381
+ meeting.processLocusLLMEvent
12382
+ );
12383
+ assert.callCount(meeting.webex.internal.llm.off, 4);
12384
+ assert.calledWithExactly(
12333
12385
  meeting.webex.internal.llm.on,
12334
12386
  'event:relay.event',
12335
12387
  meeting.processRelayEvent
12336
12388
  );
12389
+ assert.calledWithExactly(
12390
+ meeting.webex.internal.llm.on,
12391
+ 'event:locus.state_message',
12392
+ meeting.processLocusLLMEvent
12393
+ );
12337
12394
  });
12338
12395
 
12339
- it('disconnects if first if the data channel url has changed', async () => {
12396
+ it('disconnects it first if the data channel url has changed', async () => {
12340
12397
  meeting.joinedWith = {state: 'JOINED'};
12341
12398
  webex.internal.llm.isConnected.returns(true);
12342
12399
  webex.internal.llm.getLocusUrl.returns('a url');
@@ -12361,12 +12418,21 @@ describe('plugin-meetings', () => {
12361
12418
  'event:relay.event',
12362
12419
  meeting.processRelayEvent
12363
12420
  );
12364
- assert.calledTwice(meeting.webex.internal.llm.off);
12365
- assert.calledOnceWithExactly(
12421
+ assert.calledWithExactly(
12422
+ meeting.webex.internal.llm.off,
12423
+ 'event:locus.state_message',
12424
+ meeting.processLocusLLMEvent
12425
+ );
12426
+ assert.calledWithExactly(
12366
12427
  meeting.webex.internal.llm.on,
12367
12428
  'event:relay.event',
12368
12429
  meeting.processRelayEvent
12369
12430
  );
12431
+ assert.calledWithExactly(
12432
+ meeting.webex.internal.llm.on,
12433
+ 'event:locus.state_message',
12434
+ meeting.processLocusLLMEvent
12435
+ );
12370
12436
  });
12371
12437
 
12372
12438
  it('disconnects when the state is not JOINED', async () => {
@@ -12381,11 +12447,16 @@ describe('plugin-meetings', () => {
12381
12447
  assert.calledWith(webex.internal.llm.disconnectLLM, undefined);
12382
12448
  assert.notCalled(webex.internal.llm.registerAndConnect);
12383
12449
  assert.equal(result, undefined);
12384
- assert.calledOnceWithExactly(
12450
+ assert.calledWithExactly(
12385
12451
  meeting.webex.internal.llm.off,
12386
12452
  'event:relay.event',
12387
12453
  meeting.processRelayEvent
12388
12454
  );
12455
+ assert.calledWithExactly(
12456
+ meeting.webex.internal.llm.off,
12457
+ 'event:locus.state_message',
12458
+ meeting.processLocusLLMEvent
12459
+ );
12389
12460
  });
12390
12461
 
12391
12462
  it('connect ps data channel if ps started in webinar', async () => {
@@ -12411,22 +12482,22 @@ describe('plugin-meetings', () => {
12411
12482
  });
12412
12483
 
12413
12484
  it('should read the locus object, set on the meeting and return null', () => {
12485
+ const dataSets = {someFakeStuff: 'dataSet'};
12486
+
12414
12487
  meeting.setLocus({
12415
12488
  mediaConnections: [test1],
12416
12489
  locusUrl: url1,
12417
12490
  locusId: uuid1,
12418
12491
  selfId: uuid2,
12419
12492
  mediaId: uuid3,
12420
- host: {id: uuid4},
12493
+ locus: {host: {id: uuid4}},
12494
+ dataSets,
12421
12495
  });
12422
12496
  assert.calledOnce(meeting.locusInfo.initialSetup);
12423
12497
  assert.calledWith(meeting.locusInfo.initialSetup, {
12424
- mediaConnections: [test1],
12425
- locusUrl: url1,
12426
- locusId: uuid1,
12427
- selfId: uuid2,
12428
- mediaId: uuid3,
12429
- host: {id: uuid4},
12498
+ trigger: 'join-response',
12499
+ locus: {host: {id: uuid4}},
12500
+ dataSets,
12430
12501
  });
12431
12502
  assert.equal(meeting.mediaConnections, test1);
12432
12503
  assert.equal(meeting.locusUrl, url1);
@@ -1433,5 +1433,82 @@ describe('plugin-meetings', () => {
1433
1433
  });
1434
1434
  });
1435
1435
  });
1436
+
1437
+ describe('#parseLocusJoin', () => {
1438
+ let response;
1439
+
1440
+ beforeEach(() => {
1441
+ response = {
1442
+ body: {
1443
+ locus: {
1444
+ url: 'https://locus-a.wbx2.com/locus/api/v1/loci/12345',
1445
+ self: {
1446
+ id: 'selfId123',
1447
+ },
1448
+ },
1449
+ dataSets: [{name: 'dataset1', url: 'http://dataset.com'}],
1450
+ mediaConnections: [
1451
+ {mediaId: 'mediaId456'},
1452
+ {someOtherField: 'value'},
1453
+ ],
1454
+ },
1455
+ };
1456
+ });
1457
+
1458
+ it('works as expected', () => {
1459
+ const result = MeetingUtil.parseLocusJoin(response);
1460
+
1461
+ assert.deepEqual(result, {
1462
+ locus: response.body.locus,
1463
+ dataSets: response.body.dataSets,
1464
+ mediaConnections: response.body.mediaConnections,
1465
+ locusUrl: 'https://locus-a.wbx2.com/locus/api/v1/loci/12345',
1466
+ locusId: '12345',
1467
+ selfId: 'selfId123',
1468
+ mediaId: 'mediaId456',
1469
+ });
1470
+ });
1471
+
1472
+ it('extracts mediaId from the last mediaConnection that has it', () => {
1473
+ response.body.mediaConnections = [
1474
+ {someField: 'noMediaId'},
1475
+ {mediaId: 'firstMediaId'},
1476
+ {mediaId: 'secondMediaId'},
1477
+ ];
1478
+
1479
+ const result = MeetingUtil.parseLocusJoin(response);
1480
+
1481
+ // Note: the implementation uses forEach which doesn't break,
1482
+ // so it will use the last mediaId found, not the first
1483
+ assert.equal(result.mediaId, 'secondMediaId');
1484
+ });
1485
+
1486
+ it('handles empty mediaConnections array', () => {
1487
+ response.body.mediaConnections = [];
1488
+
1489
+ const result = MeetingUtil.parseLocusJoin(response);
1490
+
1491
+ assert.deepEqual(result, {
1492
+ locus: response.body.locus,
1493
+ dataSets: response.body.dataSets,
1494
+ mediaConnections: [],
1495
+ locusUrl: 'https://locus-a.wbx2.com/locus/api/v1/loci/12345',
1496
+ locusId: '12345',
1497
+ selfId: 'selfId123',
1498
+ });
1499
+ assert.isUndefined(result.mediaId);
1500
+ });
1501
+
1502
+ it('handles mediaConnections without mediaId', () => {
1503
+ response.body.mediaConnections = [
1504
+ {someField: 'value1'},
1505
+ {anotherField: 'value2'},
1506
+ ];
1507
+
1508
+ const result = MeetingUtil.parseLocusJoin(response);
1509
+
1510
+ assert.isUndefined(result.mediaId);
1511
+ });
1512
+ });
1436
1513
  });
1437
1514
  });
@@ -914,7 +914,11 @@ describe('plugin-meetings', () => {
914
914
  'LOCUS_ID'
915
915
  );
916
916
  assert.calledWith(initialSetup, {
917
- url: url1,
917
+ trigger: 'get-loci-response',
918
+ locus: {
919
+ url: url1,
920
+ },
921
+ hashTreeMessage: undefined
918
922
  });
919
923
  });
920
924
  });
@@ -1415,21 +1419,53 @@ describe('plugin-meetings', () => {
1415
1419
  );
1416
1420
  assert.calledOnce(initialSetup);
1417
1421
  assert.calledWith(initialSetup, {
1418
- id: uuid1,
1419
- replaces: [
1420
- {
1421
- locusUrl: 'http:locusUrl',
1422
+ trigger: 'locus-message',
1423
+ locus: {
1424
+ id: uuid1,
1425
+ replaces: [
1426
+ {
1427
+ locusUrl: 'http:locusUrl',
1428
+ },
1429
+ ],
1430
+ self: {
1431
+ callBackInfo: {
1432
+ callbackAddress: uri1,
1433
+ },
1434
+ devices: [],
1422
1435
  },
1423
- ],
1424
- self: {
1425
- callBackInfo: {
1426
- callbackAddress: uri1,
1436
+ info: {
1437
+ webExMeetingId,
1427
1438
  },
1428
- devices: [],
1429
1439
  },
1440
+ hashTreeMessage: undefined
1441
+ });
1442
+ });
1443
+ it('should setup the meeting from a hash tree event', async () => {
1444
+ const locus = {
1445
+ id: uuid1,
1446
+ self: {},
1430
1447
  info: {
1431
1448
  webExMeetingId,
1432
1449
  },
1450
+ };
1451
+ const hashTreeMessage = {something: 'hashTreeData'};
1452
+ await webex.meetings.handleLocusEvent({
1453
+ locus,
1454
+ eventType: 'locus.state_message',
1455
+ locusUrl: url1,
1456
+ stateElementsMessage: hashTreeMessage,
1457
+ });
1458
+ assert.calledWith(webex.meetings.meetingCollection.getByKey, 'locusUrl', url1);
1459
+ assert.calledWith(
1460
+ webex.meetings.meetingCollection.getByKey,
1461
+ 'meetingNumber',
1462
+ webExMeetingId
1463
+ );
1464
+ assert.calledOnce(initialSetup);
1465
+ assert.calledWith(initialSetup, {
1466
+ trigger: 'locus-message',
1467
+ locus,
1468
+ hashTreeMessage,
1433
1469
  });
1434
1470
  });
1435
1471
  it('should setup the meeting by difference event without replaces', async () => {
@@ -1458,16 +1494,20 @@ describe('plugin-meetings', () => {
1458
1494
  );
1459
1495
  assert.calledOnce(initialSetup);
1460
1496
  assert.calledWith(initialSetup, {
1461
- id: uuid1,
1462
- self: {
1463
- callBackInfo: {
1464
- callbackAddress: uri1,
1497
+ trigger: 'locus-message',
1498
+ locus: {
1499
+ id: uuid1,
1500
+ self: {
1501
+ callBackInfo: {
1502
+ callbackAddress: uri1,
1503
+ },
1504
+ devices: [],
1505
+ },
1506
+ info: {
1507
+ webExMeetingId,
1465
1508
  },
1466
- devices: [],
1467
- },
1468
- info: {
1469
- webExMeetingId,
1470
1509
  },
1510
+ hashTreeMessage: undefined
1471
1511
  });
1472
1512
  });
1473
1513
 
@@ -1530,16 +1570,20 @@ describe('plugin-meetings', () => {
1530
1570
  );
1531
1571
  assert.calledOnce(initialSetup);
1532
1572
  assert.calledWith(initialSetup, {
1533
- id: uuid1,
1534
- self: {
1535
- callBackInfo: {
1536
- callbackAddress: uri1,
1573
+ trigger: 'locus-message',
1574
+ locus: {
1575
+ id: uuid1,
1576
+ self: {
1577
+ callBackInfo: {
1578
+ callbackAddress: uri1,
1579
+ },
1580
+ devices: [],
1581
+ },
1582
+ info: {
1583
+ webExMeetingId,
1537
1584
  },
1538
- devices: [],
1539
- },
1540
- info: {
1541
- webExMeetingId,
1542
1585
  },
1586
+ hashTreeMessage: undefined
1543
1587
  });
1544
1588
  });
1545
1589
 
@@ -3087,6 +3131,7 @@ describe('plugin-meetings', () => {
3087
3131
  },
3088
3132
  });
3089
3133
  assert.calledWith(webex.meetings.handleLocusEvent, {
3134
+ eventType: LOCUSEVENT.SDK_NO_EVENT,
3090
3135
  locus: breakoutLocus,
3091
3136
  locusUrl: breakoutLocus.url,
3092
3137
  });