@webex/plugin-meetings 2.37.0 → 2.37.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 (308) hide show
  1. package/UPGRADING.md +9 -9
  2. package/browsers.js +19 -24
  3. package/dist/common/browser-detection.js +1 -20
  4. package/dist/common/browser-detection.js.map +1 -1
  5. package/dist/common/collection.js +5 -20
  6. package/dist/common/collection.js.map +1 -1
  7. package/dist/common/config.js +0 -7
  8. package/dist/common/config.js.map +1 -1
  9. package/dist/common/errors/captcha-error.js +5 -26
  10. package/dist/common/errors/captcha-error.js.map +1 -1
  11. package/dist/common/errors/intent-to-join.js +5 -26
  12. package/dist/common/errors/intent-to-join.js.map +1 -1
  13. package/dist/common/errors/join-meeting.js +6 -27
  14. package/dist/common/errors/join-meeting.js.map +1 -1
  15. package/dist/common/errors/media.js +5 -26
  16. package/dist/common/errors/media.js.map +1 -1
  17. package/dist/common/errors/parameter.js +5 -33
  18. package/dist/common/errors/parameter.js.map +1 -1
  19. package/dist/common/errors/password-error.js +5 -26
  20. package/dist/common/errors/password-error.js.map +1 -1
  21. package/dist/common/errors/permission.js +4 -25
  22. package/dist/common/errors/permission.js.map +1 -1
  23. package/dist/common/errors/reconnection-in-progress.js +0 -17
  24. package/dist/common/errors/reconnection-in-progress.js.map +1 -1
  25. package/dist/common/errors/reconnection.js +5 -26
  26. package/dist/common/errors/reconnection.js.map +1 -1
  27. package/dist/common/errors/stats.js +5 -26
  28. package/dist/common/errors/stats.js.map +1 -1
  29. package/dist/common/errors/webex-errors.js +7 -46
  30. package/dist/common/errors/webex-errors.js.map +1 -1
  31. package/dist/common/errors/webex-meetings-error.js +1 -24
  32. package/dist/common/errors/webex-meetings-error.js.map +1 -1
  33. package/dist/common/events/events-scope.js +0 -22
  34. package/dist/common/events/events-scope.js.map +1 -1
  35. package/dist/common/events/events.js +0 -23
  36. package/dist/common/events/events.js.map +1 -1
  37. package/dist/common/events/trigger-proxy.js +0 -12
  38. package/dist/common/events/trigger-proxy.js.map +1 -1
  39. package/dist/common/events/util.js +0 -15
  40. package/dist/common/events/util.js.map +1 -1
  41. package/dist/common/logs/logger-config.js +0 -4
  42. package/dist/common/logs/logger-config.js.map +1 -1
  43. package/dist/common/logs/logger-proxy.js +1 -8
  44. package/dist/common/logs/logger-proxy.js.map +1 -1
  45. package/dist/common/logs/request.js +35 -61
  46. package/dist/common/logs/request.js.map +1 -1
  47. package/dist/common/queue.js +4 -14
  48. package/dist/common/queue.js.map +1 -1
  49. package/dist/config.js +1 -5
  50. package/dist/config.js.map +1 -1
  51. package/dist/constants.js +46 -42
  52. package/dist/constants.js.map +1 -1
  53. package/dist/index.js +1 -17
  54. package/dist/index.js.map +1 -1
  55. package/dist/locus-info/controlsUtils.js +10 -28
  56. package/dist/locus-info/controlsUtils.js.map +1 -1
  57. package/dist/locus-info/embeddedAppsUtils.js +3 -26
  58. package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
  59. package/dist/locus-info/fullState.js +0 -15
  60. package/dist/locus-info/fullState.js.map +1 -1
  61. package/dist/locus-info/hostUtils.js +4 -12
  62. package/dist/locus-info/hostUtils.js.map +1 -1
  63. package/dist/locus-info/index.js +101 -193
  64. package/dist/locus-info/index.js.map +1 -1
  65. package/dist/locus-info/infoUtils.js +0 -37
  66. package/dist/locus-info/infoUtils.js.map +1 -1
  67. package/dist/locus-info/mediaSharesUtils.js +12 -38
  68. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  69. package/dist/locus-info/parser.js +87 -123
  70. package/dist/locus-info/parser.js.map +1 -1
  71. package/dist/locus-info/selfUtils.js +16 -81
  72. package/dist/locus-info/selfUtils.js.map +1 -1
  73. package/dist/media/index.js +74 -137
  74. package/dist/media/index.js.map +1 -1
  75. package/dist/media/properties.js +64 -110
  76. package/dist/media/properties.js.map +1 -1
  77. package/dist/media/util.js +3 -17
  78. package/dist/media/util.js.map +1 -1
  79. package/dist/mediaQualityMetrics/config.js +10 -12
  80. package/dist/mediaQualityMetrics/config.js.map +1 -1
  81. package/dist/meeting/effectsState.js +120 -192
  82. package/dist/meeting/effectsState.js.map +1 -1
  83. package/dist/meeting/in-meeting-actions.js +0 -13
  84. package/dist/meeting/in-meeting-actions.js.map +1 -1
  85. package/dist/meeting/index.js +812 -1487
  86. package/dist/meeting/index.js.map +1 -1
  87. package/dist/meeting/muteState.js +31 -78
  88. package/dist/meeting/muteState.js.map +1 -1
  89. package/dist/meeting/request.js +157 -227
  90. package/dist/meeting/request.js.map +1 -1
  91. package/dist/meeting/state.js +21 -31
  92. package/dist/meeting/state.js.map +1 -1
  93. package/dist/meeting/util.js +25 -169
  94. package/dist/meeting/util.js.map +1 -1
  95. package/dist/meeting-info/collection.js +3 -25
  96. package/dist/meeting-info/collection.js.map +1 -1
  97. package/dist/meeting-info/index.js +10 -33
  98. package/dist/meeting-info/index.js.map +1 -1
  99. package/dist/meeting-info/meeting-info-v2.js +179 -268
  100. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  101. package/dist/meeting-info/request.js +1 -16
  102. package/dist/meeting-info/request.js.map +1 -1
  103. package/dist/meeting-info/util.js +98 -183
  104. package/dist/meeting-info/util.js.map +1 -1
  105. package/dist/meeting-info/utilv2.js +137 -228
  106. package/dist/meeting-info/utilv2.js.map +1 -1
  107. package/dist/meetings/collection.js +3 -21
  108. package/dist/meetings/collection.js.map +1 -1
  109. package/dist/meetings/index.js +451 -570
  110. package/dist/meetings/index.js.map +1 -1
  111. package/dist/meetings/request.js +7 -30
  112. package/dist/meetings/request.js.map +1 -1
  113. package/dist/meetings/util.js +94 -148
  114. package/dist/meetings/util.js.map +1 -1
  115. package/dist/member/index.js +49 -89
  116. package/dist/member/index.js.map +1 -1
  117. package/dist/member/util.js +17 -68
  118. package/dist/member/util.js.map +1 -1
  119. package/dist/members/collection.js +2 -12
  120. package/dist/members/collection.js.map +1 -1
  121. package/dist/members/index.js +68 -184
  122. package/dist/members/index.js.map +1 -1
  123. package/dist/members/request.js +21 -56
  124. package/dist/members/request.js.map +1 -1
  125. package/dist/members/util.js +9 -38
  126. package/dist/members/util.js.map +1 -1
  127. package/dist/metrics/config.js +0 -2
  128. package/dist/metrics/config.js.map +1 -1
  129. package/dist/metrics/constants.js +1 -2
  130. package/dist/metrics/constants.js.map +1 -1
  131. package/dist/metrics/index.js +48 -136
  132. package/dist/metrics/index.js.map +1 -1
  133. package/dist/networkQualityMonitor/index.js +28 -57
  134. package/dist/networkQualityMonitor/index.js.map +1 -1
  135. package/dist/peer-connection-manager/index.js +60 -190
  136. package/dist/peer-connection-manager/index.js.map +1 -1
  137. package/dist/peer-connection-manager/util.js +10 -24
  138. package/dist/peer-connection-manager/util.js.map +1 -1
  139. package/dist/personal-meeting-room/index.js +10 -45
  140. package/dist/personal-meeting-room/index.js.map +1 -1
  141. package/dist/personal-meeting-room/request.js +2 -33
  142. package/dist/personal-meeting-room/request.js.map +1 -1
  143. package/dist/personal-meeting-room/util.js +0 -13
  144. package/dist/personal-meeting-room/util.js.map +1 -1
  145. package/dist/reachability/index.js +100 -166
  146. package/dist/reachability/index.js.map +1 -1
  147. package/dist/reachability/request.js +2 -18
  148. package/dist/reachability/request.js.map +1 -1
  149. package/dist/reactions/reactions.js +0 -2
  150. package/dist/reactions/reactions.js.map +1 -1
  151. package/dist/reactions/reactions.type.js +0 -5
  152. package/dist/reactions/reactions.type.js.map +1 -1
  153. package/dist/reconnection-manager/index.js +294 -468
  154. package/dist/reconnection-manager/index.js.map +1 -1
  155. package/dist/roap/collection.js +1 -12
  156. package/dist/roap/collection.js.map +1 -1
  157. package/dist/roap/handler.js +15 -85
  158. package/dist/roap/handler.js.map +1 -1
  159. package/dist/roap/index.js +42 -94
  160. package/dist/roap/index.js.map +1 -1
  161. package/dist/roap/request.js +81 -148
  162. package/dist/roap/request.js.map +1 -1
  163. package/dist/roap/state.js +2 -39
  164. package/dist/roap/state.js.map +1 -1
  165. package/dist/roap/turnDiscovery.js +8 -52
  166. package/dist/roap/turnDiscovery.js.map +1 -1
  167. package/dist/roap/util.js +0 -26
  168. package/dist/roap/util.js.map +1 -1
  169. package/dist/statsAnalyzer/global.js +0 -2
  170. package/dist/statsAnalyzer/global.js.map +1 -1
  171. package/dist/statsAnalyzer/index.js +68 -168
  172. package/dist/statsAnalyzer/index.js.map +1 -1
  173. package/dist/statsAnalyzer/mqaUtil.js +54 -53
  174. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  175. package/dist/transcription/index.js +13 -45
  176. package/dist/transcription/index.js.map +1 -1
  177. package/internal-README.md +7 -6
  178. package/package.json +17 -17
  179. package/src/common/browser-detection.ts +9 -6
  180. package/src/common/collection.ts +3 -1
  181. package/src/common/errors/captcha-error.ts +6 -6
  182. package/src/common/errors/intent-to-join.ts +6 -6
  183. package/src/common/errors/join-meeting.ts +12 -8
  184. package/src/common/errors/media.ts +6 -6
  185. package/src/common/errors/parameter.ts +9 -6
  186. package/src/common/errors/password-error.ts +6 -6
  187. package/src/common/errors/permission.ts +5 -5
  188. package/src/common/errors/reconnection.ts +6 -6
  189. package/src/common/errors/stats.ts +6 -6
  190. package/src/common/errors/webex-errors.ts +7 -5
  191. package/src/common/errors/webex-meetings-error.ts +1 -1
  192. package/src/common/events/events-scope.ts +5 -1
  193. package/src/common/events/events.ts +5 -1
  194. package/src/common/events/trigger-proxy.ts +8 -3
  195. package/src/common/events/util.ts +1 -2
  196. package/src/common/logs/logger-proxy.ts +21 -10
  197. package/src/common/logs/request.ts +11 -8
  198. package/src/config.ts +11 -11
  199. package/src/constants.ts +138 -119
  200. package/src/index.js +1 -1
  201. package/src/locus-info/controlsUtils.ts +34 -24
  202. package/src/locus-info/fullState.ts +15 -11
  203. package/src/locus-info/hostUtils.ts +4 -3
  204. package/src/locus-info/index.ts +25 -34
  205. package/src/locus-info/infoUtils.ts +12 -4
  206. package/src/locus-info/mediaSharesUtils.ts +4 -4
  207. package/src/locus-info/parser.ts +45 -68
  208. package/src/locus-info/selfUtils.ts +106 -57
  209. package/src/media/index.ts +118 -109
  210. package/src/media/properties.ts +26 -20
  211. package/src/media/util.ts +2 -2
  212. package/src/mediaQualityMetrics/config.ts +46 -46
  213. package/src/meeting/effectsState.ts +35 -35
  214. package/src/meeting/in-meeting-actions.ts +7 -3
  215. package/src/meeting/index.ts +1435 -1210
  216. package/src/meeting/muteState.ts +62 -31
  217. package/src/meeting/request.ts +160 -113
  218. package/src/meeting/state.ts +45 -30
  219. package/src/meeting/util.ts +131 -90
  220. package/src/meeting-info/collection.ts +2 -1
  221. package/src/meeting-info/index.ts +32 -30
  222. package/src/meeting-info/meeting-info-v2.ts +106 -108
  223. package/src/meeting-info/request.ts +9 -3
  224. package/src/meeting-info/util.ts +54 -46
  225. package/src/meeting-info/utilv2.ts +59 -53
  226. package/src/meetings/collection.ts +1 -1
  227. package/src/meetings/index.ts +513 -441
  228. package/src/meetings/request.ts +26 -24
  229. package/src/meetings/util.ts +26 -23
  230. package/src/member/index.ts +55 -49
  231. package/src/member/util.ts +26 -13
  232. package/src/members/collection.ts +0 -1
  233. package/src/members/index.ts +172 -121
  234. package/src/members/request.ts +46 -14
  235. package/src/members/util.ts +44 -42
  236. package/src/metrics/config.ts +254 -81
  237. package/src/metrics/constants.ts +0 -2
  238. package/src/metrics/index.ts +84 -71
  239. package/src/networkQualityMonitor/index.ts +20 -23
  240. package/src/peer-connection-manager/index.ts +321 -241
  241. package/src/peer-connection-manager/util.ts +4 -2
  242. package/src/personal-meeting-room/index.ts +12 -16
  243. package/src/personal-meeting-room/request.ts +10 -3
  244. package/src/personal-meeting-room/util.ts +3 -3
  245. package/src/reachability/index.ts +61 -59
  246. package/src/reachability/request.ts +36 -32
  247. package/src/reactions/reactions.ts +4 -4
  248. package/src/reactions/reactions.type.ts +2 -3
  249. package/src/reconnection-manager/index.ts +159 -98
  250. package/src/roap/collection.ts +2 -4
  251. package/src/roap/handler.ts +63 -32
  252. package/src/roap/index.ts +78 -58
  253. package/src/roap/request.ts +69 -54
  254. package/src/roap/state.ts +17 -11
  255. package/src/roap/turnDiscovery.ts +60 -31
  256. package/src/roap/util.ts +39 -31
  257. package/src/statsAnalyzer/global.ts +30 -33
  258. package/src/statsAnalyzer/index.ts +397 -169
  259. package/src/statsAnalyzer/mqaUtil.ts +178 -72
  260. package/src/transcription/index.ts +34 -32
  261. package/test/integration/spec/journey.js +666 -462
  262. package/test/integration/spec/space-meeting.js +318 -203
  263. package/test/integration/spec/transcription.js +6 -7
  264. package/test/unit/spec/common/browser-detection.js +9 -28
  265. package/test/unit/spec/fixture/locus.js +92 -90
  266. package/test/unit/spec/locus-info/controlsUtils.js +5 -5
  267. package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
  268. package/test/unit/spec/locus-info/index.js +1 -2
  269. package/test/unit/spec/locus-info/infoUtils.js +24 -31
  270. package/test/unit/spec/locus-info/lib/BasicSeqCmp.json +88 -430
  271. package/test/unit/spec/locus-info/lib/SeqCmp.json +513 -685
  272. package/test/unit/spec/locus-info/parser.js +3 -9
  273. package/test/unit/spec/locus-info/selfConstant.js +72 -103
  274. package/test/unit/spec/locus-info/selfUtils.js +21 -12
  275. package/test/unit/spec/meeting/effectsState.js +33 -45
  276. package/test/unit/spec/meeting/in-meeting-actions.ts +2 -3
  277. package/test/unit/spec/meeting/index.js +1141 -649
  278. package/test/unit/spec/meeting/muteState.js +42 -33
  279. package/test/unit/spec/meeting/request.js +56 -45
  280. package/test/unit/spec/meeting/utils.js +66 -49
  281. package/test/unit/spec/meeting-info/meetinginfov2.js +100 -73
  282. package/test/unit/spec/meeting-info/request.js +7 -9
  283. package/test/unit/spec/meeting-info/util.js +11 -12
  284. package/test/unit/spec/meeting-info/utilv2.js +110 -74
  285. package/test/unit/spec/meetings/collection.js +1 -1
  286. package/test/unit/spec/meetings/index.js +438 -257
  287. package/test/unit/spec/meetings/utils.js +14 -12
  288. package/test/unit/spec/member/index.js +0 -1
  289. package/test/unit/spec/member/util.js +5 -6
  290. package/test/unit/spec/members/index.js +84 -35
  291. package/test/unit/spec/members/request.js +29 -20
  292. package/test/unit/spec/members/utils.js +8 -5
  293. package/test/unit/spec/metrics/index.js +16 -21
  294. package/test/unit/spec/networkQualityMonitor/index.js +21 -15
  295. package/test/unit/spec/peerconnection-manager/index.js +88 -58
  296. package/test/unit/spec/peerconnection-manager/utils.js +5 -4
  297. package/test/unit/spec/peerconnection-manager/utils.test-fixtures.ts +7 -8
  298. package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -7
  299. package/test/unit/spec/reachability/index.ts +9 -11
  300. package/test/unit/spec/reconnection-manager/index.js +14 -17
  301. package/test/unit/spec/roap/index.ts +18 -8
  302. package/test/unit/spec/roap/turnDiscovery.ts +22 -19
  303. package/test/unit/spec/roap/util.js +3 -3
  304. package/test/unit/spec/stats-analyzer/index.js +29 -24
  305. package/test/utils/cmr.js +44 -42
  306. package/test/utils/testUtils.js +83 -74
  307. package/test/utils/webex-config.js +18 -18
  308. package/test/utils/webex-test-users.js +53 -50
@@ -25,15 +25,15 @@ describe('TurnDiscovery', () => {
25
25
  sinon.stub(Metrics, 'sendBehavioralMetric');
26
26
 
27
27
  mockRoapRequest = {
28
- sendRoap: sinon.fake.resolves({mediaConnections: FAKE_MEDIA_CONNECTIONS_FROM_LOCUS})
28
+ sendRoap: sinon.fake.resolves({mediaConnections: FAKE_MEDIA_CONNECTIONS_FROM_LOCUS}),
29
29
  } as unknown as RoapRequest;
30
30
 
31
31
  testMeeting = {
32
32
  id: 'fake meeting id',
33
33
  config: {
34
34
  experimental: {
35
- enableTurnDiscovery: true
36
- }
35
+ enableTurnDiscovery: true,
36
+ },
37
37
  },
38
38
  correlationId: 'fake correlation id',
39
39
  selfUrl: 'fake self url',
@@ -46,7 +46,7 @@ describe('TurnDiscovery', () => {
46
46
  testMeeting.roapSeq = newSeq;
47
47
  }),
48
48
  updateMediaConnections: sinon.stub(),
49
- webex: {meetings: {reachability: {isAnyClusterReachable: () => false}}}
49
+ webex: {meetings: {reachability: {isAnyClusterReachable: () => false}}},
50
50
  };
51
51
  });
52
52
 
@@ -55,7 +55,11 @@ describe('TurnDiscovery', () => {
55
55
  sinon.restore();
56
56
  });
57
57
 
58
- const checkRoapMessageSent = async (messageType, expectedSeq, expectedMediaId = testMeeting.mediaId) => {
58
+ const checkRoapMessageSent = async (
59
+ messageType,
60
+ expectedSeq,
61
+ expectedMediaId = testMeeting.mediaId
62
+ ) => {
59
63
  await testUtils.flushPromises();
60
64
 
61
65
  assert.calledOnce(mockRoapRequest.sendRoap);
@@ -70,7 +74,7 @@ describe('TurnDiscovery', () => {
70
74
  mediaId: expectedMediaId,
71
75
  audioMuted: testMeeting.isAudioMuted(),
72
76
  videoMuted: testMeeting.isVideoMuted(),
73
- meetingId: testMeeting.id
77
+ meetingId: testMeeting.id,
74
78
  });
75
79
 
76
80
  if (messageType === 'TURN_DISCOVERY_REQUEST') {
@@ -109,7 +113,7 @@ describe('TurnDiscovery', () => {
109
113
  `x-cisco-turn-url=${FAKE_TURN_URL}`,
110
114
  `x-cisco-turn-username=${FAKE_TURN_USERNAME}`,
111
115
  `x-cisco-turn-password=${FAKE_TURN_PASSWORD}`,
112
- ]
116
+ ],
113
117
  });
114
118
 
115
119
  await testUtils.flushPromises();
@@ -122,7 +126,7 @@ describe('TurnDiscovery', () => {
122
126
  assert.deepEqual(turnServerInfo, {
123
127
  url: FAKE_TURN_URL,
124
128
  username: FAKE_TURN_USERNAME,
125
- password: FAKE_TURN_PASSWORD
129
+ password: FAKE_TURN_PASSWORD,
126
130
  });
127
131
 
128
132
  assert.isUndefined(turnDiscoverySkippedReason);
@@ -145,7 +149,7 @@ describe('TurnDiscovery', () => {
145
149
  `x-cisco-turn-url=${FAKE_TURN_URL}`,
146
150
  `x-cisco-turn-username=${FAKE_TURN_USERNAME}`,
147
151
  `x-cisco-turn-password=${FAKE_TURN_PASSWORD}`,
148
- ]
152
+ ],
149
153
  });
150
154
 
151
155
  await testUtils.flushPromises();
@@ -158,7 +162,7 @@ describe('TurnDiscovery', () => {
158
162
  assert.deepEqual(turnServerInfo, {
159
163
  url: FAKE_TURN_URL,
160
164
  username: FAKE_TURN_USERNAME,
161
- password: FAKE_TURN_PASSWORD
165
+ password: FAKE_TURN_PASSWORD,
162
166
  });
163
167
  assert.isUndefined(turnDiscoverySkippedReason);
164
168
  });
@@ -181,7 +185,7 @@ describe('TurnDiscovery', () => {
181
185
  `x-cisco-turn-username=${FAKE_TURN_USERNAME}`,
182
186
  `x-cisco-turn-password=${FAKE_TURN_PASSWORD}`,
183
187
  'another-header-at-the-end=12345',
184
- ]
188
+ ],
185
189
  });
186
190
 
187
191
  await testUtils.flushPromises();
@@ -193,7 +197,7 @@ describe('TurnDiscovery', () => {
193
197
  assert.deepEqual(turnServerInfo, {
194
198
  url: FAKE_TURN_URL,
195
199
  username: FAKE_TURN_USERNAME,
196
- password: FAKE_TURN_PASSWORD
200
+ password: FAKE_TURN_PASSWORD,
197
201
  });
198
202
  assert.isUndefined(turnDiscoverySkippedReason);
199
203
  });
@@ -242,10 +246,9 @@ describe('TurnDiscovery', () => {
242
246
  assert.notCalled(mockRoapRequest.sendRoap);
243
247
  assert.notCalled(Metrics.sendBehavioralMetric);
244
248
  testMeeting.webex.meetings.reachability.isAnyClusterReachable = prev;
245
-
246
249
  });
247
250
 
248
- it('resolves with undefined if we don\'t get a response within 10s', async () => {
251
+ it("resolves with undefined if we don't get a response within 10s", async () => {
249
252
  const td = new TurnDiscovery(mockRoapRequest);
250
253
 
251
254
  const promise = td.doTurnDiscovery(testMeeting, false);
@@ -269,7 +272,7 @@ describe('TurnDiscovery', () => {
269
272
  headers: [
270
273
  `x-cisco-turn-url=${FAKE_TURN_URL}`,
271
274
  `x-cisco-turn-username=${FAKE_TURN_USERNAME}`,
272
- ]
275
+ ],
273
276
  });
274
277
  await testUtils.flushPromises();
275
278
  const {turnServerInfo, turnDiscoverySkippedReason} = await turnDiscoveryPromise;
@@ -302,7 +305,7 @@ describe('TurnDiscovery', () => {
302
305
  td.handleTurnDiscoveryResponse({headers: []});
303
306
 
304
307
  await testUtils.flushPromises();
305
- const {turnServerInfo, turnDiscoverySkippedReason}= await turnDiscoveryPromise;
308
+ const {turnServerInfo, turnDiscoverySkippedReason} = await turnDiscoveryPromise;
306
309
 
307
310
  assert.isUndefined(turnServerInfo);
308
311
  assert.isUndefined(turnDiscoverySkippedReason);
@@ -328,7 +331,7 @@ describe('TurnDiscovery', () => {
328
331
  `x-cisco-turn-url=${FAKE_TURN_URL}`,
329
332
  `x-cisco-turn-username=${FAKE_TURN_USERNAME}`,
330
333
  `x-cisco-turn-password=${FAKE_TURN_PASSWORD}`,
331
- ]
334
+ ],
332
335
  });
333
336
 
334
337
  await testUtils.flushPromises();
@@ -345,7 +348,7 @@ describe('TurnDiscovery', () => {
345
348
  });
346
349
 
347
350
  describe('handleTurnDiscoveryResponse', () => {
348
- it('doesn\'t do anything if turn discovery was not started', () => {
351
+ it("doesn't do anything if turn discovery was not started", () => {
349
352
  const td = new TurnDiscovery(mockRoapRequest);
350
353
 
351
354
  // there is not much we can check, but we mainly want to make
@@ -355,7 +358,7 @@ describe('TurnDiscovery', () => {
355
358
  `x-cisco-turn-url=${FAKE_TURN_URL}`,
356
359
  `x-cisco-turn-username=${FAKE_TURN_USERNAME}`,
357
360
  `x-cisco-turn-password=${FAKE_TURN_PASSWORD}`,
358
- ]
361
+ ],
359
362
  });
360
363
 
361
364
  assert.notCalled(mockRoapRequest.sendRoap);
@@ -11,11 +11,11 @@ describe('RoapUtil', () => {
11
11
  beforeEach('stub PeerConnectionManager', () => {
12
12
  meeting = {
13
13
  mediaProperties: {
14
- peerConnection: {name: 'peer-connection'}
14
+ peerConnection: {name: 'peer-connection'},
15
15
  },
16
16
  roap: {
17
- lastRoapOffer: 'lastRoapOffer'
18
- }
17
+ lastRoapOffer: 'lastRoapOffer',
18
+ },
19
19
  };
20
20
  session = {OFFER: {sdps: ['sdp1', 'sdp2']}};
21
21
 
@@ -19,31 +19,31 @@ describe('plugin-meetings', () => {
19
19
  let sandBoxSpy;
20
20
 
21
21
  const initialConfig = {
22
- videoPacketLossRatioThreshold: 9
22
+ videoPacketLossRatioThreshold: 9,
23
23
  };
24
24
 
25
25
  const defaultStats = {
26
26
  internal: {
27
27
  video: {
28
28
  send: {
29
- totalPacketsLostOnReceiver: 10
30
- }
31
- }
29
+ totalPacketsLostOnReceiver: 10,
30
+ },
31
+ },
32
32
  },
33
33
  video: {
34
34
  send: {
35
35
  packetsSent: 2,
36
36
  meanRemoteJitter: [],
37
- meanRoundTripTime: []
38
- }
39
- }
37
+ meanRoundTripTime: [],
38
+ },
39
+ },
40
40
  };
41
41
 
42
42
  const statusResult = {
43
43
  type: 'remote-inbound-rtp',
44
44
  packetsLost: 11,
45
45
  rttThreshold: 501,
46
- jitterThreshold: 501
46
+ jitterThreshold: 501,
47
47
  };
48
48
 
49
49
  const sandbox = sinon.createSandbox();
@@ -53,7 +53,10 @@ describe('plugin-meetings', () => {
53
53
 
54
54
  statsAnalyzer = new StatsAnalyzer(initialConfig, networkQualityMonitor, defaultStats);
55
55
 
56
- sandBoxSpy = sandbox.spy(statsAnalyzer.networkQualityMonitor, 'determineUplinkNetworkQuality');
56
+ sandBoxSpy = sandbox.spy(
57
+ statsAnalyzer.networkQualityMonitor,
58
+ 'determineUplinkNetworkQuality'
59
+ );
57
60
  });
58
61
 
59
62
  afterEach(() => {
@@ -64,11 +67,13 @@ describe('plugin-meetings', () => {
64
67
  await statsAnalyzer.parseGetStatsResult(statusResult, 'video');
65
68
 
66
69
  assert.calledOnce(statsAnalyzer.networkQualityMonitor.determineUplinkNetworkQuality);
67
- assert(sandBoxSpy.calledWith({
68
- mediaType: 'video',
69
- remoteRtpResults: statusResult,
70
- statsAnalyzerCurrentStats: statsAnalyzer.statsResults
71
- }));
70
+ assert(
71
+ sandBoxSpy.calledWith({
72
+ mediaType: 'video',
73
+ remoteRtpResults: statusResult,
74
+ statsAnalyzerCurrentStats: statsAnalyzer.statsResults,
75
+ })
76
+ );
72
77
  });
73
78
  });
74
79
 
@@ -113,7 +118,7 @@ describe('plugin-meetings', () => {
113
118
  type: 'outbound-rtp',
114
119
  packetsSent: 0,
115
120
  bytesSent: 1,
116
- }
121
+ },
117
122
  },
118
123
  video: {
119
124
  receiver: {
@@ -125,35 +130,35 @@ describe('plugin-meetings', () => {
125
130
  type: 'outbound-rtp',
126
131
  framesSent: 0,
127
132
  bytesSent: 1,
128
- }
129
- }
133
+ },
134
+ },
130
135
  };
131
136
 
132
137
  pc = {
133
138
  audioTransceiver: {
134
139
  sender: {
135
- getStats: sinon.stub().resolves([fakeStats.audio.sender])
140
+ getStats: sinon.stub().resolves([fakeStats.audio.sender]),
136
141
  },
137
142
  receiver: {
138
- getStats: sinon.stub().resolves([fakeStats.audio.receiver])
143
+ getStats: sinon.stub().resolves([fakeStats.audio.receiver]),
139
144
  },
140
145
  },
141
146
  videoTransceiver: {
142
147
  sender: {
143
- getStats: sinon.stub().resolves([fakeStats.video.sender])
148
+ getStats: sinon.stub().resolves([fakeStats.video.sender]),
144
149
  },
145
150
  receiver: {
146
- getStats: sinon.stub().resolves([fakeStats.video.receiver])
151
+ getStats: sinon.stub().resolves([fakeStats.video.receiver]),
147
152
  },
148
153
  },
149
154
  shareTransceiver: {
150
155
  sender: {
151
- getStats: sinon.stub().resolves([])
156
+ getStats: sinon.stub().resolves([]),
152
157
  },
153
158
  receiver: {
154
- getStats: sinon.stub().resolves([])
159
+ getStats: sinon.stub().resolves([]),
155
160
  },
156
- }
161
+ },
157
162
  };
158
163
 
159
164
  networkQualityMonitor = new NetworkQualityMonitor(initialConfig);
package/test/utils/cmr.js CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  import uuid from 'uuid';
3
2
  import retry from '@webex/test-helper-retry';
4
3
 
@@ -23,16 +22,16 @@ CMR.reserve = (webex, claimed) => {
23
22
  authorization: `Bearer ${webex.credentials.supertoken.access_token}`,
24
23
  'cisco-no-http-redirect': null,
25
24
  'spark-user-agent': null,
26
- trackingid: `ITCLIENT_${uuid.v4()}_0_imi:true`
25
+ trackingid: `ITCLIENT_${uuid.v4()}_0_imi:true`,
27
26
  },
28
27
  body: {
29
28
  resourceType,
30
29
  requestMetaData: {
31
30
  emailAddress: `test${uuid.v4()}@wx2.example.com`,
32
- loginType: 'loginGuest'
31
+ loginType: 'loginGuest',
33
32
  },
34
- reservedBy: 'Webex JavaScript SDK Test Suite'
35
- }
33
+ reservedBy: 'Webex JavaScript SDK Test Suite',
34
+ },
36
35
  };
37
36
 
38
37
  if (claimed) {
@@ -40,7 +39,8 @@ CMR.reserve = (webex, claimed) => {
40
39
  }
41
40
  console.log('USER ID ', webex.internal.device.userId);
42
41
 
43
- return webex.request(requestBody)
42
+ return webex
43
+ .request(requestBody)
44
44
  .then((response) => {
45
45
  const cmr = response.body;
46
46
 
@@ -56,47 +56,49 @@ CMR.reserve = (webex, claimed) => {
56
56
  CMR.release = (webex, reservationUrl) => {
57
57
  console.log('releasing cmr');
58
58
 
59
- return webex.request({
60
- method: 'DELETE',
61
- uri: reservationUrl,
62
- headers: {
63
- authorization: `Bearer ${webex.credentials.supertoken.access_token}`,
64
- 'cisco-no-http-redirect': null,
65
- 'spark-user-agent': null
66
- }
67
- })
59
+ return webex
60
+ .request({
61
+ method: 'DELETE',
62
+ uri: reservationUrl,
63
+ headers: {
64
+ authorization: `Bearer ${webex.credentials.supertoken.access_token}`,
65
+ 'cisco-no-http-redirect': null,
66
+ 'spark-user-agent': null,
67
+ },
68
+ })
68
69
  .then(() => console.log('released cmr'));
69
70
  };
70
71
 
71
- CMR.waitForHostToJoin = (webex, resourceUrl) => retry(() => {
72
- console.log('checking if the host has joined');
73
-
74
- return webex.request({
75
- method: 'GET',
76
- uri: resourceUrl,
77
- headers: {
78
- authorization: `Bearer ${webex.credentials.supertoken.access_token}`,
79
- 'cisco-no-http-redirect': null,
80
- 'spark-user-agent': null
81
- }
72
+ CMR.waitForHostToJoin = (webex, resourceUrl) =>
73
+ retry(() => {
74
+ console.log('checking if the host has joined');
75
+
76
+ return webex
77
+ .request({
78
+ method: 'GET',
79
+ uri: resourceUrl,
80
+ headers: {
81
+ authorization: `Bearer ${webex.credentials.supertoken.access_token}`,
82
+ 'cisco-no-http-redirect': null,
83
+ 'spark-user-agent': null,
84
+ },
85
+ })
86
+ .then((res) => {
87
+ if (res.body && res.body.meeting.hostPresent) {
88
+ console.log('the host has joined');
89
+
90
+ return;
91
+ }
92
+
93
+ console.log('the host has not joined');
94
+ throw new Error('Meeting host has not yet joined');
95
+ });
82
96
  })
83
- .then((res) => {
84
- if (res.body && res.body.meeting.hostPresent) {
85
- console.log('the host has joined');
97
+ .then(() => true)
98
+ .catch((reason) => {
99
+ console.warn(reason);
86
100
 
87
- return;
88
- }
89
-
90
- console.log('the host has not joined');
91
- throw new Error('Meeting host has not yet joined');
101
+ return false;
92
102
  });
93
- })
94
- .then(() => true)
95
- .catch((reason) => {
96
- console.warn(reason);
97
-
98
- return false;
99
- });
100
-
101
103
 
102
104
  export default CMR;
@@ -19,7 +19,7 @@ const waitForSpy = (spy, event) => {
19
19
  resolve(spy.args[0][0]);
20
20
  }
21
21
  }, 1000);
22
- })
22
+ }),
23
23
  ]);
24
24
  };
25
25
 
@@ -40,7 +40,7 @@ const waitForStateChange = (meeting, state) => {
40
40
  resolve(meeting.locusInfo.parsedLocus.states);
41
41
  }
42
42
  }, 1000);
43
- })
43
+ }),
44
44
  ]);
45
45
  };
46
46
 
@@ -59,44 +59,46 @@ const waitForCallEnded = (user, email) => {
59
59
  clearTimeout(timer);
60
60
  clearInterval(interval);
61
61
  resolve();
62
- }
63
- else {
62
+ } else {
64
63
  console.log('MEETING STILL EXISTS!', user.webex.meetings.getAllMeetings());
65
64
  }
66
65
  }, 3000);
67
- })
66
+ }),
68
67
  ]);
69
68
  };
70
69
 
71
- const syncAndEndMeeting = (user) => user.webex.meetings.syncMeetings()
72
- .then(() => {
73
- const promise = [];
74
- const meetings = user.webex.meetings.getAllMeetings();
70
+ const syncAndEndMeeting = (user) =>
71
+ user.webex.meetings
72
+ .syncMeetings()
73
+ .then(() => {
74
+ const promise = [];
75
+ const meetings = user.webex.meetings.getAllMeetings();
75
76
 
76
- if (Object.keys(meetings).length === 0) {
77
- return Promise.resolve();
78
- }
79
- Object.keys(meetings)
80
- .forEach((key) => {
77
+ if (Object.keys(meetings).length === 0) {
78
+ return Promise.resolve();
79
+ }
80
+ Object.keys(meetings).forEach((key) => {
81
81
  promise.push(meetings[key].leave());
82
82
  });
83
83
 
84
- return Promise.all(promise);
85
- })
86
- .then(() => new Promise((resolve) => {
87
- const interval = setInterval(() => {
88
- if (Object.keys(user.webex.meetings.getAllMeetings()).length === 0) {
89
- clearInterval(interval);
90
- resolve();
91
- }
92
- else {
93
- console.log('End Meetings before test failed');
94
- }
95
- }, 3000);
96
- }))
97
- .catch((e) => {
98
- console.log('ERROR on syncMeeting', e);
99
- });
84
+ return Promise.all(promise);
85
+ })
86
+ .then(
87
+ () =>
88
+ new Promise((resolve) => {
89
+ const interval = setInterval(() => {
90
+ if (Object.keys(user.webex.meetings.getAllMeetings()).length === 0) {
91
+ clearInterval(interval);
92
+ resolve();
93
+ } else {
94
+ console.log('End Meetings before test failed');
95
+ }
96
+ }, 3000);
97
+ })
98
+ )
99
+ .catch((e) => {
100
+ console.log('ERROR on syncMeeting', e);
101
+ });
100
102
 
101
103
  //
102
104
  const waitForEvents = (scopeEvents, timeout = max) => {
@@ -125,11 +127,12 @@ const waitForEvents = (scopeEvents, timeout = max) => {
125
127
  obj.user.memberId = value.meeting.locusInfo.parsedLocus.selfId;
126
128
  }
127
129
  if (obj.event === 'meeting:removed') {
128
- console.log(`MEETING:REMOVED ${obj.user.name} ID ${obj.user.meeting.id} correlationID ${obj.user.meeting.correlationId}`);
130
+ console.log(
131
+ `MEETING:REMOVED ${obj.user.name} ID ${obj.user.meeting.id} correlationID ${obj.user.meeting.correlationId}`
132
+ );
129
133
  if (obj.user.meeting.id === value.meetingId) {
130
134
  obj.user.meeting = null;
131
- }
132
- else {
135
+ } else {
133
136
  console.log('MEETING EXISTING ', obj.user.webex.meetings.getAllMeetings());
134
137
  reject(new Error(`Different Meeting Object ${value}`));
135
138
  }
@@ -142,8 +145,7 @@ const waitForEvents = (scopeEvents, timeout = max) => {
142
145
 
143
146
  resolve(result);
144
147
  }
145
- }
146
- else if (result.length === scopeEvents.length) {
148
+ } else if (result.length === scopeEvents.length) {
147
149
  resolve(result);
148
150
  obj.scope.off(obj.event, handler);
149
151
  clearTimeout(timer);
@@ -152,12 +154,11 @@ const waitForEvents = (scopeEvents, timeout = max) => {
152
154
 
153
155
  obj.scope.on(obj.event, handler);
154
156
  });
155
- }
156
- catch (e) {
157
+ } catch (e) {
157
158
  console.error('waitForEvents', e);
158
159
  reject(e);
159
160
  }
160
- })
161
+ }),
161
162
  ]);
162
163
  };
163
164
 
@@ -172,25 +173,27 @@ const delayedPromise = (promise) => {
172
173
  }),
173
174
  new Promise((resolve, reject) => {
174
175
  setTimeout(() => {
175
- promise.then((res) => {
176
- resolve(res);
177
- clearTimeout(timer);
178
- })
176
+ promise
177
+ .then((res) => {
178
+ resolve(res);
179
+ clearTimeout(timer);
180
+ })
179
181
  .catch((e) => {
180
182
  console.error('delayedPromise', e);
181
183
  reject(e);
182
184
  });
183
185
  }, 2000);
184
- })
186
+ }),
185
187
  ]);
186
188
  };
187
189
 
188
- const delayedTest = (callback, timeout) => new Promise((resolve) => {
189
- setTimeout(() => {
190
- callback();
191
- resolve();
192
- }, timeout);
193
- });
190
+ const delayedTest = (callback, timeout) =>
191
+ new Promise((resolve) => {
192
+ setTimeout(() => {
193
+ callback();
194
+ resolve();
195
+ }, timeout);
196
+ });
194
197
 
195
198
  const addMedia = (user) => {
196
199
  const mediaReadyPromises = {
@@ -209,23 +212,26 @@ const addMedia = (user) => {
209
212
 
210
213
  user.meeting.on('media:ready', mediaReady);
211
214
 
212
- return user.meeting.getMediaStreams({
213
- sendAudio: true,
214
- sendVideo: true,
215
- sendShare: false
216
- })
217
- .then(([localStream, localShare]) => user.meeting.addMedia({
218
- mediaSettings: {
219
- sendAudio: true,
220
- sendVideo: true,
221
- sendShare: false,
222
- receiveShare: true,
223
- receiveAudio: true,
224
- receiveVideo: true
225
- },
226
- localShare,
227
- localStream
228
- }))
215
+ return user.meeting
216
+ .getMediaStreams({
217
+ sendAudio: true,
218
+ sendVideo: true,
219
+ sendShare: false,
220
+ })
221
+ .then(([localStream, localShare]) =>
222
+ user.meeting.addMedia({
223
+ mediaSettings: {
224
+ sendAudio: true,
225
+ sendVideo: true,
226
+ sendShare: false,
227
+ receiveShare: true,
228
+ receiveAudio: true,
229
+ receiveVideo: true,
230
+ },
231
+ localShare,
232
+ localStream,
233
+ })
234
+ )
229
235
  .then(() => Promise.all(Object.values(mediaReadyPromises).map((defer) => defer.promise)))
230
236
  .then(() => {
231
237
  assert.exists(user.meeting.mediaProperties.audioTrack, 'audioTrack not present');
@@ -233,11 +239,12 @@ const addMedia = (user) => {
233
239
  });
234
240
  };
235
241
 
236
- const waitUntil = (waitTime) => new Promise((resolve) => {
237
- setTimeout(() => {
238
- resolve();
239
- }, waitTime);
240
- });
242
+ const waitUntil = (waitTime) =>
243
+ new Promise((resolve) => {
244
+ setTimeout(() => {
245
+ resolve();
246
+ }, waitTime);
247
+ });
241
248
 
242
249
  const flushPromises = () => new Promise(setImmediate);
243
250
 
@@ -259,7 +266,10 @@ const getCircularReplacer = () => {
259
266
 
260
267
  // this function is meant to be used as the "match" callback with waitForEvents()
261
268
  // when you want to wait for a particular users's status to reach a certain value
262
- const checkParticipantUpdatedStatus = (user, expectedStatus) => (event) => !!event.delta.updated.find((member) => user.meeting.members.selfId === member.id && member.status === expectedStatus);
269
+ const checkParticipantUpdatedStatus = (user, expectedStatus) => (event) =>
270
+ !!event.delta.updated.find(
271
+ (member) => user.meeting.members.selfId === member.id && member.status === expectedStatus
272
+ );
263
273
 
264
274
  export default {
265
275
  waitForSpy,
@@ -273,6 +283,5 @@ export default {
273
283
  waitUntil,
274
284
  delayedTest,
275
285
  flushPromises,
276
- getCircularReplacer
286
+ getCircularReplacer,
277
287
  };
278
-