@webex/plugin-meetings 3.0.0-stream-classes.5 → 3.0.0

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