@webex/plugin-meetings 2.60.1-next.9 → 2.60.2

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 (539) hide show
  1. package/README.md +8 -58
  2. package/dist/common/browser-detection.js +3 -2
  3. package/dist/common/browser-detection.js.map +1 -1
  4. package/dist/common/collection.js +4 -3
  5. package/dist/common/collection.js.map +1 -1
  6. package/dist/common/config.js +2 -1
  7. package/dist/common/config.js.map +1 -1
  8. package/dist/common/errors/captcha-error.js +2 -1
  9. package/dist/common/errors/captcha-error.js.map +1 -1
  10. package/dist/common/errors/intent-to-join.js +2 -1
  11. package/dist/common/errors/intent-to-join.js.map +1 -1
  12. package/dist/common/errors/join-meeting.js +2 -1
  13. package/dist/common/errors/join-meeting.js.map +1 -1
  14. package/dist/common/errors/media.js +2 -1
  15. package/dist/common/errors/media.js.map +1 -1
  16. package/dist/common/errors/parameter.js +4 -3
  17. package/dist/common/errors/parameter.js.map +1 -1
  18. package/dist/common/errors/password-error.js +2 -1
  19. package/dist/common/errors/password-error.js.map +1 -1
  20. package/dist/common/errors/permission.js +2 -1
  21. package/dist/common/errors/permission.js.map +1 -1
  22. package/dist/common/errors/{reclaim-host-role-errors.js → reclaim-host-role-error.js} +11 -7
  23. package/dist/common/errors/reclaim-host-role-error.js.map +1 -0
  24. package/dist/common/errors/reconnection-in-progress.js +2 -1
  25. package/dist/common/errors/reconnection-in-progress.js.map +1 -1
  26. package/dist/common/errors/reconnection.js +2 -1
  27. package/dist/common/errors/reconnection.js.map +1 -1
  28. package/dist/common/errors/stats.js +2 -1
  29. package/dist/common/errors/stats.js.map +1 -1
  30. package/dist/common/errors/webex-errors.d.ts +8 -20
  31. package/dist/common/errors/webex-errors.js +28 -48
  32. package/dist/common/errors/webex-errors.js.map +1 -1
  33. package/dist/common/errors/webex-meetings-error.js +2 -1
  34. package/dist/common/errors/webex-meetings-error.js.map +1 -1
  35. package/dist/common/events/events-scope.js +2 -1
  36. package/dist/common/events/events-scope.js.map +1 -1
  37. package/dist/common/events/events.js +2 -1
  38. package/dist/common/events/events.js.map +1 -1
  39. package/dist/common/events/trigger-proxy.js +2 -1
  40. package/dist/common/events/trigger-proxy.js.map +1 -1
  41. package/dist/common/events/util.js +2 -1
  42. package/dist/common/events/util.js.map +1 -1
  43. package/dist/common/logs/logger-config.js +2 -1
  44. package/dist/common/logs/logger-config.js.map +1 -1
  45. package/dist/common/logs/logger-proxy.js +3 -2
  46. package/dist/common/logs/logger-proxy.js.map +1 -1
  47. package/dist/common/logs/request.d.ts +1 -3
  48. package/dist/common/logs/request.js +5 -8
  49. package/dist/common/logs/request.js.map +1 -1
  50. package/dist/common/queue.d.ts +7 -9
  51. package/dist/common/queue.js +9 -22
  52. package/dist/common/queue.js.map +1 -1
  53. package/dist/config.d.ts +7 -6
  54. package/dist/config.js +10 -8
  55. package/dist/config.js.map +1 -1
  56. package/dist/constants.d.ts +100 -234
  57. package/dist/constants.js +444 -433
  58. package/dist/constants.js.map +1 -1
  59. package/dist/controls-options-manager/constants.js +6 -3
  60. package/dist/controls-options-manager/constants.js.map +1 -1
  61. package/dist/controls-options-manager/enums.d.ts +1 -11
  62. package/dist/controls-options-manager/enums.js +6 -15
  63. package/dist/controls-options-manager/enums.js.map +1 -1
  64. package/dist/controls-options-manager/index.d.ts +1 -17
  65. package/dist/controls-options-manager/index.js +38 -127
  66. package/dist/controls-options-manager/index.js.map +1 -1
  67. package/dist/controls-options-manager/util.d.ts +7 -1
  68. package/dist/controls-options-manager/util.js +19 -309
  69. package/dist/controls-options-manager/util.js.map +1 -1
  70. package/dist/index.d.ts +3 -6
  71. package/dist/index.js +5 -121
  72. package/dist/index.js.map +1 -1
  73. package/dist/locus-info/controlsUtils.js +11 -100
  74. package/dist/locus-info/controlsUtils.js.map +1 -1
  75. package/dist/locus-info/embeddedAppsUtils.js +4 -3
  76. package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
  77. package/dist/locus-info/fullState.js +2 -1
  78. package/dist/locus-info/fullState.js.map +1 -1
  79. package/dist/locus-info/hostUtils.js +2 -1
  80. package/dist/locus-info/hostUtils.js.map +1 -1
  81. package/dist/locus-info/index.d.ts +4 -57
  82. package/dist/locus-info/index.js +84 -425
  83. package/dist/locus-info/index.js.map +1 -1
  84. package/dist/locus-info/infoUtils.js +5 -13
  85. package/dist/locus-info/infoUtils.js.map +1 -1
  86. package/dist/locus-info/mediaSharesUtils.js +3 -58
  87. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  88. package/dist/locus-info/parser.d.ts +6 -66
  89. package/dist/locus-info/parser.js +80 -253
  90. package/dist/locus-info/parser.js.map +1 -1
  91. package/dist/locus-info/selfUtils.js +13 -97
  92. package/dist/locus-info/selfUtils.js.map +1 -1
  93. package/dist/media/index.d.ts +0 -2
  94. package/dist/media/index.js +319 -107
  95. package/dist/media/index.js.map +1 -1
  96. package/dist/media/properties.d.ts +53 -38
  97. package/dist/media/properties.js +153 -96
  98. package/dist/media/properties.js.map +1 -1
  99. package/dist/media/util.js +22 -1
  100. package/dist/media/util.js.map +1 -1
  101. package/dist/mediaQualityMetrics/config.d.ts +230 -234
  102. package/dist/mediaQualityMetrics/config.js +498 -302
  103. package/dist/mediaQualityMetrics/config.js.map +1 -1
  104. package/dist/meeting/effectsState.d.ts +42 -0
  105. package/dist/meeting/effectsState.js +260 -0
  106. package/dist/meeting/effectsState.js.map +1 -0
  107. package/dist/meeting/in-meeting-actions.d.ts +0 -88
  108. package/dist/meeting/in-meeting-actions.js +3 -94
  109. package/dist/meeting/in-meeting-actions.js.map +1 -1
  110. package/dist/meeting/index.d.ts +520 -705
  111. package/dist/meeting/index.js +3083 -5041
  112. package/dist/meeting/index.js.map +1 -1
  113. package/dist/meeting/muteState.d.ts +25 -93
  114. package/dist/meeting/muteState.js +133 -224
  115. package/dist/meeting/muteState.js.map +1 -1
  116. package/dist/meeting/request.d.ts +47 -82
  117. package/dist/meeting/request.js +199 -304
  118. package/dist/meeting/request.js.map +1 -1
  119. package/dist/meeting/state.js +2 -1
  120. package/dist/meeting/state.js.map +1 -1
  121. package/dist/meeting/util.d.ts +1 -118
  122. package/dist/meeting/util.js +435 -676
  123. package/dist/meeting/util.js.map +1 -1
  124. package/dist/meeting-info/collection.js +4 -3
  125. package/dist/meeting-info/collection.js.map +1 -1
  126. package/dist/meeting-info/index.d.ts +1 -13
  127. package/dist/meeting-info/index.js +7 -74
  128. package/dist/meeting-info/index.js.map +1 -1
  129. package/dist/meeting-info/meeting-info-v2.d.ts +1 -31
  130. package/dist/meeting-info/meeting-info-v2.js +63 -200
  131. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  132. package/dist/meeting-info/request.js +2 -1
  133. package/dist/meeting-info/request.js.map +1 -1
  134. package/dist/meeting-info/util.js +3 -2
  135. package/dist/meeting-info/util.js.map +1 -1
  136. package/dist/meeting-info/utilv2.js +41 -39
  137. package/dist/meeting-info/utilv2.js.map +1 -1
  138. package/dist/meetings/collection.d.ts +0 -17
  139. package/dist/meetings/collection.js +4 -42
  140. package/dist/meetings/collection.js.map +1 -1
  141. package/dist/meetings/index.d.ts +20 -114
  142. package/dist/meetings/index.js +133 -540
  143. package/dist/meetings/index.js.map +1 -1
  144. package/dist/meetings/request.js +3 -4
  145. package/dist/meetings/request.js.map +1 -1
  146. package/dist/meetings/util.js +6 -107
  147. package/dist/meetings/util.js.map +1 -1
  148. package/dist/member/index.d.ts +1 -13
  149. package/dist/member/index.js +2 -45
  150. package/dist/member/index.js.map +1 -1
  151. package/dist/member/member.types.js +4 -3
  152. package/dist/member/member.types.js.map +1 -1
  153. package/dist/member/util.js +29 -120
  154. package/dist/member/util.js.map +1 -1
  155. package/dist/members/collection.d.ts +0 -5
  156. package/dist/members/collection.js +2 -11
  157. package/dist/members/collection.js.map +1 -1
  158. package/dist/members/index.d.ts +11 -56
  159. package/dist/members/index.js +47 -174
  160. package/dist/members/index.js.map +1 -1
  161. package/dist/members/request.d.ts +11 -67
  162. package/dist/members/request.js +54 -102
  163. package/dist/members/request.js.map +1 -1
  164. package/dist/members/types.js +4 -3
  165. package/dist/members/types.js.map +1 -1
  166. package/dist/members/util.d.ts +1 -214
  167. package/dist/members/util.js +284 -327
  168. package/dist/members/util.js.map +1 -1
  169. package/dist/metrics/config.d.ts +169 -0
  170. package/dist/metrics/config.js +289 -0
  171. package/dist/metrics/config.js.map +1 -0
  172. package/dist/metrics/constants.d.ts +6 -15
  173. package/dist/metrics/constants.js +9 -17
  174. package/dist/metrics/constants.js.map +1 -1
  175. package/dist/metrics/index.d.ts +111 -4
  176. package/dist/metrics/index.js +452 -4
  177. package/dist/metrics/index.js.map +1 -1
  178. package/dist/networkQualityMonitor/index.js +4 -5
  179. package/dist/networkQualityMonitor/index.js.map +1 -1
  180. package/dist/peer-connection-manager/index.d.ts +6 -0
  181. package/dist/peer-connection-manager/index.js +671 -0
  182. package/dist/peer-connection-manager/index.js.map +1 -0
  183. package/dist/peer-connection-manager/util.d.ts +6 -0
  184. package/dist/peer-connection-manager/util.js +110 -0
  185. package/dist/peer-connection-manager/util.js.map +1 -0
  186. package/dist/personal-meeting-room/index.js +3 -2
  187. package/dist/personal-meeting-room/index.js.map +1 -1
  188. package/dist/personal-meeting-room/request.js +3 -2
  189. package/dist/personal-meeting-room/request.js.map +1 -1
  190. package/dist/personal-meeting-room/util.js +2 -1
  191. package/dist/personal-meeting-room/util.js.map +1 -1
  192. package/dist/reachability/index.d.ts +95 -61
  193. package/dist/reachability/index.js +392 -304
  194. package/dist/reachability/index.js.map +1 -1
  195. package/dist/reachability/request.d.ts +3 -7
  196. package/dist/reachability/request.js +10 -18
  197. package/dist/reachability/request.js.map +1 -1
  198. package/dist/reactions/reactions.d.ts +2 -2
  199. package/dist/reactions/reactions.js +6 -4
  200. package/dist/reactions/reactions.js.map +1 -1
  201. package/dist/reactions/reactions.type.d.ts +3 -23
  202. package/dist/reactions/reactions.type.js +23 -21
  203. package/dist/reactions/reactions.type.js.map +1 -1
  204. package/dist/reconnection-manager/index.d.ts +8 -32
  205. package/dist/reconnection-manager/index.js +232 -285
  206. package/dist/reconnection-manager/index.js.map +1 -1
  207. package/dist/recording-controller/enums.js +5 -4
  208. package/dist/recording-controller/enums.js.map +1 -1
  209. package/dist/recording-controller/index.d.ts +1 -15
  210. package/dist/recording-controller/index.js +46 -57
  211. package/dist/recording-controller/index.js.map +1 -1
  212. package/dist/recording-controller/util.d.ts +4 -5
  213. package/dist/recording-controller/util.js +10 -10
  214. package/dist/recording-controller/util.js.map +1 -1
  215. package/dist/roap/collection.d.ts +10 -0
  216. package/dist/roap/collection.js +63 -0
  217. package/dist/roap/collection.js.map +1 -0
  218. package/dist/roap/handler.d.ts +47 -0
  219. package/dist/roap/handler.js +279 -0
  220. package/dist/roap/handler.js.map +1 -0
  221. package/dist/roap/index.d.ts +47 -9
  222. package/dist/roap/index.js +238 -100
  223. package/dist/roap/index.js.map +1 -1
  224. package/dist/roap/request.d.ts +12 -18
  225. package/dist/roap/request.js +180 -126
  226. package/dist/roap/request.js.map +1 -1
  227. package/dist/roap/state.d.ts +9 -0
  228. package/dist/roap/state.js +127 -0
  229. package/dist/roap/state.js.map +1 -0
  230. package/dist/roap/turnDiscovery.d.ts +16 -27
  231. package/dist/roap/turnDiscovery.js +105 -115
  232. package/dist/roap/turnDiscovery.js.map +1 -1
  233. package/dist/roap/util.d.ts +2 -0
  234. package/dist/roap/util.js +76 -0
  235. package/dist/roap/util.js.map +1 -0
  236. package/dist/statsAnalyzer/global.d.ts +83 -1
  237. package/dist/statsAnalyzer/global.js +85 -2
  238. package/dist/statsAnalyzer/global.js.map +1 -1
  239. package/dist/statsAnalyzer/index.d.ts +30 -50
  240. package/dist/statsAnalyzer/index.js +511 -436
  241. package/dist/statsAnalyzer/index.js.map +1 -1
  242. package/dist/statsAnalyzer/mqaUtil.d.ts +6 -8
  243. package/dist/statsAnalyzer/mqaUtil.js +90 -130
  244. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  245. package/dist/transcription/index.js +2 -1
  246. package/dist/transcription/index.js.map +1 -1
  247. package/package.json +26 -39
  248. package/src/common/errors/webex-errors.ts +12 -36
  249. package/src/common/logs/logger-proxy.ts +1 -1
  250. package/src/common/logs/request.ts +1 -5
  251. package/src/common/queue.ts +8 -22
  252. package/src/config.ts +7 -6
  253. package/src/constants.ts +100 -265
  254. package/src/controls-options-manager/enums.ts +0 -12
  255. package/src/controls-options-manager/index.ts +21 -116
  256. package/src/controls-options-manager/util.ts +14 -294
  257. package/src/index.js +15 -0
  258. package/src/locus-info/controlsUtils.ts +0 -110
  259. package/src/locus-info/index.ts +61 -450
  260. package/src/locus-info/infoUtils.ts +2 -14
  261. package/src/locus-info/mediaSharesUtils.ts +0 -64
  262. package/src/locus-info/parser.ts +47 -258
  263. package/src/locus-info/selfUtils.ts +2 -85
  264. package/src/media/index.ts +370 -153
  265. package/src/media/properties.ts +136 -106
  266. package/src/media/util.ts +21 -0
  267. package/src/mediaQualityMetrics/config.ts +377 -244
  268. package/src/meeting/effectsState.ts +209 -0
  269. package/src/meeting/in-meeting-actions.ts +0 -176
  270. package/src/meeting/index.ts +2581 -4306
  271. package/src/meeting/muteState.ts +138 -224
  272. package/src/meeting/request.ts +127 -214
  273. package/src/meeting/util.ts +423 -687
  274. package/src/meeting-info/index.ts +8 -81
  275. package/src/meeting-info/meeting-info-v2.ts +13 -163
  276. package/src/meeting-info/util.ts +1 -1
  277. package/src/meeting-info/utilv2.ts +28 -28
  278. package/src/meetings/collection.ts +0 -33
  279. package/src/meetings/index.ts +136 -531
  280. package/src/meetings/request.ts +0 -2
  281. package/src/meetings/util.ts +5 -116
  282. package/src/member/index.ts +1 -43
  283. package/src/member/util.ts +28 -125
  284. package/src/members/collection.ts +0 -8
  285. package/src/members/index.ts +52 -187
  286. package/src/members/request.ts +27 -87
  287. package/src/members/util.ts +291 -332
  288. package/src/metrics/config.ts +485 -0
  289. package/src/metrics/constants.ts +6 -15
  290. package/src/metrics/index.ts +471 -1
  291. package/src/networkQualityMonitor/index.ts +6 -6
  292. package/src/peer-connection-manager/index.ts +847 -0
  293. package/src/peer-connection-manager/util.ts +119 -0
  294. package/src/reachability/index.ts +347 -246
  295. package/src/reachability/request.ts +8 -17
  296. package/src/reactions/reactions.ts +4 -4
  297. package/src/reactions/reactions.type.ts +4 -30
  298. package/src/reconnection-manager/index.ts +156 -168
  299. package/src/recording-controller/index.ts +3 -20
  300. package/src/recording-controller/util.ts +9 -26
  301. package/src/roap/collection.ts +62 -0
  302. package/src/roap/handler.ts +294 -0
  303. package/src/roap/index.ts +241 -96
  304. package/src/roap/request.ts +148 -74
  305. package/src/roap/state.ts +156 -0
  306. package/src/roap/turnDiscovery.ts +56 -62
  307. package/src/roap/util.ts +100 -0
  308. package/src/statsAnalyzer/global.ts +84 -1
  309. package/src/statsAnalyzer/index.ts +645 -479
  310. package/src/statsAnalyzer/mqaUtil.ts +126 -128
  311. package/test/integration/spec/journey.js +264 -320
  312. package/test/integration/spec/space-meeting.js +4 -77
  313. package/test/unit/spec/common/queue.js +2 -31
  314. package/test/unit/spec/controls-options-manager/index.js +0 -163
  315. package/test/unit/spec/controls-options-manager/util.js +60 -576
  316. package/test/unit/spec/fixture/locus.js +0 -1
  317. package/test/unit/spec/locus-info/controlsUtils.js +30 -323
  318. package/test/unit/spec/locus-info/index.js +15 -1437
  319. package/test/unit/spec/locus-info/infoUtils.js +16 -54
  320. package/test/unit/spec/locus-info/lib/SeqCmp.json +0 -16
  321. package/test/unit/spec/locus-info/lib/selfConstant.js +0 -48
  322. package/test/unit/spec/locus-info/parser.js +35 -116
  323. package/test/unit/spec/locus-info/selfUtils.js +0 -275
  324. package/test/unit/spec/media/properties.ts +84 -75
  325. package/test/unit/spec/meeting/effectsState.js +281 -0
  326. package/test/unit/spec/meeting/in-meeting-actions.ts +0 -86
  327. package/test/unit/spec/meeting/index.js +2313 -8384
  328. package/test/unit/spec/meeting/muteState.js +213 -409
  329. package/test/unit/spec/meeting/request.js +43 -523
  330. package/test/unit/spec/meeting/utils.js +24 -834
  331. package/test/unit/spec/meeting-info/meetinginfov2.js +5 -527
  332. package/test/unit/spec/meeting-info/utilv2.js +0 -21
  333. package/test/unit/spec/meetings/collection.js +0 -26
  334. package/test/unit/spec/meetings/index.js +232 -1445
  335. package/test/unit/spec/meetings/utils.js +2 -202
  336. package/test/unit/spec/member/index.js +9 -32
  337. package/test/unit/spec/member/util.js +61 -499
  338. package/test/unit/spec/members/index.js +5 -394
  339. package/test/unit/spec/members/request.js +27 -206
  340. package/test/unit/spec/members/utils.js +38 -173
  341. package/test/unit/spec/metrics/index.js +50 -1
  342. package/test/unit/spec/networkQualityMonitor/index.js +4 -4
  343. package/test/unit/spec/peerconnection-manager/index.js +218 -0
  344. package/test/unit/spec/peerconnection-manager/utils.js +49 -0
  345. package/test/unit/spec/peerconnection-manager/utils.test-fixtures.ts +388 -0
  346. package/test/unit/spec/reachability/index.ts +24 -532
  347. package/test/unit/spec/reconnection-manager/index.js +24 -163
  348. package/test/unit/spec/recording-controller/index.js +218 -293
  349. package/test/unit/spec/recording-controller/util.js +96 -223
  350. package/test/unit/spec/roap/index.ts +77 -187
  351. package/test/unit/spec/roap/turnDiscovery.ts +48 -86
  352. package/test/unit/spec/roap/util.js +30 -0
  353. package/test/unit/spec/stats-analyzer/index.js +165 -644
  354. package/test/utils/testUtils.js +45 -0
  355. package/test/utils/webex-config.js +0 -4
  356. package/test/utils/webex-test-users.js +3 -7
  357. package/dist/annotation/annotation.types.d.ts +0 -42
  358. package/dist/annotation/annotation.types.js +0 -7
  359. package/dist/annotation/annotation.types.js.map +0 -1
  360. package/dist/annotation/constants.d.ts +0 -31
  361. package/dist/annotation/constants.js +0 -41
  362. package/dist/annotation/constants.js.map +0 -1
  363. package/dist/annotation/index.d.ts +0 -117
  364. package/dist/annotation/index.js +0 -357
  365. package/dist/annotation/index.js.map +0 -1
  366. package/dist/breakouts/breakout.d.ts +0 -8
  367. package/dist/breakouts/breakout.js +0 -215
  368. package/dist/breakouts/breakout.js.map +0 -1
  369. package/dist/breakouts/collection.d.ts +0 -5
  370. package/dist/breakouts/collection.js +0 -22
  371. package/dist/breakouts/collection.js.map +0 -1
  372. package/dist/breakouts/edit-lock-error.d.ts +0 -15
  373. package/dist/breakouts/edit-lock-error.js +0 -51
  374. package/dist/breakouts/edit-lock-error.js.map +0 -1
  375. package/dist/breakouts/events.d.ts +0 -8
  376. package/dist/breakouts/events.js +0 -44
  377. package/dist/breakouts/events.js.map +0 -1
  378. package/dist/breakouts/index.d.ts +0 -5
  379. package/dist/breakouts/index.js +0 -1047
  380. package/dist/breakouts/index.js.map +0 -1
  381. package/dist/breakouts/request.d.ts +0 -22
  382. package/dist/breakouts/request.js +0 -77
  383. package/dist/breakouts/request.js.map +0 -1
  384. package/dist/breakouts/utils.d.ts +0 -15
  385. package/dist/breakouts/utils.js +0 -64
  386. package/dist/breakouts/utils.js.map +0 -1
  387. package/dist/common/errors/no-meeting-info.d.ts +0 -14
  388. package/dist/common/errors/no-meeting-info.js +0 -50
  389. package/dist/common/errors/no-meeting-info.js.map +0 -1
  390. package/dist/common/errors/reclaim-host-role-errors.js.map +0 -1
  391. package/dist/controls-options-manager/types.d.ts +0 -43
  392. package/dist/controls-options-manager/types.js +0 -7
  393. package/dist/controls-options-manager/types.js.map +0 -1
  394. package/dist/interceptors/index.d.ts +0 -2
  395. package/dist/interceptors/index.js +0 -15
  396. package/dist/interceptors/index.js.map +0 -1
  397. package/dist/interceptors/locusRetry.d.ts +0 -27
  398. package/dist/interceptors/locusRetry.js +0 -94
  399. package/dist/interceptors/locusRetry.js.map +0 -1
  400. package/dist/interpretation/collection.d.ts +0 -5
  401. package/dist/interpretation/collection.js +0 -22
  402. package/dist/interpretation/collection.js.map +0 -1
  403. package/dist/interpretation/index.d.ts +0 -5
  404. package/dist/interpretation/index.js +0 -365
  405. package/dist/interpretation/index.js.map +0 -1
  406. package/dist/interpretation/siLanguage.d.ts +0 -5
  407. package/dist/interpretation/siLanguage.js +0 -24
  408. package/dist/interpretation/siLanguage.js.map +0 -1
  409. package/dist/meeting/locusMediaRequest.d.ts +0 -74
  410. package/dist/meeting/locusMediaRequest.js +0 -291
  411. package/dist/meeting/locusMediaRequest.js.map +0 -1
  412. package/dist/meeting/request.type.d.ts +0 -11
  413. package/dist/meeting/request.type.js +0 -7
  414. package/dist/meeting/request.type.js.map +0 -1
  415. package/dist/meeting/voicea-meeting.d.ts +0 -20
  416. package/dist/meeting/voicea-meeting.js +0 -201
  417. package/dist/meeting/voicea-meeting.js.map +0 -1
  418. package/dist/meetings/meetings.types.d.ts +0 -4
  419. package/dist/meetings/meetings.types.js +0 -7
  420. package/dist/meetings/meetings.types.js.map +0 -1
  421. package/dist/member/types.d.ts +0 -32
  422. package/dist/member/types.js +0 -23
  423. package/dist/member/types.js.map +0 -1
  424. package/dist/multistream/mediaRequestManager.d.ts +0 -118
  425. package/dist/multistream/mediaRequestManager.js +0 -344
  426. package/dist/multistream/mediaRequestManager.js.map +0 -1
  427. package/dist/multistream/receiveSlot.d.ts +0 -68
  428. package/dist/multistream/receiveSlot.js +0 -200
  429. package/dist/multistream/receiveSlot.js.map +0 -1
  430. package/dist/multistream/receiveSlotManager.d.ts +0 -56
  431. package/dist/multistream/receiveSlotManager.js +0 -174
  432. package/dist/multistream/receiveSlotManager.js.map +0 -1
  433. package/dist/multistream/remoteMedia.d.ts +0 -72
  434. package/dist/multistream/remoteMedia.js +0 -268
  435. package/dist/multistream/remoteMedia.js.map +0 -1
  436. package/dist/multistream/remoteMediaGroup.d.ts +0 -47
  437. package/dist/multistream/remoteMediaGroup.js +0 -267
  438. package/dist/multistream/remoteMediaGroup.js.map +0 -1
  439. package/dist/multistream/remoteMediaManager.d.ts +0 -285
  440. package/dist/multistream/remoteMediaManager.js +0 -1211
  441. package/dist/multistream/remoteMediaManager.js.map +0 -1
  442. package/dist/multistream/sendSlotManager.d.ts +0 -61
  443. package/dist/multistream/sendSlotManager.js +0 -236
  444. package/dist/multistream/sendSlotManager.js.map +0 -1
  445. package/dist/reachability/clusterReachability.d.ts +0 -109
  446. package/dist/reachability/clusterReachability.js +0 -357
  447. package/dist/reachability/clusterReachability.js.map +0 -1
  448. package/dist/reachability/util.d.ts +0 -8
  449. package/dist/reachability/util.js +0 -29
  450. package/dist/reachability/util.js.map +0 -1
  451. package/dist/reactions/constants.d.ts +0 -3
  452. package/dist/reactions/constants.js +0 -12
  453. package/dist/reactions/constants.js.map +0 -1
  454. package/dist/rtcMetrics/constants.d.ts +0 -4
  455. package/dist/rtcMetrics/constants.js +0 -11
  456. package/dist/rtcMetrics/constants.js.map +0 -1
  457. package/dist/rtcMetrics/index.d.ts +0 -54
  458. package/dist/rtcMetrics/index.js +0 -140
  459. package/dist/rtcMetrics/index.js.map +0 -1
  460. package/dist/webinar/collection.d.ts +0 -16
  461. package/dist/webinar/collection.js +0 -43
  462. package/dist/webinar/collection.js.map +0 -1
  463. package/dist/webinar/index.d.ts +0 -5
  464. package/dist/webinar/index.js +0 -68
  465. package/dist/webinar/index.js.map +0 -1
  466. package/src/annotation/annotation.types.ts +0 -50
  467. package/src/annotation/constants.ts +0 -36
  468. package/src/annotation/index.ts +0 -328
  469. package/src/breakouts/README.md +0 -220
  470. package/src/breakouts/breakout.ts +0 -188
  471. package/src/breakouts/collection.ts +0 -19
  472. package/src/breakouts/edit-lock-error.ts +0 -25
  473. package/src/breakouts/events.ts +0 -56
  474. package/src/breakouts/index.ts +0 -925
  475. package/src/breakouts/request.ts +0 -55
  476. package/src/breakouts/utils.ts +0 -57
  477. package/src/common/errors/no-meeting-info.ts +0 -24
  478. package/src/controls-options-manager/types.ts +0 -59
  479. package/src/index.ts +0 -44
  480. package/src/interceptors/index.ts +0 -3
  481. package/src/interceptors/locusRetry.ts +0 -67
  482. package/src/interpretation/README.md +0 -60
  483. package/src/interpretation/collection.ts +0 -19
  484. package/src/interpretation/index.ts +0 -332
  485. package/src/interpretation/siLanguage.ts +0 -18
  486. package/src/meeting/locusMediaRequest.ts +0 -313
  487. package/src/meeting/request.type.ts +0 -13
  488. package/src/meeting/voicea-meeting.ts +0 -161
  489. package/src/meetings/meetings.types.ts +0 -12
  490. package/src/member/types.ts +0 -38
  491. package/src/multistream/mediaRequestManager.ts +0 -440
  492. package/src/multistream/receiveSlot.ts +0 -184
  493. package/src/multistream/receiveSlotManager.ts +0 -166
  494. package/src/multistream/remoteMedia.ts +0 -254
  495. package/src/multistream/remoteMediaGroup.ts +0 -284
  496. package/src/multistream/remoteMediaManager.ts +0 -1145
  497. package/src/multistream/sendSlotManager.ts +0 -170
  498. package/src/reachability/clusterReachability.ts +0 -320
  499. package/src/reachability/util.ts +0 -24
  500. package/src/reactions/constants.ts +0 -4
  501. package/src/rtcMetrics/constants.ts +0 -3
  502. package/src/rtcMetrics/index.ts +0 -124
  503. package/src/webinar/collection.ts +0 -31
  504. package/src/webinar/index.ts +0 -62
  505. package/test/integration/spec/converged-space-meetings.js +0 -233
  506. package/test/unit/spec/annotation/index.ts +0 -418
  507. package/test/unit/spec/breakouts/breakout.ts +0 -237
  508. package/test/unit/spec/breakouts/collection.ts +0 -15
  509. package/test/unit/spec/breakouts/edit-lock-error.ts +0 -30
  510. package/test/unit/spec/breakouts/events.ts +0 -89
  511. package/test/unit/spec/breakouts/index.ts +0 -1790
  512. package/test/unit/spec/breakouts/request.ts +0 -104
  513. package/test/unit/spec/breakouts/utils.js +0 -72
  514. package/test/unit/spec/interceptors/locusRetry.ts +0 -131
  515. package/test/unit/spec/interpretation/collection.ts +0 -15
  516. package/test/unit/spec/interpretation/index.ts +0 -589
  517. package/test/unit/spec/interpretation/siLanguage.ts +0 -28
  518. package/test/unit/spec/locus-info/mediaSharesUtils.ts +0 -32
  519. package/test/unit/spec/media/index.ts +0 -290
  520. package/test/unit/spec/meeting/locusMediaRequest.ts +0 -442
  521. package/test/unit/spec/meeting-info/index.js +0 -300
  522. package/test/unit/spec/multistream/mediaRequestManager.ts +0 -1418
  523. package/test/unit/spec/multistream/receiveSlot.ts +0 -163
  524. package/test/unit/spec/multistream/receiveSlotManager.ts +0 -203
  525. package/test/unit/spec/multistream/remoteMedia.ts +0 -255
  526. package/test/unit/spec/multistream/remoteMediaGroup.ts +0 -662
  527. package/test/unit/spec/multistream/remoteMediaManager.ts +0 -1924
  528. package/test/unit/spec/multistream/sendSlotManager.ts +0 -242
  529. package/test/unit/spec/reachability/clusterReachability.ts +0 -279
  530. package/test/unit/spec/reachability/request.js +0 -68
  531. package/test/unit/spec/reachability/util.ts +0 -40
  532. package/test/unit/spec/roap/request.ts +0 -255
  533. package/test/unit/spec/rtcMetrics/index.ts +0 -93
  534. package/test/unit/spec/webinar/collection.ts +0 -13
  535. package/test/unit/spec/webinar/index.ts +0 -60
  536. package/test/utils/constants.js +0 -9
  537. package/test/utils/integrationTestUtils.js +0 -46
  538. /package/dist/common/errors/{reclaim-host-role-errors.d.ts → reclaim-host-role-error.d.ts} +0 -0
  539. /package/src/common/errors/{reclaim-host-role-errors.ts → reclaim-host-role-error.ts} +0 -0
@@ -9,35 +9,26 @@ exports.default = void 0;
9
9
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
10
10
  var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
11
11
  var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
12
- var _entries = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/entries"));
12
+ var _now = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/date/now"));
13
13
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
14
14
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
15
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/slicedToArray"));
15
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
16
16
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
17
17
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
18
18
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
19
19
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
20
- var _lodash = require("lodash");
20
+ var _uniq2 = _interopRequireDefault(require("lodash/uniq"));
21
21
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
22
- var _util = _interopRequireDefault(require("../meeting/util"));
23
22
  var _constants = require("../constants");
24
23
  var _request = _interopRequireDefault(require("./request"));
25
- var _clusterReachability = require("./clusterReachability");
26
- /*!
27
- * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
28
- */
29
- /* eslint-disable class-methods-use-this */
30
- /**
31
- * This is the type that matches what backend expects us to send to them. It is a bit weird, because
32
- * it uses strings instead of booleans and numbers, but that's what they require.
33
- */
34
- // this is the type that is required by the backend when we send them reachability results
35
- // this is the type used by Reachability class internally and stored in local storage
24
+ var DEFAULT_TIMEOUT = 3000;
25
+ var VIDEO_MESH_TIMEOUT = 1000;
26
+
36
27
  /**
37
28
  * @class Reachability
38
29
  * @export
39
30
  */
40
- var Reachability = exports.default = /*#__PURE__*/function () {
31
+ var Reachability = /*#__PURE__*/function () {
41
32
  /**
42
33
  * Creates an instance of Reachability.
43
34
  * @param {object} webex
@@ -45,10 +36,9 @@ var Reachability = exports.default = /*#__PURE__*/function () {
45
36
  */
46
37
  function Reachability(webex) {
47
38
  (0, _classCallCheck2.default)(this, Reachability);
48
- (0, _defineProperty2.default)(this, "namespace", _constants.REACHABILITY.namespace);
49
39
  (0, _defineProperty2.default)(this, "webex", void 0);
50
40
  (0, _defineProperty2.default)(this, "reachabilityRequest", void 0);
51
- (0, _defineProperty2.default)(this, "clusterReachability", void 0);
41
+ (0, _defineProperty2.default)(this, "clusterLatencyResults", void 0);
52
42
  this.webex = webex;
53
43
 
54
44
  /**
@@ -59,58 +49,69 @@ var Reachability = exports.default = /*#__PURE__*/function () {
59
49
  * @memberof Reachability
60
50
  */
61
51
  this.reachabilityRequest = new _request.default(this.webex);
62
- this.clusterReachability = {};
52
+
53
+ /**
54
+ * internal object of clusters latency results
55
+ * @instance
56
+ * @type {object}
57
+ * @private
58
+ * @memberof Reachability
59
+ */
60
+ this.clusterLatencyResults = {};
63
61
  }
64
62
 
65
63
  /**
66
- * Gets a list of media clusters from the backend and performs reachability checks on all the clusters
67
- * @returns {Promise<ReachabilityResults>} reachability results
64
+ * fetches reachability data
65
+ * @returns {Object} reachability data
68
66
  * @public
67
+ * @async
69
68
  * @memberof Reachability
70
69
  */
71
70
  (0, _createClass2.default)(Reachability, [{
72
71
  key: "gatherReachability",
73
- value: (function () {
72
+ value: function () {
74
73
  var _gatherReachability = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
75
- var _yield$this$reachabil, clusters, joinCookie, results;
74
+ var _window, _window$localStorage;
75
+ var clusters, results;
76
76
  return _regenerator.default.wrap(function _callee$(_context) {
77
77
  while (1) switch (_context.prev = _context.next) {
78
78
  case 0:
79
- _context.next = 2;
80
- return this.webex.boundedStorage.del(this.namespace, _constants.REACHABILITY.localStorageResult);
81
- case 2:
82
- _context.next = 4;
83
- return this.webex.boundedStorage.del(this.namespace, _constants.REACHABILITY.localStorageJoinCookie);
84
- case 4:
85
- _context.prev = 4;
79
+ this.setup();
80
+
81
+ // Remove stored reachability results to ensure no stale data
82
+ if (!((_window = window) !== null && _window !== void 0 && (_window$localStorage = _window.localStorage) !== null && _window$localStorage !== void 0 && _window$localStorage.removeItem)) {
83
+ _context.next = 5;
84
+ break;
85
+ }
86
+ window.localStorage.removeItem(_constants.REACHABILITY.localStorage);
86
87
  _context.next = 7;
87
- return this.reachabilityRequest.getClusters(_util.default.getIpVersion(this.webex));
88
+ break;
89
+ case 5:
90
+ _loggerProxy.default.logger.error('Reachability:index#gatherReachability --> Error in accessing LocalStorage.');
91
+ return _context.abrupt("return", {});
88
92
  case 7:
89
- _yield$this$reachabil = _context.sent;
90
- clusters = _yield$this$reachabil.clusters;
91
- joinCookie = _yield$this$reachabil.joinCookie;
92
- _context.next = 12;
93
- return this.performReachabilityChecks(clusters);
94
- case 12:
93
+ _context.prev = 7;
94
+ _context.next = 10;
95
+ return this.reachabilityRequest.getClusters();
96
+ case 10:
97
+ clusters = _context.sent;
98
+ _context.next = 13;
99
+ return this.performReachabilityCheck(clusters);
100
+ case 13:
95
101
  results = _context.sent;
96
- _context.next = 15;
97
- return this.webex.boundedStorage.put(this.namespace, _constants.REACHABILITY.localStorageResult, (0, _stringify.default)(results));
98
- case 15:
99
- _context.next = 17;
100
- return this.webex.boundedStorage.put(this.namespace, _constants.REACHABILITY.localStorageJoinCookie, (0, _stringify.default)(joinCookie));
101
- case 17:
102
+ window.localStorage.setItem(_constants.REACHABILITY.localStorage, (0, _stringify.default)(results));
102
103
  _loggerProxy.default.logger.log('Reachability:index#gatherReachability --> Reachability checks completed');
103
104
  return _context.abrupt("return", results);
104
- case 21:
105
- _context.prev = 21;
106
- _context.t0 = _context["catch"](4);
107
- _loggerProxy.default.logger.error("Reachability:index#gatherReachability --> Error:", _context.t0);
105
+ case 19:
106
+ _context.prev = 19;
107
+ _context.t0 = _context["catch"](7);
108
+ _loggerProxy.default.logger.error("Reachability:index#gatherReachability --> Error in calling getClusters(): ".concat(_context.t0));
108
109
  return _context.abrupt("return", {});
109
- case 25:
110
+ case 23:
110
111
  case "end":
111
112
  return _context.stop();
112
113
  }
113
- }, _callee, this, [[4, 21]]);
114
+ }, _callee, this, [[7, 19]]);
114
115
  }));
115
116
  function gatherReachability() {
116
117
  return _gatherReachability.apply(this, arguments);
@@ -118,235 +119,271 @@ var Reachability = exports.default = /*#__PURE__*/function () {
118
119
  return gatherReachability;
119
120
  }()
120
121
  /**
121
- * Returns statistics about last reachability results. The returned value is an object
122
- * with a flat list of properties so that it can be easily sent with metrics
123
- *
124
- * @returns {Promise} Promise with metrics values, it never rejects/throws.
122
+ * fetches reachability data and checks for cluster reachability
123
+ * @returns {boolean}
124
+ * @public
125
+ * @memberof Reachability
125
126
  */
126
- )
127
127
  }, {
128
- key: "getReachabilityMetrics",
129
- value: (function () {
130
- var _getReachabilityMetrics = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
131
- var stats, updateStats, resultsJson, results;
132
- return _regenerator.default.wrap(function _callee2$(_context2) {
133
- while (1) switch (_context2.prev = _context2.next) {
134
- case 0:
135
- stats = {
136
- reachability_public_udp_success: 0,
137
- reachability_public_udp_failed: 0,
138
- reachability_public_tcp_success: 0,
139
- reachability_public_tcp_failed: 0,
140
- reachability_vmn_udp_success: 0,
141
- reachability_vmn_udp_failed: 0,
142
- reachability_vmn_tcp_success: 0,
143
- reachability_vmn_tcp_failed: 0
144
- };
145
- updateStats = function updateStats(clusterType, result) {
146
- if (result.udp && result.udp.result !== 'untested') {
147
- var outcome = result.udp.result === 'reachable' ? 'success' : 'failed';
148
- stats["reachability_".concat(clusterType, "_udp_").concat(outcome)] += 1;
149
- }
150
- if (result.tcp && result.tcp.result !== 'untested') {
151
- var _outcome = result.tcp.result === 'reachable' ? 'success' : 'failed';
152
- stats["reachability_".concat(clusterType, "_tcp_").concat(_outcome)] += 1;
153
- }
154
- };
155
- _context2.prev = 2;
156
- _context2.next = 5;
157
- return this.webex.boundedStorage.get(_constants.REACHABILITY.namespace, _constants.REACHABILITY.localStorageResult);
158
- case 5:
159
- resultsJson = _context2.sent;
160
- results = JSON.parse(resultsJson);
161
- (0, _values.default)(results).forEach(function (result) {
162
- updateStats(result.isVideoMesh ? 'vmn' : 'public', result);
163
- });
164
- _context2.next = 13;
165
- break;
166
- case 10:
167
- _context2.prev = 10;
168
- _context2.t0 = _context2["catch"](2);
169
- // empty storage, that's ok
170
- _loggerProxy.default.logger.warn('Roap:request#getReachabilityMetrics --> Error parsing reachability data: ', _context2.t0);
171
- case 13:
172
- return _context2.abrupt("return", stats);
173
- case 14:
174
- case "end":
175
- return _context2.stop();
176
- }
177
- }, _callee2, this, [[2, 10]]);
178
- }));
179
- function getReachabilityMetrics() {
180
- return _getReachabilityMetrics.apply(this, arguments);
128
+ key: "isAnyClusterReachable",
129
+ value: function isAnyClusterReachable() {
130
+ var reachable = false;
131
+ var reachabilityData = window.localStorage.getItem(_constants.REACHABILITY.localStorage);
132
+ if (reachabilityData) {
133
+ try {
134
+ var reachabilityResults = JSON.parse(reachabilityData);
135
+ reachable = (0, _values.default)(reachabilityResults).some(function (result) {
136
+ var _result$udp, _result$tcp;
137
+ return ((_result$udp = result.udp) === null || _result$udp === void 0 ? void 0 : _result$udp.reachable) === 'true' || ((_result$tcp = result.tcp) === null || _result$tcp === void 0 ? void 0 : _result$tcp.reachable) === 'true';
138
+ });
139
+ } catch (e) {
140
+ _loggerProxy.default.logger.error("Roap:request#attachReachabilityData --> Error in parsing reachability data: ".concat(e));
141
+ }
181
142
  }
182
- return getReachabilityMetrics;
183
- }()
143
+ return reachable;
144
+ }
145
+
184
146
  /**
185
- * Maps our internal transport result to the format that backend expects
186
- * @param {TransportResult} transportResult
187
- * @returns {TransportResultForBackend}
147
+ * Generate peerConnection config settings
148
+ * @param {object} cluster
149
+ * @returns {object} peerConnectionConfig
150
+ * @private
151
+ * @memberof Reachability
188
152
  */
189
- )
190
153
  }, {
191
- key: "mapTransportResultToBackendDataFormat",
192
- value: function mapTransportResultToBackendDataFormat(transportResult) {
193
- var output = {};
194
- for (var _i = 0, _Object$entries = (0, _entries.default)(transportResult); _i < _Object$entries.length; _i++) {
195
- var _Object$entries$_i = (0, _slicedToArray2.default)(_Object$entries[_i], 2),
196
- _key = _Object$entries$_i[0],
197
- value = _Object$entries$_i[1];
198
- switch (_key) {
199
- case 'result':
200
- switch (value) {
201
- case 'reachable':
202
- output.reachable = 'true';
203
- break;
204
- case 'unreachable':
205
- output.reachable = 'false';
206
- break;
207
- case 'untested':
208
- output.untested = 'true';
209
- break;
210
- }
211
- break;
212
- case 'latencyInMilliseconds':
213
- output.latencyInMilliseconds = value.toString();
214
- break;
215
- default:
216
- output[_key] = value;
217
- }
218
- }
219
- return output;
154
+ key: "buildPeerConnectionConfig",
155
+ value: function buildPeerConnectionConfig(cluster) {
156
+ var iceServers = (0, _uniq2.default)([].concat((0, _toConsumableArray2.default)(cluster.udp), (0, _toConsumableArray2.default)(cluster.tcp))).map(function (url) {
157
+ return {
158
+ username: '',
159
+ credential: '',
160
+ urls: [url]
161
+ };
162
+ });
163
+ return {
164
+ iceServers: (0, _toConsumableArray2.default)(iceServers),
165
+ iceCandidatePoolSize: '0',
166
+ iceTransportPolicy: 'all'
167
+ };
220
168
  }
221
169
 
222
170
  /**
223
- * Reachability results as an object in the format that backend expects
224
- *
225
- * @returns {any} reachability results that need to be sent to the backend
171
+ * Creates an RTCPeerConnection
172
+ * @param {object} cluster
173
+ * @returns {RTCPeerConnection} peerConnection
174
+ * @private
175
+ * @memberof Reachability
226
176
  */
227
177
  }, {
228
- key: "getReachabilityResults",
229
- value: (function () {
230
- var _getReachabilityResults = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
231
- var _this = this;
232
- var results, resultsJson, allClusterResults;
233
- return _regenerator.default.wrap(function _callee3$(_context3) {
234
- while (1) switch (_context3.prev = _context3.next) {
235
- case 0:
236
- _context3.prev = 0;
237
- _context3.next = 3;
238
- return this.webex.boundedStorage.get(_constants.REACHABILITY.namespace, _constants.REACHABILITY.localStorageResult);
239
- case 3:
240
- resultsJson = _context3.sent;
241
- allClusterResults = JSON.parse(resultsJson);
242
- results = (0, _lodash.mapValues)(allClusterResults, function (clusterResult) {
243
- return {
244
- udp: _this.mapTransportResultToBackendDataFormat(clusterResult.udp || {
245
- result: 'untested'
246
- }),
247
- tcp: _this.mapTransportResultToBackendDataFormat(clusterResult.tcp || {
248
- result: 'untested'
249
- }),
250
- xtls: _this.mapTransportResultToBackendDataFormat(clusterResult.xtls || {
251
- result: 'untested'
252
- })
253
- };
254
- });
255
- _context3.next = 11;
256
- break;
257
- case 8:
258
- _context3.prev = 8;
259
- _context3.t0 = _context3["catch"](0);
260
- // empty storage, that's ok
261
- _loggerProxy.default.logger.warn('Roap:request#attachReachabilityData --> Error parsing reachability data: ', _context3.t0);
262
- case 11:
263
- return _context3.abrupt("return", results);
264
- case 12:
265
- case "end":
266
- return _context3.stop();
267
- }
268
- }, _callee3, this, [[0, 8]]);
269
- }));
270
- function getReachabilityResults() {
271
- return _getReachabilityResults.apply(this, arguments);
178
+ key: "createPeerConnection",
179
+ value: function createPeerConnection(cluster) {
180
+ var key = cluster.key,
181
+ config = cluster.config;
182
+ try {
183
+ var peerConnection = new window.RTCPeerConnection(config);
184
+
185
+ // @ts-ignore
186
+ peerConnection.key = key;
187
+ return peerConnection;
188
+ } catch (peerConnectionError) {
189
+ _loggerProxy.default.logger.log("Reachability:index#createPeerConnection --> Error creating peerConnection: ".concat(peerConnectionError));
190
+ return null;
272
191
  }
273
- return getReachabilityResults;
274
- }()
192
+ }
193
+
275
194
  /**
276
- * fetches reachability data and checks for cluster reachability
277
- * @returns {boolean}
278
- * @public
195
+ * Gets total elapsed time
196
+ * @param {RTCPeerConnection} peerConnection
197
+ * @returns {Number} Milliseconds
198
+ * @private
279
199
  * @memberof Reachability
280
200
  */
281
- )
282
201
  }, {
283
- key: "isAnyPublicClusterReachable",
284
- value: (function () {
285
- var _isAnyPublicClusterReachable = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
286
- var reachable, reachabilityData, reachabilityResults;
287
- return _regenerator.default.wrap(function _callee4$(_context4) {
288
- while (1) switch (_context4.prev = _context4.next) {
289
- case 0:
290
- reachable = false; // @ts-ignore
291
- _context4.next = 3;
292
- return this.webex.boundedStorage.get(this.namespace, _constants.REACHABILITY.localStorageResult).catch(function () {});
293
- case 3:
294
- reachabilityData = _context4.sent;
295
- if (reachabilityData) {
296
- try {
297
- reachabilityResults = JSON.parse(reachabilityData);
298
- reachable = (0, _values.default)(reachabilityResults).some(function (result) {
299
- var _result$udp, _result$tcp;
300
- return !result.isVideoMesh && (((_result$udp = result.udp) === null || _result$udp === void 0 ? void 0 : _result$udp.result) === 'reachable' || ((_result$tcp = result.tcp) === null || _result$tcp === void 0 ? void 0 : _result$tcp.result) === 'reachable');
301
- });
302
- } catch (e) {
303
- _loggerProxy.default.logger.error("Roap:request#attachReachabilityData --> Error in parsing reachability data: ".concat(e));
304
- }
305
- }
306
- return _context4.abrupt("return", reachable);
307
- case 6:
308
- case "end":
309
- return _context4.stop();
310
- }
311
- }, _callee4, this);
312
- }));
313
- function isAnyPublicClusterReachable() {
314
- return _isAnyPublicClusterReachable.apply(this, arguments);
315
- }
316
- return isAnyPublicClusterReachable;
317
- }()
202
+ key: "getElapsedTime",
203
+ value: function getElapsedTime(peerConnection) {
204
+ var startTime = peerConnection.begin;
205
+ delete peerConnection.begin;
206
+ return (0, _now.default)() - startTime;
207
+ }
208
+
209
+ /**
210
+ * creates offer and generates localSDP
211
+ * @param {object} clusterList cluster List
212
+ * @returns {Promise} Reachability latency results
213
+ * @private
214
+ * @memberof Reachability
215
+ */
216
+ }, {
217
+ key: "getLocalSDPForClusters",
218
+ value: function getLocalSDPForClusters(clusterList) {
219
+ var _this = this;
220
+ var clusters = (0, _toConsumableArray2.default)((0, _keys.default)(clusterList));
221
+ clusters = clusters.map( /*#__PURE__*/function () {
222
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(key) {
223
+ var cluster, config, peerConnection, description;
224
+ return _regenerator.default.wrap(function _callee2$(_context2) {
225
+ while (1) switch (_context2.prev = _context2.next) {
226
+ case 0:
227
+ cluster = clusterList[key];
228
+ config = _this.buildPeerConnectionConfig(cluster);
229
+ peerConnection = _this.createPeerConnection({
230
+ key: key,
231
+ config: config
232
+ });
233
+ _context2.next = 5;
234
+ return peerConnection.createOffer({
235
+ offerToReceiveAudio: true
236
+ });
237
+ case 5:
238
+ description = _context2.sent;
239
+ // @ts-ignore
240
+ peerConnection.begin = (0, _now.default)();
241
+ peerConnection.setLocalDescription(description);
242
+ return _context2.abrupt("return", _this.iceGatheringState(peerConnection, cluster.isVideoMesh ? VIDEO_MESH_TIMEOUT : DEFAULT_TIMEOUT).catch(function (iceGatheringStateError) {
243
+ _loggerProxy.default.logger.log("Reachability:index#getLocalSDPForClusters --> Error in getLocalSDP : ".concat(iceGatheringStateError));
244
+ }));
245
+ case 9:
246
+ case "end":
247
+ return _context2.stop();
248
+ }
249
+ }, _callee2);
250
+ }));
251
+ return function (_x) {
252
+ return _ref.apply(this, arguments);
253
+ };
254
+ }());
255
+ return _promise.default.all(clusters).then(this.parseIceResultsToReachabilityResults).then(function (reachabilityLatencyResults) {
256
+ _this.logUnreachableClusters();
257
+
258
+ // return results
259
+ return reachabilityLatencyResults;
260
+ });
261
+ }
262
+
318
263
  /**
319
264
  * Get list of all unreachable clusters
320
265
  * @returns {array} Unreachable clusters
321
266
  * @private
322
267
  * @memberof Reachability
323
268
  */
324
- )
325
269
  }, {
326
- key: "getUnreachableClusters",
327
- value: function getUnreachableClusters() {
270
+ key: "getUnreachablClusters",
271
+ value: function getUnreachablClusters() {
328
272
  var unreachableList = [];
329
- (0, _entries.default)(this.clusterReachability).forEach(function (_ref) {
330
- var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
331
- key = _ref2[0],
332
- clusterReachability = _ref2[1];
333
- var result = clusterReachability.getResult();
334
- if (result.udp.result === 'unreachable') {
335
- unreachableList.push({
336
- name: key,
337
- protocol: 'udp'
338
- });
339
- }
340
- if (result.tcp.result === 'unreachable') {
341
- unreachableList.push({
342
- name: key,
343
- protocol: 'tcp'
344
- });
273
+ var clusters = this.clusterLatencyResults;
274
+ (0, _keys.default)(clusters).forEach(function (key) {
275
+ var cluster = clusters[key];
276
+ if (cluster.unreachable && !cluster.reachable) {
277
+ unreachableList.push(key);
345
278
  }
346
279
  });
347
280
  return unreachableList;
348
281
  }
349
282
 
283
+ /**
284
+ * Attach an event handler for the icegatheringstatechange
285
+ * event and measure latency.
286
+ * @param {RTCPeerConnection} peerConnection
287
+ * @returns {undefined}
288
+ * @private
289
+ * @memberof Reachability
290
+ */
291
+ }, {
292
+ key: "handleIceGatheringStateChange",
293
+ value: function handleIceGatheringStateChange(peerConnection) {
294
+ var _this2 = this;
295
+ peerConnection.onicegatheringstatechange = function () {
296
+ var COMPLETE = _constants.ICE_GATHERING_STATE.COMPLETE;
297
+ if (peerConnection.iceConnectionState === COMPLETE) {
298
+ var elapsed = _this2.getElapsedTime(peerConnection);
299
+
300
+ // @ts-ignore
301
+ _loggerProxy.default.logger.log( // @ts-ignore
302
+ "Reachability:index#onIceGatheringStateChange --> Successfully pinged ".concat(peerConnection.key, ":"), elapsed);
303
+ _this2.setLatencyAndClose(peerConnection, elapsed);
304
+ }
305
+ };
306
+ }
307
+
308
+ /**
309
+ * Attach an event handler for the icecandidate
310
+ * event and measure latency.
311
+ * @param {RTCPeerConnection} peerConnection
312
+ * @returns {undefined}
313
+ * @private
314
+ * @memberof Reachability
315
+ */
316
+ }, {
317
+ key: "handleOnIceCandidate",
318
+ value: function handleOnIceCandidate(peerConnection) {
319
+ var _this3 = this;
320
+ peerConnection.onicecandidate = function (e) {
321
+ var SERVER_REFLEXIVE = 'srflx';
322
+ if (e.candidate && String(e.candidate.type).toLowerCase() === SERVER_REFLEXIVE) {
323
+ var elapsed = _this3.getElapsedTime(peerConnection);
324
+ _loggerProxy.default.logger.log( // @ts-ignore
325
+ "Reachability:index#onIceCandidate --> Successfully pinged ".concat(peerConnection.key, ":"), elapsed);
326
+ _this3.setLatencyAndClose(peerConnection, elapsed);
327
+ }
328
+ };
329
+ }
330
+
331
+ /**
332
+ * An event handler on an RTCPeerConnection when the state of the ICE
333
+ * candidate gathering process changes. Used to measure connection
334
+ * speed.
335
+ * @private
336
+ * @param {RTCPeerConnection} peerConnection
337
+ * @param {number} timeout
338
+ * @returns {Promise}
339
+ */
340
+ }, {
341
+ key: "iceGatheringState",
342
+ value: function iceGatheringState(peerConnection, timeout) {
343
+ var _this4 = this;
344
+ var ELAPSED = 'elapsed';
345
+ return new _promise.default(function (resolve) {
346
+ var peerConnectionProxy = new window.Proxy(peerConnection, {
347
+ get: function get(target, property) {
348
+ var targetMember = target[property];
349
+ if (typeof targetMember === 'function') {
350
+ return targetMember.bind(target);
351
+ }
352
+ return targetMember;
353
+ },
354
+ set: function set(target, property, value) {
355
+ // only intercept elapsed property
356
+ if (property === ELAPSED) {
357
+ // @ts-ignore
358
+ resolve({
359
+ clusterId: peerConnection.key,
360
+ elapsed: value
361
+ });
362
+ return true;
363
+ }
364
+
365
+ // pass thru
366
+ return window.Reflect.set(target, property, value);
367
+ }
368
+ });
369
+
370
+ // Using peerConnection proxy so handle functions below
371
+ // won't be coupled to our promise implementation
372
+ _this4.handleIceGatheringStateChange(peerConnectionProxy);
373
+ _this4.handleOnIceCandidate(peerConnectionProxy);
374
+
375
+ // Set maximum timeout
376
+ window.setTimeout(function () {
377
+ var CLOSED = _constants.CONNECTION_STATE.CLOSED;
378
+
379
+ // Close any open peerConnections
380
+ if (peerConnectionProxy.connectionState !== CLOSED) {
381
+ _this4.setLatencyAndClose(peerConnectionProxy, null);
382
+ }
383
+ }, timeout);
384
+ });
385
+ }
386
+
350
387
  /**
351
388
  * Make a log of unreachable clusters.
352
389
  * @returns {undefined}
@@ -356,71 +393,122 @@ var Reachability = exports.default = /*#__PURE__*/function () {
356
393
  }, {
357
394
  key: "logUnreachableClusters",
358
395
  value: function logUnreachableClusters() {
359
- var list = this.getUnreachableClusters();
360
- list.forEach(function (_ref3) {
361
- var name = _ref3.name,
362
- protocol = _ref3.protocol;
363
- _loggerProxy.default.logger.log("Reachability:index#logUnreachableClusters --> failed to reach ".concat(name, " over ").concat(protocol));
396
+ var list = this.getUnreachablClusters();
397
+ list.forEach(function (cluster) {
398
+ _loggerProxy.default.logger.log("Reachability:index#logUnreachableClusters --> No ice candidate for ".concat(cluster, "."));
364
399
  });
365
400
  }
366
401
 
367
402
  /**
368
- * Performs reachability checks for all clusters
369
- * @param {ClusterList} clusterList
370
- * @returns {Promise<ReachabilityResults>} reachability check results
403
+ * Calculates time to establish connection
404
+ * @param {array} iceResults iceResults
405
+ * @returns {object} reachabilityMap
406
+ * @private
407
+ * @memberof Reachability
371
408
  */
372
409
  }, {
373
- key: "performReachabilityChecks",
374
- value: (function () {
375
- var _performReachabilityChecks = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(clusterList) {
376
- var _this2 = this;
377
- var results, clusterReachabilityChecks;
378
- return _regenerator.default.wrap(function _callee5$(_context5) {
379
- while (1) switch (_context5.prev = _context5.next) {
380
- case 0:
381
- results = {};
382
- if (!(!clusterList || !(0, _keys.default)(clusterList).length)) {
383
- _context5.next = 3;
384
- break;
385
- }
386
- return _context5.abrupt("return", _promise.default.resolve(results));
387
- case 3:
388
- _loggerProxy.default.logger.log("Reachability:index#performReachabilityChecks --> doing UDP".concat(
389
- // @ts-ignore
390
- this.webex.config.meetings.experimental.enableTcpReachability ? ' and TCP' : '', " reachability checks"));
391
- clusterReachabilityChecks = (0, _keys.default)(clusterList).map(function (key) {
392
- var cluster = clusterList[key];
410
+ key: "parseIceResultsToReachabilityResults",
411
+ value: function parseIceResultsToReachabilityResults(iceResults) {
412
+ var reachabilityMap = {};
413
+ iceResults.forEach(function (_ref2) {
414
+ var clusterId = _ref2.clusterId,
415
+ elapsed = _ref2.elapsed;
416
+ var latencyResult;
417
+ if (elapsed === null) {
418
+ latencyResult = {
419
+ reachable: 'false'
420
+ };
421
+ } else {
422
+ latencyResult = {
423
+ reachable: 'true',
424
+ latencyInMilliseconds: elapsed.toString()
425
+ };
426
+ }
427
+ reachabilityMap[clusterId] = {
428
+ udp: latencyResult,
429
+ tcp: latencyResult
430
+ };
431
+ });
432
+ return reachabilityMap;
433
+ }
393
434
 
394
- // Linus doesn't support TCP reachability checks on video mesh nodes
395
- var includeTcpReachability =
396
- // @ts-ignore
397
- _this2.webex.config.meetings.experimental.enableTcpReachability && !cluster.isVideoMesh;
398
- if (!includeTcpReachability) {
399
- cluster.tcp = [];
400
- }
401
- _this2.clusterReachability[key] = new _clusterReachability.ClusterReachability(key, cluster);
402
- return _this2.clusterReachability[key].start().then(function (result) {
403
- results[key] = result;
404
- results[key].isVideoMesh = cluster.isVideoMesh;
405
- });
406
- });
407
- _context5.next = 7;
408
- return _promise.default.all(clusterReachabilityChecks);
409
- case 7:
410
- this.logUnreachableClusters();
411
- return _context5.abrupt("return", results);
412
- case 9:
413
- case "end":
414
- return _context5.stop();
435
+ /**
436
+ * fetches reachability data
437
+ * @param {object} clusterList
438
+ * @returns {Promise<localSDPData>} reachability check results
439
+ * @private
440
+ * @memberof Reachability
441
+ */
442
+ }, {
443
+ key: "performReachabilityCheck",
444
+ value: function performReachabilityCheck(clusterList) {
445
+ var _this5 = this;
446
+ if (!clusterList || !(0, _keys.default)(clusterList).length) {
447
+ return _promise.default.resolve({});
448
+ }
449
+ return new _promise.default(function (resolve) {
450
+ _this5.getLocalSDPForClusters(clusterList).then(function (localSDPData) {
451
+ if (!localSDPData || !(0, _keys.default)(localSDPData).length) {
452
+ // TODO: handle the error condition properly and try retry
453
+ _loggerProxy.default.logger.log('Reachability:index#performReachabilityCheck --> Local SDP is empty or has missing elements..returning');
454
+ resolve({});
455
+ } else {
456
+ resolve(localSDPData);
415
457
  }
416
- }, _callee5, this);
417
- }));
418
- function performReachabilityChecks(_x) {
419
- return _performReachabilityChecks.apply(this, arguments);
458
+ }).catch(function (error) {
459
+ _loggerProxy.default.logger.error("Reachability:index#performReachabilityCheck --> Error in getLocalSDPForClusters: ".concat(error));
460
+ resolve({});
461
+ });
462
+ });
463
+ }
464
+
465
+ /**
466
+ * Records latency and closes the peerConnection
467
+ * @param {RTCPeerConnection} peerConnection
468
+ * @param {number} elapsed Latency in milliseconds
469
+ * @returns {undefined}
470
+ * @private
471
+ * @memberof Reachability
472
+ */
473
+ }, {
474
+ key: "setLatencyAndClose",
475
+ value: function setLatencyAndClose(peerConnection, elapsed) {
476
+ var _intialState;
477
+ var REACHABLE = 'reachable';
478
+ var UNREACHABLE = 'unreachable';
479
+ var CLOSED = _constants.CONNECTION_STATE.CLOSED;
480
+ // @ts-ignore
481
+ var key = peerConnection.key;
482
+ var resultKey = elapsed === null ? UNREACHABLE : REACHABLE;
483
+ var intialState = (_intialState = {}, (0, _defineProperty2.default)(_intialState, REACHABLE, 0), (0, _defineProperty2.default)(_intialState, UNREACHABLE, 0), _intialState);
484
+ if (peerConnection.connectionState === CLOSED) {
485
+ _loggerProxy.default.logger.log("Reachability:index#setLatencyAndClose --> Attempting to set latency of ".concat(elapsed, " on closed peerConnection."));
486
+ return;
420
487
  }
421
- return performReachabilityChecks;
422
- }())
488
+ this.clusterLatencyResults[key] = this.clusterLatencyResults[key] || intialState;
489
+ this.clusterLatencyResults[key][resultKey] += 1;
490
+
491
+ // Set to null in case this fired from
492
+ // an event other than onIceCandidate
493
+ peerConnection.onicecandidate = null;
494
+ peerConnection.close();
495
+ // @ts-ignore
496
+ peerConnection.elapsed = elapsed;
497
+ }
498
+
499
+ /**
500
+ * utility function
501
+ * @returns {undefined}
502
+ * @private
503
+ * @memberof Reachability
504
+ */
505
+ }, {
506
+ key: "setup",
507
+ value: function setup() {
508
+ this.clusterLatencyResults = {};
509
+ }
423
510
  }]);
424
511
  return Reachability;
425
512
  }();
513
+ exports.default = Reachability;
426
514
  //# sourceMappingURL=index.js.map