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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/dist/breakouts/breakout.js +1 -1
  2. package/dist/breakouts/index.js +70 -6
  3. package/dist/breakouts/index.js.map +1 -1
  4. package/dist/common/errors/webex-errors.js +12 -2
  5. package/dist/common/errors/webex-errors.js.map +1 -1
  6. package/dist/config.js +5 -1
  7. package/dist/config.js.map +1 -1
  8. package/dist/constants.js +23 -123
  9. package/dist/constants.js.map +1 -1
  10. package/dist/controls-options-manager/enums.js +2 -0
  11. package/dist/controls-options-manager/enums.js.map +1 -1
  12. package/dist/controls-options-manager/types.js.map +1 -1
  13. package/dist/controls-options-manager/util.js +52 -0
  14. package/dist/controls-options-manager/util.js.map +1 -1
  15. package/dist/interpretation/index.js +4 -4
  16. package/dist/interpretation/index.js.map +1 -1
  17. package/dist/interpretation/siLanguage.js +1 -1
  18. package/dist/locus-info/controlsUtils.js +31 -11
  19. package/dist/locus-info/controlsUtils.js.map +1 -1
  20. package/dist/locus-info/index.js +83 -12
  21. package/dist/locus-info/index.js.map +1 -1
  22. package/dist/locus-info/selfUtils.js +432 -418
  23. package/dist/locus-info/selfUtils.js.map +1 -1
  24. package/dist/media/index.js +17 -17
  25. package/dist/media/index.js.map +1 -1
  26. package/dist/media/properties.js +94 -6
  27. package/dist/media/properties.js.map +1 -1
  28. package/dist/meeting/brbState.js +9 -2
  29. package/dist/meeting/brbState.js.map +1 -1
  30. package/dist/meeting/in-meeting-actions.js +17 -1
  31. package/dist/meeting/in-meeting-actions.js.map +1 -1
  32. package/dist/meeting/index.js +661 -334
  33. package/dist/meeting/index.js.map +1 -1
  34. package/dist/meeting/locusMediaRequest.js +21 -22
  35. package/dist/meeting/locusMediaRequest.js.map +1 -1
  36. package/dist/meeting/muteState.js +4 -4
  37. package/dist/meeting/muteState.js.map +1 -1
  38. package/dist/meeting/request.js +30 -0
  39. package/dist/meeting/request.js.map +1 -1
  40. package/dist/meeting/request.type.js.map +1 -1
  41. package/dist/meeting/util.js +13 -2
  42. package/dist/meeting/util.js.map +1 -1
  43. package/dist/meeting-info/meeting-info-v2.js +373 -68
  44. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  45. package/dist/meeting-info/utilv2.js +5 -1
  46. package/dist/meeting-info/utilv2.js.map +1 -1
  47. package/dist/meetings/index.js +136 -1
  48. package/dist/meetings/index.js.map +1 -1
  49. package/dist/meetings/util.js +14 -0
  50. package/dist/meetings/util.js.map +1 -1
  51. package/dist/member/index.js +55 -9
  52. package/dist/member/index.js.map +1 -1
  53. package/dist/member/types.js +3 -0
  54. package/dist/member/types.js.map +1 -1
  55. package/dist/member/util.js +335 -353
  56. package/dist/member/util.js.map +1 -1
  57. package/dist/members/collection.js.map +1 -1
  58. package/dist/members/index.js +137 -29
  59. package/dist/members/index.js.map +1 -1
  60. package/dist/members/request.js +38 -0
  61. package/dist/members/request.js.map +1 -1
  62. package/dist/members/util.js +36 -1
  63. package/dist/members/util.js.map +1 -1
  64. package/dist/metrics/constants.js +10 -0
  65. package/dist/metrics/constants.js.map +1 -1
  66. package/dist/multistream/remoteMediaManager.js +40 -8
  67. package/dist/multistream/remoteMediaManager.js.map +1 -1
  68. package/dist/reachability/clusterReachability.js +63 -27
  69. package/dist/reachability/clusterReachability.js.map +1 -1
  70. package/dist/reachability/index.js +112 -47
  71. package/dist/reachability/index.js.map +1 -1
  72. package/dist/reachability/reachability.types.js +14 -0
  73. package/dist/reachability/reachability.types.js.map +1 -1
  74. package/dist/reachability/request.js +19 -3
  75. package/dist/reachability/request.js.map +1 -1
  76. package/dist/reconnection-manager/index.js +2 -2
  77. package/dist/reconnection-manager/index.js.map +1 -1
  78. package/dist/recording-controller/util.js +5 -5
  79. package/dist/recording-controller/util.js.map +1 -1
  80. package/dist/roap/index.js.map +1 -1
  81. package/dist/roap/turnDiscovery.js +45 -27
  82. package/dist/roap/turnDiscovery.js.map +1 -1
  83. package/dist/roap/types.js +17 -0
  84. package/dist/roap/types.js.map +1 -0
  85. package/dist/types/common/errors/webex-errors.d.ts +7 -1
  86. package/dist/types/config.d.ts +3 -0
  87. package/dist/types/constants.d.ts +16 -85
  88. package/dist/types/controls-options-manager/enums.d.ts +3 -1
  89. package/dist/types/controls-options-manager/types.d.ts +7 -1
  90. package/dist/types/locus-info/index.d.ts +3 -3
  91. package/dist/types/locus-info/selfUtils.d.ts +216 -1
  92. package/dist/types/media/properties.d.ts +15 -0
  93. package/dist/types/meeting/in-meeting-actions.d.ts +16 -0
  94. package/dist/types/meeting/index.d.ts +65 -1
  95. package/dist/types/meeting/muteState.d.ts +0 -1
  96. package/dist/types/meeting/request.d.ts +12 -1
  97. package/dist/types/meeting/request.type.d.ts +6 -0
  98. package/dist/types/meeting/util.d.ts +3 -1
  99. package/dist/types/meeting-info/meeting-info-v2.d.ts +82 -1
  100. package/dist/types/meetings/index.d.ts +57 -0
  101. package/dist/types/member/index.d.ts +21 -6
  102. package/dist/types/member/types.d.ts +73 -14
  103. package/dist/types/member/util.d.ts +156 -1
  104. package/dist/types/members/collection.d.ts +6 -5
  105. package/dist/types/members/index.d.ts +32 -43
  106. package/dist/types/members/request.d.ts +26 -0
  107. package/dist/types/members/util.d.ts +27 -0
  108. package/dist/types/metrics/constants.d.ts +10 -0
  109. package/dist/types/multistream/remoteMediaManager.d.ts +10 -1
  110. package/dist/types/reachability/clusterReachability.d.ts +15 -7
  111. package/dist/types/reachability/index.d.ts +10 -1
  112. package/dist/types/reachability/reachability.types.d.ts +5 -0
  113. package/dist/types/roap/index.d.ts +3 -2
  114. package/dist/types/roap/turnDiscovery.d.ts +5 -17
  115. package/dist/types/roap/types.d.ts +16 -0
  116. package/dist/webinar/index.js +2 -2
  117. package/dist/webinar/index.js.map +1 -1
  118. package/package.json +24 -23
  119. package/src/breakouts/index.ts +69 -0
  120. package/src/common/errors/webex-errors.ts +8 -1
  121. package/src/config.ts +3 -0
  122. package/src/constants.ts +24 -90
  123. package/src/controls-options-manager/enums.ts +2 -0
  124. package/src/controls-options-manager/types.ts +11 -1
  125. package/src/controls-options-manager/util.ts +62 -0
  126. package/src/interpretation/index.ts +3 -3
  127. package/src/locus-info/controlsUtils.ts +50 -14
  128. package/src/locus-info/index.ts +88 -13
  129. package/src/locus-info/selfUtils.ts +496 -442
  130. package/src/media/index.ts +23 -21
  131. package/src/media/properties.ts +96 -0
  132. package/src/meeting/brbState.ts +11 -2
  133. package/src/meeting/in-meeting-actions.ts +32 -0
  134. package/src/meeting/index.ts +449 -95
  135. package/src/meeting/locusMediaRequest.ts +27 -22
  136. package/src/meeting/muteState.ts +4 -4
  137. package/src/meeting/request.ts +36 -1
  138. package/src/meeting/request.type.ts +7 -0
  139. package/src/meeting/util.ts +11 -2
  140. package/src/meeting-info/meeting-info-v2.ts +254 -8
  141. package/src/meeting-info/utilv2.ts +5 -0
  142. package/src/meetings/index.ts +148 -1
  143. package/src/meetings/util.ts +18 -0
  144. package/src/member/index.ts +68 -22
  145. package/src/member/types.ts +82 -16
  146. package/src/member/util.ts +357 -350
  147. package/src/members/collection.ts +4 -3
  148. package/src/members/index.ts +137 -18
  149. package/src/members/request.ts +44 -0
  150. package/src/members/util.ts +43 -1
  151. package/src/metrics/constants.ts +10 -0
  152. package/src/multistream/remoteMediaManager.ts +32 -10
  153. package/src/reachability/clusterReachability.ts +73 -26
  154. package/src/reachability/index.ts +70 -1
  155. package/src/reachability/reachability.types.ts +6 -0
  156. package/src/reachability/request.ts +7 -0
  157. package/src/reconnection-manager/index.ts +2 -2
  158. package/src/recording-controller/util.ts +17 -13
  159. package/src/roap/index.ts +3 -7
  160. package/src/roap/turnDiscovery.ts +34 -39
  161. package/src/roap/types.ts +23 -0
  162. package/src/webinar/index.ts +1 -1
  163. package/test/unit/spec/breakouts/index.ts +167 -95
  164. package/test/unit/spec/controls-options-manager/util.js +120 -0
  165. package/test/unit/spec/interpretation/index.ts +39 -1
  166. package/test/unit/spec/locus-info/controlsUtils.js +139 -9
  167. package/test/unit/spec/locus-info/index.js +195 -73
  168. package/test/unit/spec/locus-info/selfUtils.js +98 -24
  169. package/test/unit/spec/media/index.ts +150 -18
  170. package/test/unit/spec/media/properties.ts +130 -0
  171. package/test/unit/spec/meeting/brbState.ts +40 -2
  172. package/test/unit/spec/meeting/in-meeting-actions.ts +19 -4
  173. package/test/unit/spec/meeting/index.js +754 -139
  174. package/test/unit/spec/meeting/locusMediaRequest.ts +95 -87
  175. package/test/unit/spec/meeting/muteState.js +73 -2
  176. package/test/unit/spec/meeting/request.js +32 -1
  177. package/test/unit/spec/meeting/utils.js +119 -18
  178. package/test/unit/spec/meeting-info/meetinginfov2.js +484 -114
  179. package/test/unit/spec/meeting-info/utilv2.js +19 -0
  180. package/test/unit/spec/meetings/index.js +146 -2
  181. package/test/unit/spec/member/index.js +7 -0
  182. package/test/unit/spec/member/util.js +24 -0
  183. package/test/unit/spec/members/index.js +304 -78
  184. package/test/unit/spec/members/request.js +68 -22
  185. package/test/unit/spec/members/utils.js +75 -0
  186. package/test/unit/spec/multistream/remoteMediaManager.ts +397 -118
  187. package/test/unit/spec/reachability/clusterReachability.ts +88 -56
  188. package/test/unit/spec/reachability/index.ts +101 -0
  189. package/test/unit/spec/reachability/request.js +47 -2
  190. package/test/unit/spec/reconnection-manager/index.js +4 -4
  191. package/test/unit/spec/roap/turnDiscovery.ts +110 -28
  192. package/test/unit/spec/webinar/index.ts +5 -0
  193. package/dist/annotation/annotation.types.d.ts +0 -42
  194. package/dist/annotation/constants.d.ts +0 -31
  195. package/dist/annotation/index.d.ts +0 -117
  196. package/dist/breakouts/breakout.d.ts +0 -8
  197. package/dist/breakouts/collection.d.ts +0 -5
  198. package/dist/breakouts/edit-lock-error.d.ts +0 -15
  199. package/dist/breakouts/events.d.ts +0 -8
  200. package/dist/breakouts/index.d.ts +0 -5
  201. package/dist/breakouts/request.d.ts +0 -22
  202. package/dist/breakouts/utils.d.ts +0 -15
  203. package/dist/common/browser-detection.d.ts +0 -9
  204. package/dist/common/collection.d.ts +0 -48
  205. package/dist/common/config.d.ts +0 -2
  206. package/dist/common/errors/captcha-error.d.ts +0 -15
  207. package/dist/common/errors/intent-to-join.d.ts +0 -16
  208. package/dist/common/errors/join-meeting.d.ts +0 -17
  209. package/dist/common/errors/media.d.ts +0 -15
  210. package/dist/common/errors/no-meeting-info.d.ts +0 -14
  211. package/dist/common/errors/parameter.d.ts +0 -15
  212. package/dist/common/errors/password-error.d.ts +0 -15
  213. package/dist/common/errors/permission.d.ts +0 -14
  214. package/dist/common/errors/reclaim-host-role-error.js +0 -149
  215. package/dist/common/errors/reclaim-host-role-error.js.map +0 -1
  216. package/dist/common/errors/reclaim-host-role-errors.d.ts +0 -60
  217. package/dist/common/errors/reconnection-in-progress.d.ts +0 -9
  218. package/dist/common/errors/reconnection-in-progress.js +0 -33
  219. package/dist/common/errors/reconnection-in-progress.js.map +0 -1
  220. package/dist/common/errors/reconnection.d.ts +0 -15
  221. package/dist/common/errors/stats.d.ts +0 -15
  222. package/dist/common/errors/webex-errors.d.ts +0 -93
  223. package/dist/common/errors/webex-meetings-error.d.ts +0 -20
  224. package/dist/common/events/events-scope.d.ts +0 -17
  225. package/dist/common/events/events.d.ts +0 -12
  226. package/dist/common/events/trigger-proxy.d.ts +0 -2
  227. package/dist/common/events/util.d.ts +0 -2
  228. package/dist/common/logs/logger-config.d.ts +0 -2
  229. package/dist/common/logs/logger-proxy.d.ts +0 -2
  230. package/dist/common/logs/request.d.ts +0 -36
  231. package/dist/common/queue.d.ts +0 -34
  232. package/dist/config.d.ts +0 -72
  233. package/dist/constants.d.ts +0 -1088
  234. package/dist/controls-options-manager/constants.d.ts +0 -4
  235. package/dist/controls-options-manager/enums.d.ts +0 -15
  236. package/dist/controls-options-manager/index.d.ts +0 -136
  237. package/dist/controls-options-manager/types.d.ts +0 -43
  238. package/dist/controls-options-manager/util.d.ts +0 -1
  239. package/dist/index.d.ts +0 -7
  240. package/dist/interceptors/index.d.ts +0 -2
  241. package/dist/interceptors/locusRetry.d.ts +0 -27
  242. package/dist/interpretation/collection.d.ts +0 -5
  243. package/dist/interpretation/index.d.ts +0 -5
  244. package/dist/interpretation/siLanguage.d.ts +0 -5
  245. package/dist/locus-info/controlsUtils.d.ts +0 -2
  246. package/dist/locus-info/embeddedAppsUtils.d.ts +0 -2
  247. package/dist/locus-info/fullState.d.ts +0 -2
  248. package/dist/locus-info/hostUtils.d.ts +0 -2
  249. package/dist/locus-info/index.d.ts +0 -322
  250. package/dist/locus-info/infoUtils.d.ts +0 -2
  251. package/dist/locus-info/mediaSharesUtils.d.ts +0 -2
  252. package/dist/locus-info/parser.d.ts +0 -272
  253. package/dist/locus-info/selfUtils.d.ts +0 -2
  254. package/dist/media/index.d.ts +0 -34
  255. package/dist/media/properties.d.ts +0 -93
  256. package/dist/media/util.d.ts +0 -2
  257. package/dist/mediaQualityMetrics/config.d.ts +0 -241
  258. package/dist/mediaQualityMetrics/config.js +0 -502
  259. package/dist/mediaQualityMetrics/config.js.map +0 -1
  260. package/dist/meeting/effectsState.js +0 -260
  261. package/dist/meeting/effectsState.js.map +0 -1
  262. package/dist/meeting/in-meeting-actions.d.ts +0 -167
  263. package/dist/meeting/index.d.ts +0 -1825
  264. package/dist/meeting/locusMediaRequest.d.ts +0 -74
  265. package/dist/meeting/muteState.d.ts +0 -178
  266. package/dist/meeting/request.d.ts +0 -295
  267. package/dist/meeting/request.type.d.ts +0 -11
  268. package/dist/meeting/state.d.ts +0 -9
  269. package/dist/meeting/util.d.ts +0 -119
  270. package/dist/meeting/voicea-meeting.d.ts +0 -16
  271. package/dist/meeting-info/collection.d.ts +0 -20
  272. package/dist/meeting-info/index.d.ts +0 -69
  273. package/dist/meeting-info/meeting-info-v2.d.ts +0 -123
  274. package/dist/meeting-info/request.d.ts +0 -22
  275. package/dist/meeting-info/util.d.ts +0 -2
  276. package/dist/meeting-info/utilv2.d.ts +0 -2
  277. package/dist/meetings/collection.d.ts +0 -40
  278. package/dist/meetings/index.d.ts +0 -390
  279. package/dist/meetings/meetings.types.d.ts +0 -4
  280. package/dist/meetings/request.d.ts +0 -27
  281. package/dist/meetings/util.d.ts +0 -18
  282. package/dist/member/index.d.ts +0 -160
  283. package/dist/member/member.types.js +0 -17
  284. package/dist/member/member.types.js.map +0 -1
  285. package/dist/member/types.d.ts +0 -32
  286. package/dist/member/util.d.ts +0 -2
  287. package/dist/members/collection.d.ts +0 -29
  288. package/dist/members/index.d.ts +0 -353
  289. package/dist/members/request.d.ts +0 -114
  290. package/dist/members/types.d.ts +0 -25
  291. package/dist/members/util.d.ts +0 -215
  292. package/dist/metrics/config.js +0 -276
  293. package/dist/metrics/config.js.map +0 -1
  294. package/dist/metrics/constants.d.ts +0 -70
  295. package/dist/metrics/index.d.ts +0 -45
  296. package/dist/multistream/mediaRequestManager.d.ts +0 -119
  297. package/dist/multistream/receiveSlot.d.ts +0 -68
  298. package/dist/multistream/receiveSlotManager.d.ts +0 -56
  299. package/dist/multistream/remoteMedia.d.ts +0 -72
  300. package/dist/multistream/remoteMediaGroup.d.ts +0 -49
  301. package/dist/multistream/remoteMediaManager.d.ts +0 -300
  302. package/dist/multistream/sendSlotManager.d.ts +0 -69
  303. package/dist/networkQualityMonitor/index.d.ts +0 -70
  304. package/dist/networkQualityMonitor/index.js +0 -221
  305. package/dist/networkQualityMonitor/index.js.map +0 -1
  306. package/dist/peer-connection-manager/index.js +0 -671
  307. package/dist/peer-connection-manager/index.js.map +0 -1
  308. package/dist/peer-connection-manager/util.js +0 -109
  309. package/dist/peer-connection-manager/util.js.map +0 -1
  310. package/dist/personal-meeting-room/index.d.ts +0 -47
  311. package/dist/personal-meeting-room/request.d.ts +0 -14
  312. package/dist/personal-meeting-room/util.d.ts +0 -2
  313. package/dist/reachability/clusterReachability.d.ts +0 -109
  314. package/dist/reachability/index.d.ts +0 -105
  315. package/dist/reachability/request.d.ts +0 -39
  316. package/dist/reachability/util.d.ts +0 -8
  317. package/dist/reactions/constants.d.ts +0 -3
  318. package/dist/reactions/reactions.d.ts +0 -4
  319. package/dist/reactions/reactions.type.d.ts +0 -52
  320. package/dist/reconnection-manager/index.d.ts +0 -136
  321. package/dist/recording-controller/enums.d.ts +0 -7
  322. package/dist/recording-controller/index.d.ts +0 -207
  323. package/dist/recording-controller/util.d.ts +0 -14
  324. package/dist/roap/collection.js +0 -62
  325. package/dist/roap/collection.js.map +0 -1
  326. package/dist/roap/handler.js +0 -275
  327. package/dist/roap/handler.js.map +0 -1
  328. package/dist/roap/index.d.ts +0 -86
  329. package/dist/roap/request.d.ts +0 -39
  330. package/dist/roap/state.js +0 -126
  331. package/dist/roap/state.js.map +0 -1
  332. package/dist/roap/turnDiscovery.d.ts +0 -155
  333. package/dist/roap/util.js +0 -75
  334. package/dist/roap/util.js.map +0 -1
  335. package/dist/rtcMetrics/constants.d.ts +0 -4
  336. package/dist/rtcMetrics/constants.js +0 -11
  337. package/dist/rtcMetrics/constants.js.map +0 -1
  338. package/dist/rtcMetrics/index.d.ts +0 -61
  339. package/dist/rtcMetrics/index.js +0 -197
  340. package/dist/rtcMetrics/index.js.map +0 -1
  341. package/dist/statsAnalyzer/global.d.ts +0 -36
  342. package/dist/statsAnalyzer/global.js +0 -126
  343. package/dist/statsAnalyzer/global.js.map +0 -1
  344. package/dist/statsAnalyzer/index.d.ts +0 -217
  345. package/dist/statsAnalyzer/index.js +0 -1013
  346. package/dist/statsAnalyzer/index.js.map +0 -1
  347. package/dist/statsAnalyzer/mqaUtil.d.ts +0 -48
  348. package/dist/statsAnalyzer/mqaUtil.js +0 -179
  349. package/dist/statsAnalyzer/mqaUtil.js.map +0 -1
  350. package/dist/transcription/index.d.ts +0 -64
  351. package/dist/types/common/errors/reconnection-in-progress.d.ts +0 -9
  352. package/dist/types/mediaQualityMetrics/config.d.ts +0 -241
  353. package/dist/types/networkQualityMonitor/index.d.ts +0 -70
  354. package/dist/types/rtcMetrics/constants.d.ts +0 -4
  355. package/dist/types/rtcMetrics/index.d.ts +0 -71
  356. package/dist/types/statsAnalyzer/global.d.ts +0 -36
  357. package/dist/types/statsAnalyzer/index.d.ts +0 -217
  358. package/dist/types/statsAnalyzer/mqaUtil.d.ts +0 -48
  359. package/dist/webinar/collection.d.ts +0 -16
  360. 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,EAAEC,IAAI;EAA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A,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,CAAC;IACnF,IAAI,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AEA;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;