@webex/plugin-meetings 3.12.0-next.16 → 3.12.0-next.161

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 (301) 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 +24 -9
  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 +1688 -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/multistream/remoteMediaManager.js +32 -4
  130. package/dist/multistream/remoteMediaManager.js.map +1 -1
  131. package/dist/reachability/clusterReachability.js.map +1 -1
  132. package/dist/reachability/index.js +121 -83
  133. package/dist/reachability/index.js.map +1 -1
  134. package/dist/reachability/reachability.types.js +2 -0
  135. package/dist/reachability/reachability.types.js.map +1 -1
  136. package/dist/reachability/util.js +45 -0
  137. package/dist/reachability/util.js.map +1 -1
  138. package/dist/reactions/reactions.type.js.map +1 -1
  139. package/dist/recording-controller/index.js +1 -3
  140. package/dist/recording-controller/index.js.map +1 -1
  141. package/dist/roap/turnDiscovery.js +8 -1
  142. package/dist/roap/turnDiscovery.js.map +1 -1
  143. package/dist/types/common/errors/webex-errors.d.ts +32 -2
  144. package/dist/types/config.d.ts +2 -2
  145. package/dist/types/constants.d.ts +13 -1
  146. package/dist/types/controls-options-manager/index.d.ts +16 -0
  147. package/dist/types/hashTree/constants.d.ts +1 -0
  148. package/dist/types/hashTree/hashTreeParser.d.ts +201 -22
  149. package/dist/types/hashTree/utils.d.ts +7 -0
  150. package/dist/types/index.d.ts +3 -0
  151. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  152. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  153. package/dist/types/locus-info/index.d.ts +106 -8
  154. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  155. package/dist/types/locus-info/types.d.ts +22 -1
  156. package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
  157. package/dist/types/media/properties.d.ts +6 -2
  158. package/dist/types/meeting/in-meeting-actions.d.ts +6 -0
  159. package/dist/types/meeting/index.d.ts +176 -11
  160. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  161. package/dist/types/meeting/request.d.ts +1 -0
  162. package/dist/types/meeting/util.d.ts +9 -0
  163. package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
  164. package/dist/types/meetings/index.d.ts +40 -19
  165. package/dist/types/meetings/meetings.types.d.ts +15 -0
  166. package/dist/types/meetings/request.d.ts +14 -0
  167. package/dist/types/member/index.d.ts +1 -0
  168. package/dist/types/member/types.d.ts +1 -0
  169. package/dist/types/member/util.d.ts +9 -0
  170. package/dist/types/members/index.d.ts +15 -2
  171. package/dist/types/members/util.d.ts +1 -5
  172. package/dist/types/metrics/constants.d.ts +6 -0
  173. package/dist/types/multistream/codec/constants.d.ts +7 -0
  174. package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
  175. package/dist/types/multistream/remoteMediaManager.d.ts +18 -0
  176. package/dist/types/reachability/clusterReachability.d.ts +3 -3
  177. package/dist/types/reachability/index.d.ts +10 -3
  178. package/dist/types/reachability/reachability.types.d.ts +7 -0
  179. package/dist/types/reachability/util.d.ts +17 -0
  180. package/dist/types/reactions/reactions.type.d.ts +3 -0
  181. package/dist/webinar/index.js +307 -161
  182. package/dist/webinar/index.js.map +1 -1
  183. package/package.json +23 -23
  184. package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +223 -0
  185. package/src/aiEnableRequest/index.ts +16 -0
  186. package/src/annotation/ai-docs/annotation-spec.md +236 -0
  187. package/src/annotation/index.ts +6 -4
  188. package/src/breakouts/ai-docs/breakouts-spec.md +324 -0
  189. package/src/breakouts/breakout.ts +3 -1
  190. package/src/breakouts/events.ts +33 -11
  191. package/src/breakouts/index.ts +122 -2
  192. package/src/common/errors/webex-errors.ts +50 -3
  193. package/src/config.ts +2 -2
  194. package/src/constants.ts +21 -3
  195. package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +243 -0
  196. package/src/controls-options-manager/index.ts +62 -10
  197. package/src/hashTree/ai-docs/hash-tree-spec.md +267 -0
  198. package/src/hashTree/constants.ts +7 -0
  199. package/src/hashTree/hashTreeParser.ts +861 -193
  200. package/src/hashTree/utils.ts +19 -0
  201. package/src/index.ts +6 -0
  202. package/src/interceptors/ai-docs/interceptors-spec.md +247 -0
  203. package/src/interceptors/dataChannelAuthToken.ts +88 -12
  204. package/src/interceptors/locusRetry.ts +26 -5
  205. package/src/interpretation/ai-docs/interpretation-spec.md +256 -0
  206. package/src/interpretation/index.ts +65 -10
  207. package/src/interpretation/interpretation.types.ts +11 -0
  208. package/src/locus-info/ai-docs/locus-info-spec.md +293 -0
  209. package/src/locus-info/controlsUtils.ts +3 -1
  210. package/src/locus-info/index.ts +566 -164
  211. package/src/locus-info/infoUtils.ts +41 -6
  212. package/src/locus-info/types.ts +26 -1
  213. package/src/media/MediaConnectionAwaiter.ts +21 -4
  214. package/src/media/ai-docs/media-spec.md +267 -0
  215. package/src/media/index.ts +10 -1
  216. package/src/media/properties.ts +8 -3
  217. package/src/meeting/ai-docs/meeting-spec.md +401 -0
  218. package/src/meeting/in-meeting-actions.ts +12 -0
  219. package/src/meeting/index.ts +946 -120
  220. package/src/meeting/locusMediaRequest.ts +106 -6
  221. package/src/meeting/muteState.ts +10 -1
  222. package/src/meeting/request.ts +11 -0
  223. package/src/meeting/util.ts +51 -7
  224. package/src/meeting/voicea-meeting.ts +1 -1
  225. package/src/meeting-info/ai-docs/meeting-info-spec.md +261 -0
  226. package/src/meeting-info/meeting-info-v2.ts +10 -4
  227. package/src/meetings/ai-docs/meetings-spec.md +296 -0
  228. package/src/meetings/index.ts +200 -80
  229. package/src/meetings/meetings.types.ts +19 -0
  230. package/src/meetings/request.ts +43 -0
  231. package/src/meetings/util.ts +117 -4
  232. package/src/member/ai-docs/member-spec.md +196 -0
  233. package/src/member/index.ts +10 -0
  234. package/src/member/types.ts +1 -0
  235. package/src/member/util.ts +29 -0
  236. package/src/members/ai-docs/members-spec.md +256 -0
  237. package/src/members/index.ts +70 -7
  238. package/src/members/util.ts +12 -4
  239. package/src/metrics/ai-docs/metrics-spec.md +185 -0
  240. package/src/metrics/constants.ts +6 -0
  241. package/src/multistream/ai-docs/multistream-spec.md +292 -0
  242. package/src/multistream/codec/constants.ts +58 -0
  243. package/src/multistream/mediaRequestManager.ts +119 -28
  244. package/src/multistream/receiveSlot.ts +18 -0
  245. package/src/multistream/remoteMediaManager.ts +23 -1
  246. package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +234 -0
  247. package/src/reachability/ai-docs/reachability-spec.md +261 -0
  248. package/src/reachability/clusterReachability.ts +3 -2
  249. package/src/reachability/index.ts +47 -16
  250. package/src/reachability/reachability.types.ts +11 -0
  251. package/src/reachability/util.ts +36 -0
  252. package/src/reactions/ai-docs/reactions-spec.md +198 -0
  253. package/src/reactions/reactions.type.ts +3 -0
  254. package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +272 -0
  255. package/src/recording-controller/ai-docs/recording-controller-spec.md +223 -0
  256. package/src/recording-controller/index.ts +1 -2
  257. package/src/roap/ai-docs/roap-spec.md +241 -0
  258. package/src/roap/turnDiscovery.ts +9 -1
  259. package/src/webinar/ai-docs/webinar-spec.md +243 -0
  260. package/src/webinar/index.ts +216 -38
  261. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  262. package/test/unit/spec/annotation/index.ts +3 -3
  263. package/test/unit/spec/breakouts/breakout.ts +9 -3
  264. package/test/unit/spec/breakouts/events.ts +120 -2
  265. package/test/unit/spec/breakouts/index.ts +223 -3
  266. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  267. package/test/unit/spec/controls-options-manager/index.js +139 -32
  268. package/test/unit/spec/hashTree/hashTreeParser.ts +2451 -184
  269. package/test/unit/spec/hashTree/utils.ts +37 -0
  270. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
  271. package/test/unit/spec/interceptors/locusRetry.ts +234 -5
  272. package/test/unit/spec/interpretation/index.ts +119 -4
  273. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  274. package/test/unit/spec/locus-info/index.js +1014 -58
  275. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  276. package/test/unit/spec/media/MediaConnectionAwaiter.ts +55 -0
  277. package/test/unit/spec/media/index.ts +92 -0
  278. package/test/unit/spec/media/properties.ts +23 -23
  279. package/test/unit/spec/meeting/in-meeting-actions.ts +6 -0
  280. package/test/unit/spec/meeting/index.js +2838 -109
  281. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  282. package/test/unit/spec/meeting/muteState.js +81 -0
  283. package/test/unit/spec/meeting/request.js +12 -0
  284. package/test/unit/spec/meeting/utils.js +189 -17
  285. package/test/unit/spec/meeting/voicea-meeting.ts +85 -1
  286. package/test/unit/spec/meeting-info/meetinginfov2.js +76 -10
  287. package/test/unit/spec/meetings/index.js +544 -49
  288. package/test/unit/spec/meetings/request.js +141 -0
  289. package/test/unit/spec/meetings/utils.js +402 -51
  290. package/test/unit/spec/member/index.js +7 -0
  291. package/test/unit/spec/member/util.js +89 -0
  292. package/test/unit/spec/members/index.js +216 -0
  293. package/test/unit/spec/members/request.js +37 -1
  294. package/test/unit/spec/members/utils.js +63 -0
  295. package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
  296. package/test/unit/spec/multistream/remoteMediaManager.ts +46 -0
  297. package/test/unit/spec/reachability/index.ts +128 -46
  298. package/test/unit/spec/reachability/util.ts +31 -0
  299. package/test/unit/spec/recording-controller/index.js +9 -8
  300. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  301. package/test/unit/spec/webinar/index.ts +332 -31
@@ -12,6 +12,7 @@ import * as BrowserDetectionModule from '@webex/plugin-meetings/src/common/brows
12
12
  import PasswordError from '@webex/plugin-meetings/src/common/errors/password-error';
13
13
  import CaptchaError from '@webex/plugin-meetings/src/common/errors/captcha-error';
14
14
  import {ServerRoles} from '@webex/plugin-meetings/src/member/types';
15
+ import {WebexHttpError} from '@webex/webex-core';
15
16
 
16
17
  describe('plugin-meetings', () => {
17
18
  let webex;
@@ -90,7 +91,8 @@ describe('plugin-meetings', () => {
90
91
  assert.calledOnceWithExactly(meeting.cleanupLLMConneciton, {throwOnError: false});
91
92
  assert.calledOnce(meeting.breakouts.cleanUp);
92
93
  assert.calledOnce(meeting.simultaneousInterpretation.cleanUp);
93
- assert.calledOnce(meeting.locusInfo.cleanUp);
94
+ // locusInfo.cleanUp (hash tree parser teardown) is deferred to Meetings#destroy
95
+ assert.notCalled(meeting.locusInfo.cleanUp);
94
96
  assert.calledOnce(webex.internal.device.meetingEnded);
95
97
  assert.calledOnceWithExactly(
96
98
  meeting.webex.internal.newMetrics.callDiagnosticMetrics.clearEventLimitsForCorrelationId,
@@ -112,7 +114,8 @@ describe('plugin-meetings', () => {
112
114
  assert.notCalled(meeting.cleanupLLMConneciton);
113
115
  assert.calledOnce(meeting.breakouts.cleanUp);
114
116
  assert.calledOnce(meeting.simultaneousInterpretation.cleanUp);
115
- assert.calledOnce(meeting.locusInfo.cleanUp);
117
+ // locusInfo.cleanUp (hash tree parser teardown) is deferred to Meetings#destroy
118
+ assert.notCalled(meeting.locusInfo.cleanUp);
116
119
  assert.calledOnce(webex.internal.device.meetingEnded);
117
120
  assert.calledOnceWithExactly(
118
121
  meeting.webex.internal.newMetrics.callDiagnosticMetrics.clearEventLimitsForCorrelationId,
@@ -133,7 +136,8 @@ describe('plugin-meetings', () => {
133
136
  assert.notCalled(meeting.cleanupLLMConneciton);
134
137
  assert.calledOnce(meeting.breakouts.cleanUp);
135
138
  assert.calledOnce(meeting.simultaneousInterpretation.cleanUp);
136
- assert.calledOnce(meeting.locusInfo.cleanUp);
139
+ // locusInfo.cleanUp (hash tree parser teardown) is deferred to Meetings#destroy
140
+ assert.notCalled(meeting.locusInfo.cleanUp);
137
141
  assert.calledOnce(webex.internal.device.meetingEnded);
138
142
  assert.calledOnceWithExactly(
139
143
  meeting.webex.internal.newMetrics.callDiagnosticMetrics.clearEventLimitsForCorrelationId,
@@ -276,6 +280,31 @@ describe('plugin-meetings', () => {
276
280
  assert.notCalled(meeting.locusInfo.handleLocusAPIResponse);
277
281
  });
278
282
 
283
+ it('should call handleLocusAPIResponse when response body is an unwrapped LocusDTO', () => {
284
+ const meeting = {
285
+ locusInfo: {
286
+ handleLocusAPIResponse: sinon.stub(),
287
+ },
288
+ };
289
+
290
+ const originalResponse = {
291
+ body: {
292
+ url: 'https://locus-a.wbx2.com/locus/api/v1/loci/some-id',
293
+ participants: [],
294
+ self: {},
295
+ },
296
+ };
297
+
298
+ const response = MeetingUtil.updateLocusFromApiResponse(meeting, originalResponse);
299
+
300
+ assert.deepEqual(response, originalResponse);
301
+ assert.calledOnceWithExactly(
302
+ meeting.locusInfo.handleLocusAPIResponse,
303
+ meeting,
304
+ originalResponse.body
305
+ );
306
+ });
307
+
279
308
  it('should work with an undefined meeting', () => {
280
309
  const originalResponse = {
281
310
  body: {
@@ -294,6 +323,7 @@ describe('plugin-meetings', () => {
294
323
  const addSequenceSpy = sinon.spy(MeetingUtil, 'addSequence');
295
324
 
296
325
  const meeting = {
326
+ locusUrl: 'https://locus.example.com/loci/abc',
297
327
  request: sinon.stub().returns(Promise.resolve('result')),
298
328
  };
299
329
 
@@ -301,6 +331,7 @@ describe('plugin-meetings', () => {
301
331
 
302
332
  const options = {
303
333
  some: 'option',
334
+ uri: 'https://locus.example.com/loci/abc',
304
335
  body: {},
305
336
  };
306
337
 
@@ -314,7 +345,7 @@ describe('plugin-meetings', () => {
314
345
  addSequenceSpy.resetHistory();
315
346
 
316
347
  // body missing from options
317
- result = await locusDeltaRequest({});
348
+ result = await locusDeltaRequest({uri: 'https://locus.example.com/loci/abc'});
318
349
  assert.equal(result, 'result');
319
350
  assert.calledOnceWithExactly(updateLocusFromApiResponseSpy, meeting, 'result');
320
351
  assert.calledOnceWithExactly(addSequenceSpy, meeting, options.body);
@@ -328,6 +359,78 @@ describe('plugin-meetings', () => {
328
359
  WeakRef.prototype.deref.restore();
329
360
  });
330
361
 
362
+ it('calls updateLocusFromApiResponse when request uri starts with the meeting locusUrl', async () => {
363
+ const updateLocusFromApiResponseSpy = sinon.spy(MeetingUtil, 'updateLocusFromApiResponse');
364
+
365
+ const meeting = {
366
+ locusUrl: 'https://locus.example.com/loci/abc',
367
+ request: sinon.stub().returns(Promise.resolve('result')),
368
+ };
369
+
370
+ const locusDeltaRequest = MeetingUtil.generateLocusDeltaRequest(meeting);
371
+
372
+ const result = await locusDeltaRequest({
373
+ uri: 'https://locus.example.com/loci/abc/participant/123',
374
+ body: {},
375
+ });
376
+
377
+ assert.equal(result, 'result');
378
+ assert.calledOnceWithExactly(updateLocusFromApiResponseSpy, meeting, 'result');
379
+ });
380
+
381
+ it('does not call updateLocusFromApiResponse when request uri does not match the meeting locusUrl', async () => {
382
+ const updateLocusFromApiResponseSpy = sinon.spy(MeetingUtil, 'updateLocusFromApiResponse');
383
+
384
+ const meeting = {
385
+ locusUrl: 'https://locus.example.com/loci/abc',
386
+ request: sinon.stub().returns(Promise.resolve('result')),
387
+ };
388
+
389
+ const locusDeltaRequest = MeetingUtil.generateLocusDeltaRequest(meeting);
390
+
391
+ const result = await locusDeltaRequest({
392
+ uri: 'https://locus.example.com/loci/different',
393
+ body: {},
394
+ });
395
+
396
+ assert.equal(result, 'result');
397
+ assert.notCalled(updateLocusFromApiResponseSpy);
398
+ });
399
+
400
+ it('does not call updateLocusFromApiResponse when request uri is missing', async () => {
401
+ const updateLocusFromApiResponseSpy = sinon.spy(MeetingUtil, 'updateLocusFromApiResponse');
402
+
403
+ const meeting = {
404
+ locusUrl: 'https://locus.example.com/loci/abc',
405
+ request: sinon.stub().returns(Promise.resolve('result')),
406
+ };
407
+
408
+ const locusDeltaRequest = MeetingUtil.generateLocusDeltaRequest(meeting);
409
+
410
+ const result = await locusDeltaRequest({body: {}});
411
+
412
+ assert.equal(result, 'result');
413
+ assert.notCalled(updateLocusFromApiResponseSpy);
414
+ });
415
+
416
+ it('does not call updateLocusFromApiResponse when meeting locusUrl is missing', async () => {
417
+ const updateLocusFromApiResponseSpy = sinon.spy(MeetingUtil, 'updateLocusFromApiResponse');
418
+
419
+ const meeting = {
420
+ request: sinon.stub().returns(Promise.resolve('result')),
421
+ };
422
+
423
+ const locusDeltaRequest = MeetingUtil.generateLocusDeltaRequest(meeting);
424
+
425
+ const result = await locusDeltaRequest({
426
+ uri: 'https://locus.example.com/loci/abc',
427
+ body: {},
428
+ });
429
+
430
+ assert.equal(result, 'result');
431
+ assert.notCalled(updateLocusFromApiResponseSpy);
432
+ });
433
+
331
434
  it('calls generateBuildLocusDeltaRequestOptions as expected', () => {
332
435
  const generateBuildLocusDeltaRequestOptionsSpy = sinon.spy(
333
436
  MeetingUtil,
@@ -663,7 +766,15 @@ describe('plugin-meetings', () => {
663
766
  });
664
767
 
665
768
  it('should post client event with error when join fails', async () => {
666
- const joinError = new Error('Join failed');
769
+ const joinError = new WebexHttpError.TooManyRequests({
770
+ statusCode: 429,
771
+ body: {message: 'Locus rate limited'},
772
+ options: {
773
+ method: 'POST',
774
+ headers: {},
775
+ uri: 'https://locus.example.com/locus/api/v1/loci/call',
776
+ },
777
+ });
667
778
  meeting.meetingRequest.joinMeeting.rejects(joinError);
668
779
  meeting.meetingInfo = {meetingLookupUrl: 'test-lookup-url'};
669
780
 
@@ -942,6 +1053,55 @@ describe('plugin-meetings', () => {
942
1053
  });
943
1054
  });
944
1055
 
1056
+ describe('canViewTheParticipantList', () => {
1057
+ it('returns true when both VIEW_THE_PARTICIPANT_LIST and CAN_VIEW_THE_PARTICIPANT_LIST hints are present and canNotViewTheParticipantList is false', () => {
1058
+ assert.isTrue(
1059
+ MeetingUtil.canViewTheParticipantList(
1060
+ ['VIEW_THE_PARTICIPANT_LIST', 'CAN_VIEW_THE_PARTICIPANT_LIST'],
1061
+ false
1062
+ )
1063
+ );
1064
+ });
1065
+
1066
+ it('returns false when VIEW_THE_PARTICIPANT_LIST hint is missing', () => {
1067
+ assert.isFalse(
1068
+ MeetingUtil.canViewTheParticipantList(['CAN_VIEW_THE_PARTICIPANT_LIST'], false)
1069
+ );
1070
+ });
1071
+
1072
+ it('returns false when CAN_VIEW_THE_PARTICIPANT_LIST hint is missing', () => {
1073
+ assert.isFalse(
1074
+ MeetingUtil.canViewTheParticipantList(['VIEW_THE_PARTICIPANT_LIST'], false)
1075
+ );
1076
+ });
1077
+
1078
+ it('returns false when canNotViewTheParticipantList is true', () => {
1079
+ assert.isFalse(
1080
+ MeetingUtil.canViewTheParticipantList(
1081
+ ['VIEW_THE_PARTICIPANT_LIST', 'CAN_VIEW_THE_PARTICIPANT_LIST'],
1082
+ true
1083
+ )
1084
+ );
1085
+ });
1086
+
1087
+ it('returns false when display hints array is empty', () => {
1088
+ assert.isFalse(MeetingUtil.canViewTheParticipantList([], false));
1089
+ });
1090
+
1091
+ it('returns false when both conditions are violated', () => {
1092
+ assert.isFalse(MeetingUtil.canViewTheParticipantList([], true));
1093
+ });
1094
+
1095
+ it('returns true when canNotViewTheParticipantList is undefined (not yet set on meeting)', () => {
1096
+ assert.isTrue(
1097
+ MeetingUtil.canViewTheParticipantList(
1098
+ ['VIEW_THE_PARTICIPANT_LIST', 'CAN_VIEW_THE_PARTICIPANT_LIST'],
1099
+ undefined
1100
+ )
1101
+ );
1102
+ });
1103
+ });
1104
+
945
1105
  describe('canAttendeeRequestAiAssistantEnabled', () => {
946
1106
  it('returns false when user is a cohost', () => {
947
1107
  assert.deepEqual(
@@ -1150,6 +1310,10 @@ describe('plugin-meetings', () => {
1150
1310
  {functionName: 'canSelectSpokenLanguages', displayHint: 'DISPLAY_NON_ENGLISH_ASR'},
1151
1311
  {functionName: 'waitingForOthersToJoin', displayHint: 'WAITING_FOR_OTHERS'},
1152
1312
  {functionName: 'showAutoEndMeetingWarning', displayHint: 'SHOW_AUTO_END_MEETING_WARNING'},
1313
+ {
1314
+ functionName: 'isAnonymizeDisplayNamesEnabled',
1315
+ displayHint: 'ANONYMOUS_DISPLAY_NAMES_ENABLED',
1316
+ },
1153
1317
  ].forEach(({functionName, displayHint}) => {
1154
1318
  describe(functionName, () => {
1155
1319
  it('works as expected', () => {
@@ -1260,12 +1424,16 @@ describe('plugin-meetings', () => {
1260
1424
  MeetingUtil.parseInterpretationInfo(meeting, meetingInfo);
1261
1425
  assert.calledWith(meeting.simultaneousInterpretation.updateMeetingSIEnabled, true, true);
1262
1426
  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
- });
1427
+ assert.calledWith(
1428
+ meeting.simultaneousInterpretation.updateInterpretation,
1429
+ {
1430
+ siLanguages: [
1431
+ {languageName: 'en', languageCode: 1},
1432
+ {languageName: 'es', languageCode: 2},
1433
+ ],
1434
+ },
1435
+ {preserveSiEnabled: true}
1436
+ );
1269
1437
  });
1270
1438
 
1271
1439
  it('should update simultaneous interpretation settings with host SI disabled', () => {
@@ -1274,12 +1442,16 @@ describe('plugin-meetings', () => {
1274
1442
  MeetingUtil.parseInterpretationInfo(meeting, meetingInfo);
1275
1443
  assert.calledWith(meeting.simultaneousInterpretation.updateMeetingSIEnabled, true, false);
1276
1444
  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
- });
1445
+ assert.calledWith(
1446
+ meeting.simultaneousInterpretation.updateInterpretation,
1447
+ {
1448
+ siLanguages: [
1449
+ {languageName: 'en', languageCode: 1},
1450
+ {languageName: 'es', languageCode: 2},
1451
+ ],
1452
+ },
1453
+ {preserveSiEnabled: true}
1454
+ );
1283
1455
  });
1284
1456
  it('should update simultaneous interpretation settings with SI disabled', () => {
1285
1457
  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 () => {