@webex/plugin-meetings 3.11.0-webex-services-ready.1 → 3.12.0-metrics-init-fix-2.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 (293) hide show
  1. package/AGENTS.md +9 -0
  2. package/dist/aiEnableRequest/index.js +197 -0
  3. package/dist/aiEnableRequest/index.js.map +1 -0
  4. package/dist/aiEnableRequest/utils.js +36 -0
  5. package/dist/aiEnableRequest/utils.js.map +1 -0
  6. package/dist/annotation/index.js +14 -5
  7. package/dist/annotation/index.js.map +1 -1
  8. package/dist/breakouts/breakout.js +8 -3
  9. package/dist/breakouts/breakout.js.map +1 -1
  10. package/dist/breakouts/events.js +29 -14
  11. package/dist/breakouts/events.js.map +1 -1
  12. package/dist/breakouts/index.js +90 -3
  13. package/dist/breakouts/index.js.map +1 -1
  14. package/dist/common/errors/webex-errors.js +49 -5
  15. package/dist/common/errors/webex-errors.js.map +1 -1
  16. package/dist/config.js +8 -3
  17. package/dist/config.js.map +1 -1
  18. package/dist/constants.js +60 -11
  19. package/dist/constants.js.map +1 -1
  20. package/dist/controls-options-manager/constants.js +11 -1
  21. package/dist/controls-options-manager/constants.js.map +1 -1
  22. package/dist/controls-options-manager/index.js +67 -29
  23. package/dist/controls-options-manager/index.js.map +1 -1
  24. package/dist/controls-options-manager/util.js +91 -0
  25. package/dist/controls-options-manager/util.js.map +1 -1
  26. package/dist/hashTree/constants.js +16 -2
  27. package/dist/hashTree/constants.js.map +1 -1
  28. package/dist/hashTree/hashTree.js +18 -0
  29. package/dist/hashTree/hashTree.js.map +1 -1
  30. package/dist/hashTree/hashTreeParser.js +1655 -538
  31. package/dist/hashTree/hashTreeParser.js.map +1 -1
  32. package/dist/hashTree/types.js +4 -2
  33. package/dist/hashTree/types.js.map +1 -1
  34. package/dist/hashTree/utils.js +52 -0
  35. package/dist/hashTree/utils.js.map +1 -1
  36. package/dist/index.js +18 -2
  37. package/dist/index.js.map +1 -1
  38. package/dist/interceptors/constant.js +12 -0
  39. package/dist/interceptors/constant.js.map +1 -0
  40. package/dist/interceptors/dataChannelAuthToken.js +350 -0
  41. package/dist/interceptors/dataChannelAuthToken.js.map +1 -0
  42. package/dist/interceptors/index.js +7 -0
  43. package/dist/interceptors/index.js.map +1 -1
  44. package/dist/interceptors/locusRetry.js +23 -8
  45. package/dist/interceptors/locusRetry.js.map +1 -1
  46. package/dist/interceptors/utils.js +27 -0
  47. package/dist/interceptors/utils.js.map +1 -0
  48. package/dist/interpretation/index.js +11 -2
  49. package/dist/interpretation/index.js.map +1 -1
  50. package/dist/interpretation/interpretation.types.js +7 -0
  51. package/dist/interpretation/interpretation.types.js.map +1 -0
  52. package/dist/interpretation/siLanguage.js +1 -1
  53. package/dist/locus-info/controlsUtils.js +9 -4
  54. package/dist/locus-info/controlsUtils.js.map +1 -1
  55. package/dist/locus-info/index.js +911 -211
  56. package/dist/locus-info/index.js.map +1 -1
  57. package/dist/locus-info/infoUtils.js +36 -5
  58. package/dist/locus-info/infoUtils.js.map +1 -1
  59. package/dist/locus-info/selfUtils.js +1 -0
  60. package/dist/locus-info/selfUtils.js.map +1 -1
  61. package/dist/locus-info/types.js +19 -0
  62. package/dist/locus-info/types.js.map +1 -1
  63. package/dist/media/MediaConnectionAwaiter.js +72 -3
  64. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  65. package/dist/media/index.js +8 -2
  66. package/dist/media/index.js.map +1 -1
  67. package/dist/media/properties.js +8 -7
  68. package/dist/media/properties.js.map +1 -1
  69. package/dist/meeting/in-meeting-actions.js +11 -1
  70. package/dist/meeting/in-meeting-actions.js.map +1 -1
  71. package/dist/meeting/index.js +2266 -1069
  72. package/dist/meeting/index.js.map +1 -1
  73. package/dist/meeting/locusMediaRequest.js +229 -82
  74. package/dist/meeting/locusMediaRequest.js.map +1 -1
  75. package/dist/meeting/muteState.js +10 -1
  76. package/dist/meeting/muteState.js.map +1 -1
  77. package/dist/meeting/request.js +55 -2
  78. package/dist/meeting/request.js.map +1 -1
  79. package/dist/meeting/request.type.js.map +1 -1
  80. package/dist/meeting/util.js +168 -5
  81. package/dist/meeting/util.js.map +1 -1
  82. package/dist/meeting-info/meeting-info-v2.js +2 -2
  83. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  84. package/dist/meetings/index.js +369 -162
  85. package/dist/meetings/index.js.map +1 -1
  86. package/dist/meetings/meetings.types.js +6 -1
  87. package/dist/meetings/meetings.types.js.map +1 -1
  88. package/dist/meetings/request.js +39 -0
  89. package/dist/meetings/request.js.map +1 -1
  90. package/dist/meetings/util.js +116 -18
  91. package/dist/meetings/util.js.map +1 -1
  92. package/dist/member/index.js +20 -0
  93. package/dist/member/index.js.map +1 -1
  94. package/dist/member/types.js.map +1 -1
  95. package/dist/member/util.js +40 -0
  96. package/dist/member/util.js.map +1 -1
  97. package/dist/members/index.js +101 -43
  98. package/dist/members/index.js.map +1 -1
  99. package/dist/members/util.js +8 -1
  100. package/dist/members/util.js.map +1 -1
  101. package/dist/metrics/constants.js +12 -1
  102. package/dist/metrics/constants.js.map +1 -1
  103. package/dist/multistream/codec/constants.js +63 -0
  104. package/dist/multistream/codec/constants.js.map +1 -0
  105. package/dist/multistream/mediaRequestManager.js +64 -68
  106. package/dist/multistream/mediaRequestManager.js.map +1 -1
  107. package/dist/multistream/receiveSlot.js +9 -0
  108. package/dist/multistream/receiveSlot.js.map +1 -1
  109. package/dist/multistream/remoteMediaManager.js +11 -0
  110. package/dist/multistream/remoteMediaManager.js.map +1 -1
  111. package/dist/multistream/sendSlotManager.js +116 -2
  112. package/dist/multistream/sendSlotManager.js.map +1 -1
  113. package/dist/reachability/clusterReachability.js.map +1 -1
  114. package/dist/reachability/index.js +121 -83
  115. package/dist/reachability/index.js.map +1 -1
  116. package/dist/reachability/reachability.types.js +2 -0
  117. package/dist/reachability/reachability.types.js.map +1 -1
  118. package/dist/reachability/util.js +45 -0
  119. package/dist/reachability/util.js.map +1 -1
  120. package/dist/reactions/reactions.type.js.map +1 -1
  121. package/dist/reconnection-manager/index.js +0 -1
  122. package/dist/reconnection-manager/index.js.map +1 -1
  123. package/dist/recording-controller/index.js +1 -3
  124. package/dist/recording-controller/index.js.map +1 -1
  125. package/dist/roap/turnDiscovery.js +8 -1
  126. package/dist/roap/turnDiscovery.js.map +1 -1
  127. package/dist/types/aiEnableRequest/index.d.ts +5 -0
  128. package/dist/types/aiEnableRequest/utils.d.ts +2 -0
  129. package/dist/types/common/errors/webex-errors.d.ts +32 -2
  130. package/dist/types/config.d.ts +6 -2
  131. package/dist/types/constants.d.ts +35 -1
  132. package/dist/types/controls-options-manager/constants.d.ts +6 -1
  133. package/dist/types/controls-options-manager/index.d.ts +16 -0
  134. package/dist/types/hashTree/constants.d.ts +3 -0
  135. package/dist/types/hashTree/hashTree.d.ts +7 -0
  136. package/dist/types/hashTree/hashTreeParser.d.ts +315 -30
  137. package/dist/types/hashTree/types.d.ts +3 -0
  138. package/dist/types/hashTree/utils.d.ts +24 -0
  139. package/dist/types/index.d.ts +4 -0
  140. package/dist/types/interceptors/constant.d.ts +5 -0
  141. package/dist/types/interceptors/dataChannelAuthToken.d.ts +43 -0
  142. package/dist/types/interceptors/index.d.ts +2 -1
  143. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  144. package/dist/types/interceptors/utils.d.ts +1 -0
  145. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  146. package/dist/types/locus-info/index.d.ts +126 -15
  147. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  148. package/dist/types/locus-info/types.d.ts +28 -1
  149. package/dist/types/media/MediaConnectionAwaiter.d.ts +20 -2
  150. package/dist/types/media/properties.d.ts +8 -3
  151. package/dist/types/meeting/in-meeting-actions.d.ts +10 -0
  152. package/dist/types/meeting/index.d.ts +245 -16
  153. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  154. package/dist/types/meeting/request.d.ts +17 -1
  155. package/dist/types/meeting/request.type.d.ts +5 -0
  156. package/dist/types/meeting/util.d.ts +40 -0
  157. package/dist/types/meetings/index.d.ts +42 -20
  158. package/dist/types/meetings/meetings.types.d.ts +15 -0
  159. package/dist/types/meetings/request.d.ts +14 -0
  160. package/dist/types/member/index.d.ts +2 -0
  161. package/dist/types/member/types.d.ts +1 -0
  162. package/dist/types/member/util.d.ts +14 -0
  163. package/dist/types/members/index.d.ts +15 -2
  164. package/dist/types/members/util.d.ts +1 -5
  165. package/dist/types/metrics/constants.d.ts +11 -0
  166. package/dist/types/multistream/codec/constants.d.ts +7 -0
  167. package/dist/types/multistream/mediaRequestManager.d.ts +20 -26
  168. package/dist/types/multistream/sendSlotManager.d.ts +23 -1
  169. package/dist/types/reachability/clusterReachability.d.ts +3 -3
  170. package/dist/types/reachability/index.d.ts +10 -3
  171. package/dist/types/reachability/reachability.types.d.ts +7 -0
  172. package/dist/types/reachability/util.d.ts +17 -0
  173. package/dist/types/reactions/reactions.type.d.ts +4 -0
  174. package/dist/types/webinar/utils.d.ts +6 -0
  175. package/dist/webinar/index.js +585 -164
  176. package/dist/webinar/index.js.map +1 -1
  177. package/dist/webinar/utils.js +25 -0
  178. package/dist/webinar/utils.js.map +1 -0
  179. package/package.json +24 -23
  180. package/src/aiEnableRequest/README.md +84 -0
  181. package/src/aiEnableRequest/index.ts +186 -0
  182. package/src/aiEnableRequest/utils.ts +25 -0
  183. package/src/annotation/index.ts +27 -7
  184. package/src/breakouts/breakout.ts +3 -1
  185. package/src/breakouts/events.ts +33 -11
  186. package/src/breakouts/index.ts +110 -1
  187. package/src/common/errors/webex-errors.ts +50 -3
  188. package/src/config.ts +6 -2
  189. package/src/constants.ts +49 -3
  190. package/src/controls-options-manager/constants.ts +14 -1
  191. package/src/controls-options-manager/index.ts +87 -28
  192. package/src/controls-options-manager/util.ts +81 -1
  193. package/src/hashTree/constants.ts +17 -0
  194. package/src/hashTree/hashTree.ts +17 -0
  195. package/src/hashTree/hashTreeParser.ts +1482 -361
  196. package/src/hashTree/types.ts +4 -0
  197. package/src/hashTree/utils.ts +45 -0
  198. package/src/index.ts +14 -1
  199. package/src/interceptors/constant.ts +6 -0
  200. package/src/interceptors/dataChannelAuthToken.ts +246 -0
  201. package/src/interceptors/index.ts +2 -1
  202. package/src/interceptors/locusRetry.ts +25 -4
  203. package/src/interceptors/utils.ts +16 -0
  204. package/src/interpretation/index.ts +29 -11
  205. package/src/interpretation/interpretation.types.ts +11 -0
  206. package/src/locus-info/controlsUtils.ts +14 -1
  207. package/src/locus-info/index.ts +975 -203
  208. package/src/locus-info/infoUtils.ts +41 -6
  209. package/src/locus-info/selfUtils.ts +1 -0
  210. package/src/locus-info/types.ts +33 -1
  211. package/src/media/MediaConnectionAwaiter.ts +62 -5
  212. package/src/media/index.ts +10 -1
  213. package/src/media/properties.ts +11 -4
  214. package/src/meeting/in-meeting-actions.ts +20 -0
  215. package/src/meeting/index.ts +1258 -166
  216. package/src/meeting/locusMediaRequest.ts +106 -6
  217. package/src/meeting/muteState.ts +10 -1
  218. package/src/meeting/request.ts +53 -0
  219. package/src/meeting/request.type.ts +6 -0
  220. package/src/meeting/util.ts +207 -7
  221. package/src/meeting-info/meeting-info-v2.ts +4 -2
  222. package/src/meetings/index.ts +319 -117
  223. package/src/meetings/meetings.types.ts +19 -0
  224. package/src/meetings/request.ts +43 -0
  225. package/src/meetings/util.ts +117 -4
  226. package/src/member/index.ts +20 -0
  227. package/src/member/types.ts +1 -0
  228. package/src/member/util.ts +41 -0
  229. package/src/members/index.ts +70 -7
  230. package/src/members/util.ts +12 -4
  231. package/src/metrics/constants.ts +12 -0
  232. package/src/multistream/codec/constants.ts +58 -0
  233. package/src/multistream/mediaRequestManager.ts +117 -76
  234. package/src/multistream/receiveSlot.ts +18 -0
  235. package/src/multistream/remoteMediaManager.ts +13 -0
  236. package/src/multistream/sendSlotManager.ts +97 -3
  237. package/src/reachability/clusterReachability.ts +3 -2
  238. package/src/reachability/index.ts +47 -16
  239. package/src/reachability/reachability.types.ts +11 -0
  240. package/src/reachability/util.ts +36 -0
  241. package/src/reactions/reactions.type.ts +4 -0
  242. package/src/reconnection-manager/index.ts +0 -1
  243. package/src/recording-controller/index.ts +1 -2
  244. package/src/roap/turnDiscovery.ts +9 -1
  245. package/src/webinar/index.ts +448 -11
  246. package/src/webinar/utils.ts +16 -0
  247. package/test/unit/spec/aiEnableRequest/index.ts +1067 -0
  248. package/test/unit/spec/aiEnableRequest/utils.ts +130 -0
  249. package/test/unit/spec/annotation/index.ts +69 -7
  250. package/test/unit/spec/breakouts/breakout.ts +9 -3
  251. package/test/unit/spec/breakouts/events.ts +120 -2
  252. package/test/unit/spec/breakouts/index.ts +191 -2
  253. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  254. package/test/unit/spec/controls-options-manager/index.js +244 -29
  255. package/test/unit/spec/controls-options-manager/util.js +165 -0
  256. package/test/unit/spec/hashTree/hashTree.ts +66 -0
  257. package/test/unit/spec/hashTree/hashTreeParser.ts +4528 -171
  258. package/test/unit/spec/hashTree/utils.ts +125 -1
  259. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +406 -0
  260. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  261. package/test/unit/spec/interceptors/utils.ts +75 -0
  262. package/test/unit/spec/interpretation/index.ts +26 -4
  263. package/test/unit/spec/locus-info/controlsUtils.js +200 -56
  264. package/test/unit/spec/locus-info/index.js +1848 -164
  265. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  266. package/test/unit/spec/media/MediaConnectionAwaiter.ts +96 -1
  267. package/test/unit/spec/media/index.ts +92 -0
  268. package/test/unit/spec/media/properties.ts +35 -26
  269. package/test/unit/spec/meeting/in-meeting-actions.ts +12 -2
  270. package/test/unit/spec/meeting/index.js +3611 -334
  271. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  272. package/test/unit/spec/meeting/muteState.js +81 -0
  273. package/test/unit/spec/meeting/request.js +82 -0
  274. package/test/unit/spec/meeting/utils.js +595 -27
  275. package/test/unit/spec/meeting-info/meetinginfov2.js +19 -10
  276. package/test/unit/spec/meetings/index.js +1138 -86
  277. package/test/unit/spec/meetings/request.js +141 -0
  278. package/test/unit/spec/meetings/utils.js +402 -51
  279. package/test/unit/spec/member/index.js +35 -4
  280. package/test/unit/spec/member/util.js +154 -27
  281. package/test/unit/spec/members/index.js +216 -0
  282. package/test/unit/spec/members/request.js +37 -1
  283. package/test/unit/spec/members/utils.js +63 -0
  284. package/test/unit/spec/multistream/mediaRequestManager.ts +503 -122
  285. package/test/unit/spec/multistream/remoteMediaManager.ts +30 -0
  286. package/test/unit/spec/multistream/sendSlotManager.ts +135 -36
  287. package/test/unit/spec/reachability/index.ts +128 -46
  288. package/test/unit/spec/reachability/util.ts +31 -0
  289. package/test/unit/spec/reconnection-manager/index.js +4 -8
  290. package/test/unit/spec/recording-controller/index.js +9 -8
  291. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  292. package/test/unit/spec/webinar/index.ts +837 -39
  293. package/test/unit/spec/webinar/utils.ts +39 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_internalMediaCore","require","SendSlotManager","exports","default","LoggerProxy","_classCallCheck2","_defineProperty2","_map","_createClass2","key","value","createSlot","mediaConnection","mediaType","active","arguments","length","undefined","slots","has","Error","concat","slot","createSendSlot","set","logger","info","getSlot","get","setNamedMediaGroups","namedMediaGroups","MediaType","AudioMain","setSourceStateOverride","state","VideoMain","currentStateOverride","getSourceStateOverride","sourceStateOverrides","clearSourceStateOverride","delete","_publishStream","_asyncToGenerator2","_regenerator","mark","_callee","stream","wrap","_context","prev","next","publishStream","label","muted","stop","_x","_x2","apply","_unpublishStream","_callee2","_context2","unpublishStream","_x3","setActive","_setCodecParameters","_callee3","codecParameters","_context3","setCodecParameters","_x4","_x5","_deleteCodecParameters","_callee4","parameters","_context4","deleteCodecParameters","_x6","_x7","reset","clear"],"sources":["sendSlotManager.ts"],"sourcesContent":["import {\n SendSlot,\n MediaType,\n LocalStream,\n MultistreamRoapMediaConnection,\n NamedMediaGroup,\n StreamState,\n} from '@webex/internal-media-core';\n\n/**\n * This class is used to manage the sendSlots for the given media types.\n */\nexport default class SendSlotManager {\n private readonly slots: Map<MediaType, SendSlot> = new Map();\n private readonly LoggerProxy: any;\n private readonly sourceStateOverrides: Map<MediaType, StreamState> = new Map();\n\n /**\n * Constructor for SendSlotManager\n *\n * @param {any} LoggerProxy is used to log the messages\n * @constructor\n */\n constructor(LoggerProxy: any) {\n this.LoggerProxy = LoggerProxy;\n }\n\n /**\n * This method is used to create a sendSlot for the given mediaType and returns the created sendSlot\n * @param {MultistreamRoapMediaConnection} mediaConnection MultistreamRoapMediaConnection for which a sendSlot needs to be created\n * @param {MediaType} mediaType MediaType for which a sendSlot needs to be created (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {boolean} active This is optional boolean to set the active state of the sendSlot. Default is true\n * @returns {SendSlot} slot The created sendSlot\n */\n public createSlot(\n mediaConnection: MultistreamRoapMediaConnection,\n mediaType: MediaType,\n active = true\n ): SendSlot {\n if (this.slots.has(mediaType)) {\n throw new Error(`Slot for ${mediaType} already exists`);\n }\n\n const slot: SendSlot = mediaConnection.createSendSlot(mediaType, active);\n\n this.slots.set(mediaType, slot);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->createSlot#Created slot for ${mediaType} with active ${active}`\n );\n\n return slot;\n }\n\n /**\n * This method is used to retrieve the sendSlot for the given mediaType\n * @param {MediaType} mediaType of which the slot needs to be retrieved\n * @returns {SendSlot}\n */\n public getSlot(mediaType: MediaType): SendSlot {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n return slot;\n }\n\n /**\n * Allow users to specify 'namedMediaGroups' to indicate which named media group its audio should be sent to.\n * @param {MediaType} mediaType MediaType of the sendSlot to which the audio stream needs to be send to the media group\n * @param {[]}namedMediaGroups - Allow users to specify 'namedMediaGroups'.If the value of 'namedMediaGroups' is zero,\n * named media group will be canceled and the audio stream will be sent to the floor.\n * @returns {void}\n */\n public setNamedMediaGroups(mediaType: MediaType, namedMediaGroups: NamedMediaGroup[]) {\n if (mediaType !== MediaType.AudioMain) {\n throw new Error(\n `sendSlotManager cannot set named media group which media type is ${mediaType}`\n );\n }\n\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n slot.setNamedMediaGroups(namedMediaGroups);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setNamedMediaGroups#set named media group ${namedMediaGroups}`\n );\n }\n\n /**\n * Sets the source state override for the given media type.\n * @param {MediaType} mediaType - The type of media (must be MediaType.VideoMain to apply source state changes).\n * @param {StreamState | null} state - The state to set or null to clear the override value.\n * @returns {void}\n */\n public setSourceStateOverride(mediaType: MediaType, state: StreamState | null) {\n if (mediaType !== MediaType.VideoMain) {\n throw new Error(\n `Invalid media type '${mediaType}'. Source state overrides are only applicable to ${MediaType.VideoMain}.`\n );\n }\n\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n const currentStateOverride = this.getSourceStateOverride(mediaType);\n if (currentStateOverride === state) {\n return;\n }\n\n if (state) {\n slot.setSourceStateOverride(state);\n this.sourceStateOverrides.set(mediaType, state);\n } else {\n slot.clearSourceStateOverride();\n this.sourceStateOverrides.delete(mediaType);\n }\n\n this.LoggerProxy.logger.info(\n `SendSlotManager->setSourceStateOverride#set source state override for ${mediaType} to ${state}`\n );\n }\n\n /**\n * Gets the source state override for the given media type.\n * @param {MediaType} mediaType - The type of media to get the source state override for.\n * @returns {StreamState | null} - The current source state override or null if not set.\n */\n private getSourceStateOverride(mediaType: MediaType): StreamState | null {\n if (mediaType !== MediaType.VideoMain) {\n throw new Error(\n `Invalid media type '${mediaType}'. Source state overrides are only applicable to ${MediaType.VideoMain}.`\n );\n }\n\n return this.sourceStateOverrides.get(mediaType) || null;\n }\n\n /**\n * This method publishes the given stream to the sendSlot for the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot to which a stream needs to be published (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {LocalStream} stream LocalStream to be published\n * @returns {Promise<void>}\n */\n public async publishStream(mediaType: MediaType, stream: LocalStream): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.publishStream(stream);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->publishStream#Published stream for ${mediaType} and stream with label ${stream.label} and muted ${stream.muted}`\n );\n }\n\n /**\n * This method unpublishes the stream from the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot from which a stream needs to be unpublished (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @returns {Promise<void>}\n */\n public async unpublishStream(mediaType: MediaType): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.unpublishStream();\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->unpublishStream#Unpublished stream for ${mediaType}`\n );\n }\n\n /**\n * This method is used to set the active state of the sendSlot for the given mediaType\n * @param {MediaType} mediaType The MediaType of the sendSlot for which the active state needs to be set (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {boolean} active The boolean to set the active state of the sendSlot. Default is true\n * @returns {void}\n */\n public setActive(mediaType: MediaType, active = true): void {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n slot.active = active;\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setActive#Set active for ${mediaType} to ${active}`\n );\n }\n\n /**\n * This method is used to set the codec parameters for the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be set (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {Object} codecParameters\n * @returns {Promise<void>}\n */\n public async setCodecParameters(\n mediaType: MediaType,\n codecParameters: {\n [key: string]: string | undefined; // As per ts-sdp undefined is considered as a valid value to be used for codec parameters\n }\n ): Promise<void> {\n // These codec parameter changes underneath are SDP value changes that are taken care by WCME automatically. So no need for any change in streams from the web sdk side\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.setCodecParameters(codecParameters);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setCodecParameters#Set codec parameters for ${mediaType} to ${codecParameters}`\n );\n }\n\n /**\n * This method is used to delete the codec parameters for the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be deleted (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {Array<String>} parameters Array of keys of the codec parameters to be deleted\n * @returns {Promise<void>}\n */\n public async deleteCodecParameters(mediaType: MediaType, parameters: string[]): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.deleteCodecParameters(parameters);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->deleteCodecParameters#Deleted the following codec parameters -> ${parameters} for ${mediaType}`\n );\n }\n\n /**\n * This method is used to reset the SendSlotsManager by deleting all the sendSlots\n * @returns {undefined}\n */\n public reset(): void {\n this.slots.clear();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AASA;AACA;AACA;AAFA,IAGqBC,eAAe,GAAAC,OAAA,CAAAC,OAAA;EAKlC;AACF;AACA;AACA;AACA;AACA;EACE,SAAAF,gBAAYG,WAAgB,EAAE;IAAA,IAAAC,gBAAA,CAAAF,OAAA,QAAAF,eAAA;IAAA,IAAAK,gBAAA,CAAAH,OAAA,iBAVqB,IAAAI,IAAA,CAAAJ,OAAA,CAAQ,CAAC;IAAA,IAA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A,CACH;MAAA,SAZYG,qBAAqBA,CAAAC,GAAA,EAAAC,GAAA;QAAA,OAAAN,sBAAA,CAAAd,KAAA,OAAA1C,SAAA;MAAA;MAAA,OAArB4D,qBAAqB;IAAA;IAclC;AACF;AACA;AACA;IAHE;EAAA;IAAAlE,GAAA;IAAAC,KAAA,EAIA,SAAOoE,KAAKA,CAAA,EAAS;MACnB,IAAI,CAAC5D,KAAK,CAAC6D,KAAK,CAAC,CAAC;IACpB;EAAC;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_internalMediaCore","require","_metrics","_interopRequireDefault","_constants","SendSlotManager","exports","default","LoggerProxy","_classCallCheck2","_defineProperty2","_map","_createClass2","key","value","createSlot","mediaConnection","mediaType","active","arguments","length","undefined","slots","has","Error","concat","slot","createSendSlot","set","logger","info","getSlot","get","setNamedMediaGroups","namedMediaGroups","MediaType","AudioMain","setSourceStateOverride","state","VideoMain","currentStateOverride","getSourceStateOverride","sourceStateOverrides","clearSourceStateOverride","delete","_publishStream","_asyncToGenerator2","_regenerator","mark","_callee","stream","wrap","_context","prev","next","publishStream","label","muted","stop","_x","_x2","apply","_unpublishStream","_callee2","_context2","unpublishStream","_x3","setActive","_setCodecParameters","_callee3","codecParameters","_context3","setCodecParameters","warn","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","DEPRECATED_SET_CODEC_PARAMETERS_USED","_x4","_x5","_deleteCodecParameters","_callee4","parameters","_context4","deleteCodecParameters","DEPRECATED_DELETE_CODEC_PARAMETERS_USED","_x6","_x7","_setCustomCodecParameters","_callee5","codecMimeType","_t","_context5","setCustomCodecParameters","_stringify","error","SET_CUSTOM_CODEC_PARAMETERS_USED","finish","_x8","_x9","_x0","_markCustomCodecParametersForDeletion","_callee6","_context6","markCustomCodecParametersForDeletion","MARK_CUSTOM_CODEC_PARAMETERS_FOR_DELETION_USED","_x1","_x10","_x11","reset","clear"],"sources":["sendSlotManager.ts"],"sourcesContent":["import {\n SendSlot,\n MediaType,\n LocalStream,\n MultistreamRoapMediaConnection,\n NamedMediaGroup,\n StreamState,\n MediaCodecMimeType,\n CodecParameters,\n} from '@webex/internal-media-core';\nimport Metrics from '../metrics';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\n\n/**\n * This class is used to manage the sendSlots for the given media types.\n */\nexport default class SendSlotManager {\n private readonly slots: Map<MediaType, SendSlot> = new Map();\n private readonly LoggerProxy: any;\n private readonly sourceStateOverrides: Map<MediaType, StreamState> = new Map();\n\n /**\n * Constructor for SendSlotManager\n *\n * @param {any} LoggerProxy is used to log the messages\n * @constructor\n */\n constructor(LoggerProxy: any) {\n this.LoggerProxy = LoggerProxy;\n }\n\n /**\n * This method is used to create a sendSlot for the given mediaType and returns the created sendSlot\n * @param {MultistreamRoapMediaConnection} mediaConnection MultistreamRoapMediaConnection for which a sendSlot needs to be created\n * @param {MediaType} mediaType MediaType for which a sendSlot needs to be created (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {boolean} active This is optional boolean to set the active state of the sendSlot. Default is true\n * @returns {SendSlot} slot The created sendSlot\n */\n public createSlot(\n mediaConnection: MultistreamRoapMediaConnection,\n mediaType: MediaType,\n active = true\n ): SendSlot {\n if (this.slots.has(mediaType)) {\n throw new Error(`Slot for ${mediaType} already exists`);\n }\n\n const slot: SendSlot = mediaConnection.createSendSlot(mediaType, active);\n\n this.slots.set(mediaType, slot);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->createSlot#Created slot for ${mediaType} with active ${active}`\n );\n\n return slot;\n }\n\n /**\n * This method is used to retrieve the sendSlot for the given mediaType\n * @param {MediaType} mediaType of which the slot needs to be retrieved\n * @returns {SendSlot}\n */\n public getSlot(mediaType: MediaType): SendSlot {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n return slot;\n }\n\n /**\n * Allow users to specify 'namedMediaGroups' to indicate which named media group its audio should be sent to.\n * @param {MediaType} mediaType MediaType of the sendSlot to which the audio stream needs to be send to the media group\n * @param {[]}namedMediaGroups - Allow users to specify 'namedMediaGroups'.If the value of 'namedMediaGroups' is zero,\n * named media group will be canceled and the audio stream will be sent to the floor.\n * @returns {void}\n */\n public setNamedMediaGroups(mediaType: MediaType, namedMediaGroups: NamedMediaGroup[]) {\n if (mediaType !== MediaType.AudioMain) {\n throw new Error(\n `sendSlotManager cannot set named media group which media type is ${mediaType}`\n );\n }\n\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n slot.setNamedMediaGroups(namedMediaGroups);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setNamedMediaGroups#set named media group ${namedMediaGroups}`\n );\n }\n\n /**\n * Sets the source state override for the given media type.\n * @param {MediaType} mediaType - The type of media (must be MediaType.VideoMain to apply source state changes).\n * @param {StreamState | null} state - The state to set or null to clear the override value.\n * @returns {void}\n */\n public setSourceStateOverride(mediaType: MediaType, state: StreamState | null) {\n if (mediaType !== MediaType.VideoMain) {\n throw new Error(\n `Invalid media type '${mediaType}'. Source state overrides are only applicable to ${MediaType.VideoMain}.`\n );\n }\n\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n const currentStateOverride = this.getSourceStateOverride(mediaType);\n if (currentStateOverride === state) {\n return;\n }\n\n if (state) {\n slot.setSourceStateOverride(state);\n this.sourceStateOverrides.set(mediaType, state);\n } else {\n slot.clearSourceStateOverride();\n this.sourceStateOverrides.delete(mediaType);\n }\n\n this.LoggerProxy.logger.info(\n `SendSlotManager->setSourceStateOverride#set source state override for ${mediaType} to ${state}`\n );\n }\n\n /**\n * Gets the source state override for the given media type.\n * @param {MediaType} mediaType - The type of media to get the source state override for.\n * @returns {StreamState | null} - The current source state override or null if not set.\n */\n private getSourceStateOverride(mediaType: MediaType): StreamState | null {\n if (mediaType !== MediaType.VideoMain) {\n throw new Error(\n `Invalid media type '${mediaType}'. Source state overrides are only applicable to ${MediaType.VideoMain}.`\n );\n }\n\n return this.sourceStateOverrides.get(mediaType) || null;\n }\n\n /**\n * This method publishes the given stream to the sendSlot for the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot to which a stream needs to be published (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {LocalStream} stream LocalStream to be published\n * @returns {Promise<void>}\n */\n public async publishStream(mediaType: MediaType, stream: LocalStream): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.publishStream(stream);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->publishStream#Published stream for ${mediaType} and stream with label ${stream.label} and muted ${stream.muted}`\n );\n }\n\n /**\n * This method unpublishes the stream from the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot from which a stream needs to be unpublished (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @returns {Promise<void>}\n */\n public async unpublishStream(mediaType: MediaType): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.unpublishStream();\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->unpublishStream#Unpublished stream for ${mediaType}`\n );\n }\n\n /**\n * This method is used to set the active state of the sendSlot for the given mediaType\n * @param {MediaType} mediaType The MediaType of the sendSlot for which the active state needs to be set (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {boolean} active The boolean to set the active state of the sendSlot. Default is true\n * @returns {void}\n */\n public setActive(mediaType: MediaType, active = true): void {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n slot.active = active;\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setActive#Set active for ${mediaType} to ${active}`\n );\n }\n\n /**\n * @deprecated Use {@link setCustomCodecParameters} instead, which requires specifying the codec MIME type.\n *\n * This method is used to set the codec parameters for the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be set (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {Object} codecParameters\n * @returns {Promise<void>}\n */\n public async setCodecParameters(\n mediaType: MediaType,\n codecParameters: {\n [key: string]: string | undefined; // As per ts-sdp undefined is considered as a valid value to be used for codec parameters\n }\n ): Promise<void> {\n // These codec parameter changes underneath are SDP value changes that are taken care by WCME automatically. So no need for any change in streams from the web sdk side\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.setCodecParameters(codecParameters);\n\n this.LoggerProxy.logger.warn(\n 'SendSlotsManager->setCodecParameters --> [DEPRECATION WARNING]: setCodecParameters has been deprecated, use setCustomCodecParameters instead'\n );\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.DEPRECATED_SET_CODEC_PARAMETERS_USED, {\n mediaType,\n codecParameters,\n });\n }\n\n /**\n * @deprecated Use {@link markCustomCodecParametersForDeletion} instead, which requires specifying the codec MIME type.\n *\n * This method is used to delete the codec parameters for the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be deleted (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {Array<String>} parameters Array of keys of the codec parameters to be deleted\n * @returns {Promise<void>}\n */\n public async deleteCodecParameters(mediaType: MediaType, parameters: string[]): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.deleteCodecParameters(parameters);\n\n this.LoggerProxy.logger.warn(\n 'SendSlotsManager->deleteCodecParameters --> [DEPRECATION WARNING]: deleteCodecParameters has been deprecated, use markCustomCodecParametersForDeletion instead'\n );\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.DEPRECATED_DELETE_CODEC_PARAMETERS_USED, {\n mediaType,\n parameters,\n });\n }\n\n /**\n * Sets custom codec parameters for the sendSlot of the given mediaType, scoped to a specific codec MIME type.\n * Delegates to WCME's setCustomCodecParameters API.\n * @param {MediaType} mediaType MediaType of the sendSlot\n * @param {MediaCodecMimeType} codecMimeType The codec MIME type to apply parameters to (e.g. OPUS, H264, AV1)\n * @param {CodecParameters} parameters Key-value pairs of codec parameters to set\n * @returns {Promise<void>}\n */\n public async setCustomCodecParameters(\n mediaType: MediaType,\n codecMimeType: MediaCodecMimeType,\n parameters: CodecParameters\n ): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n try {\n await slot.setCustomCodecParameters(codecMimeType, parameters);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setCustomCodecParameters#Set custom codec parameters for ${mediaType} (codec: ${codecMimeType}) to ${JSON.stringify(\n parameters\n )}`\n );\n } catch (error) {\n this.LoggerProxy.logger.error(\n `SendSlotsManager->setCustomCodecParameters#Failed to set custom codec parameters for ${mediaType} (codec: ${codecMimeType}): ${error}`\n );\n throw error;\n } finally {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.SET_CUSTOM_CODEC_PARAMETERS_USED, {\n mediaType,\n codecMimeType,\n parameters,\n });\n }\n }\n\n /**\n * Marks custom codec parameters for deletion on the sendSlot of the given mediaType, scoped to a specific codec MIME type.\n * Delegates to WCME's markCustomCodecParametersForDeletion API.\n * @param {MediaType} mediaType MediaType of the sendSlot\n * @param {MediaCodecMimeType} codecMimeType The codec MIME type whose parameters should be deleted (e.g. OPUS, H264, AV1)\n * @param {string[]} parameters Array of parameter keys to delete\n * @returns {Promise<void>}\n */\n public async markCustomCodecParametersForDeletion(\n mediaType: MediaType,\n codecMimeType: MediaCodecMimeType,\n parameters: string[]\n ): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.markCustomCodecParametersForDeletion(codecMimeType, parameters);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->markCustomCodecParametersForDeletion#Marked codec parameters for deletion -> ${parameters} for ${mediaType} (codec: ${codecMimeType})`\n );\n\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.MARK_CUSTOM_CODEC_PARAMETERS_FOR_DELETION_USED,\n {\n mediaType,\n codecMimeType,\n parameters,\n }\n );\n }\n\n /**\n * This method is used to reset the SendSlotsManager by deleting all the sendSlots\n * @returns {undefined}\n */\n public reset(): void {\n this.slots.clear();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAUA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA;AACA;AACA;AAFA,IAGqBI,eAAe,GAAAC,OAAA,CAAAC,OAAA;EAKlC;AACF;AACA;AACA;AACA;AACA;EACE,SAAAF,gBAAYG,WAAgB,EAAE;IAAA,IAAAC,gBAAA,CAAAF,OAAA,QAAAF,eAAA;IAAA,IAAAK,gBAAA,CAAAH,OAAA,iBAVqB,IAAAI,IAAA,CAAAJ,OAAA,CAAQ,CAAC;IAAA,IAAAG,gBAAA,CAAAH,OAAA;IAAA,IAAAG,gBAAA,CAAAH,OAAA,gCAES,IAAAI,IAAA,CAAAJ,OAAA,CAAQ,CAAC;IAS5E,IAAI,CAACC,WAAW,GAAGA,WAAW;EAChC;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE,WAAAI,aAAA,CAAAL,OAAA,EAAAF,eAAA;IAAAQ,GAAA;IAAAC,KAAA,EAOA,SAAOC,UAAUA,CACfC,eAA+C,EAC/CC,SAAoB,EAEV;MAAA,IADVC,MAAM,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAA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oBAAoB,CAC1BC,kBAAkB,CAAC6B,8CAA8C,EACjE;gBACExF,SAAS,EAATA,SAAS;gBACTyE,aAAa,EAAbA,aAAa;gBACbR,UAAU,EAAVA;cACF,CACF,CAAC;YAAC;YAAA;cAAA,OAAAqB,SAAA,CAAA7C,IAAA;UAAA;QAAA,GAAA4C,QAAA;MAAA,CACH;MAAA,SAzBYE,oCAAoCA,CAAAE,GAAA,EAAAC,IAAA,EAAAC,IAAA;QAAA,OAAAP,qCAAA,CAAAxC,KAAA,OAAA1C,SAAA;MAAA;MAAA,OAApCqF,oCAAoC;IAAA;IA2BjD;AACF;AACA;AACA;IAHE;EAAA;IAAA3F,GAAA;IAAAC,KAAA,EAIA,SAAO+F,KAAKA,CAAA,EAAS;MACnB,IAAI,CAACvF,KAAK,CAACwF,KAAK,CAAC,CAAC;IACpB;EAAC;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_eventsScope","_interopRequireDefault","require","_loggerProxy","_reachability","_reachabilityPeerConnection","_createForOfIteratorHelper","r","e","t","_Symbol","_Symbol$iterator","_Array$isArray","_unsupportedIterableToArray","length","_n","F","s","n","done","value","f","TypeError","o","a","u","call","next","return","_arrayLikeToArray","toString","slice","constructor","name","_Array$from","test","Array","_callSuper","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","apply","Boolean","prototype","valueOf","Events","exports","resultReady","clientMediaIpsUpdated","natTypeUpdated","ClusterReachability","_EventsScope","clusterInfo","_this","enablePerUdpUrlReachability","arguments","undefined","_classCallCheck2","_defineProperty2","_set","isVideoMesh","initializePerUdpUrlReachabilityCheck","initializeSingleReachabilityPeerConnection","_inherits2","_createClass2","key","reachabilityPeerConnection","ReachabilityPeerConnection","setupReachabilityPeerConnectionEventListeners","_this2","LoggerProxy","logger","log","concat","udp","forEach","udpUrl","singleUdpClusterInfo","tcp","xtls","rpc","reachabilityPeerConnectionsForUdp","push","tcpTlsClusterInfo","_this3","isUdpPerUrl","on","ReachabilityPeerConnectionEvents","data","protocol","udpResultEmitted","result","emit","file","function","reachedSubnets","subnets","subnet","add","getResult","_this$reachabilityPee","_this$reachabilityPee2","_iterator","_step","rpcResult","err","mainResult","_start","_asyncToGenerator2","_regenerator","mark","_callee","startPromises","wrap","_context","prev","start","_promise","all","abrupt","stop","abort","_this$reachabilityPee3","EventsScope"],"sources":["clusterReachability.ts"],"sourcesContent":["import {ClusterNode} from './request';\nimport EventsScope from '../common/events/events-scope';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nimport {Enum} from '../constants';\nimport {\n ClusterReachabilityResult,\n NatType,\n ReachabilityPeerConnectionEvents,\n} from './reachability.types';\nimport {ReachabilityPeerConnection} from './reachabilityPeerConnection';\n\n// data for the Events.resultReady event\nexport type ResultEventData = {\n protocol: 'udp' | 'tcp' | 'xtls';\n result: 'reachable' | 'unreachable' | 'untested';\n latencyInMilliseconds: number; // amount of time it took to get the ICE candidate\n clientMediaIPs?: string[];\n};\n\n// data for the Events.clientMediaIpsUpdated event\nexport type ClientMediaIpsUpdatedEventData = {\n protocol: 'udp' | 'tcp' | 'xtls';\n clientMediaIPs: string[];\n};\n\nexport type NatTypeUpdatedEventData = {\n natType: NatType;\n};\n\nexport const Events = {\n resultReady: 'resultReady', // emitted when a cluster is reached successfully using specific protocol\n clientMediaIpsUpdated: 'clientMediaIpsUpdated', // emitted when more public IPs are found after resultReady was already sent for a given protocol\n natTypeUpdated: 'natTypeUpdated', // emitted when NAT type is determined\n} as const;\n\nexport type Events = Enum<typeof Events>;\n\n/**\n * A class that handles reachability checks for a single cluster.\n * Creates and orchestrates ReachabilityPeerConnection instance(s).\n * Listens to events and emits them to consumers.\n *\n * When enablePerUdpUrlReachability is true:\n * - Creates one ReachabilityPeerConnection for each UDP URL\n * - Creates one ReachabilityPeerConnection for all TCP and TLS URLs together\n * Otherwise:\n * - Creates a single ReachabilityPeerConnection for all URLs\n */\nexport class ClusterReachability extends EventsScope {\n private reachabilityPeerConnection: ReachabilityPeerConnection | null = null;\n private reachabilityPeerConnectionsForUdp: ReachabilityPeerConnection[] = [];\n\n public readonly isVideoMesh: boolean;\n public readonly name;\n public readonly reachedSubnets: Set<string> = new Set();\n\n private enablePerUdpUrlReachability: boolean;\n private udpResultEmitted = false;\n\n /**\n * Constructor for ClusterReachability\n * @param {string} name cluster name\n * @param {ClusterNode} clusterInfo information about the media cluster\n * @param {boolean} enablePerUdpUrlReachability whether to create separate peer connections per UDP URL\n */\n constructor(name: string, clusterInfo: ClusterNode, enablePerUdpUrlReachability = false) {\n super();\n this.name = name;\n this.isVideoMesh = clusterInfo.isVideoMesh;\n this.enablePerUdpUrlReachability = enablePerUdpUrlReachability;\n\n if (this.enablePerUdpUrlReachability) {\n this.initializePerUdpUrlReachabilityCheck(clusterInfo);\n } else {\n this.initializeSingleReachabilityPeerConnection(clusterInfo);\n }\n }\n\n /**\n * Initializes a single ReachabilityPeerConnection for all protocols\n * @param {ClusterNode} clusterInfo information about the media cluster\n * @returns {void}\n */\n private initializeSingleReachabilityPeerConnection(clusterInfo: ClusterNode) {\n this.reachabilityPeerConnection = new ReachabilityPeerConnection(this.name, clusterInfo);\n this.setupReachabilityPeerConnectionEventListeners(this.reachabilityPeerConnection);\n }\n\n /**\n * Initializes per-URL UDP reachability checks:\n * - One ReachabilityPeerConnection per UDP URL\n * - One ReachabilityPeerConnection for all TCP and TLS URLs together\n * @param {ClusterNode} clusterInfo information about the media cluster\n * @returns {void}\n */\n private initializePerUdpUrlReachabilityCheck(clusterInfo: ClusterNode) {\n LoggerProxy.logger.log(\n `ClusterReachability#initializePerUdpUrlReachabilityCheck --> cluster: ${this.name}, performing per-URL UDP reachability for ${clusterInfo.udp.length} URLs`\n );\n\n // Create one ReachabilityPeerConnection for each UDP URL\n clusterInfo.udp.forEach((udpUrl) => {\n const singleUdpClusterInfo: ClusterNode = {\n isVideoMesh: clusterInfo.isVideoMesh,\n udp: [udpUrl],\n tcp: [],\n xtls: [],\n };\n const rpc = new ReachabilityPeerConnection(this.name, singleUdpClusterInfo);\n this.setupReachabilityPeerConnectionEventListeners(rpc, true);\n this.reachabilityPeerConnectionsForUdp.push(rpc);\n });\n\n // Create one ReachabilityPeerConnection for all TCP and TLS URLs together\n if (clusterInfo.tcp.length > 0 || clusterInfo.xtls.length > 0) {\n const tcpTlsClusterInfo: ClusterNode = {\n isVideoMesh: clusterInfo.isVideoMesh,\n udp: [],\n tcp: clusterInfo.tcp,\n xtls: clusterInfo.xtls,\n };\n this.reachabilityPeerConnection = new ReachabilityPeerConnection(\n this.name,\n tcpTlsClusterInfo\n );\n this.setupReachabilityPeerConnectionEventListeners(this.reachabilityPeerConnection);\n }\n }\n\n /**\n * Sets up event listeners for a ReachabilityPeerConnection instance\n * @param {ReachabilityPeerConnection} rpc the ReachabilityPeerConnection instance\n * @param {boolean} isUdpPerUrl whether this is a per-URL UDP instance\n * @returns {void}\n */\n private setupReachabilityPeerConnectionEventListeners(\n rpc: ReachabilityPeerConnection,\n isUdpPerUrl = false\n ) {\n rpc.on(ReachabilityPeerConnectionEvents.resultReady, (data) => {\n // For per-URL UDP checks, only emit the first successful UDP result\n if (isUdpPerUrl && data.protocol === 'udp') {\n if (this.udpResultEmitted) {\n return;\n }\n if (data.result === 'reachable') {\n this.udpResultEmitted = true;\n }\n }\n\n this.emit(\n {\n file: 'clusterReachability',\n function: 'setupReachabilityPeerConnectionEventListeners',\n },\n Events.resultReady,\n data\n );\n });\n\n rpc.on(ReachabilityPeerConnectionEvents.clientMediaIpsUpdated, (data) => {\n this.emit(\n {\n file: 'clusterReachability',\n function: 'setupReachabilityPeerConnectionEventListeners',\n },\n Events.clientMediaIpsUpdated,\n data\n );\n });\n\n rpc.on(ReachabilityPeerConnectionEvents.natTypeUpdated, (data) => {\n this.emit(\n {\n file: 'clusterReachability',\n function: 'setupReachabilityPeerConnectionEventListeners',\n },\n Events.natTypeUpdated,\n data\n );\n });\n\n rpc.on(ReachabilityPeerConnectionEvents.reachedSubnets, (data) => {\n data.subnets.forEach((subnet: string) => {\n this.reachedSubnets.add(subnet);\n });\n });\n }\n\n /**\n * Gets the aggregated reachability result for this cluster.\n * @returns {ClusterReachabilityResult} reachability result for this cluster\n */\n getResult(): ClusterReachabilityResult {\n if (!this.enablePerUdpUrlReachability) {\n return (\n this.reachabilityPeerConnection?.getResult() ?? {\n udp: {result: 'untested'},\n tcp: {result: 'untested'},\n xtls: {result: 'untested'},\n }\n );\n }\n\n const result: ClusterReachabilityResult = {\n udp: {result: 'untested'},\n tcp: {result: 'untested'},\n xtls: {result: 'untested'},\n };\n\n // Get the first reachable UDP result from per-URL instances\n for (const rpc of this.reachabilityPeerConnectionsForUdp) {\n const rpcResult = rpc.getResult();\n if (rpcResult.udp.result === 'reachable') {\n result.udp = rpcResult.udp;\n break;\n }\n if (rpcResult.udp.result === 'unreachable' && result.udp.result === 'untested') {\n result.udp = rpcResult.udp;\n }\n }\n\n // Get TCP and TLS results from the main peer connection\n if (this.reachabilityPeerConnection) {\n const mainResult = this.reachabilityPeerConnection.getResult();\n result.tcp = mainResult.tcp;\n result.xtls = mainResult.xtls;\n }\n\n return result;\n }\n\n /**\n * Starts the process of doing UDP, TCP, and XTLS reachability checks on the media cluster.\n * @returns {Promise<ClusterReachabilityResult>}\n */\n async start(): Promise<ClusterReachabilityResult> {\n const startPromises: Promise<ClusterReachabilityResult>[] = [];\n\n this.reachabilityPeerConnectionsForUdp.forEach((rpc) => {\n startPromises.push(rpc.start());\n });\n\n if (this.reachabilityPeerConnection) {\n startPromises.push(this.reachabilityPeerConnection.start());\n }\n\n await Promise.all(startPromises);\n\n return this.getResult();\n }\n\n /**\n * Aborts the cluster reachability checks\n * @returns {void}\n */\n public abort() {\n this.reachabilityPeerConnectionsForUdp.forEach((rpc) => rpc.abort());\n this.reachabilityPeerConnection?.abort();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GA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AA,CAAAzF,IAAA;YAAA;cACQuF,aAAmD,GAAG,EAAE;cAE9D,IAAI,CAAC/B,iCAAiC,CAACN,OAAO,CAAC,UAACK,GAAG,EAAK;gBACtDgC,aAAa,CAAC9B,IAAI,CAACF,GAAG,CAACoC,KAAK,CAAC,CAAC,CAAC;cACjC,CAAC,CAAC;cAEF,IAAI,IAAI,CAAClD,0BAA0B,EAAE;gBACnC8C,aAAa,CAAC9B,IAAI,CAAC,IAAI,CAAChB,0BAA0B,CAACkD,KAAK,CAAC,CAAC,CAAC;cAC7D;cAACF,QAAA,CAAAzF,IAAA;cAAA,OAEK4F,QAAA,CAAAhF,OAAA,CAAQiF,GAAG,CAACN,aAAa,CAAC;YAAA;cAAA,OAAAE,QAAA,CAAAK,MAAA,WAEzB,IAAI,CAACpB,SAAS,CAAC,CAAC;YAAA;YAAA;cAAA,OAAAe,QAAA,CAAAM,IAAA;UAAA;QAAA,GAAAT,OAAA;MAAA,CACxB;MAAA,SAdKK,KAAKA,CAAA;QAAA,OAAAT,MAAA,CAAAlE,KAAA,OAAAc,SAAA;MAAA;MAAA,OAAL6D,KAAK;IAAA;IAgBX;AACF;AACA;AACA;IAHE;EAAA;IAAAnD,GAAA;IAAA/C,KAAA,EAIA,SAAOuG,KAAKA,CAAA,EAAG;MAAA,IAAAC,sBAAA;MACb,IAAI,CAACzC,iCAAiC,CAACN,OAAO,CAAC,UAACK,GAAG;QAAA,OAAKA,GAAG,CAACyC,KAAK,CAAC,CAAC;MAAA,EAAC;MACpE,CAAAC,sBAAA,OAAI,CAACxD,0BAA0B,cAAAwD,sBAAA,uBAA/BA,sBAAA,CAAiCD,KAAK,CAAC,CAAC;IAC1C;EAAC;AAAA,EAnNsCE,oBAAW","ignoreList":[]}
1
+ {"version":3,"names":["_eventsScope","_interopRequireDefault","require","_loggerProxy","_reachability","_reachabilityPeerConnection","_createForOfIteratorHelper","r","e","t","_Symbol","_Symbol$iterator","_Array$isArray","_unsupportedIterableToArray","length","_n","F","s","n","done","value","f","TypeError","o","a","u","call","next","return","_arrayLikeToArray","toString","slice","constructor","name","_Array$from","test","Array","_callSuper","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","apply","Boolean","prototype","valueOf","Events","exports","resultReady","clientMediaIpsUpdated","natTypeUpdated","ClusterReachability","_EventsScope","clusterInfo","_this","enablePerUdpUrlReachability","arguments","undefined","_classCallCheck2","_defineProperty2","_set","isVideoMesh","initializePerUdpUrlReachabilityCheck","initializeSingleReachabilityPeerConnection","_inherits2","_createClass2","key","reachabilityPeerConnection","ReachabilityPeerConnection","setupReachabilityPeerConnectionEventListeners","_this2","LoggerProxy","logger","log","concat","udp","forEach","udpUrl","singleUdpClusterInfo","tcp","xtls","rpc","reachabilityPeerConnectionsForUdp","push","tcpTlsClusterInfo","_this3","isUdpPerUrl","on","ReachabilityPeerConnectionEvents","data","protocol","udpResultEmitted","result","emit","file","function","reachedSubnets","subnets","subnet","add","getResult","_this$reachabilityPee","_this$reachabilityPee2","_iterator","_step","rpcResult","err","mainResult","_start","_asyncToGenerator2","_regenerator","mark","_callee","startPromises","wrap","_context","prev","start","_promise","all","abrupt","stop","abort","_this$reachabilityPee3","EventsScope"],"sources":["clusterReachability.ts"],"sourcesContent":["import {ClusterNode} from './request';\nimport EventsScope from '../common/events/events-scope';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nimport {Enum} from '../constants';\nimport {\n ClusterReachabilityResult,\n NatType,\n Protocol,\n ReachabilityPeerConnectionEvents,\n} from './reachability.types';\nimport {ReachabilityPeerConnection} from './reachabilityPeerConnection';\n\n// data for the Events.resultReady event\nexport type ResultEventData = {\n protocol: Protocol;\n result: 'reachable' | 'unreachable' | 'untested';\n latencyInMilliseconds: number; // amount of time it took to get the ICE candidate\n clientMediaIPs?: string[];\n};\n\n// data for the Events.clientMediaIpsUpdated event\nexport type ClientMediaIpsUpdatedEventData = {\n protocol: Protocol;\n clientMediaIPs: string[];\n};\n\nexport type NatTypeUpdatedEventData = {\n natType: NatType;\n};\n\nexport const Events = {\n resultReady: 'resultReady', // emitted when a cluster is reached successfully using specific protocol\n clientMediaIpsUpdated: 'clientMediaIpsUpdated', // emitted when more public IPs are found after resultReady was already sent for a given protocol\n natTypeUpdated: 'natTypeUpdated', // emitted when NAT type is determined\n} as const;\n\nexport type Events = Enum<typeof Events>;\n\n/**\n * A class that handles reachability checks for a single cluster.\n * Creates and orchestrates ReachabilityPeerConnection instance(s).\n * Listens to events and emits them to consumers.\n *\n * When enablePerUdpUrlReachability is true:\n * - Creates one ReachabilityPeerConnection for each UDP URL\n * - Creates one ReachabilityPeerConnection for all TCP and TLS URLs together\n * Otherwise:\n * - Creates a single ReachabilityPeerConnection for all URLs\n */\nexport class ClusterReachability extends EventsScope {\n private reachabilityPeerConnection: ReachabilityPeerConnection | null = null;\n private reachabilityPeerConnectionsForUdp: ReachabilityPeerConnection[] = [];\n\n public readonly isVideoMesh: boolean;\n public readonly name;\n public readonly reachedSubnets: Set<string> = new Set();\n\n private enablePerUdpUrlReachability: boolean;\n private udpResultEmitted = false;\n\n /**\n * Constructor for ClusterReachability\n * @param {string} name cluster name\n * @param {ClusterNode} clusterInfo information about the media cluster\n * @param {boolean} enablePerUdpUrlReachability whether to create separate peer connections per UDP URL\n */\n constructor(name: string, clusterInfo: ClusterNode, enablePerUdpUrlReachability = false) {\n super();\n this.name = name;\n this.isVideoMesh = clusterInfo.isVideoMesh;\n this.enablePerUdpUrlReachability = enablePerUdpUrlReachability;\n\n if (this.enablePerUdpUrlReachability) {\n this.initializePerUdpUrlReachabilityCheck(clusterInfo);\n } else {\n this.initializeSingleReachabilityPeerConnection(clusterInfo);\n }\n }\n\n /**\n * Initializes a single ReachabilityPeerConnection for all protocols\n * @param {ClusterNode} clusterInfo information about the media cluster\n * @returns {void}\n */\n private initializeSingleReachabilityPeerConnection(clusterInfo: ClusterNode) {\n this.reachabilityPeerConnection = new ReachabilityPeerConnection(this.name, clusterInfo);\n this.setupReachabilityPeerConnectionEventListeners(this.reachabilityPeerConnection);\n }\n\n /**\n * Initializes per-URL UDP reachability checks:\n * - One ReachabilityPeerConnection per UDP URL\n * - One ReachabilityPeerConnection for all TCP and TLS URLs together\n * @param {ClusterNode} clusterInfo information about the media cluster\n * @returns {void}\n */\n private initializePerUdpUrlReachabilityCheck(clusterInfo: ClusterNode) {\n LoggerProxy.logger.log(\n `ClusterReachability#initializePerUdpUrlReachabilityCheck --> cluster: ${this.name}, performing per-URL UDP reachability for ${clusterInfo.udp.length} URLs`\n );\n\n // Create one ReachabilityPeerConnection for each UDP URL\n clusterInfo.udp.forEach((udpUrl) => {\n const singleUdpClusterInfo: ClusterNode = {\n isVideoMesh: clusterInfo.isVideoMesh,\n udp: [udpUrl],\n tcp: [],\n xtls: [],\n };\n const rpc = new ReachabilityPeerConnection(this.name, singleUdpClusterInfo);\n this.setupReachabilityPeerConnectionEventListeners(rpc, true);\n this.reachabilityPeerConnectionsForUdp.push(rpc);\n });\n\n // Create one ReachabilityPeerConnection for all TCP and TLS URLs together\n if (clusterInfo.tcp.length > 0 || clusterInfo.xtls.length > 0) {\n const tcpTlsClusterInfo: ClusterNode = {\n isVideoMesh: clusterInfo.isVideoMesh,\n udp: [],\n tcp: clusterInfo.tcp,\n xtls: clusterInfo.xtls,\n };\n this.reachabilityPeerConnection = new ReachabilityPeerConnection(\n this.name,\n tcpTlsClusterInfo\n );\n this.setupReachabilityPeerConnectionEventListeners(this.reachabilityPeerConnection);\n }\n }\n\n /**\n * Sets up event listeners for a ReachabilityPeerConnection instance\n * @param {ReachabilityPeerConnection} rpc the ReachabilityPeerConnection instance\n * @param {boolean} isUdpPerUrl whether this is a per-URL UDP instance\n * @returns {void}\n */\n private setupReachabilityPeerConnectionEventListeners(\n rpc: ReachabilityPeerConnection,\n isUdpPerUrl = false\n ) {\n rpc.on(ReachabilityPeerConnectionEvents.resultReady, (data) => {\n // For per-URL UDP checks, only emit the first successful UDP result\n if (isUdpPerUrl && data.protocol === 'udp') {\n if (this.udpResultEmitted) {\n return;\n }\n if (data.result === 'reachable') {\n this.udpResultEmitted = true;\n }\n }\n\n this.emit(\n {\n file: 'clusterReachability',\n function: 'setupReachabilityPeerConnectionEventListeners',\n },\n Events.resultReady,\n data\n );\n });\n\n rpc.on(ReachabilityPeerConnectionEvents.clientMediaIpsUpdated, (data) => {\n this.emit(\n {\n file: 'clusterReachability',\n function: 'setupReachabilityPeerConnectionEventListeners',\n },\n Events.clientMediaIpsUpdated,\n data\n );\n });\n\n rpc.on(ReachabilityPeerConnectionEvents.natTypeUpdated, (data) => {\n this.emit(\n {\n file: 'clusterReachability',\n function: 'setupReachabilityPeerConnectionEventListeners',\n },\n Events.natTypeUpdated,\n data\n );\n });\n\n rpc.on(ReachabilityPeerConnectionEvents.reachedSubnets, (data) => {\n data.subnets.forEach((subnet: string) => {\n this.reachedSubnets.add(subnet);\n });\n });\n }\n\n /**\n * Gets the aggregated reachability result for this cluster.\n * @returns {ClusterReachabilityResult} reachability result for this cluster\n */\n getResult(): ClusterReachabilityResult {\n if (!this.enablePerUdpUrlReachability) {\n return (\n this.reachabilityPeerConnection?.getResult() ?? {\n udp: {result: 'untested'},\n tcp: {result: 'untested'},\n xtls: {result: 'untested'},\n }\n );\n }\n\n const result: ClusterReachabilityResult = {\n udp: {result: 'untested'},\n tcp: {result: 'untested'},\n xtls: {result: 'untested'},\n };\n\n // Get the first reachable UDP result from per-URL instances\n for (const rpc of this.reachabilityPeerConnectionsForUdp) {\n const rpcResult = rpc.getResult();\n if (rpcResult.udp.result === 'reachable') {\n result.udp = rpcResult.udp;\n break;\n }\n if (rpcResult.udp.result === 'unreachable' && result.udp.result === 'untested') {\n result.udp = rpcResult.udp;\n }\n }\n\n // Get TCP and TLS results from the main peer connection\n if (this.reachabilityPeerConnection) {\n const mainResult = this.reachabilityPeerConnection.getResult();\n result.tcp = mainResult.tcp;\n result.xtls = mainResult.xtls;\n }\n\n return result;\n }\n\n /**\n * Starts the process of doing UDP, TCP, and XTLS reachability checks on the media cluster.\n * @returns {Promise<ClusterReachabilityResult>}\n */\n async start(): Promise<ClusterReachabilityResult> {\n const startPromises: Promise<ClusterReachabilityResult>[] = [];\n\n this.reachabilityPeerConnectionsForUdp.forEach((rpc) => {\n startPromises.push(rpc.start());\n });\n\n if (this.reachabilityPeerConnection) {\n startPromises.push(this.reachabilityPeerConnection.start());\n }\n\n await Promise.all(startPromises);\n\n return this.getResult();\n }\n\n /**\n * Aborts the cluster reachability checks\n * @returns {void}\n */\n public abort() {\n this.reachabilityPeerConnectionsForUdp.forEach((rpc) => rpc.abort());\n this.reachabilityPeerConnection?.abort();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AAGA,IAAAE,aAAA,GAAAF,OAAA;AAMA,IAAAG,2BAAA,GAAAH,OAAA;AAAwE,SAAAI,2BAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,yBAAAC,OAAA,IAAAH,CAAA,CAAAI,gBAAA,KAAAJ,CAAA,qBAAAE,CAAA,QAAAG,cAAA,CAAAL,CAAA,MAAAE,CAAA,GAAAI,2BAAA,CAAAN,CAAA,MAAAC,CAAA,IAAAD,CAAA,uBAAAA,CAAA,CAAAO,MAAA,IAAAL,CAAA,KAAAF,CAAA,GAAAE,CAAA,OAAAM,EAAA,MAAAC,CAAA,YAAAA,EAAA,eAAAC,CAAA,EAAAD,CAAA,EAAAE,CAAA,WAAAA,EAAA,WAAAH,EAAA,IAAAR,CAAA,CAAAO,MAAA,KAAAK,IAAA,WAAAA,IAAA,MAAAC,KAAA,EAAAb,CAAA,CAAAQ,EAAA,UAAAP,CAAA,WAAAA,EAAAD,CAAA,UAAAA,CAAA,KAAAc,CAAA,EAAAL,CAAA,gBAAAM,SAAA,iJAAAC,CAAA,EAAAC,CAAA,OAAAC,CAAA,gBAAAR,CAAA,WAAAA,EAAA,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;IAAAnD,GAAA;IAAA/C,KAAA,EAIA,SAAOuG,KAAKA,CAAA,EAAG;MAAA,IAAAC,sBAAA;MACb,IAAI,CAACzC,iCAAiC,CAACN,OAAO,CAAC,UAACK,GAAG;QAAA,OAAKA,GAAG,CAACyC,KAAK,CAAC,CAAC;MAAA,EAAC;MACpE,CAAAC,sBAAA,OAAI,CAACxD,0BAA0B,cAAAwD,sBAAA,uBAA/BA,sBAAA,CAAiCD,KAAK,CAAC,CAAC;IAC1C;EAAC;AAAA,EAnNsCE,oBAAW","ignoreList":[]}
@@ -37,6 +37,7 @@ var _constants = require("../constants");
37
37
  var _request = _interopRequireDefault(require("./request"));
38
38
  var _reachability = require("./reachability.types");
39
39
  var _clusterReachability = require("./clusterReachability");
40
+ var _util2 = require("./util");
40
41
  var _eventsScope = _interopRequireDefault(require("../common/events/events-scope"));
41
42
  var _constants2 = _interopRequireDefault(require("../metrics/constants"));
42
43
  var _metrics = _interopRequireDefault(require("../metrics"));
@@ -227,7 +228,7 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
227
228
  return _regenerator.default.wrap(function (_context2) {
228
229
  while (1) switch (_context2.prev = _context2.next) {
229
230
  case 0:
230
- if (this.webex.config.meetings.enableReachabilityChecks) {
231
+ if ((0, _util2.isReachabilityEnabled)(this.webex.config.meetings.enableReachabilityChecks)) {
231
232
  _context2.next = 1;
232
233
  break;
233
234
  }
@@ -652,7 +653,7 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
652
653
  * Returns true only if ALL protocols (UDP, TCP and TLS) have been tested and none
653
654
  * of the media clusters where reachable with any of the protocols. This is done
654
655
  * irrespective of the config, so for example:
655
- * if config.meetings.experimental.enableTlsReachability === false,
656
+ * if config.meetings.enableReachabilityChecks disables TLS,
656
657
  * it will return false, because TLS reachability won't be tested,
657
658
  * so we can't say for sure that media backend is unreachable over TLS.
658
659
  *
@@ -721,6 +722,47 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
721
722
  }
722
723
  return isWebexMediaBackendUnreachable;
723
724
  }()
725
+ /**
726
+ * Checks if any cluster is reachable via the given protocol based on stored reachability results.
727
+ *
728
+ * @param {string} protocol - the protocol to check ('udp', 'tcp', or 'xtls')
729
+ * @returns {Promise<boolean>} true if at least one cluster has a 'reachable' result for the given protocol
730
+ */
731
+ )
732
+ }, {
733
+ key: "isAnyClusterReachableViaProtocol",
734
+ value: (function () {
735
+ var _isAnyClusterReachableViaProtocol = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0(protocol) {
736
+ var resultsJson, results, _t6;
737
+ return _regenerator.default.wrap(function (_context0) {
738
+ while (1) switch (_context0.prev = _context0.next) {
739
+ case 0:
740
+ _context0.prev = 0;
741
+ _context0.next = 1;
742
+ return this.webex.boundedStorage.get(this.namespace, _constants.REACHABILITY.localStorageResult);
743
+ case 1:
744
+ resultsJson = _context0.sent;
745
+ results = JSON.parse(resultsJson);
746
+ return _context0.abrupt("return", (0, _values.default)(results).some(function (result) {
747
+ var _result$protocol3;
748
+ return ((_result$protocol3 = result[protocol]) === null || _result$protocol3 === void 0 ? void 0 : _result$protocol3.result) === 'reachable';
749
+ }));
750
+ case 2:
751
+ _context0.prev = 2;
752
+ _t6 = _context0["catch"](0);
753
+ _loggerProxy.default.logger.warn("Reachability:index#isAnyClusterReachableViaProtocol --> Error reading reachability data: ".concat(_t6));
754
+ return _context0.abrupt("return", false);
755
+ case 3:
756
+ case "end":
757
+ return _context0.stop();
758
+ }
759
+ }, _callee0, this, [[0, 2]]);
760
+ }));
761
+ function isAnyClusterReachableViaProtocol(_x4) {
762
+ return _isAnyClusterReachableViaProtocol.apply(this, arguments);
763
+ }
764
+ return isAnyClusterReachableViaProtocol;
765
+ }()
724
766
  /**
725
767
  * Get list of all unreachable clusters
726
768
  * @returns {array} Unreachable clusters
@@ -900,15 +942,15 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
900
942
  }, {
901
943
  key: "sendMetric",
902
944
  value: (function () {
903
- var _sendMetric = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
945
+ var _sendMetric = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
904
946
  var aborted,
905
947
  results,
906
948
  stats,
907
- _args0 = arguments;
908
- return _regenerator.default.wrap(function (_context0) {
909
- while (1) switch (_context0.prev = _context0.next) {
949
+ _args1 = arguments;
950
+ return _regenerator.default.wrap(function (_context1) {
951
+ while (1) switch (_context1.prev = _context1.next) {
910
952
  case 0:
911
- aborted = _args0.length > 0 && _args0[0] !== undefined ? _args0[0] : false;
953
+ aborted = _args1.length > 0 && _args1[0] !== undefined ? _args1[0] : false;
912
954
  results = [];
913
955
  (0, _values.default)(this.clusterReachability).forEach(function (clusterReachability) {
914
956
  results.push(_objectSpread(_objectSpread({}, clusterReachability.getResult()), {}, {
@@ -940,9 +982,9 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
940
982
  _metrics.default.sendBehavioralMetric(_constants2.default.REACHABILITY_COMPLETED, _metrics.default.prepareMetricFields(stats));
941
983
  case 1:
942
984
  case "end":
943
- return _context0.stop();
985
+ return _context1.stop();
944
986
  }
945
- }, _callee0, this);
987
+ }, _callee1, this);
946
988
  }));
947
989
  function sendMetric() {
948
990
  return _sendMetric.apply(this, arguments);
@@ -998,19 +1040,19 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
998
1040
  }, {
999
1041
  key: "storeResults",
1000
1042
  value: (function () {
1001
- var _storeResults = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1(results) {
1002
- return _regenerator.default.wrap(function (_context1) {
1003
- while (1) switch (_context1.prev = _context1.next) {
1043
+ var _storeResults = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10(results) {
1044
+ return _regenerator.default.wrap(function (_context10) {
1045
+ while (1) switch (_context10.prev = _context10.next) {
1004
1046
  case 0:
1005
- _context1.next = 1;
1047
+ _context10.next = 1;
1006
1048
  return this.webex.boundedStorage.put(this.namespace, _constants.REACHABILITY.localStorageResult, (0, _stringify.default)(results));
1007
1049
  case 1:
1008
1050
  case "end":
1009
- return _context1.stop();
1051
+ return _context10.stop();
1010
1052
  }
1011
- }, _callee1, this);
1053
+ }, _callee10, this);
1012
1054
  }));
1013
- function storeResults(_x4) {
1055
+ function storeResults(_x5) {
1014
1056
  return _storeResults.apply(this, arguments);
1015
1057
  }
1016
1058
  return storeResults;
@@ -1071,20 +1113,20 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
1071
1113
  }, {
1072
1114
  key: "performReachabilityChecks",
1073
1115
  value: (function () {
1074
- var _performReachabilityChecks = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13(clusterList) {
1116
+ var _performReachabilityChecks = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14(clusterList) {
1075
1117
  var _this4 = this;
1076
- var results, isFirstResult;
1077
- return _regenerator.default.wrap(function (_context13) {
1078
- while (1) switch (_context13.prev = _context13.next) {
1118
+ var results, protocols, enabledProtocols, isFirstResult;
1119
+ return _regenerator.default.wrap(function (_context14) {
1120
+ while (1) switch (_context14.prev = _context14.next) {
1079
1121
  case 0:
1080
1122
  results = {};
1081
1123
  this.clusterReachability = {};
1082
1124
  this.startTime = performance.now();
1083
- _loggerProxy.default.logger.log("Reachability:index#performReachabilityChecks --> doing UDP".concat(
1125
+ protocols = (0, _util2.resolveReachabilityProtocols)(
1084
1126
  // @ts-ignore
1085
- this.webex.config.meetings.experimental.enableTcpReachability ? ',TCP' : '').concat(
1086
- // @ts-ignore
1087
- this.webex.config.meetings.experimental.enableTlsReachability ? ',TLS' : '', " reachability checks"));
1127
+ this.webex.config.meetings.enableReachabilityChecks);
1128
+ enabledProtocols = [protocols.udp && 'UDP', protocols.tcp && 'TCP', protocols.tls && 'TLS'].filter(Boolean);
1129
+ _loggerProxy.default.logger.log("Reachability:index#performReachabilityChecks --> doing ".concat(enabledProtocols.join(','), " reachability checks"));
1088
1130
  this.resetResultCounters();
1089
1131
 
1090
1132
  // sanitize the urls in the clusterList
@@ -1092,17 +1134,13 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
1092
1134
  var cluster = clusterList[key];
1093
1135
 
1094
1136
  // Linus doesn't support TCP reachability checks on video mesh nodes
1095
- var includeTcpReachability =
1096
- // @ts-ignore
1097
- _this4.webex.config.meetings.experimental.enableTcpReachability && !cluster.isVideoMesh;
1137
+ var includeTcpReachability = protocols.tcp && !cluster.isVideoMesh;
1098
1138
  if (!includeTcpReachability) {
1099
1139
  cluster.tcp = [];
1100
1140
  }
1101
1141
 
1102
1142
  // Linus doesn't support xTLS reachability checks on video mesh nodes
1103
- var includeTlsReachability =
1104
- // @ts-ignore
1105
- _this4.webex.config.meetings.experimental.enableTlsReachability && !cluster.isVideoMesh;
1143
+ var includeTlsReachability = protocols.tls && !cluster.isVideoMesh;
1106
1144
  if (!includeTlsReachability) {
1107
1145
  cluster.xtls = [];
1108
1146
  }
@@ -1133,11 +1171,11 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
1133
1171
  tcp: true,
1134
1172
  xtls: true
1135
1173
  }; // save the initialized results (in case we don't get any "resultReady" events at all)
1136
- _context13.next = 1;
1174
+ _context14.next = 1;
1137
1175
  return this.storeResults(results);
1138
1176
  case 1:
1139
1177
  if (!(!clusterList || !(0, _keys.default)(clusterList).length)) {
1140
- _context13.next = 2;
1178
+ _context14.next = 2;
1141
1179
  break;
1142
1180
  }
1143
1181
  // nothing to do, finish immediately
@@ -1146,7 +1184,7 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
1146
1184
  file: 'reachability',
1147
1185
  function: 'performReachabilityChecks'
1148
1186
  }, 'reachability:done', {});
1149
- return _context13.abrupt("return");
1187
+ return _context14.abrupt("return");
1150
1188
  case 2:
1151
1189
  this.startTimers();
1152
1190
 
@@ -1157,10 +1195,10 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
1157
1195
  // @ts-ignore
1158
1196
  _this4.webex.config.meetings.enablePerUdpUrlReachability);
1159
1197
  _this4.clusterReachability[key].on(_clusterReachability.Events.resultReady, /*#__PURE__*/function () {
1160
- var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10(data) {
1198
+ var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11(data) {
1161
1199
  var protocol, result, clientMediaIPs, latencyInMilliseconds, areAllResultsReady;
1162
- return _regenerator.default.wrap(function (_context10) {
1163
- while (1) switch (_context10.prev = _context10.next) {
1200
+ return _regenerator.default.wrap(function (_context11) {
1201
+ while (1) switch (_context11.prev = _context11.next) {
1164
1202
  case 0:
1165
1203
  protocol = data.protocol, result = data.result, clientMediaIPs = data.clientMediaIPs, latencyInMilliseconds = data.latencyInMilliseconds;
1166
1204
  if (isFirstResult[protocol]) {
@@ -1177,7 +1215,7 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
1177
1215
  results[key][protocol].result = result;
1178
1216
  results[key][protocol].clientMediaIPs = clientMediaIPs;
1179
1217
  results[key][protocol].latencyInMilliseconds = latencyInMilliseconds;
1180
- _context10.next = 1;
1218
+ _context11.next = 1;
1181
1219
  return _this4.storeResults(results);
1182
1220
  case 1:
1183
1221
  if (areAllResultsReady) {
@@ -1192,47 +1230,47 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
1192
1230
  }
1193
1231
  case 2:
1194
1232
  case "end":
1195
- return _context10.stop();
1233
+ return _context11.stop();
1196
1234
  }
1197
- }, _callee10);
1235
+ }, _callee11);
1198
1236
  }));
1199
- return function (_x6) {
1237
+ return function (_x7) {
1200
1238
  return _ref6.apply(this, arguments);
1201
1239
  };
1202
1240
  }());
1203
1241
 
1204
1242
  // clientMediaIps can be updated independently from the results, so we need to listen for them too
1205
1243
  _this4.clusterReachability[key].on(_clusterReachability.Events.clientMediaIpsUpdated, /*#__PURE__*/function () {
1206
- var _ref7 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11(data) {
1207
- return _regenerator.default.wrap(function (_context11) {
1208
- while (1) switch (_context11.prev = _context11.next) {
1244
+ var _ref7 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12(data) {
1245
+ return _regenerator.default.wrap(function (_context12) {
1246
+ while (1) switch (_context12.prev = _context12.next) {
1209
1247
  case 0:
1210
1248
  results[key][data.protocol].clientMediaIPs = data.clientMediaIPs;
1211
- _context11.next = 1;
1249
+ _context12.next = 1;
1212
1250
  return _this4.storeResults(results);
1213
1251
  case 1:
1214
1252
  case "end":
1215
- return _context11.stop();
1253
+ return _context12.stop();
1216
1254
  }
1217
- }, _callee11);
1255
+ }, _callee12);
1218
1256
  }));
1219
- return function (_x7) {
1257
+ return function (_x8) {
1220
1258
  return _ref7.apply(this, arguments);
1221
1259
  };
1222
1260
  }());
1223
1261
  _this4.clusterReachability[key].on(_clusterReachability.Events.natTypeUpdated, /*#__PURE__*/function () {
1224
- var _ref8 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12(data) {
1225
- return _regenerator.default.wrap(function (_context12) {
1226
- while (1) switch (_context12.prev = _context12.next) {
1262
+ var _ref8 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13(data) {
1263
+ return _regenerator.default.wrap(function (_context13) {
1264
+ while (1) switch (_context13.prev = _context13.next) {
1227
1265
  case 0:
1228
1266
  _this4.natType = data.natType;
1229
1267
  case 1:
1230
1268
  case "end":
1231
- return _context12.stop();
1269
+ return _context13.stop();
1232
1270
  }
1233
- }, _callee12);
1271
+ }, _callee13);
1234
1272
  }));
1235
- return function (_x8) {
1273
+ return function (_x9) {
1236
1274
  return _ref8.apply(this, arguments);
1237
1275
  };
1238
1276
  }());
@@ -1240,11 +1278,11 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
1240
1278
  });
1241
1279
  case 3:
1242
1280
  case "end":
1243
- return _context13.stop();
1281
+ return _context14.stop();
1244
1282
  }
1245
- }, _callee13, this);
1283
+ }, _callee14, this);
1246
1284
  }));
1247
- function performReachabilityChecks(_x5) {
1285
+ function performReachabilityChecks(_x6) {
1248
1286
  return _performReachabilityChecks.apply(this, arguments);
1249
1287
  }
1250
1288
  return performReachabilityChecks;
@@ -1261,42 +1299,42 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
1261
1299
  }, {
1262
1300
  key: "getClientMediaPreferences",
1263
1301
  value: (function () {
1264
- var _getClientMediaPreferences = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14(isMultistream, ipver) {
1265
- var reachabilityReport, _t6, _t7, _t8;
1266
- return _regenerator.default.wrap(function (_context14) {
1267
- while (1) switch (_context14.prev = _context14.next) {
1302
+ var _getClientMediaPreferences = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15(isMultistream, ipver) {
1303
+ var reachabilityReport, _t7, _t8, _t9;
1304
+ return _regenerator.default.wrap(function (_context15) {
1305
+ while (1) switch (_context15.prev = _context15.next) {
1268
1306
  case 0:
1269
1307
  if (this.orpheusApiVersion) {
1270
- _context14.next = 2;
1308
+ _context15.next = 2;
1271
1309
  break;
1272
1310
  }
1273
- _t6 = ipver;
1274
- _context14.next = 1;
1311
+ _t7 = ipver;
1312
+ _context15.next = 1;
1275
1313
  return this.getJoinCookie();
1276
1314
  case 1:
1277
- _t7 = _context14.sent;
1278
- _t8 = !isMultistream;
1279
- return _context14.abrupt("return", {
1280
- ipver: _t6,
1281
- joinCookie: _t7,
1282
- preferTranscoding: _t8
1315
+ _t8 = _context15.sent;
1316
+ _t9 = !isMultistream;
1317
+ return _context15.abrupt("return", {
1318
+ ipver: _t7,
1319
+ joinCookie: _t8,
1320
+ preferTranscoding: _t9
1283
1321
  });
1284
1322
  case 2:
1285
- _context14.next = 3;
1323
+ _context15.next = 3;
1286
1324
  return this.getReachabilityReport();
1287
1325
  case 3:
1288
- reachabilityReport = _context14.sent;
1289
- return _context14.abrupt("return", _objectSpread({
1326
+ reachabilityReport = _context15.sent;
1327
+ return _context15.abrupt("return", _objectSpread({
1290
1328
  ipver: ipver,
1291
1329
  preferTranscoding: !isMultistream
1292
1330
  }, reachabilityReport));
1293
1331
  case 4:
1294
1332
  case "end":
1295
- return _context14.stop();
1333
+ return _context15.stop();
1296
1334
  }
1297
- }, _callee14, this);
1335
+ }, _callee15, this);
1298
1336
  }));
1299
- function getClientMediaPreferences(_x9, _x0) {
1337
+ function getClientMediaPreferences(_x0, _x1) {
1300
1338
  return _getClientMediaPreferences.apply(this, arguments);
1301
1339
  }
1302
1340
  return getClientMediaPreferences;
@@ -1312,22 +1350,22 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
1312
1350
  }, {
1313
1351
  key: "getReachabilityReportToAttachToRoap",
1314
1352
  value: (function () {
1315
- var _getReachabilityReportToAttachToRoap = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
1316
- return _regenerator.default.wrap(function (_context15) {
1317
- while (1) switch (_context15.prev = _context15.next) {
1353
+ var _getReachabilityReportToAttachToRoap = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
1354
+ return _regenerator.default.wrap(function (_context16) {
1355
+ while (1) switch (_context16.prev = _context16.next) {
1318
1356
  case 0:
1319
1357
  if (this.orpheusApiVersion) {
1320
- _context15.next = 1;
1358
+ _context16.next = 1;
1321
1359
  break;
1322
1360
  }
1323
- return _context15.abrupt("return", this.getReachabilityResults());
1361
+ return _context16.abrupt("return", this.getReachabilityResults());
1324
1362
  case 1:
1325
- return _context15.abrupt("return", undefined);
1363
+ return _context16.abrupt("return", undefined);
1326
1364
  case 2:
1327
1365
  case "end":
1328
- return _context15.stop();
1366
+ return _context16.stop();
1329
1367
  }
1330
- }, _callee15, this);
1368
+ }, _callee16, this);
1331
1369
  }));
1332
1370
  function getReachabilityReportToAttachToRoap() {
1333
1371
  return _getReachabilityReportToAttachToRoap.apply(this, arguments);