@webex/plugin-meetings 3.8.0 → 3.8.1-next.10

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 (361) hide show
  1. package/README.md +26 -13
  2. package/dist/breakouts/breakout.js +1 -1
  3. package/dist/breakouts/index.js +70 -6
  4. package/dist/breakouts/index.js.map +1 -1
  5. package/dist/common/errors/webex-errors.js +12 -2
  6. package/dist/common/errors/webex-errors.js.map +1 -1
  7. package/dist/config.js +5 -1
  8. package/dist/config.js.map +1 -1
  9. package/dist/constants.js +28 -123
  10. package/dist/constants.js.map +1 -1
  11. package/dist/controls-options-manager/enums.js +3 -0
  12. package/dist/controls-options-manager/enums.js.map +1 -1
  13. package/dist/controls-options-manager/types.js.map +1 -1
  14. package/dist/controls-options-manager/util.js +78 -0
  15. package/dist/controls-options-manager/util.js.map +1 -1
  16. package/dist/interpretation/index.js +4 -4
  17. package/dist/interpretation/index.js.map +1 -1
  18. package/dist/interpretation/siLanguage.js +1 -1
  19. package/dist/locus-info/controlsUtils.js +37 -11
  20. package/dist/locus-info/controlsUtils.js.map +1 -1
  21. package/dist/locus-info/index.js +92 -12
  22. package/dist/locus-info/index.js.map +1 -1
  23. package/dist/locus-info/selfUtils.js +432 -418
  24. package/dist/locus-info/selfUtils.js.map +1 -1
  25. package/dist/media/index.js +17 -17
  26. package/dist/media/index.js.map +1 -1
  27. package/dist/media/properties.js +94 -6
  28. package/dist/media/properties.js.map +1 -1
  29. package/dist/meeting/brbState.js +9 -2
  30. package/dist/meeting/brbState.js.map +1 -1
  31. package/dist/meeting/in-meeting-actions.js +21 -1
  32. package/dist/meeting/in-meeting-actions.js.map +1 -1
  33. package/dist/meeting/index.js +678 -344
  34. package/dist/meeting/index.js.map +1 -1
  35. package/dist/meeting/locusMediaRequest.js +21 -22
  36. package/dist/meeting/locusMediaRequest.js.map +1 -1
  37. package/dist/meeting/muteState.js +4 -4
  38. package/dist/meeting/muteState.js.map +1 -1
  39. package/dist/meeting/request.js +30 -0
  40. package/dist/meeting/request.js.map +1 -1
  41. package/dist/meeting/request.type.js.map +1 -1
  42. package/dist/meeting/util.js +13 -2
  43. package/dist/meeting/util.js.map +1 -1
  44. package/dist/meeting-info/meeting-info-v2.js +373 -68
  45. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  46. package/dist/meeting-info/utilv2.js +5 -1
  47. package/dist/meeting-info/utilv2.js.map +1 -1
  48. package/dist/meetings/index.js +136 -1
  49. package/dist/meetings/index.js.map +1 -1
  50. package/dist/meetings/util.js +14 -0
  51. package/dist/meetings/util.js.map +1 -1
  52. package/dist/member/index.js +55 -9
  53. package/dist/member/index.js.map +1 -1
  54. package/dist/member/types.js +3 -0
  55. package/dist/member/types.js.map +1 -1
  56. package/dist/member/util.js +335 -353
  57. package/dist/member/util.js.map +1 -1
  58. package/dist/members/collection.js.map +1 -1
  59. package/dist/members/index.js +137 -29
  60. package/dist/members/index.js.map +1 -1
  61. package/dist/members/request.js +38 -0
  62. package/dist/members/request.js.map +1 -1
  63. package/dist/members/util.js +36 -1
  64. package/dist/members/util.js.map +1 -1
  65. package/dist/metrics/constants.js +10 -0
  66. package/dist/metrics/constants.js.map +1 -1
  67. package/dist/multistream/remoteMediaManager.js +40 -8
  68. package/dist/multistream/remoteMediaManager.js.map +1 -1
  69. package/dist/reachability/clusterReachability.js +63 -27
  70. package/dist/reachability/clusterReachability.js.map +1 -1
  71. package/dist/reachability/index.js +107 -47
  72. package/dist/reachability/index.js.map +1 -1
  73. package/dist/reachability/reachability.types.js +14 -0
  74. package/dist/reachability/reachability.types.js.map +1 -1
  75. package/dist/reachability/request.js +19 -3
  76. package/dist/reachability/request.js.map +1 -1
  77. package/dist/reconnection-manager/index.js +2 -2
  78. package/dist/reconnection-manager/index.js.map +1 -1
  79. package/dist/recording-controller/util.js +5 -5
  80. package/dist/recording-controller/util.js.map +1 -1
  81. package/dist/roap/index.js.map +1 -1
  82. package/dist/roap/turnDiscovery.js +45 -27
  83. package/dist/roap/turnDiscovery.js.map +1 -1
  84. package/dist/roap/types.js +17 -0
  85. package/dist/roap/types.js.map +1 -0
  86. package/dist/types/common/errors/webex-errors.d.ts +7 -1
  87. package/dist/types/config.d.ts +3 -0
  88. package/dist/types/constants.d.ts +20 -85
  89. package/dist/types/controls-options-manager/enums.d.ts +4 -1
  90. package/dist/types/controls-options-manager/types.d.ts +10 -1
  91. package/dist/types/locus-info/index.d.ts +3 -3
  92. package/dist/types/locus-info/selfUtils.d.ts +216 -1
  93. package/dist/types/media/properties.d.ts +15 -0
  94. package/dist/types/meeting/in-meeting-actions.d.ts +20 -0
  95. package/dist/types/meeting/index.d.ts +65 -1
  96. package/dist/types/meeting/muteState.d.ts +0 -1
  97. package/dist/types/meeting/request.d.ts +12 -1
  98. package/dist/types/meeting/request.type.d.ts +6 -0
  99. package/dist/types/meeting/util.d.ts +3 -1
  100. package/dist/types/meeting-info/meeting-info-v2.d.ts +82 -1
  101. package/dist/types/meetings/index.d.ts +57 -0
  102. package/dist/types/member/index.d.ts +21 -6
  103. package/dist/types/member/types.d.ts +73 -14
  104. package/dist/types/member/util.d.ts +156 -1
  105. package/dist/types/members/collection.d.ts +6 -5
  106. package/dist/types/members/index.d.ts +32 -43
  107. package/dist/types/members/request.d.ts +26 -0
  108. package/dist/types/members/util.d.ts +27 -0
  109. package/dist/types/metrics/constants.d.ts +10 -0
  110. package/dist/types/multistream/remoteMediaManager.d.ts +10 -1
  111. package/dist/types/reachability/clusterReachability.d.ts +15 -7
  112. package/dist/types/reachability/index.d.ts +10 -1
  113. package/dist/types/reachability/reachability.types.d.ts +5 -0
  114. package/dist/types/roap/index.d.ts +3 -2
  115. package/dist/types/roap/turnDiscovery.d.ts +5 -17
  116. package/dist/types/roap/types.d.ts +16 -0
  117. package/dist/webinar/index.js +2 -2
  118. package/dist/webinar/index.js.map +1 -1
  119. package/package.json +24 -23
  120. package/src/breakouts/index.ts +69 -0
  121. package/src/common/errors/webex-errors.ts +8 -1
  122. package/src/config.ts +3 -0
  123. package/src/constants.ts +30 -90
  124. package/src/controls-options-manager/enums.ts +3 -0
  125. package/src/controls-options-manager/types.ts +16 -1
  126. package/src/controls-options-manager/util.ts +93 -0
  127. package/src/interpretation/index.ts +3 -3
  128. package/src/locus-info/controlsUtils.ts +59 -14
  129. package/src/locus-info/index.ts +97 -13
  130. package/src/locus-info/selfUtils.ts +496 -442
  131. package/src/media/index.ts +23 -21
  132. package/src/media/properties.ts +96 -0
  133. package/src/meeting/brbState.ts +11 -2
  134. package/src/meeting/in-meeting-actions.ts +40 -0
  135. package/src/meeting/index.ts +470 -105
  136. package/src/meeting/locusMediaRequest.ts +27 -22
  137. package/src/meeting/muteState.ts +4 -4
  138. package/src/meeting/request.ts +36 -1
  139. package/src/meeting/request.type.ts +7 -0
  140. package/src/meeting/util.ts +11 -2
  141. package/src/meeting-info/meeting-info-v2.ts +254 -8
  142. package/src/meeting-info/utilv2.ts +5 -0
  143. package/src/meetings/index.ts +148 -1
  144. package/src/meetings/util.ts +18 -0
  145. package/src/member/index.ts +68 -22
  146. package/src/member/types.ts +82 -16
  147. package/src/member/util.ts +357 -350
  148. package/src/members/collection.ts +4 -3
  149. package/src/members/index.ts +137 -18
  150. package/src/members/request.ts +44 -0
  151. package/src/members/util.ts +43 -1
  152. package/src/metrics/constants.ts +10 -0
  153. package/src/multistream/remoteMediaManager.ts +32 -10
  154. package/src/reachability/clusterReachability.ts +73 -26
  155. package/src/reachability/index.ts +62 -1
  156. package/src/reachability/reachability.types.ts +6 -0
  157. package/src/reachability/request.ts +7 -0
  158. package/src/reconnection-manager/index.ts +2 -2
  159. package/src/recording-controller/util.ts +17 -13
  160. package/src/roap/index.ts +3 -7
  161. package/src/roap/turnDiscovery.ts +34 -39
  162. package/src/roap/types.ts +23 -0
  163. package/src/webinar/index.ts +1 -1
  164. package/test/unit/spec/breakouts/index.ts +167 -95
  165. package/test/unit/spec/controls-options-manager/util.js +178 -0
  166. package/test/unit/spec/interpretation/index.ts +39 -1
  167. package/test/unit/spec/locus-info/controlsUtils.js +155 -9
  168. package/test/unit/spec/locus-info/index.js +209 -73
  169. package/test/unit/spec/locus-info/selfUtils.js +98 -24
  170. package/test/unit/spec/media/index.ts +150 -18
  171. package/test/unit/spec/media/properties.ts +130 -0
  172. package/test/unit/spec/meeting/brbState.ts +40 -2
  173. package/test/unit/spec/meeting/in-meeting-actions.ts +23 -4
  174. package/test/unit/spec/meeting/index.js +804 -139
  175. package/test/unit/spec/meeting/locusMediaRequest.ts +95 -87
  176. package/test/unit/spec/meeting/muteState.js +73 -2
  177. package/test/unit/spec/meeting/request.js +32 -1
  178. package/test/unit/spec/meeting/utils.js +119 -18
  179. package/test/unit/spec/meeting-info/meetinginfov2.js +484 -114
  180. package/test/unit/spec/meeting-info/utilv2.js +19 -0
  181. package/test/unit/spec/meetings/index.js +146 -2
  182. package/test/unit/spec/member/index.js +7 -0
  183. package/test/unit/spec/member/util.js +24 -0
  184. package/test/unit/spec/members/index.js +304 -78
  185. package/test/unit/spec/members/request.js +68 -22
  186. package/test/unit/spec/members/utils.js +75 -0
  187. package/test/unit/spec/multistream/remoteMediaManager.ts +397 -118
  188. package/test/unit/spec/reachability/clusterReachability.ts +88 -56
  189. package/test/unit/spec/reachability/index.ts +97 -0
  190. package/test/unit/spec/reachability/request.js +47 -2
  191. package/test/unit/spec/reconnection-manager/index.js +4 -4
  192. package/test/unit/spec/roap/turnDiscovery.ts +110 -28
  193. package/test/unit/spec/webinar/index.ts +5 -0
  194. package/dist/annotation/annotation.types.d.ts +0 -42
  195. package/dist/annotation/constants.d.ts +0 -31
  196. package/dist/annotation/index.d.ts +0 -117
  197. package/dist/breakouts/breakout.d.ts +0 -8
  198. package/dist/breakouts/collection.d.ts +0 -5
  199. package/dist/breakouts/edit-lock-error.d.ts +0 -15
  200. package/dist/breakouts/events.d.ts +0 -8
  201. package/dist/breakouts/index.d.ts +0 -5
  202. package/dist/breakouts/request.d.ts +0 -22
  203. package/dist/breakouts/utils.d.ts +0 -15
  204. package/dist/common/browser-detection.d.ts +0 -9
  205. package/dist/common/collection.d.ts +0 -48
  206. package/dist/common/config.d.ts +0 -2
  207. package/dist/common/errors/captcha-error.d.ts +0 -15
  208. package/dist/common/errors/intent-to-join.d.ts +0 -16
  209. package/dist/common/errors/join-meeting.d.ts +0 -17
  210. package/dist/common/errors/media.d.ts +0 -15
  211. package/dist/common/errors/no-meeting-info.d.ts +0 -14
  212. package/dist/common/errors/parameter.d.ts +0 -15
  213. package/dist/common/errors/password-error.d.ts +0 -15
  214. package/dist/common/errors/permission.d.ts +0 -14
  215. package/dist/common/errors/reclaim-host-role-error.js +0 -149
  216. package/dist/common/errors/reclaim-host-role-error.js.map +0 -1
  217. package/dist/common/errors/reclaim-host-role-errors.d.ts +0 -60
  218. package/dist/common/errors/reconnection-in-progress.d.ts +0 -9
  219. package/dist/common/errors/reconnection-in-progress.js +0 -33
  220. package/dist/common/errors/reconnection-in-progress.js.map +0 -1
  221. package/dist/common/errors/reconnection.d.ts +0 -15
  222. package/dist/common/errors/stats.d.ts +0 -15
  223. package/dist/common/errors/webex-errors.d.ts +0 -93
  224. package/dist/common/errors/webex-meetings-error.d.ts +0 -20
  225. package/dist/common/events/events-scope.d.ts +0 -17
  226. package/dist/common/events/events.d.ts +0 -12
  227. package/dist/common/events/trigger-proxy.d.ts +0 -2
  228. package/dist/common/events/util.d.ts +0 -2
  229. package/dist/common/logs/logger-config.d.ts +0 -2
  230. package/dist/common/logs/logger-proxy.d.ts +0 -2
  231. package/dist/common/logs/request.d.ts +0 -36
  232. package/dist/common/queue.d.ts +0 -34
  233. package/dist/config.d.ts +0 -72
  234. package/dist/constants.d.ts +0 -1088
  235. package/dist/controls-options-manager/constants.d.ts +0 -4
  236. package/dist/controls-options-manager/enums.d.ts +0 -15
  237. package/dist/controls-options-manager/index.d.ts +0 -136
  238. package/dist/controls-options-manager/types.d.ts +0 -43
  239. package/dist/controls-options-manager/util.d.ts +0 -1
  240. package/dist/index.d.ts +0 -7
  241. package/dist/interceptors/index.d.ts +0 -2
  242. package/dist/interceptors/locusRetry.d.ts +0 -27
  243. package/dist/interpretation/collection.d.ts +0 -5
  244. package/dist/interpretation/index.d.ts +0 -5
  245. package/dist/interpretation/siLanguage.d.ts +0 -5
  246. package/dist/locus-info/controlsUtils.d.ts +0 -2
  247. package/dist/locus-info/embeddedAppsUtils.d.ts +0 -2
  248. package/dist/locus-info/fullState.d.ts +0 -2
  249. package/dist/locus-info/hostUtils.d.ts +0 -2
  250. package/dist/locus-info/index.d.ts +0 -322
  251. package/dist/locus-info/infoUtils.d.ts +0 -2
  252. package/dist/locus-info/mediaSharesUtils.d.ts +0 -2
  253. package/dist/locus-info/parser.d.ts +0 -272
  254. package/dist/locus-info/selfUtils.d.ts +0 -2
  255. package/dist/media/index.d.ts +0 -34
  256. package/dist/media/properties.d.ts +0 -93
  257. package/dist/media/util.d.ts +0 -2
  258. package/dist/mediaQualityMetrics/config.d.ts +0 -241
  259. package/dist/mediaQualityMetrics/config.js +0 -502
  260. package/dist/mediaQualityMetrics/config.js.map +0 -1
  261. package/dist/meeting/effectsState.js +0 -260
  262. package/dist/meeting/effectsState.js.map +0 -1
  263. package/dist/meeting/in-meeting-actions.d.ts +0 -167
  264. package/dist/meeting/index.d.ts +0 -1825
  265. package/dist/meeting/locusMediaRequest.d.ts +0 -74
  266. package/dist/meeting/muteState.d.ts +0 -178
  267. package/dist/meeting/request.d.ts +0 -295
  268. package/dist/meeting/request.type.d.ts +0 -11
  269. package/dist/meeting/state.d.ts +0 -9
  270. package/dist/meeting/util.d.ts +0 -119
  271. package/dist/meeting/voicea-meeting.d.ts +0 -16
  272. package/dist/meeting-info/collection.d.ts +0 -20
  273. package/dist/meeting-info/index.d.ts +0 -69
  274. package/dist/meeting-info/meeting-info-v2.d.ts +0 -123
  275. package/dist/meeting-info/request.d.ts +0 -22
  276. package/dist/meeting-info/util.d.ts +0 -2
  277. package/dist/meeting-info/utilv2.d.ts +0 -2
  278. package/dist/meetings/collection.d.ts +0 -40
  279. package/dist/meetings/index.d.ts +0 -390
  280. package/dist/meetings/meetings.types.d.ts +0 -4
  281. package/dist/meetings/request.d.ts +0 -27
  282. package/dist/meetings/util.d.ts +0 -18
  283. package/dist/member/index.d.ts +0 -160
  284. package/dist/member/member.types.js +0 -17
  285. package/dist/member/member.types.js.map +0 -1
  286. package/dist/member/types.d.ts +0 -32
  287. package/dist/member/util.d.ts +0 -2
  288. package/dist/members/collection.d.ts +0 -29
  289. package/dist/members/index.d.ts +0 -353
  290. package/dist/members/request.d.ts +0 -114
  291. package/dist/members/types.d.ts +0 -25
  292. package/dist/members/util.d.ts +0 -215
  293. package/dist/metrics/config.js +0 -276
  294. package/dist/metrics/config.js.map +0 -1
  295. package/dist/metrics/constants.d.ts +0 -70
  296. package/dist/metrics/index.d.ts +0 -45
  297. package/dist/multistream/mediaRequestManager.d.ts +0 -119
  298. package/dist/multistream/receiveSlot.d.ts +0 -68
  299. package/dist/multistream/receiveSlotManager.d.ts +0 -56
  300. package/dist/multistream/remoteMedia.d.ts +0 -72
  301. package/dist/multistream/remoteMediaGroup.d.ts +0 -49
  302. package/dist/multistream/remoteMediaManager.d.ts +0 -300
  303. package/dist/multistream/sendSlotManager.d.ts +0 -69
  304. package/dist/networkQualityMonitor/index.d.ts +0 -70
  305. package/dist/networkQualityMonitor/index.js +0 -221
  306. package/dist/networkQualityMonitor/index.js.map +0 -1
  307. package/dist/peer-connection-manager/index.js +0 -671
  308. package/dist/peer-connection-manager/index.js.map +0 -1
  309. package/dist/peer-connection-manager/util.js +0 -109
  310. package/dist/peer-connection-manager/util.js.map +0 -1
  311. package/dist/personal-meeting-room/index.d.ts +0 -47
  312. package/dist/personal-meeting-room/request.d.ts +0 -14
  313. package/dist/personal-meeting-room/util.d.ts +0 -2
  314. package/dist/reachability/clusterReachability.d.ts +0 -109
  315. package/dist/reachability/index.d.ts +0 -105
  316. package/dist/reachability/request.d.ts +0 -39
  317. package/dist/reachability/util.d.ts +0 -8
  318. package/dist/reactions/constants.d.ts +0 -3
  319. package/dist/reactions/reactions.d.ts +0 -4
  320. package/dist/reactions/reactions.type.d.ts +0 -52
  321. package/dist/reconnection-manager/index.d.ts +0 -136
  322. package/dist/recording-controller/enums.d.ts +0 -7
  323. package/dist/recording-controller/index.d.ts +0 -207
  324. package/dist/recording-controller/util.d.ts +0 -14
  325. package/dist/roap/collection.js +0 -62
  326. package/dist/roap/collection.js.map +0 -1
  327. package/dist/roap/handler.js +0 -275
  328. package/dist/roap/handler.js.map +0 -1
  329. package/dist/roap/index.d.ts +0 -86
  330. package/dist/roap/request.d.ts +0 -39
  331. package/dist/roap/state.js +0 -126
  332. package/dist/roap/state.js.map +0 -1
  333. package/dist/roap/turnDiscovery.d.ts +0 -155
  334. package/dist/roap/util.js +0 -75
  335. package/dist/roap/util.js.map +0 -1
  336. package/dist/rtcMetrics/constants.d.ts +0 -4
  337. package/dist/rtcMetrics/constants.js +0 -11
  338. package/dist/rtcMetrics/constants.js.map +0 -1
  339. package/dist/rtcMetrics/index.d.ts +0 -61
  340. package/dist/rtcMetrics/index.js +0 -197
  341. package/dist/rtcMetrics/index.js.map +0 -1
  342. package/dist/statsAnalyzer/global.d.ts +0 -36
  343. package/dist/statsAnalyzer/global.js +0 -126
  344. package/dist/statsAnalyzer/global.js.map +0 -1
  345. package/dist/statsAnalyzer/index.d.ts +0 -217
  346. package/dist/statsAnalyzer/index.js +0 -1013
  347. package/dist/statsAnalyzer/index.js.map +0 -1
  348. package/dist/statsAnalyzer/mqaUtil.d.ts +0 -48
  349. package/dist/statsAnalyzer/mqaUtil.js +0 -179
  350. package/dist/statsAnalyzer/mqaUtil.js.map +0 -1
  351. package/dist/transcription/index.d.ts +0 -64
  352. package/dist/types/common/errors/reconnection-in-progress.d.ts +0 -9
  353. package/dist/types/mediaQualityMetrics/config.d.ts +0 -241
  354. package/dist/types/networkQualityMonitor/index.d.ts +0 -70
  355. package/dist/types/rtcMetrics/constants.d.ts +0 -4
  356. package/dist/types/rtcMetrics/index.d.ts +0 -71
  357. package/dist/types/statsAnalyzer/global.d.ts +0 -36
  358. package/dist/types/statsAnalyzer/index.d.ts +0 -217
  359. package/dist/types/statsAnalyzer/mqaUtil.d.ts +0 -48
  360. package/dist/webinar/collection.d.ts +0 -16
  361. package/dist/webinar/index.d.ts +0 -5
@@ -1,155 +0,0 @@
1
- import { Enum } from '../constants';
2
- import RoapRequest from './request';
3
- import Meeting from '../meeting';
4
- declare const TurnDiscoverySkipReason: {
5
- readonly missingHttpResponse: "missing http response";
6
- readonly reachability: "reachability";
7
- readonly alreadyInProgress: "already in progress";
8
- };
9
- export type TurnDiscoverySkipReason = Enum<typeof TurnDiscoverySkipReason> | string | undefined;
10
- export type TurnServerInfo = {
11
- url: string;
12
- username: string;
13
- password: string;
14
- };
15
- export type TurnDiscoveryResult = {
16
- turnServerInfo?: TurnServerInfo;
17
- turnDiscoverySkippedReason: TurnDiscoverySkipReason;
18
- };
19
- /**
20
- * Handles the process of finding out TURN server information from Linus.
21
- * This is achieved by sending a TURN_DISCOVERY_REQUEST.
22
- */
23
- export default class TurnDiscovery {
24
- private roapRequest;
25
- private defer?;
26
- private turnInfo;
27
- private responseTimer?;
28
- /**
29
- * Constructor
30
- *
31
- * @param {RoapRequest} roapRequest
32
- */
33
- constructor(roapRequest: RoapRequest);
34
- /**
35
- * waits for TURN_DISCOVERY_RESPONSE message to arrive
36
- *
37
- * @returns {Promise}
38
- * @private
39
- * @memberof Roap
40
- */
41
- private waitForTurnDiscoveryResponse;
42
- /**
43
- * Handles TURN_DISCOVERY_RESPONSE roap message. Use it if the roap message comes over the websocket,
44
- * otherwise use handleTurnDiscoveryHttpResponse() if it comes in the http response.
45
- *
46
- * @param {Object} roapMessage
47
- * @param {string} from string to indicate how we got the response (used just for logging)
48
- * @returns {void}
49
- * @public
50
- * @memberof Roap
51
- */
52
- handleTurnDiscoveryResponse(roapMessage: any, from: string): void;
53
- /**
54
- * Generates TURN_DISCOVERY_REQUEST roap message. When this method returns a roapMessage, it means that a TURN discovery process has started.
55
- * It needs be ended by calling handleTurnDiscoveryHttpResponse() once you get a response from the backend. If you don't get any response
56
- * or want to abort, you need to call abort().
57
- *
58
- * @param {Meeting} meeting
59
- * @param {boolean} isForced
60
- * @returns {Object}
61
- */
62
- generateTurnDiscoveryRequestMessage(meeting: Meeting, isForced: boolean): Promise<{
63
- roapMessage?: object;
64
- turnDiscoverySkippedReason: TurnDiscoverySkipReason;
65
- }>;
66
- /**
67
- * Handles any errors that occur during TURN discovery without re-throwing them.
68
- *
69
- * @param {Meeting} meeting
70
- * @param {Error} error
71
- * @returns {TurnDiscoveryResult}
72
- */
73
- private handleTurnDiscoveryFailure;
74
- /**
75
- * Handles TURN_DISCOVERY_RESPONSE roap message that came in http response. If the response is not valid,
76
- * it returns an object with turnServerInfo set to undefined. In that case you need to call abort()
77
- * to end the TURN discovery process.
78
- *
79
- * @param {Meeting} meeting
80
- * @param {Object|undefined} httpResponse can be undefined to indicate that we didn't get the response
81
- * @returns {Promise<TurnDiscoveryResult>}
82
- * @memberof Roap
83
- */
84
- handleTurnDiscoveryHttpResponse(meeting: Meeting, httpResponse?: object): Promise<TurnDiscoveryResult>;
85
- /**
86
- * Aborts current TURN discovery. This method needs to be called if you called generateTurnDiscoveryRequestMessage(),
87
- * but then never got any response from the server.
88
- * @returns {void}
89
- */
90
- abort(): void;
91
- /**
92
- * Parses the TURN_DISCOVERY_RESPONSE roap message out of the http response
93
- * and returns it.
94
- *
95
- * @param {Meeting} meeting
96
- * @param {any} httpResponse
97
- * @returns {any}
98
- */
99
- private parseHttpTurnDiscoveryResponse;
100
- /**
101
- * sends the TURN_DISCOVERY_REQUEST roap request
102
- *
103
- * @param {Meeting} meeting
104
- * @param {Boolean} isReconnecting
105
- * @returns {Promise}
106
- * @private
107
- * @memberof Roap
108
- */
109
- private sendRoapTurnDiscoveryRequest;
110
- /**
111
- * Sends the OK message that server expects to receive
112
- * after it sends us TURN_DISCOVERY_RESPONSE
113
- *
114
- * @param {Meeting} meeting
115
- * @returns {Promise}
116
- */
117
- sendRoapOK(meeting: Meeting): Promise<{
118
- mediaConnections: any;
119
- locus: any;
120
- }>;
121
- /**
122
- * Gets the reason why reachability is skipped.
123
- *
124
- * @param {Meeting} meeting
125
- * @returns {Promise<string>} Promise with empty string if reachability is not skipped or a reason if it is skipped
126
- */
127
- private getSkipReason;
128
- /**
129
- * Checks if TURN discovery is skipped.
130
- *
131
- * @param {Meeting} meeting
132
- * @returns {Boolean} true if TURN discovery is being skipped, false if it is being done
133
- */
134
- isSkipped(meeting: any): Promise<boolean>;
135
- /**
136
- * Retrieves TURN server information from the backend by doing
137
- * a roap message exchange:
138
- * client server
139
- * | -----TURN_DISCOVERY_REQUEST-----> |
140
- * | <----TURN_DISCOVERY_RESPONSE----- |
141
- * | --------------OK----------------> |
142
- *
143
- * This TURN discovery roap exchange is always done with seq=0.
144
- * The RoapMediaConnection SDP exchange always starts with seq=1,
145
- * so it works fine no matter if TURN discovery is done or not.
146
- *
147
- * @param {Meeting} meeting
148
- * @param {Boolean} [isReconnecting] should be set to true if this is a new
149
- * media connection just after a reconnection
150
- * @param {Boolean} [isForced]
151
- * @returns {Promise}
152
- */
153
- doTurnDiscovery(meeting: Meeting, isReconnecting?: boolean, isForced?: boolean): Promise<TurnDiscoveryResult>;
154
- }
155
- export {};
package/dist/roap/util.js DELETED
@@ -1,75 +0,0 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
- var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
5
- _Object$defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
- var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
10
- var _peerConnectionManager = _interopRequireDefault(require("../peer-connection-manager"));
11
- var _constants = require("../constants");
12
- var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
13
- var _parameter = _interopRequireDefault(require("../common/errors/parameter"));
14
- var RoapUtil = {};
15
- var ROAP_ANSWER = _constants._ANSWER_.toLowerCase();
16
- RoapUtil.shouldHandleMedia = function (meeting) {
17
- var offer = meeting.mediaProperties.peerConnection && meeting.mediaProperties.peerConnection.signalingState === _constants.SDP.HAVE_LOCAL_OFFER;
18
- if (offer) {
19
- return false;
20
- }
21
- return true;
22
- };
23
- RoapUtil.handleError = function (pc) {
24
- return _peerConnectionManager.default.rollBackLocalDescription({
25
- peerConnection: pc
26
- }).then(function () {
27
- return _promise.default.resolve(true);
28
- }).catch(function (err) {
29
- _loggerProxy.default.logger.error("Roap:util#handleError --> ".concat(err));
30
- return _promise.default.reject(err);
31
- });
32
- };
33
- RoapUtil.findError = function (messageType, errorType, type) {
34
- return (type === _constants.ROAP.RECEIVE_ROAP_MSG || type === _constants.ROAP.SEND_ROAP_MSG) && messageType === _constants._ERROR_ && errorType === _constants._CONFLICT_;
35
- };
36
- RoapUtil.ensureMeeting = function (meeting, type) {
37
- if (type === _constants.ROAP.RECEIVE_ROAP_MSG || type === _constants.ROAP.SEND_ROAP_MSG || type === _constants.ROAP.SEND_ROAP_MSG_SUCCESS) {
38
- if (!meeting) {
39
- return false;
40
- }
41
- }
42
- return true;
43
- };
44
- RoapUtil.updatePeerConnection = function (meeting, session) {
45
- return _peerConnectionManager.default.updatePeerConnection({
46
- offerSdp: session.OFFER.sdps,
47
- peerConnection: meeting.mediaProperties.peerConnection
48
- }, {
49
- meetingId: meeting.id,
50
- remoteQualityLevel: meeting.mediaProperties.remoteQualityLevel
51
- }).then(function (res) {
52
- meeting.roap.lastRoapOffer = session.OFFER.sdps;
53
- return res;
54
- });
55
- };
56
- RoapUtil.setRemoteDescription = function (meeting, session) {
57
- _loggerProxy.default.logger.info("Roap:util#setRemoteDescription --> Transmit WAIT_TX_OK, correlationId: ".concat(meeting.correlationId));
58
- if (!(meeting && meeting.mediaProperties.peerConnection)) {
59
- _loggerProxy.default.logger.error("Roap:util#setRemoteDescription --> DANGER no media or screen peer connection, correlationId: ".concat(meeting.correlationId));
60
- return _promise.default.reject(new _parameter.default('Must provide a media or screen peer connection'));
61
- }
62
- return _peerConnectionManager.default.setRemoteSessionDetails(meeting.mediaProperties.peerConnection, ROAP_ANSWER, session.ANSWER.sdps[0], meeting.id).then(function () {
63
- _loggerProxy.default.logger.info("Roap:util#setRemoteDescription --> Success for correlationId: ".concat(meeting.correlationId));
64
- return {
65
- seq: session.ANSWER.seq,
66
- mediaId: meeting.mediaId,
67
- correlationId: meeting.correlationId
68
- };
69
- }).catch(function (err) {
70
- _loggerProxy.default.logger.error("Roap:util#setRemoteDescription --> ".concat(err));
71
- throw err;
72
- });
73
- };
74
- var _default = exports.default = RoapUtil;
75
- //# sourceMappingURL=util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_peerConnectionManager","_interopRequireDefault","require","_constants","_loggerProxy","_parameter","RoapUtil","ROAP_ANSWER","_ANSWER_","toLowerCase","shouldHandleMedia","meeting","offer","mediaProperties","peerConnection","signalingState","SDP","HAVE_LOCAL_OFFER","handleError","pc","PeerConnectionManager","rollBackLocalDescription","then","_promise","default","resolve","catch","err","LoggerProxy","logger","error","concat","reject","findError","messageType","errorType","type","ROAP","RECEIVE_ROAP_MSG","SEND_ROAP_MSG","_ERROR_","_CONFLICT_","ensureMeeting","SEND_ROAP_MSG_SUCCESS","updatePeerConnection","session","offerSdp","OFFER","sdps","meetingId","id","remoteQualityLevel","res","roap","lastRoapOffer","setRemoteDescription","info","correlationId","ParameterError","setRemoteSessionDetails","ANSWER","seq","mediaId","_default","exports"],"sources":["util.ts"],"sourcesContent":["import PeerConnectionManager from '../peer-connection-manager';\nimport {_ANSWER_, _ERROR_, _CONFLICT_, ROAP, SDP} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport ParameterError from '../common/errors/parameter';\n\nconst RoapUtil: any = {};\nconst ROAP_ANSWER = _ANSWER_.toLowerCase();\n\nRoapUtil.shouldHandleMedia = (meeting) => {\n const offer =\n meeting.mediaProperties.peerConnection &&\n meeting.mediaProperties.peerConnection.signalingState === SDP.HAVE_LOCAL_OFFER;\n\n if (offer) {\n return false;\n }\n\n return true;\n};\n\nRoapUtil.handleError = (pc) =>\n PeerConnectionManager.rollBackLocalDescription({peerConnection: pc})\n .then(() => Promise.resolve(true))\n .catch((err) => {\n LoggerProxy.logger.error(`Roap:util#handleError --> ${err}`);\n\n return Promise.reject(err);\n });\n\nRoapUtil.findError = (messageType, errorType, type) =>\n (type === ROAP.RECEIVE_ROAP_MSG || type === ROAP.SEND_ROAP_MSG) &&\n messageType === _ERROR_ &&\n errorType === _CONFLICT_;\n\nRoapUtil.ensureMeeting = (meeting, type) => {\n if (\n type === ROAP.RECEIVE_ROAP_MSG ||\n type === ROAP.SEND_ROAP_MSG ||\n type === ROAP.SEND_ROAP_MSG_SUCCESS\n ) {\n if (!meeting) {\n return false;\n }\n }\n\n return true;\n};\n\nRoapUtil.updatePeerConnection = (meeting, session) =>\n PeerConnectionManager.updatePeerConnection(\n {\n offerSdp: session.OFFER.sdps,\n peerConnection: meeting.mediaProperties.peerConnection,\n },\n {\n meetingId: meeting.id,\n remoteQualityLevel: meeting.mediaProperties.remoteQualityLevel,\n }\n ).then((res) => {\n meeting.roap.lastRoapOffer = session.OFFER.sdps;\n\n return res;\n });\n\nRoapUtil.setRemoteDescription = (meeting, session) => {\n LoggerProxy.logger.info(\n `Roap:util#setRemoteDescription --> Transmit WAIT_TX_OK, correlationId: ${meeting.correlationId}`\n );\n if (!(meeting && meeting.mediaProperties.peerConnection)) {\n LoggerProxy.logger.error(\n `Roap:util#setRemoteDescription --> DANGER no media or screen peer connection, correlationId: ${meeting.correlationId}`\n );\n\n return Promise.reject(new ParameterError('Must provide a media or screen peer connection'));\n }\n\n return PeerConnectionManager.setRemoteSessionDetails(\n meeting.mediaProperties.peerConnection,\n ROAP_ANSWER,\n session.ANSWER.sdps[0],\n meeting.id\n )\n .then(() => {\n LoggerProxy.logger.info(\n `Roap:util#setRemoteDescription --> Success for correlationId: ${meeting.correlationId}`\n );\n\n return {\n seq: session.ANSWER.seq,\n mediaId: meeting.mediaId,\n correlationId: meeting.correlationId,\n };\n })\n .catch((err) => {\n LoggerProxy.logger.error(`Roap:util#setRemoteDescription --> ${err}`);\n throw err;\n });\n};\n\nexport default RoapUtil;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,sBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,UAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAMI,QAAa,GAAG,CAAC,CAAC;AACxB,IAAMC,WAAW,GAAGC,mBAAQ,CAACC,WAAW,CAAC,CAAC;AAE1CH,QAAQ,CAACI,iBAAiB,GAAG,UAACC,OAAO,EAAK;EACxC,IAAMC,KAAK,GACTD,OAAO,CAACE,eAAe,CAACC,cAAc,IACtCH,OAAO,CAACE,eAAe,CAACC,cAAc,CAACC,cAAc,KAAKC,cAAG,CAACC,gBAAgB;EAEhF,IAAIL,KAAK,EAAE;IACT,OAAO,KAAK;EACd;EAEA,OAAO,IAAI;AACb,CAAC;AAEDN,QAAQ,CAACY,WAAW,GAAG,UAACC,EAAE;EAAA,OACxBC,8BAAqB,CAACC,wBAAwB,CAAC;IAACP,cAAc,EAAEK;EAAE,CAAC,CAAC,CACjEG,IAAI,CAAC;IAAA,OAAMC,QAAA,CAAAC,OAAA,CAAQC,OAAO,CAAC,IAAI,CAAC;EAAA,EAAC,CACjCC,KAAK,CAAC,UAACC,GAAG,EAAK;IACdC,oBAAW,CAACC,MAAM,CAACC,KAAK,8BAAAC,MAAA,CAA8BJ,GAAG,CAAE,CAAC;IAE5D,OAAOJ,QAAA,CAAAC,OAAA,CAAQQ,MAAM,CAACL,GAAG,CAAC;EAC5B,CAAC,CAAC;AAAA;AAENrB,QAAQ,CAAC2B,SAAS,GAAG,UAACC,WAAW,EAAEC,SAAS,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AAK,iGAAAC,MAAA,CAC0EpB,OAAO,CAAC8C,aAAa,CACvH,CAAC;IAED,OAAOlC,QAAA,CAAAC,OAAA,CAAQQ,MAAM,CAAC,IAAI0B,kBAAc,CAAC,gDAAgD,CAAC,CAAC;EAC7F;EAEA,OAAOtC,8BAAqB,CAACuC,uBAAuB,CAClDhD,OAAO,CAACE,eAAe,CAACC,cAAc,EACtCP,WAAW,EACXsC,OAAO,CAACe,MAAM,CAACZ,IAAI,CAAC,CAAC,CAAC,EACtBrC,OAAO,CAACuC,EACV,CAAC,CACE5B,IAAI,CAAC,YAAM;IACVM,oBAAW,CAACC,MAAM,CAAC2B,IAAI,kEAAAzB,MAAA,CAC4CpB,OAAO,CAAC8C,aAAa,CACxF,CAAC;IAED,OAAO;MACLI,GAAG,EAAEhB,OAAO,CAACe,MAAM,CAACC,GAAG;MACvBC,OAAO,EAAEnD,OAAO,CAACmD,OAAO;MACxBL,aAAa,EAAE9C,OAAO,CAAC8C;IACzB,CAAC;EACH,CAAC,CAAC,CACD/B,KAAK,CAAC,UAACC,GAAG,EAAK;IACdC,oBAAW,CAACC,MAAM,CAACC,KAAK,uCAAAC,MAAA,CAAuCJ,GAAG,CAAE,CAAC;IACrE,MAAMA,GAAG;EACX,CAAC,CAAC;AACN,CAAC;AAAC,IAAAoC,QAAA,GAAAC,OAAA,CAAAxC,OAAA,GAEalB,QAAQ","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- declare const RTC_METRICS: {
2
- APP_ID: string;
3
- };
4
- export { RTC_METRICS as default };
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
- _Object$defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var RTC_METRICS = exports.default = {
9
- APP_ID: 'FFB51ED5-4319-4C55-8303-B1F2FCCDE231'
10
- };
11
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["RTC_METRICS","exports","default","APP_ID"],"sources":["constants.ts"],"sourcesContent":["const RTC_METRICS = {APP_ID: 'FFB51ED5-4319-4C55-8303-B1F2FCCDE231'};\n\nexport {RTC_METRICS as default};\n"],"mappings":";;;;;;;AAAA,IAAMA,WAAW,GAAAC,OAAA,CAAAC,OAAA,GAAG;EAACC,MAAM,EAAE;AAAsC,CAAC"}
@@ -1,61 +0,0 @@
1
- /**
2
- * Rtc Metrics
3
- */
4
- export default class RtcMetrics {
5
- /**
6
- * Array of MetricData items to be sent to the metrics service.
7
- */
8
- metricsQueue: any[];
9
- intervalId: number;
10
- webex: any;
11
- meetingId: string;
12
- correlationId: string;
13
- connectionId: string;
14
- /**
15
- * Initialize the interval.
16
- *
17
- * @param {object} webex - The main `webex` object.
18
- * @param {string} meetingId - The meeting id.
19
- * @param {string} correlationId - The correlation id.
20
- */
21
- constructor(webex: any, meetingId: any, correlationId: any);
22
- /**
23
- * Check to see if the metrics queue has any items.
24
- *
25
- * @returns {void}
26
- */
27
- sendMetricsInQueue(): void;
28
- /**
29
- * Add metrics items to the metrics queue.
30
- *
31
- * @param {object} data - An object with a payload array of metrics items.
32
- *
33
- * @returns {void}
34
- */
35
- addMetrics(data: any): void;
36
- /**
37
- * Clear the metrics interval.
38
- *
39
- * @returns {void}
40
- */
41
- closeMetrics(): void;
42
- /**
43
- * Anonymize IP addresses.
44
- *
45
- * @param {array} stats - An RTCStatsReport organized into an array of strings.
46
- * @returns {string}
47
- */
48
- anonymizeIp(stats: string): string;
49
- /**
50
- * Set a new connection id.
51
- *
52
- * @returns {void}
53
- */
54
- private setNewConnectionId;
55
- /**
56
- * Send metrics to the metrics service.
57
- *
58
- * @returns {void}
59
- */
60
- private sendMetrics;
61
- }
@@ -1,197 +0,0 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
- var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
5
- _Object$defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
- var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
11
- var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
12
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
13
- var _internalPluginMetrics = require("@webex/internal-plugin-metrics");
14
- var _uuid = _interopRequireDefault(require("uuid"));
15
- var _constants = _interopRequireDefault(require("./constants"));
16
- /* eslint-disable class-methods-use-this */
17
-
18
- var parseJsonPayload = function parseJsonPayload(payload) {
19
- try {
20
- if (payload && payload[0]) {
21
- return JSON.parse(payload[0]);
22
- }
23
- return null;
24
- } catch (_) {
25
- return null;
26
- }
27
- };
28
-
29
- /**
30
- * Rtc Metrics
31
- */
32
- var RtcMetrics = exports.default = /*#__PURE__*/function () {
33
- /**
34
- * Initialize the interval.
35
- *
36
- * @param {object} webex - The main `webex` object.
37
- * @param {string} meetingId - The meeting id.
38
- * @param {string} correlationId - The correlation id.
39
- */
40
- function RtcMetrics(webex, meetingId, correlationId) {
41
- (0, _classCallCheck2.default)(this, RtcMetrics);
42
- /**
43
- * Array of MetricData items to be sent to the metrics service.
44
- */
45
- (0, _defineProperty2.default)(this, "metricsQueue", []);
46
- (0, _defineProperty2.default)(this, "intervalId", void 0);
47
- (0, _defineProperty2.default)(this, "webex", void 0);
48
- (0, _defineProperty2.default)(this, "meetingId", void 0);
49
- (0, _defineProperty2.default)(this, "correlationId", void 0);
50
- (0, _defineProperty2.default)(this, "connectionId", void 0);
51
- (0, _defineProperty2.default)(this, "shouldSendMetricsOnNextStatsReport", void 0);
52
- // `window` is used to prevent typescript from returning a NodeJS.Timer.
53
- this.intervalId = window.setInterval(this.sendMetricsInQueue.bind(this), 30 * 1000);
54
- this.meetingId = meetingId;
55
- this.webex = webex;
56
- this.correlationId = correlationId;
57
- this.resetConnection();
58
- }
59
-
60
- /**
61
- * Check to see if the metrics queue has any items.
62
- *
63
- * @returns {void}
64
- */
65
- (0, _createClass2.default)(RtcMetrics, [{
66
- key: "sendMetricsInQueue",
67
- value: function sendMetricsInQueue() {
68
- if (this.metricsQueue.length) {
69
- this.sendMetrics();
70
- this.metricsQueue = [];
71
- }
72
- }
73
-
74
- /**
75
- * Forces sending metrics when we get the next stats-report
76
- *
77
- * This is useful for cases when something important happens that affects the media connection,
78
- * for example when we move from lobby into the meeting.
79
- *
80
- * @returns {void}
81
- */
82
- }, {
83
- key: "sendNextMetrics",
84
- value: function sendNextMetrics() {
85
- this.shouldSendMetricsOnNextStatsReport = true;
86
- }
87
-
88
- /**
89
- * Add metrics items to the metrics queue.
90
- *
91
- * @param {object} data - An object with a payload array of metrics items.
92
- *
93
- * @returns {void}
94
- */
95
- }, {
96
- key: "addMetrics",
97
- value: function addMetrics(data) {
98
- if (data.payload.length) {
99
- if (data.name === 'stats-report') {
100
- data.payload = data.payload.map(this.anonymizeIp);
101
- }
102
- this.metricsQueue.push(data);
103
- if (this.shouldSendMetricsOnNextStatsReport && data.name === 'stats-report') {
104
- // this is the first useful set of data (WCME gives it to us after 5s), send it out immediately
105
- // in case the user is unhappy and closes the browser early
106
- this.sendMetricsInQueue();
107
- this.shouldSendMetricsOnNextStatsReport = false;
108
- }
109
- try {
110
- // If a connection fails, send the rest of the metrics in queue and get a new connection id.
111
- var parsedPayload = parseJsonPayload(data.payload);
112
- if (data.name === 'onconnectionstatechange' && parsedPayload && parsedPayload.value === 'failed') {
113
- this.sendMetricsInQueue();
114
- this.resetConnection();
115
- }
116
- } catch (e) {
117
- console.error(e);
118
- }
119
- }
120
- }
121
-
122
- /**
123
- * Clear the metrics interval.
124
- *
125
- * @returns {void}
126
- */
127
- }, {
128
- key: "closeMetrics",
129
- value: function closeMetrics() {
130
- this.sendMetricsInQueue();
131
- clearInterval(this.intervalId);
132
- }
133
-
134
- /**
135
- * Anonymize IP addresses.
136
- *
137
- * @param {array} stats - An RTCStatsReport organized into an array of strings.
138
- * @returns {string}
139
- */
140
- }, {
141
- key: "anonymizeIp",
142
- value: function anonymizeIp(stats) {
143
- var data = JSON.parse(stats);
144
- // on local and remote candidates, anonymize the last 4 bits.
145
- if (data.type === 'local-candidate' || data.type === 'remote-candidate') {
146
- data.ip = _internalPluginMetrics.CallDiagnosticUtils.anonymizeIPAddress(data.ip) || undefined;
147
- data.address = _internalPluginMetrics.CallDiagnosticUtils.anonymizeIPAddress(data.address) || undefined;
148
- data.relatedAddress = _internalPluginMetrics.CallDiagnosticUtils.anonymizeIPAddress(data.relatedAddress) || undefined;
149
- }
150
- return (0, _stringify.default)(data);
151
- }
152
-
153
- /**
154
- * Set a new connection id.
155
- *
156
- * @returns {void}
157
- */
158
- }, {
159
- key: "resetConnection",
160
- value: function resetConnection() {
161
- this.connectionId = _uuid.default.v4();
162
- this.shouldSendMetricsOnNextStatsReport = true;
163
- }
164
-
165
- /**
166
- * Send metrics to the metrics service.
167
- *
168
- * @returns {void}
169
- */
170
- }, {
171
- key: "sendMetrics",
172
- value: function sendMetrics() {
173
- this.webex.request({
174
- method: 'POST',
175
- service: 'unifiedTelemetry',
176
- resource: 'metric/v2',
177
- headers: {
178
- type: 'webrtcMedia',
179
- appId: _constants.default.APP_ID
180
- },
181
- body: {
182
- metrics: [{
183
- type: 'webrtc',
184
- version: '1.1.0',
185
- userId: this.webex.internal.device.userId,
186
- meetingId: this.meetingId,
187
- correlationId: this.correlationId,
188
- connectionId: this.connectionId,
189
- data: this.metricsQueue
190
- }]
191
- }
192
- });
193
- }
194
- }]);
195
- return RtcMetrics;
196
- }();
197
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_internalPluginMetrics","require","_uuid","_interopRequireDefault","_constants","parseJsonPayload","payload","JSON","parse","_","RtcMetrics","exports","default","webex","meetingId","correlationId","_classCallCheck2","_defineProperty2","intervalId","window","setInterval","sendMetricsInQueue","bind","resetConnection","_createClass2","key","value","metricsQueue","length","sendMetrics","sendNextMetrics","shouldSendMetricsOnNextStatsReport","addMetrics","data","name","map","anonymizeIp","push","parsedPayload","e","console","error","closeMetrics","clearInterval","stats","type","ip","CallDiagnosticUtils","anonymizeIPAddress","undefined","address","relatedAddress","_stringify","connectionId","uuid","v4","request","method","service","resource","headers","appId","RTC_METRICS","APP_ID","body","metrics","version","userId","internal","device"],"sources":["index.ts"],"sourcesContent":["/* eslint-disable class-methods-use-this */\nimport {CallDiagnosticUtils} from '@webex/internal-plugin-metrics';\nimport uuid from 'uuid';\nimport RTC_METRICS from './constants';\n\nconst parseJsonPayload = (payload: any[]): any | null => {\n try {\n if (payload && payload[0]) {\n return JSON.parse(payload[0]);\n }\n\n return null;\n } catch (_) {\n return null;\n }\n};\n\n/**\n * Rtc Metrics\n */\nexport default class RtcMetrics {\n /**\n * Array of MetricData items to be sent to the metrics service.\n */\n metricsQueue = [];\n\n intervalId: number;\n\n webex: any;\n\n meetingId: string;\n\n correlationId: string;\n\n connectionId: string;\n\n shouldSendMetricsOnNextStatsReport: boolean;\n\n /**\n * Initialize the interval.\n *\n * @param {object} webex - The main `webex` object.\n * @param {string} meetingId - The meeting id.\n * @param {string} correlationId - The correlation id.\n */\n constructor(webex, meetingId, correlationId) {\n // `window` is used to prevent typescript from returning a NodeJS.Timer.\n this.intervalId = window.setInterval(this.sendMetricsInQueue.bind(this), 30 * 1000);\n this.meetingId = meetingId;\n this.webex = webex;\n this.correlationId = correlationId;\n this.resetConnection();\n }\n\n /**\n * Check to see if the metrics queue has any items.\n *\n * @returns {void}\n */\n public sendMetricsInQueue() {\n if (this.metricsQueue.length) {\n this.sendMetrics();\n this.metricsQueue = [];\n }\n }\n\n /**\n * Forces sending metrics when we get the next stats-report\n *\n * This is useful for cases when something important happens that affects the media connection,\n * for example when we move from lobby into the meeting.\n *\n * @returns {void}\n */\n public sendNextMetrics() {\n this.shouldSendMetricsOnNextStatsReport = true;\n }\n\n /**\n * Add metrics items to the metrics queue.\n *\n * @param {object} data - An object with a payload array of metrics items.\n *\n * @returns {void}\n */\n addMetrics(data) {\n if (data.payload.length) {\n if (data.name === 'stats-report') {\n data.payload = data.payload.map(this.anonymizeIp);\n }\n\n this.metricsQueue.push(data);\n\n if (this.shouldSendMetricsOnNextStatsReport && data.name === 'stats-report') {\n // this is the first useful set of data (WCME gives it to us after 5s), send it out immediately\n // in case the user is unhappy and closes the browser early\n this.sendMetricsInQueue();\n this.shouldSendMetricsOnNextStatsReport = false;\n }\n\n try {\n // If a connection fails, send the rest of the metrics in queue and get a new connection id.\n const parsedPayload = parseJsonPayload(data.payload);\n if (\n data.name === 'onconnectionstatechange' &&\n parsedPayload &&\n parsedPayload.value === 'failed'\n ) {\n this.sendMetricsInQueue();\n this.resetConnection();\n }\n } catch (e) {\n console.error(e);\n }\n }\n }\n\n /**\n * Clear the metrics interval.\n *\n * @returns {void}\n */\n closeMetrics() {\n this.sendMetricsInQueue();\n clearInterval(this.intervalId);\n }\n\n /**\n * Anonymize IP addresses.\n *\n * @param {array} stats - An RTCStatsReport organized into an array of strings.\n * @returns {string}\n */\n anonymizeIp(stats: string): string {\n const data = JSON.parse(stats);\n // on local and remote candidates, anonymize the last 4 bits.\n if (data.type === 'local-candidate' || data.type === 'remote-candidate') {\n data.ip = CallDiagnosticUtils.anonymizeIPAddress(data.ip) || undefined;\n data.address = CallDiagnosticUtils.anonymizeIPAddress(data.address) || undefined;\n data.relatedAddress =\n CallDiagnosticUtils.anonymizeIPAddress(data.relatedAddress) || undefined;\n }\n\n return JSON.stringify(data);\n }\n\n /**\n * Set a new connection id.\n *\n * @returns {void}\n */\n private resetConnection() {\n this.connectionId = uuid.v4();\n this.shouldSendMetricsOnNextStatsReport = true;\n }\n\n /**\n * Send metrics to the metrics service.\n *\n * @returns {void}\n */\n private sendMetrics() {\n this.webex.request({\n method: 'POST',\n service: 'unifiedTelemetry',\n resource: 'metric/v2',\n headers: {\n type: 'webrtcMedia',\n appId: RTC_METRICS.APP_ID,\n },\n body: {\n metrics: [\n {\n type: 'webrtc',\n version: '1.1.0',\n userId: this.webex.internal.device.userId,\n meetingId: this.meetingId,\n correlationId: this.correlationId,\n connectionId: this.connectionId,\n data: this.metricsQueue,\n },\n ],\n },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,sBAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAD,sBAAA,CAAAF,OAAA;AAHA;;AAKA,IAAMI,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,OAAc,EAAiB;EACvD,IAAI;IACF,IAAIA,OAAO,IAAIA,OAAO,CAAC,CAAC,CAAC,EAAE;MACzB,OAAOC,IAAI,CAACC,KAAK,CAACF,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/B;IAEA,OAAO,IAAI;EACb,CAAC,CAAC,OAAOG,CAAC,EAAE;IACV,OAAO,IAAI;EACb;AACF,CAAC;;AAED;AACA;AACA;AAFA,IAGqBC,UAAU,GAAAC,OAAA,CAAAC,OAAA;EAkB7B;AACF;AACA;AACA;AACA;AACA;AACA;EACE,SAAAF,WAAYG,KAAK,EAAEC,SAAS,EAAEC,aAAa,EAAE;IAAA,IAAAC,gBAAA,CAAAJ,OAAA,QAAAF,UAAA;IAxB7C;AACF;AACA;IAFE,IAAAO,gBAAA,CAAAL,OAAA,wBAGe,EAAE;IAAA,IAAAK,gBAAA,CAAAL,OAAA;IAAA,IAAAK,gBAAA,CAAAL,OAAA;IAAA,IAAAK,gBAAA,CAAAL,OAAA;IAAA,IAAAK,gBAAA,CAAAL,OAAA;IAAA,IAAAK,gBAAA,CAAAL,OAAA;IAAA,IAAAK,gBAAA,CAAAL,OAAA;IAsBf;IACA,IAAI,CAACM,UAAU,GAAGC,MAAM,CAACC,WAAW,CAAC,IAAI,CAACC,kBAAkB,CAACC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,IAAI,C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G,IAAI;IAChD;;IAEA;AACF;AACA;AACA;AACA;EAJE;IAAAN,GAAA;IAAAC,KAAA,EAKA,SAAAG,YAAA,EAAsB;MACpB,IAAI,CAAChB,KAAK,CAAC2C,OAAO,CAAC;QACjBC,MAAM,EAAE,MAAM;QACdC,OAAO,EAAE,kBAAkB;QAC3BC,QAAQ,EAAE,WAAW;QACrBC,OAAO,EAAE;UACPf,IAAI,EAAE,aAAa;UACnBgB,KAAK,EAAEC,kBAAW,CAACC;QACrB,CAAC;QACDC,IAAI,EAAE;UACJC,OAAO,EAAE,CACP;YACEpB,IAAI,EAAE,QAAQ;YACdqB,OAAO,EAAE,OAAO;YAChBC,MAAM,EAAE,IAAI,CAACtD,KAAK,CAACuD,QAAQ,CAACC,MAAM,CAACF,MAAM;YACzCrD,SAAS,EAAE,IAAI,CAACA,SAAS;YACzBC,aAAa,EAAE,IAAI,CAACA,aAAa;YACjCsC,YAAY,EAAE,IAAI,CAACA,YAAY;YAC/BpB,IAAI,EAAE,IAAI,CAACN;UACb,CAAC;QAEL;MACF,CAAC,CAAC;IACJ;EAAC;EAAA,OAAAjB,UAAA;AAAA"}
@@ -1,36 +0,0 @@
1
- declare const STATS_DEFAULT: {
2
- encryption: string;
3
- bandwidth: {
4
- systemBandwidth: number;
5
- sentPerSecond: number;
6
- encodedPerSecond: number;
7
- helper: {
8
- audioBytesSent: number;
9
- videoBytestSent: number;
10
- };
11
- speed: number;
12
- };
13
- results: {};
14
- connectionType: {
15
- systemNetworkType: string;
16
- systemIpAddress: string;
17
- local: {
18
- candidateType: any[];
19
- transport: any[];
20
- ipAddress: any[];
21
- networkType: any[];
22
- };
23
- remote: {
24
- candidateType: any[];
25
- transport: any[];
26
- ipAddress: any[];
27
- networkType: any[];
28
- };
29
- };
30
- resolutions: {};
31
- internal: {
32
- remote: {};
33
- candidates: {};
34
- };
35
- };
36
- export default STATS_DEFAULT;