@webex/plugin-meetings 3.12.0-next.15 → 3.12.0-next.151

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 (296) 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 +207 -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/dist/aiEnableRequest/index.js +15 -2
  40. package/dist/aiEnableRequest/index.js.map +1 -1
  41. package/dist/annotation/index.js +2 -2
  42. package/dist/annotation/index.js.map +1 -1
  43. package/dist/breakouts/breakout.js +8 -3
  44. package/dist/breakouts/breakout.js.map +1 -1
  45. package/dist/breakouts/events.js +29 -14
  46. package/dist/breakouts/events.js.map +1 -1
  47. package/dist/breakouts/index.js +99 -4
  48. package/dist/breakouts/index.js.map +1 -1
  49. package/dist/common/errors/webex-errors.js +49 -5
  50. package/dist/common/errors/webex-errors.js.map +1 -1
  51. package/dist/config.js +2 -2
  52. package/dist/config.js.map +1 -1
  53. package/dist/constants.js +37 -10
  54. package/dist/constants.js.map +1 -1
  55. package/dist/controls-options-manager/index.js +46 -10
  56. package/dist/controls-options-manager/index.js.map +1 -1
  57. package/dist/hashTree/constants.js +4 -1
  58. package/dist/hashTree/constants.js.map +1 -1
  59. package/dist/hashTree/hashTreeParser.js +1096 -391
  60. package/dist/hashTree/hashTreeParser.js.map +1 -1
  61. package/dist/hashTree/utils.js +20 -0
  62. package/dist/hashTree/utils.js.map +1 -1
  63. package/dist/index.js +7 -0
  64. package/dist/index.js.map +1 -1
  65. package/dist/interceptors/dataChannelAuthToken.js +75 -15
  66. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  67. package/dist/interceptors/locusRetry.js +23 -8
  68. package/dist/interceptors/locusRetry.js.map +1 -1
  69. package/dist/interpretation/index.js +55 -12
  70. package/dist/interpretation/index.js.map +1 -1
  71. package/dist/interpretation/interpretation.types.js +7 -0
  72. package/dist/interpretation/interpretation.types.js.map +1 -0
  73. package/dist/interpretation/siLanguage.js +1 -1
  74. package/dist/locus-info/controlsUtils.js +4 -1
  75. package/dist/locus-info/controlsUtils.js.map +1 -1
  76. package/dist/locus-info/index.js +615 -176
  77. package/dist/locus-info/index.js.map +1 -1
  78. package/dist/locus-info/infoUtils.js +36 -5
  79. package/dist/locus-info/infoUtils.js.map +1 -1
  80. package/dist/locus-info/types.js +20 -0
  81. package/dist/locus-info/types.js.map +1 -1
  82. package/dist/media/MediaConnectionAwaiter.js +15 -2
  83. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  84. package/dist/media/index.js +8 -2
  85. package/dist/media/index.js.map +1 -1
  86. package/dist/media/properties.js +4 -5
  87. package/dist/media/properties.js.map +1 -1
  88. package/dist/meeting/in-meeting-actions.js +7 -1
  89. package/dist/meeting/in-meeting-actions.js.map +1 -1
  90. package/dist/meeting/index.js +1684 -835
  91. package/dist/meeting/index.js.map +1 -1
  92. package/dist/meeting/locusMediaRequest.js +229 -82
  93. package/dist/meeting/locusMediaRequest.js.map +1 -1
  94. package/dist/meeting/muteState.js +10 -1
  95. package/dist/meeting/muteState.js.map +1 -1
  96. package/dist/meeting/request.js +5 -2
  97. package/dist/meeting/request.js.map +1 -1
  98. package/dist/meeting/util.js +37 -3
  99. package/dist/meeting/util.js.map +1 -1
  100. package/dist/meeting/voicea-meeting.js +2 -1
  101. package/dist/meeting/voicea-meeting.js.map +1 -1
  102. package/dist/meeting-info/meeting-info-v2.js +9 -3
  103. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  104. package/dist/meetings/index.js +300 -128
  105. package/dist/meetings/index.js.map +1 -1
  106. package/dist/meetings/meetings.types.js +6 -1
  107. package/dist/meetings/meetings.types.js.map +1 -1
  108. package/dist/meetings/request.js +39 -0
  109. package/dist/meetings/request.js.map +1 -1
  110. package/dist/meetings/util.js +116 -18
  111. package/dist/meetings/util.js.map +1 -1
  112. package/dist/member/index.js +10 -0
  113. package/dist/member/index.js.map +1 -1
  114. package/dist/member/types.js.map +1 -1
  115. package/dist/member/util.js +30 -0
  116. package/dist/member/util.js.map +1 -1
  117. package/dist/members/index.js +101 -43
  118. package/dist/members/index.js.map +1 -1
  119. package/dist/members/util.js +8 -1
  120. package/dist/members/util.js.map +1 -1
  121. package/dist/metrics/constants.js +7 -1
  122. package/dist/metrics/constants.js.map +1 -1
  123. package/dist/multistream/codec/constants.js +63 -0
  124. package/dist/multistream/codec/constants.js.map +1 -0
  125. package/dist/multistream/mediaRequestManager.js +62 -15
  126. package/dist/multistream/mediaRequestManager.js.map +1 -1
  127. package/dist/multistream/receiveSlot.js +9 -0
  128. package/dist/multistream/receiveSlot.js.map +1 -1
  129. package/dist/reachability/clusterReachability.js.map +1 -1
  130. package/dist/reachability/index.js +121 -83
  131. package/dist/reachability/index.js.map +1 -1
  132. package/dist/reachability/reachability.types.js +2 -0
  133. package/dist/reachability/reachability.types.js.map +1 -1
  134. package/dist/reachability/util.js +45 -0
  135. package/dist/reachability/util.js.map +1 -1
  136. package/dist/reactions/reactions.type.js.map +1 -1
  137. package/dist/recording-controller/index.js +1 -3
  138. package/dist/recording-controller/index.js.map +1 -1
  139. package/dist/roap/turnDiscovery.js +8 -1
  140. package/dist/roap/turnDiscovery.js.map +1 -1
  141. package/dist/types/common/errors/webex-errors.d.ts +32 -2
  142. package/dist/types/config.d.ts +2 -2
  143. package/dist/types/constants.d.ts +13 -1
  144. package/dist/types/controls-options-manager/index.d.ts +16 -0
  145. package/dist/types/hashTree/constants.d.ts +1 -0
  146. package/dist/types/hashTree/hashTreeParser.d.ts +201 -22
  147. package/dist/types/hashTree/utils.d.ts +7 -0
  148. package/dist/types/index.d.ts +3 -0
  149. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  150. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  151. package/dist/types/locus-info/index.d.ts +106 -8
  152. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  153. package/dist/types/locus-info/types.d.ts +22 -1
  154. package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
  155. package/dist/types/media/properties.d.ts +6 -2
  156. package/dist/types/meeting/in-meeting-actions.d.ts +6 -0
  157. package/dist/types/meeting/index.d.ts +176 -11
  158. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  159. package/dist/types/meeting/request.d.ts +1 -0
  160. package/dist/types/meeting/util.d.ts +9 -0
  161. package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
  162. package/dist/types/meetings/index.d.ts +40 -19
  163. package/dist/types/meetings/meetings.types.d.ts +15 -0
  164. package/dist/types/meetings/request.d.ts +14 -0
  165. package/dist/types/member/index.d.ts +1 -0
  166. package/dist/types/member/types.d.ts +1 -0
  167. package/dist/types/member/util.d.ts +9 -0
  168. package/dist/types/members/index.d.ts +15 -2
  169. package/dist/types/members/util.d.ts +1 -5
  170. package/dist/types/metrics/constants.d.ts +6 -0
  171. package/dist/types/multistream/codec/constants.d.ts +7 -0
  172. package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
  173. package/dist/types/reachability/clusterReachability.d.ts +3 -3
  174. package/dist/types/reachability/index.d.ts +10 -3
  175. package/dist/types/reachability/reachability.types.d.ts +7 -0
  176. package/dist/types/reachability/util.d.ts +17 -0
  177. package/dist/types/reactions/reactions.type.d.ts +3 -0
  178. package/dist/webinar/index.js +307 -161
  179. package/dist/webinar/index.js.map +1 -1
  180. package/package.json +23 -23
  181. package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +223 -0
  182. package/src/aiEnableRequest/index.ts +16 -0
  183. package/src/annotation/ai-docs/annotation-spec.md +236 -0
  184. package/src/annotation/index.ts +6 -4
  185. package/src/breakouts/ai-docs/breakouts-spec.md +324 -0
  186. package/src/breakouts/breakout.ts +3 -1
  187. package/src/breakouts/events.ts +33 -11
  188. package/src/breakouts/index.ts +122 -2
  189. package/src/common/errors/webex-errors.ts +50 -3
  190. package/src/config.ts +2 -2
  191. package/src/constants.ts +21 -3
  192. package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +243 -0
  193. package/src/controls-options-manager/index.ts +62 -10
  194. package/src/hashTree/ai-docs/hash-tree-spec.md +267 -0
  195. package/src/hashTree/constants.ts +7 -0
  196. package/src/hashTree/hashTreeParser.ts +861 -193
  197. package/src/hashTree/utils.ts +19 -0
  198. package/src/index.ts +6 -0
  199. package/src/interceptors/ai-docs/interceptors-spec.md +247 -0
  200. package/src/interceptors/dataChannelAuthToken.ts +88 -12
  201. package/src/interceptors/locusRetry.ts +25 -4
  202. package/src/interpretation/ai-docs/interpretation-spec.md +256 -0
  203. package/src/interpretation/index.ts +65 -10
  204. package/src/interpretation/interpretation.types.ts +11 -0
  205. package/src/locus-info/ai-docs/locus-info-spec.md +293 -0
  206. package/src/locus-info/controlsUtils.ts +3 -1
  207. package/src/locus-info/index.ts +566 -164
  208. package/src/locus-info/infoUtils.ts +41 -6
  209. package/src/locus-info/types.ts +26 -1
  210. package/src/media/MediaConnectionAwaiter.ts +21 -4
  211. package/src/media/ai-docs/media-spec.md +267 -0
  212. package/src/media/index.ts +10 -1
  213. package/src/media/properties.ts +8 -3
  214. package/src/meeting/ai-docs/meeting-spec.md +401 -0
  215. package/src/meeting/in-meeting-actions.ts +12 -0
  216. package/src/meeting/index.ts +937 -119
  217. package/src/meeting/locusMediaRequest.ts +106 -6
  218. package/src/meeting/muteState.ts +10 -1
  219. package/src/meeting/request.ts +11 -0
  220. package/src/meeting/util.ts +51 -7
  221. package/src/meeting/voicea-meeting.ts +1 -1
  222. package/src/meeting-info/ai-docs/meeting-info-spec.md +261 -0
  223. package/src/meeting-info/meeting-info-v2.ts +10 -4
  224. package/src/meetings/ai-docs/meetings-spec.md +296 -0
  225. package/src/meetings/index.ts +200 -80
  226. package/src/meetings/meetings.types.ts +19 -0
  227. package/src/meetings/request.ts +43 -0
  228. package/src/meetings/util.ts +117 -4
  229. package/src/member/ai-docs/member-spec.md +196 -0
  230. package/src/member/index.ts +10 -0
  231. package/src/member/types.ts +1 -0
  232. package/src/member/util.ts +29 -0
  233. package/src/members/ai-docs/members-spec.md +256 -0
  234. package/src/members/index.ts +70 -7
  235. package/src/members/util.ts +12 -4
  236. package/src/metrics/ai-docs/metrics-spec.md +185 -0
  237. package/src/metrics/constants.ts +6 -0
  238. package/src/multistream/ai-docs/multistream-spec.md +292 -0
  239. package/src/multistream/codec/constants.ts +58 -0
  240. package/src/multistream/mediaRequestManager.ts +119 -28
  241. package/src/multistream/receiveSlot.ts +18 -0
  242. package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +234 -0
  243. package/src/reachability/ai-docs/reachability-spec.md +261 -0
  244. package/src/reachability/clusterReachability.ts +3 -2
  245. package/src/reachability/index.ts +47 -16
  246. package/src/reachability/reachability.types.ts +11 -0
  247. package/src/reachability/util.ts +36 -0
  248. package/src/reactions/ai-docs/reactions-spec.md +198 -0
  249. package/src/reactions/reactions.type.ts +3 -0
  250. package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +272 -0
  251. package/src/recording-controller/ai-docs/recording-controller-spec.md +223 -0
  252. package/src/recording-controller/index.ts +1 -2
  253. package/src/roap/ai-docs/roap-spec.md +241 -0
  254. package/src/roap/turnDiscovery.ts +9 -1
  255. package/src/webinar/ai-docs/webinar-spec.md +243 -0
  256. package/src/webinar/index.ts +216 -38
  257. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  258. package/test/unit/spec/annotation/index.ts +3 -3
  259. package/test/unit/spec/breakouts/breakout.ts +9 -3
  260. package/test/unit/spec/breakouts/events.ts +120 -2
  261. package/test/unit/spec/breakouts/index.ts +223 -3
  262. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  263. package/test/unit/spec/controls-options-manager/index.js +139 -32
  264. package/test/unit/spec/hashTree/hashTreeParser.ts +2451 -184
  265. package/test/unit/spec/hashTree/utils.ts +37 -0
  266. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
  267. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  268. package/test/unit/spec/interpretation/index.ts +119 -4
  269. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  270. package/test/unit/spec/locus-info/index.js +1014 -58
  271. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  272. package/test/unit/spec/media/MediaConnectionAwaiter.ts +55 -0
  273. package/test/unit/spec/media/index.ts +92 -0
  274. package/test/unit/spec/media/properties.ts +23 -23
  275. package/test/unit/spec/meeting/in-meeting-actions.ts +6 -0
  276. package/test/unit/spec/meeting/index.js +2811 -117
  277. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  278. package/test/unit/spec/meeting/muteState.js +81 -0
  279. package/test/unit/spec/meeting/request.js +12 -0
  280. package/test/unit/spec/meeting/utils.js +179 -16
  281. package/test/unit/spec/meeting/voicea-meeting.ts +85 -1
  282. package/test/unit/spec/meeting-info/meetinginfov2.js +76 -10
  283. package/test/unit/spec/meetings/index.js +544 -49
  284. package/test/unit/spec/meetings/request.js +141 -0
  285. package/test/unit/spec/meetings/utils.js +402 -51
  286. package/test/unit/spec/member/index.js +7 -0
  287. package/test/unit/spec/member/util.js +89 -0
  288. package/test/unit/spec/members/index.js +216 -0
  289. package/test/unit/spec/members/request.js +37 -1
  290. package/test/unit/spec/members/utils.js +63 -0
  291. package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
  292. package/test/unit/spec/reachability/index.ts +128 -46
  293. package/test/unit/spec/reachability/util.ts +31 -0
  294. package/test/unit/spec/recording-controller/index.js +9 -8
  295. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  296. package/test/unit/spec/webinar/index.ts +332 -31
@@ -90,7 +90,8 @@ describe('plugin-meetings', () => {
90
90
  assert.calledOnceWithExactly(meeting.cleanupLLMConneciton, {throwOnError: false});
91
91
  assert.calledOnce(meeting.breakouts.cleanUp);
92
92
  assert.calledOnce(meeting.simultaneousInterpretation.cleanUp);
93
- assert.calledOnce(meeting.locusInfo.cleanUp);
93
+ // locusInfo.cleanUp (hash tree parser teardown) is deferred to Meetings#destroy
94
+ assert.notCalled(meeting.locusInfo.cleanUp);
94
95
  assert.calledOnce(webex.internal.device.meetingEnded);
95
96
  assert.calledOnceWithExactly(
96
97
  meeting.webex.internal.newMetrics.callDiagnosticMetrics.clearEventLimitsForCorrelationId,
@@ -112,7 +113,8 @@ describe('plugin-meetings', () => {
112
113
  assert.notCalled(meeting.cleanupLLMConneciton);
113
114
  assert.calledOnce(meeting.breakouts.cleanUp);
114
115
  assert.calledOnce(meeting.simultaneousInterpretation.cleanUp);
115
- assert.calledOnce(meeting.locusInfo.cleanUp);
116
+ // locusInfo.cleanUp (hash tree parser teardown) is deferred to Meetings#destroy
117
+ assert.notCalled(meeting.locusInfo.cleanUp);
116
118
  assert.calledOnce(webex.internal.device.meetingEnded);
117
119
  assert.calledOnceWithExactly(
118
120
  meeting.webex.internal.newMetrics.callDiagnosticMetrics.clearEventLimitsForCorrelationId,
@@ -133,7 +135,8 @@ describe('plugin-meetings', () => {
133
135
  assert.notCalled(meeting.cleanupLLMConneciton);
134
136
  assert.calledOnce(meeting.breakouts.cleanUp);
135
137
  assert.calledOnce(meeting.simultaneousInterpretation.cleanUp);
136
- assert.calledOnce(meeting.locusInfo.cleanUp);
138
+ // locusInfo.cleanUp (hash tree parser teardown) is deferred to Meetings#destroy
139
+ assert.notCalled(meeting.locusInfo.cleanUp);
137
140
  assert.calledOnce(webex.internal.device.meetingEnded);
138
141
  assert.calledOnceWithExactly(
139
142
  meeting.webex.internal.newMetrics.callDiagnosticMetrics.clearEventLimitsForCorrelationId,
@@ -276,6 +279,31 @@ describe('plugin-meetings', () => {
276
279
  assert.notCalled(meeting.locusInfo.handleLocusAPIResponse);
277
280
  });
278
281
 
282
+ it('should call handleLocusAPIResponse when response body is an unwrapped LocusDTO', () => {
283
+ const meeting = {
284
+ locusInfo: {
285
+ handleLocusAPIResponse: sinon.stub(),
286
+ },
287
+ };
288
+
289
+ const originalResponse = {
290
+ body: {
291
+ url: 'https://locus-a.wbx2.com/locus/api/v1/loci/some-id',
292
+ participants: [],
293
+ self: {},
294
+ },
295
+ };
296
+
297
+ const response = MeetingUtil.updateLocusFromApiResponse(meeting, originalResponse);
298
+
299
+ assert.deepEqual(response, originalResponse);
300
+ assert.calledOnceWithExactly(
301
+ meeting.locusInfo.handleLocusAPIResponse,
302
+ meeting,
303
+ originalResponse.body
304
+ );
305
+ });
306
+
279
307
  it('should work with an undefined meeting', () => {
280
308
  const originalResponse = {
281
309
  body: {
@@ -294,6 +322,7 @@ describe('plugin-meetings', () => {
294
322
  const addSequenceSpy = sinon.spy(MeetingUtil, 'addSequence');
295
323
 
296
324
  const meeting = {
325
+ locusUrl: 'https://locus.example.com/loci/abc',
297
326
  request: sinon.stub().returns(Promise.resolve('result')),
298
327
  };
299
328
 
@@ -301,6 +330,7 @@ describe('plugin-meetings', () => {
301
330
 
302
331
  const options = {
303
332
  some: 'option',
333
+ uri: 'https://locus.example.com/loci/abc',
304
334
  body: {},
305
335
  };
306
336
 
@@ -314,7 +344,7 @@ describe('plugin-meetings', () => {
314
344
  addSequenceSpy.resetHistory();
315
345
 
316
346
  // body missing from options
317
- result = await locusDeltaRequest({});
347
+ result = await locusDeltaRequest({uri: 'https://locus.example.com/loci/abc'});
318
348
  assert.equal(result, 'result');
319
349
  assert.calledOnceWithExactly(updateLocusFromApiResponseSpy, meeting, 'result');
320
350
  assert.calledOnceWithExactly(addSequenceSpy, meeting, options.body);
@@ -328,6 +358,78 @@ describe('plugin-meetings', () => {
328
358
  WeakRef.prototype.deref.restore();
329
359
  });
330
360
 
361
+ it('calls updateLocusFromApiResponse when request uri starts with the meeting locusUrl', async () => {
362
+ const updateLocusFromApiResponseSpy = sinon.spy(MeetingUtil, 'updateLocusFromApiResponse');
363
+
364
+ const meeting = {
365
+ locusUrl: 'https://locus.example.com/loci/abc',
366
+ request: sinon.stub().returns(Promise.resolve('result')),
367
+ };
368
+
369
+ const locusDeltaRequest = MeetingUtil.generateLocusDeltaRequest(meeting);
370
+
371
+ const result = await locusDeltaRequest({
372
+ uri: 'https://locus.example.com/loci/abc/participant/123',
373
+ body: {},
374
+ });
375
+
376
+ assert.equal(result, 'result');
377
+ assert.calledOnceWithExactly(updateLocusFromApiResponseSpy, meeting, 'result');
378
+ });
379
+
380
+ it('does not call updateLocusFromApiResponse when request uri does not match the meeting locusUrl', async () => {
381
+ const updateLocusFromApiResponseSpy = sinon.spy(MeetingUtil, 'updateLocusFromApiResponse');
382
+
383
+ const meeting = {
384
+ locusUrl: 'https://locus.example.com/loci/abc',
385
+ request: sinon.stub().returns(Promise.resolve('result')),
386
+ };
387
+
388
+ const locusDeltaRequest = MeetingUtil.generateLocusDeltaRequest(meeting);
389
+
390
+ const result = await locusDeltaRequest({
391
+ uri: 'https://locus.example.com/loci/different',
392
+ body: {},
393
+ });
394
+
395
+ assert.equal(result, 'result');
396
+ assert.notCalled(updateLocusFromApiResponseSpy);
397
+ });
398
+
399
+ it('does not call updateLocusFromApiResponse when request uri is missing', async () => {
400
+ const updateLocusFromApiResponseSpy = sinon.spy(MeetingUtil, 'updateLocusFromApiResponse');
401
+
402
+ const meeting = {
403
+ locusUrl: 'https://locus.example.com/loci/abc',
404
+ request: sinon.stub().returns(Promise.resolve('result')),
405
+ };
406
+
407
+ const locusDeltaRequest = MeetingUtil.generateLocusDeltaRequest(meeting);
408
+
409
+ const result = await locusDeltaRequest({body: {}});
410
+
411
+ assert.equal(result, 'result');
412
+ assert.notCalled(updateLocusFromApiResponseSpy);
413
+ });
414
+
415
+ it('does not call updateLocusFromApiResponse when meeting locusUrl is missing', async () => {
416
+ const updateLocusFromApiResponseSpy = sinon.spy(MeetingUtil, 'updateLocusFromApiResponse');
417
+
418
+ const meeting = {
419
+ request: sinon.stub().returns(Promise.resolve('result')),
420
+ };
421
+
422
+ const locusDeltaRequest = MeetingUtil.generateLocusDeltaRequest(meeting);
423
+
424
+ const result = await locusDeltaRequest({
425
+ uri: 'https://locus.example.com/loci/abc',
426
+ body: {},
427
+ });
428
+
429
+ assert.equal(result, 'result');
430
+ assert.notCalled(updateLocusFromApiResponseSpy);
431
+ });
432
+
331
433
  it('calls generateBuildLocusDeltaRequestOptions as expected', () => {
332
434
  const generateBuildLocusDeltaRequestOptionsSpy = sinon.spy(
333
435
  MeetingUtil,
@@ -942,6 +1044,55 @@ describe('plugin-meetings', () => {
942
1044
  });
943
1045
  });
944
1046
 
1047
+ describe('canViewTheParticipantList', () => {
1048
+ it('returns true when both VIEW_THE_PARTICIPANT_LIST and CAN_VIEW_THE_PARTICIPANT_LIST hints are present and canNotViewTheParticipantList is false', () => {
1049
+ assert.isTrue(
1050
+ MeetingUtil.canViewTheParticipantList(
1051
+ ['VIEW_THE_PARTICIPANT_LIST', 'CAN_VIEW_THE_PARTICIPANT_LIST'],
1052
+ false
1053
+ )
1054
+ );
1055
+ });
1056
+
1057
+ it('returns false when VIEW_THE_PARTICIPANT_LIST hint is missing', () => {
1058
+ assert.isFalse(
1059
+ MeetingUtil.canViewTheParticipantList(['CAN_VIEW_THE_PARTICIPANT_LIST'], false)
1060
+ );
1061
+ });
1062
+
1063
+ it('returns false when CAN_VIEW_THE_PARTICIPANT_LIST hint is missing', () => {
1064
+ assert.isFalse(
1065
+ MeetingUtil.canViewTheParticipantList(['VIEW_THE_PARTICIPANT_LIST'], false)
1066
+ );
1067
+ });
1068
+
1069
+ it('returns false when canNotViewTheParticipantList is true', () => {
1070
+ assert.isFalse(
1071
+ MeetingUtil.canViewTheParticipantList(
1072
+ ['VIEW_THE_PARTICIPANT_LIST', 'CAN_VIEW_THE_PARTICIPANT_LIST'],
1073
+ true
1074
+ )
1075
+ );
1076
+ });
1077
+
1078
+ it('returns false when display hints array is empty', () => {
1079
+ assert.isFalse(MeetingUtil.canViewTheParticipantList([], false));
1080
+ });
1081
+
1082
+ it('returns false when both conditions are violated', () => {
1083
+ assert.isFalse(MeetingUtil.canViewTheParticipantList([], true));
1084
+ });
1085
+
1086
+ it('returns true when canNotViewTheParticipantList is undefined (not yet set on meeting)', () => {
1087
+ assert.isTrue(
1088
+ MeetingUtil.canViewTheParticipantList(
1089
+ ['VIEW_THE_PARTICIPANT_LIST', 'CAN_VIEW_THE_PARTICIPANT_LIST'],
1090
+ undefined
1091
+ )
1092
+ );
1093
+ });
1094
+ });
1095
+
945
1096
  describe('canAttendeeRequestAiAssistantEnabled', () => {
946
1097
  it('returns false when user is a cohost', () => {
947
1098
  assert.deepEqual(
@@ -1150,6 +1301,10 @@ describe('plugin-meetings', () => {
1150
1301
  {functionName: 'canSelectSpokenLanguages', displayHint: 'DISPLAY_NON_ENGLISH_ASR'},
1151
1302
  {functionName: 'waitingForOthersToJoin', displayHint: 'WAITING_FOR_OTHERS'},
1152
1303
  {functionName: 'showAutoEndMeetingWarning', displayHint: 'SHOW_AUTO_END_MEETING_WARNING'},
1304
+ {
1305
+ functionName: 'isAnonymizeDisplayNamesEnabled',
1306
+ displayHint: 'ANONYMOUS_DISPLAY_NAMES_ENABLED',
1307
+ },
1153
1308
  ].forEach(({functionName, displayHint}) => {
1154
1309
  describe(functionName, () => {
1155
1310
  it('works as expected', () => {
@@ -1260,12 +1415,16 @@ describe('plugin-meetings', () => {
1260
1415
  MeetingUtil.parseInterpretationInfo(meeting, meetingInfo);
1261
1416
  assert.calledWith(meeting.simultaneousInterpretation.updateMeetingSIEnabled, true, true);
1262
1417
  assert.calledWith(meeting.simultaneousInterpretation.updateHostSIEnabled, true);
1263
- assert.calledWith(meeting.simultaneousInterpretation.updateInterpretation, {
1264
- siLanguages: [
1265
- {languageName: 'en', languageCode: 1},
1266
- {languageName: 'es', languageCode: 2},
1267
- ],
1268
- });
1418
+ assert.calledWith(
1419
+ meeting.simultaneousInterpretation.updateInterpretation,
1420
+ {
1421
+ siLanguages: [
1422
+ {languageName: 'en', languageCode: 1},
1423
+ {languageName: 'es', languageCode: 2},
1424
+ ],
1425
+ },
1426
+ {preserveSiEnabled: true}
1427
+ );
1269
1428
  });
1270
1429
 
1271
1430
  it('should update simultaneous interpretation settings with host SI disabled', () => {
@@ -1274,12 +1433,16 @@ describe('plugin-meetings', () => {
1274
1433
  MeetingUtil.parseInterpretationInfo(meeting, meetingInfo);
1275
1434
  assert.calledWith(meeting.simultaneousInterpretation.updateMeetingSIEnabled, true, false);
1276
1435
  assert.calledWith(meeting.simultaneousInterpretation.updateHostSIEnabled, false);
1277
- assert.calledWith(meeting.simultaneousInterpretation.updateInterpretation, {
1278
- siLanguages: [
1279
- {languageName: 'en', languageCode: 1},
1280
- {languageName: 'es', languageCode: 2},
1281
- ],
1282
- });
1436
+ assert.calledWith(
1437
+ meeting.simultaneousInterpretation.updateInterpretation,
1438
+ {
1439
+ siLanguages: [
1440
+ {languageName: 'en', languageCode: 1},
1441
+ {languageName: 'es', languageCode: 2},
1442
+ ],
1443
+ },
1444
+ {preserveSiEnabled: true}
1445
+ );
1283
1446
  });
1284
1447
  it('should update simultaneous interpretation settings with SI disabled', () => {
1285
1448
  meetingInfo.turnOnSimultaneousInterpretation = false;
@@ -150,6 +150,90 @@ describe('plugin-meetings', () => {
150
150
  });
151
151
 
152
152
  describe('processNewCaptions', () => {
153
+ const processCaptions = () => processNewCaptions({
154
+ data: fakeVoiceaPayload,
155
+ meeting: fakeMeeting
156
+ });
157
+
158
+ it('should process a final-only caption without an existing interim caption', () => {
159
+ const transcriptData = fakeMeeting.transcription;
160
+ const transcriptId = fakeVoiceaPayload.transcriptId;
161
+
162
+ delete transcriptData.interimCaptions[transcriptId];
163
+
164
+ assert.doesNotThrow(processCaptions);
165
+
166
+ const finalCaption = transcriptData.captions.find(caption => caption.id === transcriptId);
167
+
168
+ assert.exists(finalCaption);
169
+ assert.deepEqual(transcriptData.interimCaptions[transcriptId], []);
170
+ });
171
+
172
+ it('should process an interim caption received after a final caption', () => {
173
+ const transcriptData = fakeMeeting.transcription;
174
+ const transcriptId = fakeVoiceaPayload.transcriptId;
175
+
176
+ delete transcriptData.interimCaptions[transcriptId];
177
+
178
+ assert.doesNotThrow(processCaptions);
179
+
180
+ fakeVoiceaPayload.isFinal = false;
181
+
182
+ assert.doesNotThrow(processCaptions);
183
+
184
+ const speakerId = fakeMeeting.members.membersCollection.members[fakeMemberId].participant.person.id;
185
+ const interimId = `${transcriptId}_${speakerId}`;
186
+
187
+ assert.exists(transcriptData.captions.find(caption => caption.id === transcriptId));
188
+ assert.exists(transcriptData.captions.find(caption => caption.id === interimId));
189
+ assert.deepEqual(transcriptData.interimCaptions[transcriptId], [interimId]);
190
+ });
191
+
192
+ it('should process repeated final captions without throwing', () => {
193
+ const transcriptData = fakeMeeting.transcription;
194
+ const transcriptId = fakeVoiceaPayload.transcriptId;
195
+
196
+ delete transcriptData.interimCaptions[transcriptId];
197
+
198
+ assert.doesNotThrow(() => {
199
+ processCaptions();
200
+ processCaptions();
201
+ });
202
+
203
+ assert.exists(transcriptData.captions.find(caption => caption.id === transcriptId));
204
+ });
205
+
206
+ it('should process a final payload containing transcript entries for multiple CSIs without throwing', () => {
207
+ const transcriptData = fakeMeeting.transcription;
208
+ const transcriptId = fakeVoiceaPayload.transcriptId;
209
+ const firstCsi = 1234867712;
210
+ const secondCsi = 1234867713;
211
+ const secondCaptionText = 'Caption from a second CSI';
212
+
213
+ fakeVoiceaPayload.transcripts = [
214
+ {
215
+ ...fakeVoiceaPayload.transcripts[0],
216
+ csis: [firstCsi]
217
+ },
218
+ {
219
+ text: secondCaptionText,
220
+ csis: [secondCsi],
221
+ transcript_language_code: 'en'
222
+ }
223
+ ];
224
+
225
+ assert.doesNotThrow(processCaptions);
226
+
227
+ const finalCaptionTexts = transcriptData.captions
228
+ .filter(caption => caption.id === transcriptId)
229
+ .map(caption => caption.text);
230
+
231
+ assert.deepEqual(finalCaptionTexts, [
232
+ fakeVoiceaPayload.transcripts[0].text,
233
+ secondCaptionText
234
+ ]);
235
+ });
236
+
153
237
  it('should process new final captions correctly', () => {
154
238
  let transcriptData = fakeMeeting.transcription;
155
239
  let transcriptId = fakeVoiceaPayload.transcriptId;
@@ -254,4 +338,4 @@ describe('plugin-meetings', () => {
254
338
  });
255
339
  });
256
340
  });
257
- });
341
+ });
@@ -654,7 +654,7 @@ describe('plugin-meetings', () => {
654
654
  meetingInfo.createAdhocSpaceMeeting,
655
655
  'conversationUrl',
656
656
  installedOrgID,
657
- null,
657
+ null
658
658
  );
659
659
  assert.notCalled(webex.request);
660
660
  meetingInfo.createAdhocSpaceMeeting.restore();
@@ -900,6 +900,63 @@ describe('plugin-meetings', () => {
900
900
  }
901
901
  );
902
902
 
903
+ forEach(
904
+ [
905
+ {
906
+ meetingId: 'meeting-id',
907
+ sendCAevents: true,
908
+ correlationId: 'correlation-id',
909
+ shouldSendCorrelationId: true,
910
+ condition: 'when CA events are enabled for the meeting',
911
+ },
912
+ {
913
+ sendCAevents: true,
914
+ correlationId: 'correlation-id',
915
+ shouldSendCorrelationId: false,
916
+ condition: 'without a meetingId',
917
+ },
918
+ {
919
+ meetingId: 'meeting-id',
920
+ sendCAevents: false,
921
+ correlationId: 'correlation-id',
922
+ shouldSendCorrelationId: false,
923
+ condition: 'when CA events are disabled',
924
+ },
925
+ {
926
+ meetingId: 'meeting-id',
927
+ sendCAevents: true,
928
+ shouldSendCorrelationId: false,
929
+ condition: 'without a correlationId',
930
+ },
931
+ ],
932
+ ({meetingId, sendCAevents, correlationId, shouldSendCorrelationId, condition}) => {
933
+ it(`should ${
934
+ shouldSendCorrelationId ? '' : 'not '
935
+ }send the correlationId header ${condition}`, async () => {
936
+ webex.request.resolves({statusCode: 200, body: {meetingKey: '1234323'}});
937
+
938
+ await meetingInfo.fetchMeetingInfo(
939
+ '1234323',
940
+ DESTINATION_TYPE.MEETING_ID,
941
+ null,
942
+ null,
943
+ null,
944
+ null,
945
+ undefined,
946
+ {meetingId, sendCAevents, correlationId}
947
+ );
948
+
949
+ const requestOptions = webex.request.firstCall.args[0];
950
+
951
+ if (shouldSendCorrelationId) {
952
+ assert.deepEqual(requestOptions.headers, {correlationId});
953
+ } else {
954
+ assert.notProperty(requestOptions, 'headers');
955
+ }
956
+ });
957
+ }
958
+ );
959
+
903
960
  it('should send CA metric if meetingId is provided and send CA events is authorized', async () => {
904
961
  const requestResponse = {
905
962
  statusCode: 200,
@@ -1068,13 +1125,16 @@ describe('plugin-meetings', () => {
1068
1125
  await runTest(423006, true);
1069
1126
  });
1070
1127
 
1128
+ it('should throw MeetingInfoV2CaptchaError for 423 response (wbxappapi code 423008)', async () => {
1129
+ await runTest(423008, true);
1130
+ });
1131
+
1071
1132
  it('should throw MeetingInfoV2CaptchaError for 423 response (wbxappapi code 423001)', async () => {
1072
1133
  await runTest(423001, false);
1073
1134
  });
1074
1135
  });
1075
1136
 
1076
1137
  describe('should stop call fetchMeetingInfo if siteFullUrl is empty for 404 response', () => {
1077
-
1078
1138
  const runTest = async (wbxAppApiCode, expectedIsPasswordRequired) => {
1079
1139
  webex.request = sinon.stub().rejects({
1080
1140
  statusCode: 404,
@@ -1082,12 +1142,11 @@ describe('plugin-meetings', () => {
1082
1142
  code: wbxAppApiCode,
1083
1143
  message: 'Alternate Meeting Server',
1084
1144
  data: {
1085
- 'siteFullUrl': ''
1086
- }
1145
+ siteFullUrl: '',
1146
+ },
1087
1147
  },
1088
1148
  });
1089
1149
 
1090
-
1091
1150
  try {
1092
1151
  await meetingInfo.fetchMeetingInfo('1234323', DESTINATION_TYPE.MEETING_ID, 'abc', {
1093
1152
  id: '999',
@@ -1097,7 +1156,7 @@ describe('plugin-meetings', () => {
1097
1156
  } catch (err) {
1098
1157
  assert(Metrics.sendBehavioralMetric.calledOnce);
1099
1158
  assert.deepEqual(err.body.data, {
1100
- siteFullUrl: ''
1159
+ siteFullUrl: '',
1101
1160
  });
1102
1161
  }
1103
1162
  };
@@ -1107,7 +1166,6 @@ describe('plugin-meetings', () => {
1107
1166
  });
1108
1167
  });
1109
1168
 
1110
-
1111
1169
  it('should throw an error and not fetch with an "empty" body', async () => {
1112
1170
  const body = {supportHostKey: 'foo', supportCountryList: 'bar'};
1113
1171
  const requestResponse = {statusCode: 200, body};
@@ -1176,7 +1234,11 @@ describe('plugin-meetings', () => {
1176
1234
  body: conversation,
1177
1235
  });
1178
1236
 
1179
- const result = await meetingInfo.createAdhocSpaceMeeting(conversationUrl, installedOrgID, classificationId);
1237
+ const result = await meetingInfo.createAdhocSpaceMeeting(
1238
+ conversationUrl,
1239
+ installedOrgID,
1240
+ classificationId
1241
+ );
1180
1242
 
1181
1243
  assert.calledWith(webex.request, {
1182
1244
  uri: conversationUrl,
@@ -1210,7 +1272,11 @@ describe('plugin-meetings', () => {
1210
1272
  webex.request = sinon.stub().resolves({
1211
1273
  body: conversation,
1212
1274
  });
1213
- await meetingInfo.createAdhocSpaceMeeting(conversationUrl, installedOrgID, classificationId);
1275
+ await meetingInfo.createAdhocSpaceMeeting(
1276
+ conversationUrl,
1277
+ installedOrgID,
1278
+ classificationId
1279
+ );
1214
1280
 
1215
1281
  assert.calledWith(webex.request, {
1216
1282
  uri: conversationUrl,
@@ -1282,7 +1348,7 @@ describe('plugin-meetings', () => {
1282
1348
  {errorCode: 423007},
1283
1349
  {errorCode: 403026},
1284
1350
  {errorCode: 403037},
1285
- {errorCode: 403137},
1351
+ {errorCode: 403106},
1286
1352
  ],
1287
1353
  ({errorCode}) => {
1288
1354
  it(`should throw a MeetingInfoV2JoinWebinarError for error code ${errorCode}`, async () => {