@webex/plugin-meetings 3.0.0-beta.11 → 3.0.0-beta.111

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 (512) hide show
  1. package/UPGRADING.md +9 -9
  2. package/browsers.js +19 -24
  3. package/dist/annotation/annotation.types.js +7 -0
  4. package/dist/annotation/annotation.types.js.map +1 -0
  5. package/dist/annotation/constants.js +48 -0
  6. package/dist/annotation/constants.js.map +1 -0
  7. package/dist/annotation/index.js +357 -0
  8. package/dist/annotation/index.js.map +1 -0
  9. package/dist/breakouts/breakout.js +176 -0
  10. package/dist/breakouts/breakout.js.map +1 -0
  11. package/dist/breakouts/collection.js +23 -0
  12. package/dist/breakouts/collection.js.map +1 -0
  13. package/dist/breakouts/edit-lock-error.js +52 -0
  14. package/dist/breakouts/edit-lock-error.js.map +1 -0
  15. package/dist/breakouts/events.js +43 -0
  16. package/dist/breakouts/events.js.map +1 -0
  17. package/dist/breakouts/index.js +944 -0
  18. package/dist/breakouts/index.js.map +1 -0
  19. package/dist/breakouts/request.js +78 -0
  20. package/dist/breakouts/request.js.map +1 -0
  21. package/dist/breakouts/utils.js +67 -0
  22. package/dist/breakouts/utils.js.map +1 -0
  23. package/dist/common/browser-detection.js +1 -20
  24. package/dist/common/browser-detection.js.map +1 -1
  25. package/dist/common/collection.js +5 -20
  26. package/dist/common/collection.js.map +1 -1
  27. package/dist/common/config.js +0 -7
  28. package/dist/common/config.js.map +1 -1
  29. package/dist/common/errors/captcha-error.js +5 -26
  30. package/dist/common/errors/captcha-error.js.map +1 -1
  31. package/dist/common/errors/intent-to-join.js +5 -26
  32. package/dist/common/errors/intent-to-join.js.map +1 -1
  33. package/dist/common/errors/join-meeting.js +6 -27
  34. package/dist/common/errors/join-meeting.js.map +1 -1
  35. package/dist/common/errors/media.js +5 -26
  36. package/dist/common/errors/media.js.map +1 -1
  37. package/dist/common/errors/parameter.js +5 -33
  38. package/dist/common/errors/parameter.js.map +1 -1
  39. package/dist/common/errors/password-error.js +5 -26
  40. package/dist/common/errors/password-error.js.map +1 -1
  41. package/dist/common/errors/permission.js +4 -25
  42. package/dist/common/errors/permission.js.map +1 -1
  43. package/dist/common/errors/reconnection-in-progress.js +0 -17
  44. package/dist/common/errors/reconnection-in-progress.js.map +1 -1
  45. package/dist/common/errors/reconnection.js +5 -26
  46. package/dist/common/errors/reconnection.js.map +1 -1
  47. package/dist/common/errors/stats.js +5 -26
  48. package/dist/common/errors/stats.js.map +1 -1
  49. package/dist/common/errors/webex-errors.js +6 -41
  50. package/dist/common/errors/webex-errors.js.map +1 -1
  51. package/dist/common/errors/webex-meetings-error.js +1 -24
  52. package/dist/common/errors/webex-meetings-error.js.map +1 -1
  53. package/dist/common/events/events-scope.js +0 -22
  54. package/dist/common/events/events-scope.js.map +1 -1
  55. package/dist/common/events/events.js +0 -23
  56. package/dist/common/events/events.js.map +1 -1
  57. package/dist/common/events/trigger-proxy.js +0 -12
  58. package/dist/common/events/trigger-proxy.js.map +1 -1
  59. package/dist/common/events/util.js +0 -15
  60. package/dist/common/events/util.js.map +1 -1
  61. package/dist/common/logs/logger-config.js +0 -4
  62. package/dist/common/logs/logger-config.js.map +1 -1
  63. package/dist/common/logs/logger-proxy.js +1 -8
  64. package/dist/common/logs/logger-proxy.js.map +1 -1
  65. package/dist/common/logs/request.js +35 -61
  66. package/dist/common/logs/request.js.map +1 -1
  67. package/dist/common/queue.js +4 -14
  68. package/dist/common/queue.js.map +1 -1
  69. package/dist/config.js +6 -6
  70. package/dist/config.js.map +1 -1
  71. package/dist/constants.js +193 -53
  72. package/dist/constants.js.map +1 -1
  73. package/dist/controls-options-manager/constants.js +14 -0
  74. package/dist/controls-options-manager/constants.js.map +1 -0
  75. package/dist/controls-options-manager/enums.js +27 -0
  76. package/dist/controls-options-manager/enums.js.map +1 -0
  77. package/dist/controls-options-manager/index.js +297 -0
  78. package/dist/controls-options-manager/index.js.map +1 -0
  79. package/dist/controls-options-manager/types.js +7 -0
  80. package/dist/controls-options-manager/types.js.map +1 -0
  81. package/dist/controls-options-manager/util.js +286 -0
  82. package/dist/controls-options-manager/util.js.map +1 -0
  83. package/dist/index.js +72 -17
  84. package/dist/index.js.map +1 -1
  85. package/dist/locus-info/controlsUtils.js +94 -29
  86. package/dist/locus-info/controlsUtils.js.map +1 -1
  87. package/dist/locus-info/embeddedAppsUtils.js +3 -26
  88. package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
  89. package/dist/locus-info/fullState.js +0 -15
  90. package/dist/locus-info/fullState.js.map +1 -1
  91. package/dist/locus-info/hostUtils.js +4 -12
  92. package/dist/locus-info/hostUtils.js.map +1 -1
  93. package/dist/locus-info/index.js +383 -212
  94. package/dist/locus-info/index.js.map +1 -1
  95. package/dist/locus-info/infoUtils.js +0 -38
  96. package/dist/locus-info/infoUtils.js.map +1 -1
  97. package/dist/locus-info/mediaSharesUtils.js +12 -38
  98. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  99. package/dist/locus-info/parser.js +88 -123
  100. package/dist/locus-info/parser.js.map +1 -1
  101. package/dist/locus-info/selfUtils.js +99 -91
  102. package/dist/locus-info/selfUtils.js.map +1 -1
  103. package/dist/media/index.js +62 -147
  104. package/dist/media/index.js.map +1 -1
  105. package/dist/media/properties.js +71 -117
  106. package/dist/media/properties.js.map +1 -1
  107. package/dist/media/util.js +2 -9
  108. package/dist/media/util.js.map +1 -1
  109. package/dist/mediaQualityMetrics/config.js +505 -495
  110. package/dist/mediaQualityMetrics/config.js.map +1 -1
  111. package/dist/meeting/in-meeting-actions.js +67 -14
  112. package/dist/meeting/in-meeting-actions.js.map +1 -1
  113. package/dist/meeting/index.js +2477 -2417
  114. package/dist/meeting/index.js.map +1 -1
  115. package/dist/meeting/muteState.js +252 -113
  116. package/dist/meeting/muteState.js.map +1 -1
  117. package/dist/meeting/request.js +296 -289
  118. package/dist/meeting/request.js.map +1 -1
  119. package/dist/meeting/request.type.js +7 -0
  120. package/dist/meeting/request.type.js.map +1 -0
  121. package/dist/meeting/state.js +21 -31
  122. package/dist/meeting/state.js.map +1 -1
  123. package/dist/meeting/util.js +58 -217
  124. package/dist/meeting/util.js.map +1 -1
  125. package/dist/meeting-info/collection.js +3 -25
  126. package/dist/meeting-info/collection.js.map +1 -1
  127. package/dist/meeting-info/index.js +10 -33
  128. package/dist/meeting-info/index.js.map +1 -1
  129. package/dist/meeting-info/meeting-info-v2.js +278 -281
  130. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  131. package/dist/meeting-info/request.js +1 -16
  132. package/dist/meeting-info/request.js.map +1 -1
  133. package/dist/meeting-info/util.js +98 -183
  134. package/dist/meeting-info/util.js.map +1 -1
  135. package/dist/meeting-info/utilv2.js +155 -232
  136. package/dist/meeting-info/utilv2.js.map +1 -1
  137. package/dist/meetings/collection.js +24 -20
  138. package/dist/meetings/collection.js.map +1 -1
  139. package/dist/meetings/index.js +675 -593
  140. package/dist/meetings/index.js.map +1 -1
  141. package/dist/meetings/request.js +23 -42
  142. package/dist/meetings/request.js.map +1 -1
  143. package/dist/meetings/util.js +177 -155
  144. package/dist/meetings/util.js.map +1 -1
  145. package/dist/member/index.js +89 -88
  146. package/dist/member/index.js.map +1 -1
  147. package/dist/member/types.js +15 -0
  148. package/dist/member/types.js.map +1 -0
  149. package/dist/member/util.js +101 -69
  150. package/dist/member/util.js.map +1 -1
  151. package/dist/members/collection.js +12 -12
  152. package/dist/members/collection.js.map +1 -1
  153. package/dist/members/index.js +162 -204
  154. package/dist/members/index.js.map +1 -1
  155. package/dist/members/request.js +58 -53
  156. package/dist/members/request.js.map +1 -1
  157. package/dist/members/types.js +15 -0
  158. package/dist/members/types.js.map +1 -0
  159. package/dist/members/util.js +107 -44
  160. package/dist/members/util.js.map +1 -1
  161. package/dist/metrics/config.js +50 -16
  162. package/dist/metrics/config.js.map +1 -1
  163. package/dist/metrics/constants.js +3 -7
  164. package/dist/metrics/constants.js.map +1 -1
  165. package/dist/metrics/index.js +93 -162
  166. package/dist/metrics/index.js.map +1 -1
  167. package/dist/multistream/mediaRequestManager.js +167 -50
  168. package/dist/multistream/mediaRequestManager.js.map +1 -1
  169. package/dist/multistream/receiveSlot.js +58 -65
  170. package/dist/multistream/receiveSlot.js.map +1 -1
  171. package/dist/multistream/receiveSlotManager.js +74 -93
  172. package/dist/multistream/receiveSlotManager.js.map +1 -1
  173. package/dist/multistream/remoteMedia.js +55 -74
  174. package/dist/multistream/remoteMedia.js.map +1 -1
  175. package/dist/multistream/remoteMediaGroup.js +6 -40
  176. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  177. package/dist/multistream/remoteMediaManager.js +466 -442
  178. package/dist/multistream/remoteMediaManager.js.map +1 -1
  179. package/dist/networkQualityMonitor/index.js +32 -59
  180. package/dist/networkQualityMonitor/index.js.map +1 -1
  181. package/dist/personal-meeting-room/index.js +10 -45
  182. package/dist/personal-meeting-room/index.js.map +1 -1
  183. package/dist/personal-meeting-room/request.js +2 -33
  184. package/dist/personal-meeting-room/request.js.map +1 -1
  185. package/dist/personal-meeting-room/util.js +0 -13
  186. package/dist/personal-meeting-room/util.js.map +1 -1
  187. package/dist/reachability/index.js +190 -199
  188. package/dist/reachability/index.js.map +1 -1
  189. package/dist/reachability/request.js +14 -23
  190. package/dist/reachability/request.js.map +1 -1
  191. package/dist/reactions/constants.js +13 -0
  192. package/dist/reactions/constants.js.map +1 -0
  193. package/dist/reactions/reactions.js +2 -4
  194. package/dist/reactions/reactions.js.map +1 -1
  195. package/dist/reactions/reactions.type.js +19 -23
  196. package/dist/reactions/reactions.type.js.map +1 -1
  197. package/dist/reconnection-manager/index.js +326 -465
  198. package/dist/reconnection-manager/index.js.map +1 -1
  199. package/dist/recording-controller/enums.js +17 -0
  200. package/dist/recording-controller/enums.js.map +1 -0
  201. package/dist/recording-controller/index.js +343 -0
  202. package/dist/recording-controller/index.js.map +1 -0
  203. package/dist/recording-controller/util.js +63 -0
  204. package/dist/recording-controller/util.js.map +1 -0
  205. package/dist/roap/index.js +38 -67
  206. package/dist/roap/index.js.map +1 -1
  207. package/dist/roap/request.js +143 -134
  208. package/dist/roap/request.js.map +1 -1
  209. package/dist/roap/turnDiscovery.js +149 -101
  210. package/dist/roap/turnDiscovery.js.map +1 -1
  211. package/dist/statsAnalyzer/global.js +1 -95
  212. package/dist/statsAnalyzer/global.js.map +1 -1
  213. package/dist/statsAnalyzer/index.js +369 -461
  214. package/dist/statsAnalyzer/index.js.map +1 -1
  215. package/dist/statsAnalyzer/mqaUtil.js +144 -94
  216. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  217. package/dist/transcription/index.js +13 -45
  218. package/dist/transcription/index.js.map +1 -1
  219. package/dist/types/annotation/annotation.types.d.ts +34 -0
  220. package/dist/types/annotation/constants.d.ts +31 -0
  221. package/dist/types/annotation/index.d.ts +124 -0
  222. package/dist/types/breakouts/breakout.d.ts +8 -0
  223. package/dist/types/breakouts/collection.d.ts +5 -0
  224. package/dist/types/breakouts/edit-lock-error.d.ts +15 -0
  225. package/dist/types/breakouts/events.d.ts +2 -0
  226. package/dist/types/breakouts/index.d.ts +5 -0
  227. package/dist/types/breakouts/request.d.ts +22 -0
  228. package/dist/types/breakouts/utils.d.ts +15 -0
  229. package/dist/types/common/browser-detection.d.ts +9 -0
  230. package/dist/types/common/collection.d.ts +48 -0
  231. package/dist/types/common/config.d.ts +2 -0
  232. package/dist/types/common/errors/captcha-error.d.ts +15 -0
  233. package/dist/types/common/errors/intent-to-join.d.ts +16 -0
  234. package/dist/types/common/errors/join-meeting.d.ts +17 -0
  235. package/dist/types/common/errors/media.d.ts +15 -0
  236. package/dist/types/common/errors/parameter.d.ts +15 -0
  237. package/dist/types/common/errors/password-error.d.ts +15 -0
  238. package/dist/types/common/errors/permission.d.ts +14 -0
  239. package/dist/types/common/errors/reconnection-in-progress.d.ts +9 -0
  240. package/dist/types/common/errors/reconnection.d.ts +15 -0
  241. package/dist/types/common/errors/stats.d.ts +15 -0
  242. package/dist/types/common/errors/webex-errors.d.ts +69 -0
  243. package/dist/types/common/errors/webex-meetings-error.d.ts +20 -0
  244. package/dist/types/common/events/events-scope.d.ts +17 -0
  245. package/dist/types/common/events/events.d.ts +12 -0
  246. package/dist/types/common/events/trigger-proxy.d.ts +2 -0
  247. package/dist/types/common/events/util.d.ts +2 -0
  248. package/dist/types/common/logs/logger-config.d.ts +2 -0
  249. package/dist/types/common/logs/logger-proxy.d.ts +2 -0
  250. package/dist/types/common/logs/request.d.ts +34 -0
  251. package/dist/types/common/queue.d.ts +32 -0
  252. package/dist/types/config.d.ts +78 -0
  253. package/dist/types/constants.d.ts +984 -0
  254. package/dist/types/controls-options-manager/constants.d.ts +4 -0
  255. package/dist/types/controls-options-manager/enums.d.ts +15 -0
  256. package/dist/types/controls-options-manager/index.d.ts +136 -0
  257. package/dist/types/controls-options-manager/types.d.ts +43 -0
  258. package/dist/types/controls-options-manager/util.d.ts +1 -0
  259. package/dist/types/index.d.ts +7 -0
  260. package/dist/types/locus-info/controlsUtils.d.ts +2 -0
  261. package/dist/types/locus-info/embeddedAppsUtils.d.ts +2 -0
  262. package/dist/types/locus-info/fullState.d.ts +2 -0
  263. package/dist/types/locus-info/hostUtils.d.ts +2 -0
  264. package/dist/types/locus-info/index.d.ts +315 -0
  265. package/dist/types/locus-info/infoUtils.d.ts +2 -0
  266. package/dist/types/locus-info/mediaSharesUtils.d.ts +2 -0
  267. package/dist/types/locus-info/parser.d.ts +212 -0
  268. package/dist/types/locus-info/selfUtils.d.ts +2 -0
  269. package/dist/types/media/index.d.ts +34 -0
  270. package/dist/types/media/properties.d.ts +108 -0
  271. package/dist/types/media/util.d.ts +2 -0
  272. package/dist/types/mediaQualityMetrics/config.d.ts +365 -0
  273. package/dist/types/meeting/in-meeting-actions.d.ts +137 -0
  274. package/dist/types/meeting/index.d.ts +1753 -0
  275. package/dist/types/meeting/muteState.d.ts +185 -0
  276. package/dist/types/meeting/request.d.ts +275 -0
  277. package/dist/types/meeting/request.type.d.ts +11 -0
  278. package/dist/types/meeting/state.d.ts +9 -0
  279. package/dist/types/meeting/util.d.ts +2 -0
  280. package/dist/types/meeting-info/collection.d.ts +20 -0
  281. package/dist/types/meeting-info/index.d.ts +57 -0
  282. package/dist/types/meeting-info/meeting-info-v2.d.ts +115 -0
  283. package/dist/types/meeting-info/request.d.ts +22 -0
  284. package/dist/types/meeting-info/util.d.ts +2 -0
  285. package/dist/types/meeting-info/utilv2.d.ts +2 -0
  286. package/dist/types/meetings/collection.d.ts +31 -0
  287. package/dist/types/meetings/index.d.ts +345 -0
  288. package/dist/types/meetings/request.d.ts +27 -0
  289. package/dist/types/meetings/util.d.ts +18 -0
  290. package/dist/types/member/index.d.ts +157 -0
  291. package/dist/types/member/types.d.ts +21 -0
  292. package/dist/types/member/util.d.ts +2 -0
  293. package/dist/types/members/collection.d.ts +29 -0
  294. package/dist/types/members/index.d.ts +353 -0
  295. package/dist/types/members/request.d.ts +69 -0
  296. package/dist/types/members/types.d.ts +24 -0
  297. package/dist/types/members/util.d.ts +2 -0
  298. package/dist/types/metrics/config.d.ts +195 -0
  299. package/dist/types/metrics/constants.d.ts +54 -0
  300. package/dist/types/metrics/index.d.ts +169 -0
  301. package/dist/types/multistream/mediaRequestManager.d.ts +101 -0
  302. package/dist/types/multistream/receiveSlot.d.ts +68 -0
  303. package/dist/types/multistream/receiveSlotManager.d.ts +56 -0
  304. package/dist/types/multistream/remoteMedia.d.ts +72 -0
  305. package/dist/types/multistream/remoteMediaGroup.d.ts +47 -0
  306. package/dist/types/multistream/remoteMediaManager.d.ts +263 -0
  307. package/dist/types/networkQualityMonitor/index.d.ts +70 -0
  308. package/dist/types/personal-meeting-room/index.d.ts +47 -0
  309. package/dist/types/personal-meeting-room/request.d.ts +14 -0
  310. package/dist/types/personal-meeting-room/util.d.ts +2 -0
  311. package/dist/types/reachability/index.d.ts +152 -0
  312. package/dist/types/reachability/request.d.ts +37 -0
  313. package/dist/types/reactions/constants.d.ts +3 -0
  314. package/dist/types/reactions/reactions.d.ts +4 -0
  315. package/dist/types/reactions/reactions.type.d.ts +52 -0
  316. package/dist/types/reconnection-manager/index.d.ts +126 -0
  317. package/dist/types/recording-controller/enums.d.ts +7 -0
  318. package/dist/types/recording-controller/index.d.ts +193 -0
  319. package/dist/types/recording-controller/util.d.ts +13 -0
  320. package/dist/types/roap/index.d.ts +77 -0
  321. package/dist/types/roap/request.d.ts +38 -0
  322. package/dist/types/roap/turnDiscovery.d.ts +88 -0
  323. package/dist/types/statsAnalyzer/global.d.ts +36 -0
  324. package/dist/types/statsAnalyzer/index.d.ts +200 -0
  325. package/dist/types/statsAnalyzer/mqaUtil.d.ts +24 -0
  326. package/dist/types/transcription/index.d.ts +64 -0
  327. package/internal-README.md +7 -6
  328. package/package.json +28 -21
  329. package/src/annotation/annotation.types.ts +41 -0
  330. package/src/annotation/constants.ts +36 -0
  331. package/src/annotation/index.ts +339 -0
  332. package/src/breakouts/README.md +220 -0
  333. package/src/breakouts/breakout.ts +141 -0
  334. package/src/breakouts/collection.ts +19 -0
  335. package/src/breakouts/edit-lock-error.ts +25 -0
  336. package/src/breakouts/events.ts +37 -0
  337. package/src/breakouts/index.ts +835 -0
  338. package/src/breakouts/request.ts +55 -0
  339. package/src/breakouts/utils.ts +57 -0
  340. package/src/common/browser-detection.ts +9 -6
  341. package/src/common/collection.ts +3 -1
  342. package/src/common/errors/captcha-error.ts +6 -6
  343. package/src/common/errors/intent-to-join.ts +6 -6
  344. package/src/common/errors/join-meeting.ts +12 -8
  345. package/src/common/errors/media.ts +6 -6
  346. package/src/common/errors/parameter.ts +9 -6
  347. package/src/common/errors/password-error.ts +6 -6
  348. package/src/common/errors/permission.ts +5 -5
  349. package/src/common/errors/reconnection.ts +6 -6
  350. package/src/common/errors/stats.ts +6 -6
  351. package/src/common/errors/webex-errors.ts +7 -5
  352. package/src/common/errors/webex-meetings-error.ts +1 -1
  353. package/src/common/events/events-scope.ts +5 -1
  354. package/src/common/events/events.ts +5 -1
  355. package/src/common/events/trigger-proxy.ts +8 -3
  356. package/src/common/events/util.ts +1 -2
  357. package/src/common/logs/logger-proxy.ts +21 -10
  358. package/src/common/logs/request.ts +11 -8
  359. package/src/config.ts +16 -12
  360. package/src/constants.ts +141 -6
  361. package/src/controls-options-manager/constants.ts +5 -0
  362. package/src/controls-options-manager/enums.ts +18 -0
  363. package/src/controls-options-manager/index.ts +278 -0
  364. package/src/controls-options-manager/types.ts +59 -0
  365. package/src/controls-options-manager/util.ts +274 -0
  366. package/src/index.ts +33 -0
  367. package/src/locus-info/controlsUtils.ts +145 -24
  368. package/src/locus-info/fullState.ts +15 -11
  369. package/src/locus-info/hostUtils.ts +4 -3
  370. package/src/locus-info/index.ts +326 -55
  371. package/src/locus-info/infoUtils.ts +12 -4
  372. package/src/locus-info/mediaSharesUtils.ts +4 -4
  373. package/src/locus-info/parser.ts +46 -68
  374. package/src/locus-info/selfUtils.ts +187 -56
  375. package/src/media/index.ts +142 -172
  376. package/src/media/properties.ts +43 -36
  377. package/src/media/util.ts +1 -1
  378. package/src/mediaQualityMetrics/config.ts +380 -378
  379. package/src/meeting/in-meeting-actions.ts +139 -3
  380. package/src/meeting/index.ts +2674 -1543
  381. package/src/meeting/muteState.ts +271 -68
  382. package/src/meeting/request.ts +231 -135
  383. package/src/meeting/request.type.ts +13 -0
  384. package/src/meeting/state.ts +45 -30
  385. package/src/meeting/util.ts +119 -110
  386. package/src/meeting-info/collection.ts +2 -1
  387. package/src/meeting-info/index.ts +32 -30
  388. package/src/meeting-info/meeting-info-v2.ts +201 -113
  389. package/src/meeting-info/request.ts +9 -3
  390. package/src/meeting-info/util.ts +54 -46
  391. package/src/meeting-info/utilv2.ts +70 -55
  392. package/src/meetings/collection.ts +21 -1
  393. package/src/meetings/index.ts +749 -437
  394. package/src/meetings/request.ts +29 -25
  395. package/src/meetings/util.ts +122 -33
  396. package/src/member/index.ts +95 -49
  397. package/src/member/types.ts +24 -0
  398. package/src/member/util.ts +106 -13
  399. package/src/members/collection.ts +8 -1
  400. package/src/members/index.ts +281 -129
  401. package/src/members/request.ts +87 -14
  402. package/src/members/types.ts +28 -0
  403. package/src/members/util.ts +140 -49
  404. package/src/metrics/config.ts +302 -90
  405. package/src/metrics/constants.ts +1 -6
  406. package/src/metrics/index.ts +124 -95
  407. package/src/multistream/mediaRequestManager.ts +203 -45
  408. package/src/multistream/receiveSlot.ts +69 -26
  409. package/src/multistream/receiveSlotManager.ts +62 -38
  410. package/src/multistream/remoteMedia.ts +30 -4
  411. package/src/multistream/remoteMediaGroup.ts +4 -3
  412. package/src/multistream/remoteMediaManager.ts +230 -66
  413. package/src/networkQualityMonitor/index.ts +24 -27
  414. package/src/personal-meeting-room/index.ts +12 -16
  415. package/src/personal-meeting-room/request.ts +10 -3
  416. package/src/personal-meeting-room/util.ts +3 -3
  417. package/src/reachability/index.ts +131 -79
  418. package/src/reachability/request.ts +43 -34
  419. package/src/reactions/constants.ts +4 -0
  420. package/src/reactions/reactions.ts +8 -8
  421. package/src/reactions/reactions.type.ts +31 -5
  422. package/src/reconnection-manager/index.ts +193 -111
  423. package/src/recording-controller/enums.ts +8 -0
  424. package/src/recording-controller/index.ts +315 -0
  425. package/src/recording-controller/util.ts +58 -0
  426. package/src/roap/index.ts +63 -51
  427. package/src/roap/request.ts +86 -53
  428. package/src/roap/turnDiscovery.ts +105 -46
  429. package/src/statsAnalyzer/global.ts +8 -104
  430. package/src/statsAnalyzer/index.ts +624 -376
  431. package/src/statsAnalyzer/mqaUtil.ts +203 -90
  432. package/src/transcription/index.ts +34 -32
  433. package/test/integration/spec/converged-space-meetings.js +177 -0
  434. package/test/integration/spec/journey.js +670 -466
  435. package/test/integration/spec/space-meeting.js +320 -204
  436. package/test/integration/spec/transcription.js +7 -8
  437. package/test/unit/spec/annotation/index.ts +435 -0
  438. package/test/unit/spec/breakouts/breakout.ts +184 -0
  439. package/test/unit/spec/breakouts/collection.ts +15 -0
  440. package/test/unit/spec/breakouts/edit-lock-error.ts +30 -0
  441. package/test/unit/spec/breakouts/events.ts +77 -0
  442. package/test/unit/spec/breakouts/index.ts +1542 -0
  443. package/test/unit/spec/breakouts/request.ts +104 -0
  444. package/test/unit/spec/breakouts/utils.js +72 -0
  445. package/test/unit/spec/common/browser-detection.js +9 -28
  446. package/test/unit/spec/controls-options-manager/index.js +287 -0
  447. package/test/unit/spec/controls-options-manager/util.js +504 -0
  448. package/test/unit/spec/fixture/locus.js +93 -90
  449. package/test/unit/spec/locus-info/controlsUtils.js +289 -32
  450. package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
  451. package/test/unit/spec/locus-info/index.js +585 -5
  452. package/test/unit/spec/locus-info/infoUtils.js +26 -33
  453. package/test/unit/spec/locus-info/lib/BasicSeqCmp.json +88 -430
  454. package/test/unit/spec/locus-info/lib/SeqCmp.json +513 -685
  455. package/test/unit/spec/locus-info/parser.js +3 -9
  456. package/test/unit/spec/locus-info/selfConstant.js +110 -103
  457. package/test/unit/spec/locus-info/selfUtils.js +236 -12
  458. package/test/unit/spec/media/index.ts +104 -8
  459. package/test/unit/spec/media/properties.ts +9 -9
  460. package/test/unit/spec/meeting/in-meeting-actions.ts +66 -3
  461. package/test/unit/spec/meeting/index.js +2934 -946
  462. package/test/unit/spec/meeting/muteState.js +368 -70
  463. package/test/unit/spec/meeting/request.js +194 -44
  464. package/test/unit/spec/meeting/utils.js +146 -165
  465. package/test/unit/spec/meeting-info/meetinginfov2.js +333 -74
  466. package/test/unit/spec/meeting-info/request.js +7 -9
  467. package/test/unit/spec/meeting-info/util.js +11 -12
  468. package/test/unit/spec/meeting-info/utilv2.js +131 -74
  469. package/test/unit/spec/meetings/collection.js +15 -1
  470. package/test/unit/spec/meetings/index.js +1052 -329
  471. package/test/unit/spec/meetings/utils.js +163 -14
  472. package/test/unit/spec/member/index.js +24 -1
  473. package/test/unit/spec/member/util.js +383 -32
  474. package/test/unit/spec/members/index.js +402 -54
  475. package/test/unit/spec/members/request.js +76 -20
  476. package/test/unit/spec/members/utils.js +191 -4
  477. package/test/unit/spec/metrics/index.js +104 -20
  478. package/test/unit/spec/multistream/mediaRequestManager.ts +650 -105
  479. package/test/unit/spec/multistream/receiveSlot.ts +76 -17
  480. package/test/unit/spec/multistream/receiveSlotManager.ts +69 -39
  481. package/test/unit/spec/multistream/remoteMedia.ts +32 -2
  482. package/test/unit/spec/multistream/remoteMediaGroup.ts +5 -5
  483. package/test/unit/spec/multistream/remoteMediaManager.ts +549 -65
  484. package/test/unit/spec/networkQualityMonitor/index.js +24 -18
  485. package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -7
  486. package/test/unit/spec/reachability/index.ts +176 -27
  487. package/test/unit/spec/reachability/request.js +66 -0
  488. package/test/unit/spec/reconnection-manager/index.js +62 -31
  489. package/test/unit/spec/recording-controller/index.js +231 -0
  490. package/test/unit/spec/recording-controller/util.js +102 -0
  491. package/test/unit/spec/roap/index.ts +21 -16
  492. package/test/unit/spec/roap/request.ts +217 -0
  493. package/test/unit/spec/roap/turnDiscovery.ts +93 -49
  494. package/test/unit/spec/stats-analyzer/index.js +116 -60
  495. package/test/utils/cmr.js +44 -42
  496. package/test/utils/constants.js +9 -0
  497. package/test/utils/integrationTestUtils.js +64 -0
  498. package/test/utils/testUtils.js +63 -99
  499. package/test/utils/webex-config.js +22 -18
  500. package/test/utils/webex-test-users.js +57 -50
  501. package/tsconfig.json +6 -0
  502. package/dist/media/internal-media-core-wrapper.js +0 -22
  503. package/dist/media/internal-media-core-wrapper.js.map +0 -1
  504. package/dist/meeting/effectsState.js +0 -334
  505. package/dist/meeting/effectsState.js.map +0 -1
  506. package/dist/multistream/multistreamMedia.js +0 -116
  507. package/dist/multistream/multistreamMedia.js.map +0 -1
  508. package/src/index.js +0 -15
  509. package/src/media/internal-media-core-wrapper.ts +0 -9
  510. package/src/meeting/effectsState.ts +0 -211
  511. package/src/multistream/multistreamMedia.ts +0 -92
  512. package/test/unit/spec/meeting/effectsState.js +0 -291
@@ -1 +1 @@
1
- {"version":3,"names":["DEFAULT_TIMEOUT","VIDEO_MESH_TIMEOUT","Reachability","webex","reachabilityRequest","ReachabilityRequest","clusterLatencyResults","setup","window","localStorage","removeItem","REACHABILITY","LoggerProxy","logger","error","getClusters","clusters","performReachabilityCheck","results","setItem","log","reachable","reachabilityData","getItem","reachabilityResults","JSON","parse","some","result","udp","tcp","e","cluster","iceServers","map","url","username","credential","urls","iceCandidatePoolSize","iceTransportPolicy","key","config","peerConnection","RTCPeerConnection","peerConnectionError","startTime","begin","clusterList","buildPeerConnectionConfig","createPeerConnection","createOffer","offerToReceiveAudio","description","setLocalDescription","iceGatheringState","isVideoMesh","catch","iceGatheringStateError","all","then","parseIceResultsToReachabilityResults","reachabilityLatencyResults","logUnreachableClusters","unreachableList","forEach","unreachable","push","onicegatheringstatechange","COMPLETE","ICE_GATHERING_STATE","iceConnectionState","elapsed","getElapsedTime","setLatencyAndClose","onicecandidate","SERVER_REFLEXIVE","candidate","String","type","toLowerCase","timeout","ELAPSED","resolve","peerConnectionProxy","Proxy","get","target","property","targetMember","bind","set","value","clusterId","Reflect","handleIceGatheringStateChange","handleOnIceCandidate","setTimeout","CLOSED","CONNECTION_STATE","connectionState","list","getUnreachablClusters","iceResults","reachabilityMap","latencyResult","latencyInMilliseconds","toString","length","getLocalSDPForClusters","localSDPData","REACHABLE","UNREACHABLE","resultKey","intialState","close"],"sources":["index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint-disable class-methods-use-this */\n/* globals window */\nimport _ from 'lodash';\n\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {\n ICE_GATHERING_STATE,\n CONNECTION_STATE,\n REACHABILITY\n} from '../constants';\n\nimport ReachabilityRequest from './request';\n\nconst DEFAULT_TIMEOUT = 3000;\nconst VIDEO_MESH_TIMEOUT = 1000;\n\n/**\n * @class Reachability\n * @export\n */\nexport default class Reachability {\n webex: object;\n reachabilityRequest: any;\n clusterLatencyResults: any;\n\n /**\n * Creates an instance of Reachability.\n * @param {object} webex\n * @memberof Reachability\n */\n constructor(webex: object) {\n this.webex = webex;\n\n /**\n * internal request object for the server\n * @instance\n * @type {Array}\n * @private\n * @memberof Reachability\n */\n this.reachabilityRequest = new ReachabilityRequest(this.webex);\n\n /**\n * internal object of clusters latency results\n * @instance\n * @type {object}\n * @private\n * @memberof Reachability\n */\n this.clusterLatencyResults = {};\n }\n\n\n /**\n * fetches reachability data\n * @returns {Object} reachability data\n * @public\n * @async\n * @memberof Reachability\n */\n public async gatherReachability() {\n this.setup();\n\n // Remove stored reachability results to ensure no stale data\n if (window?.localStorage?.removeItem) {\n window.localStorage.removeItem(REACHABILITY.localStorage);\n }\n else {\n LoggerProxy.logger.error('Reachability:index#gatherReachability --> Error in accessing LocalStorage.');\n\n return {};\n }\n\n // Fetch clusters and measure latency\n try {\n const clusters = await this.reachabilityRequest.getClusters();\n\n // Perform Reachability Check\n const results = await this.performReachabilityCheck(clusters);\n\n window.localStorage.setItem(REACHABILITY.localStorage, JSON.stringify(results));\n\n LoggerProxy.logger.log('Reachability:index#gatherReachability --> Reachability checks completed');\n\n return results;\n }\n catch (getClusterError) {\n LoggerProxy.logger.error(`Reachability:index#gatherReachability --> Error in calling getClusters(): ${getClusterError}`);\n\n return {};\n }\n }\n\n /**\n * fetches reachability data and checks for cluster reachability\n * @returns {boolean}\n * @public\n * @memberof Reachability\n */\n isAnyClusterReachable() {\n let reachable = false;\n const reachabilityData = window.localStorage.getItem(REACHABILITY.localStorage);\n\n if (reachabilityData) {\n try {\n const reachabilityResults = JSON.parse(reachabilityData);\n\n reachable = Object.values(reachabilityResults).some((result: any) => result.udp?.reachable === 'true' || result.tcp?.reachable === 'true');\n }\n catch (e) {\n LoggerProxy.logger.error(`Roap:request#attachReachabilityData --> Error in parsing reachability data: ${e}`);\n }\n }\n\n return reachable;\n }\n\n\n /**\n * Generate peerConnection config settings\n * @param {object} cluster\n * @returns {object} peerConnectionConfig\n * @private\n * @memberof Reachability\n */\n private buildPeerConnectionConfig(cluster: any) {\n const iceServers = _.uniq([\n ...cluster.udp,\n ...cluster.tcp\n ]).map((url) => ({\n username: '',\n credential: '',\n urls: [url]\n }));\n\n return {\n iceServers: [\n ...iceServers\n ],\n iceCandidatePoolSize: '0',\n iceTransportPolicy: 'all'\n };\n }\n\n\n /**\n * Creates an RTCPeerConnection\n * @param {object} cluster\n * @returns {RTCPeerConnection} peerConnection\n * @private\n * @memberof Reachability\n */\n private createPeerConnection(cluster: any) {\n const {key, config} = cluster;\n\n try {\n const peerConnection = new window.RTCPeerConnection(config);\n\n // @ts-ignore\n peerConnection.key = key;\n\n return peerConnection;\n }\n catch (peerConnectionError) {\n LoggerProxy.logger.log(`Reachability:index#createPeerConnection --> Error creating peerConnection: ${peerConnectionError}`);\n\n return null;\n }\n }\n\n\n /**\n * Gets total elapsed time\n * @param {RTCPeerConnection} peerConnection\n * @returns {Number} Milliseconds\n * @private\n * @memberof Reachability\n */\n private getElapsedTime(peerConnection: any) {\n const startTime = peerConnection.begin;\n\n delete peerConnection.begin;\n\n return Date.now() - startTime;\n }\n\n\n /**\n * creates offer and generates localSDP\n * @param {object} clusterList cluster List\n * @returns {Promise} Reachability latency results\n * @private\n * @memberof Reachability\n */\n private getLocalSDPForClusters(clusterList: object) {\n let clusters: any[] = [...Object.keys(clusterList)];\n\n clusters = clusters.map(async (key) => {\n const cluster = clusterList[key];\n const config = this.buildPeerConnectionConfig(cluster);\n const peerConnection = this.createPeerConnection({key, config});\n const description = await peerConnection.createOffer({offerToReceiveAudio: true});\n\n // @ts-ignore\n peerConnection.begin = Date.now();\n peerConnection.setLocalDescription(description);\n\n return this.iceGatheringState(peerConnection, cluster.isVideoMesh ? VIDEO_MESH_TIMEOUT : DEFAULT_TIMEOUT)\n .catch((iceGatheringStateError) => {\n LoggerProxy.logger.log(`Reachability:index#getLocalSDPForClusters --> Error in getLocalSDP : ${iceGatheringStateError}`);\n });\n });\n\n return Promise.all(clusters)\n .then(this.parseIceResultsToReachabilityResults)\n .then((reachabilityLatencyResults) => {\n this.logUnreachableClusters();\n\n // return results\n return reachabilityLatencyResults;\n });\n }\n\n\n /**\n * Get list of all unreachable clusters\n * @returns {array} Unreachable clusters\n * @private\n * @memberof Reachability\n */\n private getUnreachablClusters() {\n const unreachableList = [];\n const clusters = this.clusterLatencyResults;\n\n Object.keys(clusters).forEach((key) => {\n const cluster = clusters[key];\n\n if (cluster.unreachable && !cluster.reachable) {\n unreachableList.push(key);\n }\n });\n\n return unreachableList;\n }\n\n\n /**\n * Attach an event handler for the icegatheringstatechange\n * event and measure latency.\n * @param {RTCPeerConnection} peerConnection\n * @returns {undefined}\n * @private\n * @memberof Reachability\n */\n private handleIceGatheringStateChange(peerConnection: RTCPeerConnection) {\n peerConnection.onicegatheringstatechange = () => {\n const {COMPLETE} = ICE_GATHERING_STATE;\n\n if (peerConnection.iceConnectionState === COMPLETE) {\n const elapsed = this.getElapsedTime(peerConnection);\n\n // @ts-ignore\n LoggerProxy.logger.log(`Reachability:index#onIceGatheringStateChange --> Successfully pinged ${peerConnection.key}:`, elapsed);\n this.setLatencyAndClose(peerConnection, elapsed);\n }\n };\n }\n\n\n /**\n * Attach an event handler for the icecandidate\n * event and measure latency.\n * @param {RTCPeerConnection} peerConnection\n * @returns {undefined}\n * @private\n * @memberof Reachability\n */\n private handleOnIceCandidate(peerConnection: RTCPeerConnection) {\n peerConnection.onicecandidate = (e) => {\n const SERVER_REFLEXIVE = 'srflx';\n\n if (e.candidate && String(e.candidate.type).toLowerCase() === SERVER_REFLEXIVE) {\n const elapsed = this.getElapsedTime(peerConnection);\n\n // @ts-ignore\n LoggerProxy.logger.log(`Reachability:index#onIceCandidate --> Successfully pinged ${peerConnection.key}:`, elapsed);\n this.setLatencyAndClose(peerConnection, elapsed);\n }\n };\n }\n\n /**\n * An event handler on an RTCPeerConnection when the state of the ICE\n * candidate gathering process changes. Used to measure connection\n * speed.\n * @private\n * @param {RTCPeerConnection} peerConnection\n * @param {number} timeout\n * @returns {Promise}\n */\n private iceGatheringState(peerConnection: RTCPeerConnection, timeout: number) {\n const ELAPSED = 'elapsed';\n\n return new Promise((resolve) => {\n const peerConnectionProxy = new window.Proxy(peerConnection, {\n get(target, property) {\n const targetMember = target[property];\n\n if (typeof (targetMember) === 'function') {\n return targetMember.bind(target);\n }\n\n return targetMember;\n },\n set: (target, property, value) => {\n // only intercept elapsed property\n if (property === ELAPSED) {\n // @ts-ignore\n resolve({clusterId: peerConnection.key, elapsed: value});\n\n return true;\n }\n\n // pass thru\n return window.Reflect.set(target, property, value);\n }\n });\n\n // Using peerConnection proxy so handle functions below\n // won't be coupled to our promise implementation\n this.handleIceGatheringStateChange(peerConnectionProxy);\n this.handleOnIceCandidate(peerConnectionProxy);\n\n // Set maximum timeout\n window.setTimeout(() => {\n const {CLOSED} = CONNECTION_STATE;\n\n // Close any open peerConnections\n if (peerConnectionProxy.connectionState !== CLOSED) {\n this.setLatencyAndClose(peerConnectionProxy, null);\n }\n }, timeout);\n });\n }\n\n\n /**\n * Make a log of unreachable clusters.\n * @returns {undefined}\n * @private\n * @memberof Reachability\n */\n private logUnreachableClusters() {\n const list = this.getUnreachablClusters();\n\n list.forEach((cluster) => {\n LoggerProxy.logger.log(`Reachability:index#logUnreachableClusters --> No ice candidate for ${cluster}.`);\n });\n }\n\n\n /**\n * Calculates time to establish connection\n * @param {array} iceResults iceResults\n * @returns {object} reachabilityMap\n * @private\n * @memberof Reachability\n */\n private parseIceResultsToReachabilityResults(iceResults: Array<any>) {\n const reachabilityMap = {};\n\n iceResults.forEach(({clusterId, elapsed}) => {\n let latencyResult;\n\n if (elapsed === null) {\n latencyResult = {reachable: 'false'};\n }\n else {\n latencyResult = {\n reachable: 'true',\n latencyInMilliseconds: (elapsed).toString()\n };\n }\n\n reachabilityMap[clusterId] = {\n udp: latencyResult,\n tcp: latencyResult\n };\n });\n\n return reachabilityMap;\n }\n\n\n /**\n * fetches reachability data\n * @param {object} clusterList\n * @returns {Promise<localSDPData>} reachability check results\n * @private\n * @memberof Reachability\n */\n private performReachabilityCheck(clusterList: object) {\n if (!clusterList || !Object.keys(clusterList).length) {\n return Promise.resolve({});\n }\n\n return new Promise((resolve) => {\n this.getLocalSDPForClusters(clusterList)\n .then((localSDPData) => {\n if (!localSDPData || !Object.keys(localSDPData).length) {\n // TODO: handle the error condition properly and try retry\n LoggerProxy.logger.log('Reachability:index#performReachabilityCheck --> Local SDP is empty or has missing elements..returning');\n resolve({});\n }\n else {\n resolve(localSDPData);\n }\n })\n .catch((error) => {\n LoggerProxy.logger.error(`Reachability:index#performReachabilityCheck --> Error in getLocalSDPForClusters: ${error}`);\n resolve({});\n });\n });\n }\n\n\n /**\n * Records latency and closes the peerConnection\n * @param {RTCPeerConnection} peerConnection\n * @param {number} elapsed Latency in milliseconds\n * @returns {undefined}\n * @private\n * @memberof Reachability\n */\n private setLatencyAndClose(peerConnection: RTCPeerConnection, elapsed: number) {\n const REACHABLE = 'reachable';\n const UNREACHABLE = 'unreachable';\n const {CLOSED} = CONNECTION_STATE;\n // @ts-ignore\n const {key} = peerConnection;\n const resultKey = elapsed === null ? UNREACHABLE : REACHABLE;\n const intialState = {[REACHABLE]: 0, [UNREACHABLE]: 0};\n\n if (peerConnection.connectionState === CLOSED) {\n LoggerProxy.logger.log(`Reachability:index#setLatencyAndClose --> Attempting to set latency of ${elapsed} on closed peerConnection.`);\n\n return;\n }\n\n this.clusterLatencyResults[key] = this.clusterLatencyResults[key] || intialState;\n this.clusterLatencyResults[key][resultKey] += 1;\n\n // Set to null in case this fired from\n // an event other than onIceCandidate\n peerConnection.onicecandidate = null;\n peerConnection.close();\n // @ts-ignore\n peerConnection.elapsed = elapsed;\n }\n\n\n /**\n * utility function\n * @returns {undefined}\n * @private\n * @memberof Reachability\n */\n private setup() {\n this.clusterLatencyResults = {};\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA;;AACA;;AAMA;;AAEA,IAAMA,eAAe,GAAG,IAAxB;AACA,IAAMC,kBAAkB,GAAG,IAA3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AAP,CAH6E,CAI7E;;MACA,IAAOzD,GAAP,GAAcE,cAAd,CAAOF,GAAP;MACA,IAAMwE,SAAS,GAAGzC,OAAO,KAAK,IAAZ,GAAmBwC,WAAnB,GAAiCD,SAAnD;MACA,IAAMG,WAAW,mEAAKH,SAAL,EAAiB,CAAjB,+CAAqBC,WAArB,EAAmC,CAAnC,gBAAjB;;MAEA,IAAIrE,cAAc,CAACyD,eAAf,KAAmCF,MAAvC,EAA+C;QAC7CtF,oBAAA,CAAYC,MAAZ,CAAmBO,GAAnB,kFAAiGoD,OAAjG;;QAEA;MACD;;MAED,KAAKlE,qBAAL,CAA2BmC,GAA3B,IAAkC,KAAKnC,qBAAL,CAA2BmC,GAA3B,KAAmCyE,WAArE;MACA,KAAK5G,qBAAL,CAA2BmC,GAA3B,EAAgCwE,SAAhC,KAA8C,CAA9C,CAhB6E,CAkB7E;MACA;;MACAtE,cAAc,CAACgC,cAAf,GAAgC,IAAhC;MACAhC,cAAc,CAACwE,KAAf,GArB6E,CAsB7E;;MACAxE,cAAc,CAAC6B,OAAf,GAAyBA,OAAzB;IACD;IAGD;AACF;AACA;AACA;AACA;AACA;;;;WACE,iBAAgB;MACd,KAAKlE,qBAAL,GAA6B,EAA7B;IACD"}
1
+ {"version":3,"names":["DEFAULT_TIMEOUT","VIDEO_MESH_TIMEOUT","Reachability","webex","REACHABILITY","namespace","reachabilityRequest","ReachabilityRequest","clusterLatencyResults","setup","boundedStorage","del","localStorageResult","localStorageJoinCookie","getClusters","clusters","joinCookie","performReachabilityCheck","results","put","LoggerProxy","logger","log","error","reachable","get","catch","reachabilityData","reachabilityResults","JSON","parse","some","result","udp","tcp","e","cluster","iceServers","map","url","username","credential","urls","iceCandidatePoolSize","iceTransportPolicy","key","config","peerConnection","window","RTCPeerConnection","peerConnectionError","startTime","begin","clusterList","buildPeerConnectionConfig","createPeerConnection","createOffer","offerToReceiveAudio","description","setLocalDescription","iceGatheringState","isVideoMesh","iceGatheringStateError","all","then","parseIceResultsToReachabilityResults","reachabilityLatencyResults","logUnreachableClusters","unreachableList","forEach","unreachable","push","onicegatheringstatechange","COMPLETE","ICE_GATHERING_STATE","iceConnectionState","elapsed","getElapsedTime","setLatencyAndClose","onicecandidate","SERVER_REFLEXIVE","candidate","String","type","toLowerCase","addPublicIP","address","timeout","ELAPSED","resolve","peerConnectionProxy","Proxy","target","property","targetMember","bind","set","value","clusterId","publicIPs","Reflect","handleIceGatheringStateChange","handleOnIceCandidate","setTimeout","CLOSED","CONNECTION_STATE","connectionState","list","getUnreachablClusters","iceResults","reachabilityMap","latencyResult","latencyInMilliseconds","toString","clientMediaIPs","length","getLocalSDPForClusters","localSDPData","publicIP","modifiedPeerConnection","REACHABLE","UNREACHABLE","resultKey","intialState","close"],"sources":["index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint-disable class-methods-use-this */\n/* globals window */\nimport _ from 'lodash';\n\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {ICE_GATHERING_STATE, CONNECTION_STATE, REACHABILITY} from '../constants';\n\nimport ReachabilityRequest from './request';\n\nconst DEFAULT_TIMEOUT = 3000;\nconst VIDEO_MESH_TIMEOUT = 1000;\n\nexport type ICECandidateResult = {clusterId: string; elapsed?: string | null; publicIPs?: string[]};\n/**\n * @class Reachability\n * @export\n */\nexport default class Reachability {\n namespace = REACHABILITY.namespace;\n webex: object;\n reachabilityRequest: any;\n clusterLatencyResults: any;\n\n /**\n * Creates an instance of Reachability.\n * @param {object} webex\n * @memberof Reachability\n */\n constructor(webex: object) {\n this.webex = webex;\n\n /**\n * internal request object for the server\n * @instance\n * @type {Array}\n * @private\n * @memberof Reachability\n */\n this.reachabilityRequest = new ReachabilityRequest(this.webex);\n\n /**\n * internal object of clusters latency results\n * @instance\n * @type {object}\n * @private\n * @memberof Reachability\n */\n this.clusterLatencyResults = {};\n }\n\n /**\n * fetches reachability data\n * @returns {Object} reachability data\n * @public\n * @async\n * @memberof Reachability\n */\n public async gatherReachability() {\n this.setup();\n\n // Remove stored reachability results to ensure no stale data\n // @ts-ignore\n await this.webex.boundedStorage.del(this.namespace, REACHABILITY.localStorageResult);\n // @ts-ignore\n await this.webex.boundedStorage.del(this.namespace, REACHABILITY.localStorageJoinCookie);\n\n // Fetch clusters and measure latency\n try {\n const {clusters, joinCookie} = await this.reachabilityRequest.getClusters();\n\n // Perform Reachability Check\n const results = await this.performReachabilityCheck(clusters);\n\n // @ts-ignore\n await this.webex.boundedStorage.put(\n this.namespace,\n REACHABILITY.localStorageResult,\n JSON.stringify(results)\n );\n // @ts-ignore\n await this.webex.boundedStorage.put(\n this.namespace,\n REACHABILITY.localStorageJoinCookie,\n JSON.stringify(joinCookie)\n );\n\n LoggerProxy.logger.log(\n 'Reachability:index#gatherReachability --> Reachability checks completed'\n );\n\n return results;\n } catch (getClusterError) {\n LoggerProxy.logger.error(\n `Reachability:index#gatherReachability --> Error in calling getClusters(): ${getClusterError}`\n );\n\n return {};\n }\n }\n\n /**\n * fetches reachability data and checks for cluster reachability\n * @returns {boolean}\n * @public\n * @memberof Reachability\n */\n async isAnyClusterReachable() {\n let reachable = false;\n // @ts-ignore\n const reachabilityData = await this.webex.boundedStorage\n .get(this.namespace, REACHABILITY.localStorageResult)\n .catch(() => {});\n\n if (reachabilityData) {\n try {\n const reachabilityResults = JSON.parse(reachabilityData);\n\n reachable = Object.values(reachabilityResults).some(\n (result: any) => result.udp?.reachable === 'true' || result.tcp?.reachable === 'true'\n );\n } catch (e) {\n LoggerProxy.logger.error(\n `Roap:request#attachReachabilityData --> Error in parsing reachability data: ${e}`\n );\n }\n }\n\n return reachable;\n }\n\n /**\n * Generate peerConnection config settings\n * @param {object} cluster\n * @returns {object} peerConnectionConfig\n * @private\n * @memberof Reachability\n */\n private buildPeerConnectionConfig(cluster: any) {\n const iceServers = _.uniq([...cluster.udp, ...cluster.tcp]).map((url) => ({\n username: '',\n credential: '',\n urls: [url],\n }));\n\n return {\n iceServers: [...iceServers],\n iceCandidatePoolSize: '0',\n iceTransportPolicy: 'all',\n };\n }\n\n /**\n * Creates an RTCPeerConnection\n * @param {object} cluster\n * @returns {RTCPeerConnection} peerConnection\n * @private\n * @memberof Reachability\n */\n private createPeerConnection(cluster: any) {\n const {key, config} = cluster;\n\n try {\n const peerConnection = new window.RTCPeerConnection(config);\n\n // @ts-ignore\n peerConnection.key = key;\n\n return peerConnection;\n } catch (peerConnectionError) {\n LoggerProxy.logger.log(\n `Reachability:index#createPeerConnection --> Error creating peerConnection: ${peerConnectionError}`\n );\n\n return null;\n }\n }\n\n /**\n * Gets total elapsed time\n * @param {RTCPeerConnection} peerConnection\n * @returns {Number} Milliseconds\n * @private\n * @memberof Reachability\n */\n private getElapsedTime(peerConnection: any) {\n const startTime = peerConnection.begin;\n\n delete peerConnection.begin;\n\n return Date.now() - startTime;\n }\n\n /**\n * creates offer and generates localSDP\n * @param {object} clusterList cluster List\n * @returns {Promise} Reachability latency results\n * @private\n * @memberof Reachability\n */\n private getLocalSDPForClusters(clusterList: object) {\n let clusters: any[] = [...Object.keys(clusterList)];\n\n clusters = clusters.map(async (key) => {\n const cluster = clusterList[key];\n const config = this.buildPeerConnectionConfig(cluster);\n const peerConnection = this.createPeerConnection({key, config});\n const description = await peerConnection.createOffer({offerToReceiveAudio: true});\n\n // @ts-ignore\n peerConnection.begin = Date.now();\n peerConnection.setLocalDescription(description);\n\n return this.iceGatheringState(\n peerConnection,\n cluster.isVideoMesh ? VIDEO_MESH_TIMEOUT : DEFAULT_TIMEOUT\n ).catch((iceGatheringStateError) => {\n LoggerProxy.logger.log(\n `Reachability:index#getLocalSDPForClusters --> Error in getLocalSDP : ${iceGatheringStateError}`\n );\n });\n });\n\n return Promise.all(clusters)\n .then(this.parseIceResultsToReachabilityResults)\n .then((reachabilityLatencyResults) => {\n this.logUnreachableClusters();\n\n // return results\n return reachabilityLatencyResults;\n });\n }\n\n /**\n * Get list of all unreachable clusters\n * @returns {array} Unreachable clusters\n * @private\n * @memberof Reachability\n */\n private getUnreachablClusters() {\n const unreachableList = [];\n const clusters = this.clusterLatencyResults;\n\n Object.keys(clusters).forEach((key) => {\n const cluster = clusters[key];\n\n if (cluster.unreachable && !cluster.reachable) {\n unreachableList.push(key);\n }\n });\n\n return unreachableList;\n }\n\n /**\n * Attach an event handler for the icegatheringstatechange\n * event and measure latency.\n * @param {RTCPeerConnection} peerConnection\n * @returns {undefined}\n * @private\n * @memberof Reachability\n */\n private handleIceGatheringStateChange(peerConnection: RTCPeerConnection) {\n peerConnection.onicegatheringstatechange = () => {\n const {COMPLETE} = ICE_GATHERING_STATE;\n\n if (peerConnection.iceConnectionState === COMPLETE) {\n const elapsed = this.getElapsedTime(peerConnection);\n\n // @ts-ignore\n LoggerProxy.logger.log(\n // @ts-ignore\n `Reachability:index#onIceGatheringStateChange --> Successfully pinged ${peerConnection.key}:`,\n elapsed\n );\n this.setLatencyAndClose(peerConnection, elapsed);\n }\n };\n }\n\n /**\n * Attach an event handler for the icecandidate\n * event and measure latency.\n * @param {RTCPeerConnection} peerConnection\n * @returns {undefined}\n * @private\n * @memberof Reachability\n */\n private handleOnIceCandidate(peerConnection: RTCPeerConnection) {\n peerConnection.onicecandidate = (e) => {\n const SERVER_REFLEXIVE = 'srflx';\n\n if (e.candidate && String(e.candidate.type).toLowerCase() === SERVER_REFLEXIVE) {\n const elapsed = this.getElapsedTime(peerConnection);\n\n LoggerProxy.logger.log(\n // @ts-ignore\n `Reachability:index#onIceCandidate --> Successfully pinged ${peerConnection.key}:`,\n elapsed\n );\n // order is important\n this.addPublicIP(peerConnection, e.candidate.address);\n this.setLatencyAndClose(peerConnection, elapsed);\n }\n };\n }\n\n /**\n * An event handler on an RTCPeerConnection when the state of the ICE\n * candidate gathering process changes. Used to measure connection\n * speed.\n * @private\n * @param {RTCPeerConnection} peerConnection\n * @param {number} timeout\n * @returns {Promise}\n */\n private iceGatheringState(peerConnection: RTCPeerConnection, timeout: number) {\n const ELAPSED = 'elapsed';\n\n return new Promise<ICECandidateResult>((resolve) => {\n const peerConnectionProxy = new window.Proxy(peerConnection, {\n // eslint-disable-next-line require-jsdoc\n get(target, property) {\n const targetMember = target[property];\n\n if (typeof targetMember === 'function') {\n return targetMember.bind(target);\n }\n\n return targetMember;\n },\n set: (target, property, value) => {\n // only intercept elapsed property\n if (property === ELAPSED) {\n // @ts-ignore\n resolve({clusterId: peerConnection.key, publicIPs: target.publicIPs, elapsed: value});\n\n return true;\n }\n\n // pass thru\n return window.Reflect.set(target, property, value);\n },\n });\n\n // Using peerConnection proxy so handle functions below\n // won't be coupled to our promise implementation\n this.handleIceGatheringStateChange(peerConnectionProxy);\n this.handleOnIceCandidate(peerConnectionProxy);\n\n // Set maximum timeout\n window.setTimeout(() => {\n const {CLOSED} = CONNECTION_STATE;\n\n // Close any open peerConnections\n if (peerConnectionProxy.connectionState !== CLOSED) {\n // order is important\n this.addPublicIP(peerConnectionProxy, null);\n this.setLatencyAndClose(peerConnectionProxy, null);\n }\n }, timeout);\n });\n }\n\n /**\n * Make a log of unreachable clusters.\n * @returns {undefined}\n * @private\n * @memberof Reachability\n */\n private logUnreachableClusters() {\n const list = this.getUnreachablClusters();\n\n list.forEach((cluster) => {\n LoggerProxy.logger.log(\n `Reachability:index#logUnreachableClusters --> No ice candidate for ${cluster}.`\n );\n });\n }\n\n /**\n * Calculates time to establish connection\n * @param {Array<ICECandidateResult>} iceResults iceResults\n * @returns {object} reachabilityMap\n * @protected\n * @memberof Reachability\n */\n protected parseIceResultsToReachabilityResults(iceResults: Array<ICECandidateResult>) {\n const reachabilityMap = {};\n\n iceResults.forEach(({clusterId, elapsed, publicIPs}) => {\n const latencyResult = {};\n\n if (!elapsed) {\n Object.assign(latencyResult, {reachable: 'false'});\n } else {\n Object.assign(latencyResult, {\n reachable: 'true',\n latencyInMilliseconds: elapsed.toString(),\n });\n }\n\n if (publicIPs) {\n Object.assign(latencyResult, {\n clientMediaIPs: publicIPs,\n });\n }\n\n reachabilityMap[clusterId] = {\n udp: latencyResult,\n tcp: latencyResult,\n };\n });\n\n return reachabilityMap;\n }\n\n /**\n * fetches reachability data\n * @param {object} clusterList\n * @returns {Promise<localSDPData>} reachability check results\n * @private\n * @memberof Reachability\n */\n private performReachabilityCheck(clusterList: object) {\n if (!clusterList || !Object.keys(clusterList).length) {\n return Promise.resolve({});\n }\n\n return new Promise((resolve) => {\n this.getLocalSDPForClusters(clusterList)\n .then((localSDPData) => {\n if (!localSDPData || !Object.keys(localSDPData).length) {\n // TODO: handle the error condition properly and try retry\n LoggerProxy.logger.log(\n 'Reachability:index#performReachabilityCheck --> Local SDP is empty or has missing elements..returning'\n );\n resolve({});\n } else {\n resolve(localSDPData);\n }\n })\n .catch((error) => {\n LoggerProxy.logger.error(\n `Reachability:index#performReachabilityCheck --> Error in getLocalSDPForClusters: ${error}`\n );\n resolve({});\n });\n });\n }\n\n /**\n * Adds public IP (client media IPs)\n * @param {RTCPeerConnection} peerConnection\n * @param {string} publicIP\n * @returns {void}\n */\n protected addPublicIP(peerConnection: RTCPeerConnection, publicIP?: string | null) {\n const modifiedPeerConnection: RTCPeerConnection & {publicIPs?: string[]} = peerConnection;\n const {CLOSED} = CONNECTION_STATE;\n\n if (modifiedPeerConnection.connectionState === CLOSED) {\n LoggerProxy.logger.log(\n `Reachability:index#addPublicIP --> Attempting to set publicIP of ${publicIP} on closed peerConnection.`\n );\n }\n\n if (publicIP) {\n if (modifiedPeerConnection.publicIPs) {\n modifiedPeerConnection.publicIPs.push(publicIP);\n } else {\n modifiedPeerConnection.publicIPs = [publicIP];\n }\n } else {\n modifiedPeerConnection.publicIPs = null;\n }\n }\n\n /**\n * Records latency and closes the peerConnection\n * @param {RTCPeerConnection} peerConnection\n * @param {number} elapsed Latency in milliseconds\n * @returns {undefined}\n * @private\n * @memberof Reachability\n */\n private setLatencyAndClose(peerConnection: RTCPeerConnection, elapsed: number) {\n const REACHABLE = 'reachable';\n const UNREACHABLE = 'unreachable';\n const {CLOSED} = CONNECTION_STATE;\n // @ts-ignore\n const {key} = peerConnection;\n const resultKey = elapsed === null ? UNREACHABLE : REACHABLE;\n const intialState = {[REACHABLE]: 0, [UNREACHABLE]: 0};\n\n if (peerConnection.connectionState === CLOSED) {\n LoggerProxy.logger.log(\n `Reachability:index#setLatencyAndClose --> Attempting to set latency of ${elapsed} on closed peerConnection.`\n );\n\n return;\n }\n\n this.clusterLatencyResults[key] = this.clusterLatencyResults[key] || intialState;\n this.clusterLatencyResults[key][resultKey] += 1;\n\n // Set to null in case this fired from\n // an event other than onIceCandidate\n peerConnection.onicecandidate = null;\n peerConnection.close();\n // @ts-ignore\n peerConnection.elapsed = elapsed;\n }\n\n /**\n * utility function\n * @returns {undefined}\n * @private\n * @memberof Reachability\n */\n private setup() {\n this.clusterLatencyResults = {};\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA;AACA;AAEA;AAEA,IAAMA,eAAe,GAAG,IAAI;AAC5B,IAAMC,kBAAkB,GAAG,IAAI;AAG/B;AACA;AACA;AACA;AAHA,IAIqBC,YAAY;EAM/B;AACF;AACA;AACA;AACA;EACE,sBAAYC,KAAa,EAAE;IAAA;IAAA,iDAVfC,uBAAY,CAACC,SAAS;IAAA;IAAA;IAAA;IAWhC,IAAI,CAACF,KAAK,GAAGA,KAAK;;IAElB;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACG,mBAAmB,GAAG,IAAIC,gBAAmB,CAAC,IAAI,CAACJ,KAAK,CAAC;;IAE9D;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACK,qBAAqB,GAAG,CAAC,CAAC;EACjC;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAA;IAAA;MAAA,kGAOA;QAAA;QAAA;UAAA;YAAA;cACE,IAAI,CAACC,KAAK,EAAE;;cAEZ;cACA;cAAA;cAAA,OACM,IAAI,CAACN,KAAK,CAACO,cAAc,CAACC,GAAG,CAAC,IAAI,CAACN,SAAS,EAAED,uB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ACC,MAAM,CAACC,GAAG,kFACsDsD,OAAO,gCAClF;QAED;MACF;MAEA,IAAI,CAACpE,qBAAqB,CAACqC,GAAG,CAAC,GAAG,IAAI,CAACrC,qBAAqB,CAACqC,GAAG,CAAC,IAAI8E,WAAW;MAChF,IAAI,CAACnH,qBAAqB,CAACqC,GAAG,CAAC,CAAC6E,SAAS,CAAC,IAAI,CAAC;;MAE/C;MACA;MACA3E,cAAc,CAACgC,cAAc,GAAG,IAAI;MACpChC,cAAc,CAAC6E,KAAK,EAAE;MACtB;MACA7E,cAAc,CAAC6B,OAAO,GAAGA,OAAO;IAClC;;IAEA;AACF;AACA;AACA;AACA;AACA;EALE;IAAA;IAAA,OAMA,iBAAgB;MACd,IAAI,CAACpE,qBAAqB,GAAG,CAAC,CAAC;IACjC;EAAC;EAAA;AAAA;AAAA"}
@@ -1,29 +1,18 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
-
5
4
  var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
6
-
7
5
  _Object$defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
-
11
8
  exports.default = void 0;
12
-
13
9
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
14
-
15
10
  var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
16
-
17
11
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
18
-
19
12
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
20
-
21
13
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
22
-
23
14
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
24
-
25
15
  var _constants = require("../constants");
26
-
27
16
  /**
28
17
  * @class ReachabilityRequest
29
18
  */
@@ -35,7 +24,6 @@ var ReachabilityRequest = /*#__PURE__*/(0, _createClass2.default)(
35
24
  */
36
25
  function ReachabilityRequest(webex) {
37
26
  var _this = this;
38
-
39
27
  (0, _classCallCheck2.default)(this, ReachabilityRequest);
40
28
  (0, _defineProperty2.default)(this, "webex", void 0);
41
29
  (0, _defineProperty2.default)(this, "getClusters", function () {
@@ -43,18 +31,23 @@ function ReachabilityRequest(webex) {
43
31
  method: _constants.HTTP_VERBS.GET,
44
32
  shouldRefreshAccessToken: false,
45
33
  api: _constants.API.CALLIOPEDISCOVERY,
46
- resource: _constants.RESOURCE.CLUSTERS
34
+ resource: _constants.RESOURCE.CLUSTERS,
35
+ qs: {
36
+ JCSupport: 1
37
+ }
47
38
  }).then(function (res) {
48
- var clusters = res.body.clusters;
39
+ var _res$body = res.body,
40
+ clusters = _res$body.clusters,
41
+ joinCookie = _res$body.joinCookie;
49
42
  (0, _keys.default)(clusters).forEach(function (key) {
50
43
  var _res$body$clusterClas, _res$body$clusterClas2;
51
-
52
44
  clusters[key].isVideoMesh = (_res$body$clusterClas = res.body.clusterClasses) === null || _res$body$clusterClas === void 0 ? void 0 : (_res$body$clusterClas2 = _res$body$clusterClas.hybridMedia) === null || _res$body$clusterClas2 === void 0 ? void 0 : _res$body$clusterClas2.includes(key);
53
45
  });
54
-
55
46
  _loggerProxy.default.logger.log("Reachability:request#getClusters --> get clusters successful:".concat((0, _stringify.default)(clusters)));
56
-
57
- return clusters;
47
+ return {
48
+ clusters: clusters,
49
+ joinCookie: joinCookie
50
+ };
58
51
  });
59
52
  });
60
53
  (0, _defineProperty2.default)(this, "remoteSDPForClusters", function (localSDPList) {
@@ -68,19 +61,17 @@ function ReachabilityRequest(webex) {
68
61
  }
69
62
  }).then(function (res) {
70
63
  _loggerProxy.default.logger.log('Reachability:request#remoteSDPForClusters --> Remote SDPs got succcessfully');
71
-
72
64
  return res.body;
73
65
  });
74
66
  });
75
67
  this.webex = webex;
76
68
  }
69
+
77
70
  /**
78
- * gets the cluster information
71
+ * Gets the cluster information
79
72
  *
80
- * @param {boolean} includeVideoMesh whether to include the video mesh clusters in the result or not
81
73
  * @returns {Promise}
82
- */
83
- );
74
+ */);
84
75
  var _default = ReachabilityRequest;
85
76
  exports.default = _default;
86
77
  //# sourceMappingURL=request.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ReachabilityRequest","webex","request","method","HTTP_VERBS","GET","shouldRefreshAccessToken","api","API","CALLIOPEDISCOVERY","resource","RESOURCE","CLUSTERS","then","res","clusters","body","forEach","key","isVideoMesh","clusterClasses","hybridMedia","includes","LoggerProxy","logger","log","localSDPList","POST","REACHABILITY","offers"],"sources":["request.ts"],"sourcesContent":["import LoggerProxy from '../common/logs/logger-proxy';\nimport {\n HTTP_VERBS,\n RESOURCE,\n API\n} from '../constants';\n\nexport interface ClusterNode {\n isVideoMesh: boolean;\n udp: Array<string>;\n tcp: Array<string>;\n xtls: Array<string>;\n}\n\nexport type ClusterList = {\n [key:string]: ClusterNode;\n}\n\n/**\n * @class ReachabilityRequest\n */\nclass ReachabilityRequest {\n webex: any;\n\n /**\n * Creates an instance of ReachabilityRequest.\n * @param {object} webex\n * @memberof ReachabilityRequest\n */\n constructor(webex: object) {\n this.webex = webex;\n }\n\n /**\n * gets the cluster information\n *\n * @param {boolean} includeVideoMesh whether to include the video mesh clusters in the result or not\n * @returns {Promise}\n */\n getClusters = (): Promise<ClusterList> => this.webex.request({\n method: HTTP_VERBS.GET,\n shouldRefreshAccessToken: false,\n api: API.CALLIOPEDISCOVERY,\n resource: RESOURCE.CLUSTERS\n })\n .then((res) => {\n const {clusters} = res.body;\n\n Object.keys(clusters).forEach((key) => {\n clusters[key].isVideoMesh = res.body.clusterClasses?.hybridMedia?.includes(key);\n });\n\n LoggerProxy.logger.log(`Reachability:request#getClusters --> get clusters successful:${JSON.stringify(clusters)}`);\n\n return clusters;\n });\n\n /**\n * gets remote SDP For Clusters\n * @param {Object} localSDPList localSDPs for the cluster\n * @returns {Object}\n */\n remoteSDPForClusters = (localSDPList: object) => this.webex.request({\n method: HTTP_VERBS.POST,\n shouldRefreshAccessToken: false,\n api: API.CALLIOPEDISCOVERY,\n resource: RESOURCE.REACHABILITY,\n body: {offers: localSDPList}\n })\n .then((res) => {\n LoggerProxy.logger.log('Reachability:request#remoteSDPForClusters --> Remote SDPs got succcessfully');\n\n return res.body;\n });\n}\n\nexport default ReachabilityRequest;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAiBA;AACA;AACA;IACMA,mB;AAGJ;AACF;AACA;AACA;AACA;AACE,6BAAYC,KAAZ,EAA2B;EAAA;;EAAA;EAAA;EAAA,mDAUb;IAAA,OAA4B,KAAI,CAACA,KAAL,CAAWC,OAAX,CAAmB;MAC3DC,MAAM,EAAEC,qBAAA,CAAWC,GADwC;MAE3DC,wBAAwB,EAAE,KAFiC;MAG3DC,GAAG,EAAEC,cAAA,CAAIC,iBAHkD;MAI3DC,QAAQ,EAAEC,mBAAA,CAASC;IAJwC,CAAnB,EAMvCC,IANuC,CAMlC,UAACC,GAAD,EAAS;MACb,IAAOC,QAAP,GAAmBD,GAAG,CAACE,IAAvB,CAAOD,QAAP;MAEA,mBAAYA,QAAZ,EAAsBE,OAAtB,CAA8B,UAACC,GAAD,EAAS;QAAA;;QACrCH,QAAQ,CAACG,GAAD,CAAR,CAAcC,WAAd,4BAA4BL,GAAG,CAACE,IAAJ,CAASI,cAArC,oFAA4B,sBAAyBC,WAArD,2DAA4B,uBAAsCC,QAAtC,CAA+CJ,GAA/C,CAA5B;MACD,CAFD;;MAIAK,oBAAA,CAAYC,MAAZ,CAAmBC,GAAnB,wEAAuF,wBAAeV,QAAf,CAAvF;;MAEA,OAAOA,QAAP;IACD,CAhBuC,CAA5B;EAAA,CAVa;EAAA,4DAiCJ,UAACW,YAAD;IAAA,OAA0B,KAAI,CAACzB,KAAL,CAAWC,OAAX,CAAmB;MAClEC,MAAM,EAAEC,qBAAA,CAAWuB,IAD+C;MAElErB,wBAAwB,EAAE,KAFwC;MAGlEC,GAAG,EAAEC,cAAA,CAAIC,iBAHyD;MAIlEC,QAAQ,EAAEC,mBAAA,CAASiB,YAJ+C;MAKlEZ,IAAI,EAAE;QAACa,MAAM,EAAEH;MAAT;IAL4D,CAAnB,EAO9Cb,IAP8C,CAOzC,UAACC,GAAD,EAAS;MACbS,oBAAA,CAAYC,MAAZ,CAAmBC,GAAnB,CAAuB,6EAAvB;;MAEA,OAAOX,GAAG,CAACE,IAAX;IACD,CAX8C,CAA1B;EAAA,CAjCI;EACzB,KAAKf,KAAL,GAAaA,KAAb;AACD;AAED;AACF;AACA;AACA;AACA;AACA;;eAsCeD,mB"}
1
+ {"version":3,"names":["ReachabilityRequest","webex","request","method","HTTP_VERBS","GET","shouldRefreshAccessToken","api","API","CALLIOPEDISCOVERY","resource","RESOURCE","CLUSTERS","qs","JCSupport","then","res","body","clusters","joinCookie","forEach","key","isVideoMesh","clusterClasses","hybridMedia","includes","LoggerProxy","logger","log","localSDPList","POST","REACHABILITY","offers"],"sources":["request.ts"],"sourcesContent":["import LoggerProxy from '../common/logs/logger-proxy';\nimport {HTTP_VERBS, RESOURCE, API} from '../constants';\n\nexport interface ClusterNode {\n isVideoMesh: boolean;\n udp: Array<string>;\n tcp: Array<string>;\n xtls: Array<string>;\n}\n\nexport type ClusterList = {\n [key: string]: ClusterNode;\n};\n\n/**\n * @class ReachabilityRequest\n */\nclass ReachabilityRequest {\n webex: any;\n\n /**\n * Creates an instance of ReachabilityRequest.\n * @param {object} webex\n * @memberof ReachabilityRequest\n */\n constructor(webex: object) {\n this.webex = webex;\n }\n\n /**\n * Gets the cluster information\n *\n * @returns {Promise}\n */\n getClusters = (): Promise<{clusters: ClusterList; joinCookie: any}> =>\n this.webex\n .request({\n method: HTTP_VERBS.GET,\n shouldRefreshAccessToken: false,\n api: API.CALLIOPEDISCOVERY,\n resource: RESOURCE.CLUSTERS,\n qs: {\n JCSupport: 1,\n },\n })\n .then((res) => {\n const {clusters, joinCookie} = res.body;\n\n Object.keys(clusters).forEach((key) => {\n clusters[key].isVideoMesh = res.body.clusterClasses?.hybridMedia?.includes(key);\n });\n\n LoggerProxy.logger.log(\n `Reachability:request#getClusters --> get clusters successful:${JSON.stringify(clusters)}`\n );\n\n return {\n clusters,\n joinCookie,\n };\n });\n\n /**\n * gets remote SDP For Clusters\n * @param {Object} localSDPList localSDPs for the cluster\n * @returns {Object}\n */\n remoteSDPForClusters = (localSDPList: object) =>\n this.webex\n .request({\n method: HTTP_VERBS.POST,\n shouldRefreshAccessToken: false,\n api: API.CALLIOPEDISCOVERY,\n resource: RESOURCE.REACHABILITY,\n body: {offers: localSDPList},\n })\n .then((res) => {\n LoggerProxy.logger.log(\n 'Reachability:request#remoteSDPForClusters --> Remote SDPs got succcessfully'\n );\n\n return res.body;\n });\n}\n\nexport default ReachabilityRequest;\n"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AAaA;AACA;AACA;AAFA,IAGMA,mBAAmB;AAGvB;AACF;AACA;AACA;AACA;AACE,6BAAYC,KAAa,EAAE;EAAA;EAAA;EAAA;EAAA,mDASb;IAAA,OACZ,KAAI,CAACA,KAAK,CACPC,OAAO,CAAC;MACPC,MAAM,EAAEC,qBAAU,CAACC,GAAG;MACtBC,wBAAwB,EAAE,KAAK;MAC/BC,GAAG,EAAEC,cAAG,CAACC,iBAAiB;MAC1BC,QAAQ,EAAEC,mBAAQ,CAACC,QAAQ;MAC3BC,EAAE,EAAE;QACFC,SAAS,EAAE;MACb;IACF,CAAC,CAAC,CACDC,IAAI,CAAC,UAACC,GAAG,EAAK;MACb,gBAA+BA,GAAG,CAACC,IAAI;QAAhCC,QAAQ,aAARA,QAAQ;QAAEC,UAAU,aAAVA,UAAU;MAE3B,mBAAYD,QAAQ,CAAC,CAACE,OAAO,CAAC,UAACC,GAAG,EAAK;QAAA;QACrCH,QAAQ,CAACG,GAAG,CAAC,CAACC,WAAW,4BAAGN,GAAG,CAACC,IAAI,CAACM,cAAc,oFAAvB,sBAAyBC,WAAW,2DAApC,uBAAsCC,QAAQ,CAACJ,GAAG,CAAC;MACjF,CAAC,CAAC;MAEFK,oBAAW,CAACC,MAAM,CAACC,GAAG,wEAC4C,wBAAeV,QAAQ,CAAC,EACzF;MAED,OAAO;QACLA,QAAQ,EAARA,QAAQ;QACRC,UAAU,EAAVA;MACF,CAAC;IACH,CAAC,CAAC;EAAA;EAAA,4DAOiB,UAACU,YAAoB;IAAA,OAC1C,KAAI,CAAC5B,KAAK,CACPC,OAAO,CAAC;MACPC,MAAM,EAAEC,qBAAU,CAAC0B,IAAI;MACvBxB,wBAAwB,EAAE,KAAK;MAC/BC,GAAG,EAAEC,cAAG,CAACC,iBAAiB;MAC1BC,QAAQ,EAAEC,mBAAQ,CAACoB,YAAY;MAC/Bd,IAAI,EAAE;QAACe,MAAM,EAAEH;MAAY;IAC7B,CAAC,CAAC,CACDd,IAAI,CAAC,UAACC,GAAG,EAAK;MACbU,oBAAW,CAACC,MAAM,CAACC,GAAG,CACpB,6EAA6E,CAC9E;MAED,OAAOZ,GAAG,CAACC,IAAI;IACjB,CAAC,CAAC;EAAA;EAxDJ,IAAI,CAAChB,KAAK,GAAGA,KAAK;AACpB;;AAEA;AACF;AACA;AACA;AACA,GAJE;AAAA,eAwDaD,mBAAmB;AAAA"}
@@ -0,0 +1,13 @@
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.REACTION_RELAY_TYPES = void 0;
8
+ // eslint-disable-next-line import/prefer-default-export
9
+ var REACTION_RELAY_TYPES = {
10
+ REACTION: 'react'
11
+ };
12
+ exports.REACTION_RELAY_TYPES = REACTION_RELAY_TYPES;
13
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["REACTION_RELAY_TYPES","REACTION"],"sources":["constants.ts"],"sourcesContent":["// eslint-disable-next-line import/prefer-default-export\nexport const REACTION_RELAY_TYPES = {\n REACTION: 'react',\n} as const;\n"],"mappings":";;;;;;;AAAA;AACO,IAAMA,oBAAoB,GAAG;EAClCC,QAAQ,EAAE;AACZ,CAAU;AAAC"}
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
-
5
4
  _Object$defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
-
9
7
  exports.SkinTones = exports.Reactions = void 0;
10
8
  var Reactions = {
11
9
  smile: {
@@ -38,12 +36,12 @@ var Reactions = {
38
36
  codepoints: '1F44F',
39
37
  shortcodes: ':clap:'
40
38
  },
41
- thumbs_up: {
39
+ thumb_up: {
42
40
  type: 'thumb_up',
43
41
  codepoints: '1F44D',
44
42
  shortcodes: ':thumbsup:'
45
43
  },
46
- thumbs_down: {
44
+ thumb_down: {
47
45
  type: 'thumb_down',
48
46
  codepoints: '1F44E',
49
47
  shortcodes: ':thumbsdown:'
@@ -1 +1 @@
1
- {"version":3,"names":["Reactions","smile","type","codepoints","shortcodes","sad","wow","haha","celebrate","clap","thumbs_up","thumbs_down","heart","fire","prayer","speed_up","slow_down","SkinTones","normal","light","medium_light","medium","medium_dark","dark"],"sources":["reactions.ts"],"sourcesContent":["import {Reaction, ReactionType, SkinTone, SkinToneType} from './reactions.type';\n\nconst Reactions: Record<ReactionType, Reaction> = {\n smile: {\n type: 'smile',\n codepoints: '1F642',\n shortcodes: ':slightly_smiling_face:'\n },\n sad: {\n type: 'sad',\n codepoints: '1F625',\n shortcodes: ':sad_but_relieved_face:',\n },\n wow: {\n type: 'wow',\n codepoints: '1F62E',\n shortcodes: ':open_mouth:',\n },\n haha: {\n type: 'haha',\n codepoints: '1F603',\n shortcodes: ':smiley:'\n },\n celebrate: {\n type: 'celebrate',\n codepoints: '1F389',\n shortcodes: ':party_popper:',\n },\n clap: {\n type: 'clap',\n codepoints: '1F44F',\n shortcodes: ':clap:',\n },\n thumbs_up: {\n type: 'thumb_up',\n codepoints: '1F44D',\n shortcodes: ':thumbsup:',\n },\n thumbs_down: {\n type: 'thumb_down',\n codepoints: '1F44E',\n shortcodes: ':thumbsdown:',\n },\n heart: {\n type: 'heart',\n codepoints: '2764',\n shortcodes: ':heart:',\n },\n fire: {\n type: 'fire',\n codepoints: '1F525',\n shortcodes: ':fire:',\n },\n prayer: {\n type: 'prayer',\n codepoints: '1F64F',\n shortcodes: ':pray:',\n },\n speed_up: {\n type: 'speed_up',\n codepoints: '1F407',\n shortcodes: ':rabbit:',\n },\n slow_down: {\n type: 'slow_down',\n codepoints: '1F422',\n shortcodes: ':turtle:',\n }\n};\n\nconst SkinTones: Record<SkinToneType, SkinTone> = {\n normal: {\n type: 'normal_skin_tone',\n codepoints: '',\n shortcodes: '',\n },\n light: {\n type: 'light_skin_tone',\n codepoints: '1F3FB',\n shortcodes: ':skin-tone-2:',\n },\n medium_light: {\n type: 'medium_light_skin_tone',\n codepoints: '1F3FC',\n shortcodes: ':skin-tone-3:',\n },\n medium: {\n type: 'medium_skin_tone',\n codepoints: '1F3FD',\n shortcodes: ':skin-tone-4:',\n },\n medium_dark: {\n type: 'medium_dark_skin_tone',\n codepoints: '1F3FE',\n shortcodes: ':skin-tone-5:',\n },\n dark: {\n type: 'dark_skin_tone',\n codepoints: '1F3FF',\n shortcodes: ':skin-tone-6:',\n }\n};\n\nexport {Reactions, SkinTones};\n"],"mappings":";;;;;;;;;AAEA,IAAMA,SAAyC,GAAG;EAChDC,KAAK,EAAE;IACLC,IAAI,EAAE,OADD;IAELC,UAAU,EAAE,OAFP;IAGLC,UAAU,EAAE;EAHP,CADyC;EAMhDC,GAAG,EAAE;IACHH,IAAI,EAAE,KADH;IAEHC,UAAU,EAAE,OAFT;IAGHC,UAAU,EAAE;EAHT,CAN2C;EAWhDE,GAAG,EAAE;IACHJ,IAAI,EAAE,KADH;IAEHC,UAAU,EAAE,OAFT;IAGHC,UAAU,EAAE;EAHT,CAX2C;EAgBhDG,IAAI,EAAE;IACJL,IAAI,EAAE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DgB,YAAY,EAAE;IACZlB,IAAI,EAAE,wBADM;IAEZC,UAAU,EAAE,OAFA;IAGZC,UAAU,EAAE;EAHA,CAXkC;EAgBhDiB,MAAM,EAAE;IACNnB,IAAI,EAAE,kBADA;IAENC,UAAU,EAAE,OAFN;IAGNC,UAAU,EAAE;EAHN,CAhBwC;EAqBhDkB,WAAW,EAAE;IACXpB,IAAI,EAAE,uBADK;IAEXC,UAAU,EAAE,OAFD;IAGXC,UAAU,EAAE;EAHD,CArBmC;EA0BhDmB,IAAI,EAAE;IACJrB,IAAI,EAAE,gBADF;IAEJC,UAAU,EAAE,OAFR;IAGJC,UAAU,EAAE;EAHR;AA1B0C,CAAlD"}
1
+ {"version":3,"names":["Reactions","smile","type","codepoints","shortcodes","sad","wow","haha","celebrate","clap","thumb_up","thumb_down","heart","fire","prayer","speed_up","slow_down","SkinTones","normal","light","medium_light","medium","medium_dark","dark"],"sources":["reactions.ts"],"sourcesContent":["import {Reaction, ReactionServerType, SkinTone, SkinToneType} from './reactions.type';\n\nconst Reactions: Record<ReactionServerType, Reaction> = {\n smile: {\n type: 'smile',\n codepoints: '1F642',\n shortcodes: ':slightly_smiling_face:',\n },\n sad: {\n type: 'sad',\n codepoints: '1F625',\n shortcodes: ':sad_but_relieved_face:',\n },\n wow: {\n type: 'wow',\n codepoints: '1F62E',\n shortcodes: ':open_mouth:',\n },\n haha: {\n type: 'haha',\n codepoints: '1F603',\n shortcodes: ':smiley:',\n },\n celebrate: {\n type: 'celebrate',\n codepoints: '1F389',\n shortcodes: ':party_popper:',\n },\n clap: {\n type: 'clap',\n codepoints: '1F44F',\n shortcodes: ':clap:',\n },\n thumb_up: {\n type: 'thumb_up',\n codepoints: '1F44D',\n shortcodes: ':thumbsup:',\n },\n thumb_down: {\n type: 'thumb_down',\n codepoints: '1F44E',\n shortcodes: ':thumbsdown:',\n },\n heart: {\n type: 'heart',\n codepoints: '2764',\n shortcodes: ':heart:',\n },\n fire: {\n type: 'fire',\n codepoints: '1F525',\n shortcodes: ':fire:',\n },\n prayer: {\n type: 'prayer',\n codepoints: '1F64F',\n shortcodes: ':pray:',\n },\n speed_up: {\n type: 'speed_up',\n codepoints: '1F407',\n shortcodes: ':rabbit:',\n },\n slow_down: {\n type: 'slow_down',\n codepoints: '1F422',\n shortcodes: ':turtle:',\n },\n};\n\nconst SkinTones: Record<SkinToneType, SkinTone> = {\n normal: {\n type: 'normal_skin_tone',\n codepoints: '',\n shortcodes: '',\n },\n light: {\n type: 'light_skin_tone',\n codepoints: '1F3FB',\n shortcodes: ':skin-tone-2:',\n },\n medium_light: {\n type: 'medium_light_skin_tone',\n codepoints: '1F3FC',\n shortcodes: ':skin-tone-3:',\n },\n medium: {\n type: 'medium_skin_tone',\n codepoints: '1F3FD',\n shortcodes: ':skin-tone-4:',\n },\n medium_dark: {\n type: 'medium_dark_skin_tone',\n codepoints: '1F3FE',\n shortcodes: ':skin-tone-5:',\n },\n dark: {\n type: 'dark_skin_tone',\n codepoints: '1F3FF',\n shortcodes: ':skin-tone-6:',\n },\n};\n\nexport {Reactions, SkinTones};\n"],"mappings":";;;;;;;AAEA,IAAMA,SAA+C,GAAG;EACtDC,KAAK,EAAE;IACLC,IAAI,EAAE,OAAO;IACbC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDC,GAAG,EAAE;IACHH,IAAI,EAAE,KAAK;IACXC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDE,GAAG,EAAE;IACHJ,IAAI,EAAE,KAAK;IACXC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDG,IAAI,EAAE;IACJL,IAAI,EAAE,MAAM;IACZC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDI,SAAS,EAAE;IACTN,IAAI,EAAE,WAAW;IACjBC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDK,IAAI,EAAE;IACJP,IAAI,EAA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BAAuB;IAC7BC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDmB,IAAI,EAAE;IACJrB,IAAI,EAAE,gBAAgB;IACtBC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd;AACF,CAAC;AAAC"}
@@ -1,34 +1,30 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
-
5
4
  _Object$defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
-
9
- exports.SkinToneType = exports.ReactionType = void 0;
10
- var ReactionType;
11
- exports.ReactionType = ReactionType;
12
-
13
- (function (ReactionType) {
14
- ReactionType["smile"] = "smile";
15
- ReactionType["sad"] = "sad";
16
- ReactionType["wow"] = "wow";
17
- ReactionType["haha"] = "haha";
18
- ReactionType["celebrate"] = "celebrate";
19
- ReactionType["clap"] = "clap";
20
- ReactionType["thumbs_up"] = "thumbs_up";
21
- ReactionType["thumbs_down"] = "thumbs_down";
22
- ReactionType["heart"] = "heart";
23
- ReactionType["fire"] = "fire";
24
- ReactionType["prayer"] = "prayer";
25
- ReactionType["speed_up"] = "speed_up";
26
- ReactionType["slow_down"] = "slow_down";
27
- })(ReactionType || (exports.ReactionType = ReactionType = {}));
28
-
7
+ exports.SkinToneType = exports.ReactionServerType = void 0;
8
+ // eslint-disable-next-line no-shadow
9
+ var ReactionServerType; // eslint-disable-next-line no-shadow
10
+ exports.ReactionServerType = ReactionServerType;
11
+ (function (ReactionServerType) {
12
+ ReactionServerType["smile"] = "smile";
13
+ ReactionServerType["sad"] = "sad";
14
+ ReactionServerType["wow"] = "wow";
15
+ ReactionServerType["haha"] = "haha";
16
+ ReactionServerType["celebrate"] = "celebrate";
17
+ ReactionServerType["clap"] = "clap";
18
+ ReactionServerType["thumb_up"] = "thumb_up";
19
+ ReactionServerType["thumb_down"] = "thumb_down";
20
+ ReactionServerType["heart"] = "heart";
21
+ ReactionServerType["fire"] = "fire";
22
+ ReactionServerType["prayer"] = "prayer";
23
+ ReactionServerType["speed_up"] = "speed_up";
24
+ ReactionServerType["slow_down"] = "slow_down";
25
+ })(ReactionServerType || (exports.ReactionServerType = ReactionServerType = {}));
29
26
  var SkinToneType;
30
27
  exports.SkinToneType = SkinToneType;
31
-
32
28
  (function (SkinToneType) {
33
29
  SkinToneType["normal"] = "normal";
34
30
  SkinToneType["light"] = "light";
@@ -1 +1 @@
1
- {"version":3,"names":["ReactionType","SkinToneType"],"sources":["reactions.type.ts"],"sourcesContent":["\nexport type EmoticonData = {\n type: string;\n codepoints?: string;\n shortcodes?: string;\n}\n\nexport type SkinTone = EmoticonData;\nexport type Reaction = EmoticonData & {\n tone?: SkinTone;\n}\n\nexport enum ReactionType {\n smile = 'smile',\n sad = 'sad',\n wow = 'wow',\n haha = 'haha',\n celebrate = 'celebrate',\n clap = 'clap',\n thumbs_up = 'thumbs_up',\n thumbs_down = 'thumbs_down',\n heart = 'heart',\n fire = 'fire',\n prayer = 'prayer',\n speed_up = 'speed_up',\n slow_down = 'slow_down',\n}\n\nexport enum SkinToneType {\n normal = 'normal',\n light = 'light',\n medium_light = 'medium_light',\n medium = 'medium',\n medium_dark = 'medium_dark',\n dark = 'dark',\n}\n"],"mappings":";;;;;;;;;IAYYA,Y;;;WAAAA,Y;EAAAA,Y;EAAAA,Y;EAAAA,Y;EAAAA,Y;EAAAA,Y;EAAAA,Y;EAAAA,Y;EAAAA,Y;EAAAA,Y;EAAAA,Y;EAAAA,Y;EAAAA,Y;EAAAA,Y;GAAAA,Y,4BAAAA,Y;;IAgBAC,Y;;;WAAAA,Y;EAAAA,Y;EAAAA,Y;EAAAA,Y;EAAAA,Y;EAAAA,Y;EAAAA,Y;GAAAA,Y,4BAAAA,Y"}
1
+ {"version":3,"names":["ReactionServerType","SkinToneType"],"sources":["reactions.type.ts"],"sourcesContent":["import {REACTION_RELAY_TYPES} from './constants';\n\nexport type EmoticonData = {\n type: string;\n codepoints?: string;\n shortcodes?: string;\n};\n\nexport type SkinTone = EmoticonData;\n\nexport type Reaction = EmoticonData & {\n tone?: SkinTone;\n};\n\n// eslint-disable-next-line no-shadow\nexport enum ReactionServerType {\n smile = 'smile',\n sad = 'sad',\n wow = 'wow',\n haha = 'haha',\n celebrate = 'celebrate',\n clap = 'clap',\n thumb_up = 'thumb_up',\n thumb_down = 'thumb_down',\n heart = 'heart',\n fire = 'fire',\n prayer = 'prayer',\n speed_up = 'speed_up',\n slow_down = 'slow_down',\n}\n\n// eslint-disable-next-line no-shadow\nexport enum SkinToneType {\n normal = 'normal',\n light = 'light',\n medium_light = 'medium_light',\n medium = 'medium',\n medium_dark = 'medium_dark',\n dark = 'dark',\n}\n\nexport type Sender = {\n participantId: string;\n};\n\nexport type ProcessedReaction = {\n reaction: Reaction;\n sender: {\n id: Sender['participantId'];\n name: string;\n };\n};\n\ntype RelayEventData = {\n relayType: (typeof REACTION_RELAY_TYPES)['REACTION'];\n reaction: Reaction;\n sender: Sender;\n};\n\nexport type RelayEvent = {\n data: RelayEventData;\n};\n"],"mappings":";;;;;;;AAcA;AAAA,IACYA,kBAAkB,EAgB9B;AAAA;AAAA,WAhBYA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;AAAA,GAAlBA,kBAAkB,kCAAlBA,kBAAkB;AAAA,IAiBlBC,YAAY;AAAA;AAAA,WAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;AAAA,GAAZA,YAAY,4BAAZA,YAAY"}