@webex/plugin-meetings 2.35.3 → 2.35.4

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 (212) hide show
  1. package/dist/common/browser-detection.js.map +1 -1
  2. package/dist/common/collection.js.map +1 -1
  3. package/dist/common/config.js.map +1 -1
  4. package/dist/common/errors/captcha-error.js +7 -0
  5. package/dist/common/errors/captcha-error.js.map +1 -1
  6. package/dist/common/errors/intent-to-join.js +8 -0
  7. package/dist/common/errors/intent-to-join.js.map +1 -1
  8. package/dist/common/errors/join-meeting.js +8 -0
  9. package/dist/common/errors/join-meeting.js.map +1 -1
  10. package/dist/common/errors/media.js +7 -0
  11. package/dist/common/errors/media.js.map +1 -1
  12. package/dist/common/errors/parameter.js.map +1 -1
  13. package/dist/common/errors/password-error.js +7 -0
  14. package/dist/common/errors/password-error.js.map +1 -1
  15. package/dist/common/errors/permission.js +7 -0
  16. package/dist/common/errors/permission.js.map +1 -1
  17. package/dist/common/errors/reconnection-in-progress.js.map +1 -1
  18. package/dist/common/errors/reconnection.js +7 -0
  19. package/dist/common/errors/reconnection.js.map +1 -1
  20. package/dist/common/errors/stats.js +7 -0
  21. package/dist/common/errors/stats.js.map +1 -1
  22. package/dist/common/errors/webex-errors.js.map +1 -1
  23. package/dist/common/errors/webex-meetings-error.js +5 -2
  24. package/dist/common/errors/webex-meetings-error.js.map +1 -1
  25. package/dist/common/events/events-scope.js.map +1 -1
  26. package/dist/common/events/events.js.map +1 -1
  27. package/dist/common/events/trigger-proxy.js.map +1 -1
  28. package/dist/common/events/util.js.map +1 -1
  29. package/dist/common/logs/logger-config.js.map +1 -1
  30. package/dist/common/logs/logger-proxy.js.map +1 -1
  31. package/dist/common/logs/request.js +3 -0
  32. package/dist/common/logs/request.js.map +1 -1
  33. package/dist/common/queue.js.map +1 -1
  34. package/dist/config.js.map +1 -1
  35. package/dist/constants.js.map +1 -1
  36. package/dist/locus-info/controlsUtils.js.map +1 -1
  37. package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
  38. package/dist/locus-info/fullState.js.map +1 -1
  39. package/dist/locus-info/hostUtils.js.map +1 -1
  40. package/dist/locus-info/index.js +43 -5
  41. package/dist/locus-info/index.js.map +1 -1
  42. package/dist/locus-info/infoUtils.js.map +1 -1
  43. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  44. package/dist/locus-info/parser.js +12 -3
  45. package/dist/locus-info/parser.js.map +1 -1
  46. package/dist/locus-info/selfUtils.js.map +1 -1
  47. package/dist/media/index.js.map +1 -1
  48. package/dist/media/properties.js +12 -0
  49. package/dist/media/properties.js.map +1 -1
  50. package/dist/media/util.js.map +1 -1
  51. package/dist/mediaQualityMetrics/config.js.map +1 -1
  52. package/dist/meeting/effectsState.js +8 -1
  53. package/dist/meeting/effectsState.js.map +1 -1
  54. package/dist/meeting/index.js +151 -32
  55. package/dist/meeting/index.js.map +1 -1
  56. package/dist/meeting/muteState.js +6 -0
  57. package/dist/meeting/muteState.js.map +1 -1
  58. package/dist/meeting/request.js +54 -24
  59. package/dist/meeting/request.js.map +1 -1
  60. package/dist/meeting/state.js.map +1 -1
  61. package/dist/meeting/util.js.map +1 -1
  62. package/dist/meeting-info/collection.js +4 -1
  63. package/dist/meeting-info/collection.js.map +1 -1
  64. package/dist/meeting-info/index.js +5 -0
  65. package/dist/meeting-info/index.js.map +1 -1
  66. package/dist/meeting-info/meeting-info-v2.js +14 -2
  67. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  68. package/dist/meeting-info/request.js +3 -0
  69. package/dist/meeting-info/request.js.map +1 -1
  70. package/dist/meeting-info/util.js.map +1 -1
  71. package/dist/meeting-info/utilv2.js.map +1 -1
  72. package/dist/meetings/collection.js +4 -1
  73. package/dist/meetings/collection.js.map +1 -1
  74. package/dist/meetings/index.js +72 -20
  75. package/dist/meetings/index.js.map +1 -1
  76. package/dist/meetings/request.js +4 -0
  77. package/dist/meetings/request.js.map +1 -1
  78. package/dist/meetings/util.js.map +1 -1
  79. package/dist/member/index.js +30 -7
  80. package/dist/member/index.js.map +1 -1
  81. package/dist/member/util.js +2 -1
  82. package/dist/member/util.js.map +1 -1
  83. package/dist/members/collection.js +1 -0
  84. package/dist/members/collection.js.map +1 -1
  85. package/dist/members/index.js +12 -1
  86. package/dist/members/index.js.map +1 -1
  87. package/dist/members/request.js +19 -9
  88. package/dist/members/request.js.map +1 -1
  89. package/dist/members/util.js.map +1 -1
  90. package/dist/metrics/config.js.map +1 -1
  91. package/dist/metrics/constants.js.map +1 -1
  92. package/dist/metrics/index.js +8 -0
  93. package/dist/metrics/index.js.map +1 -1
  94. package/dist/networkQualityMonitor/index.js +10 -2
  95. package/dist/networkQualityMonitor/index.js.map +1 -1
  96. package/dist/peer-connection-manager/index.js +11 -4
  97. package/dist/peer-connection-manager/index.js.map +1 -1
  98. package/dist/personal-meeting-room/index.js +11 -0
  99. package/dist/personal-meeting-room/index.js.map +1 -1
  100. package/dist/personal-meeting-room/request.js +2 -1
  101. package/dist/personal-meeting-room/request.js.map +1 -1
  102. package/dist/personal-meeting-room/util.js.map +1 -1
  103. package/dist/reachability/index.js +17 -7
  104. package/dist/reachability/index.js.map +1 -1
  105. package/dist/reachability/request.js +1 -0
  106. package/dist/reachability/request.js.map +1 -1
  107. package/dist/reconnection-manager/index.js +21 -2
  108. package/dist/reconnection-manager/index.js.map +1 -1
  109. package/dist/roap/collection.js +1 -0
  110. package/dist/roap/collection.js.map +1 -1
  111. package/dist/roap/handler.js +14 -2
  112. package/dist/roap/handler.js.map +1 -1
  113. package/dist/roap/index.js +11 -1
  114. package/dist/roap/index.js.map +1 -1
  115. package/dist/roap/request.js +7 -2
  116. package/dist/roap/request.js.map +1 -1
  117. package/dist/roap/state.js.map +1 -1
  118. package/dist/roap/turnDiscovery.js +9 -1
  119. package/dist/roap/turnDiscovery.js.map +1 -1
  120. package/dist/roap/util.js.map +1 -1
  121. package/dist/statsAnalyzer/global.js.map +1 -1
  122. package/dist/statsAnalyzer/index.js +19 -1
  123. package/dist/statsAnalyzer/index.js.map +1 -1
  124. package/dist/statsAnalyzer/mqaUtil.js +9 -3
  125. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  126. package/dist/transcription/index.js +10 -3
  127. package/dist/transcription/index.js.map +1 -1
  128. package/package.json +17 -17
  129. package/src/common/{browser-detection.js → browser-detection.ts} +1 -1
  130. package/src/common/collection.ts +6 -6
  131. package/src/common/{config.js → config.ts} +1 -1
  132. package/src/common/errors/{captcha-error.js → captcha-error.ts} +5 -1
  133. package/src/common/errors/{intent-to-join.js → intent-to-join.ts} +6 -1
  134. package/src/common/errors/{join-meeting.js → join-meeting.ts} +6 -1
  135. package/src/common/errors/{media.js → media.ts} +5 -1
  136. package/src/common/errors/parameter.ts +3 -2
  137. package/src/common/errors/{password-error.js → password-error.ts} +5 -1
  138. package/src/common/errors/{permission.js → permission.ts} +5 -1
  139. package/src/common/errors/{reconnection-in-progress.js → reconnection-in-progress.ts} +0 -0
  140. package/src/common/errors/{reconnection.js → reconnection.ts} +5 -1
  141. package/src/common/errors/{stats.js → stats.ts} +5 -1
  142. package/src/common/errors/{webex-errors.js → webex-errors.ts} +1 -2
  143. package/src/common/errors/{webex-meetings-error.js → webex-meetings-error.ts} +3 -1
  144. package/src/common/events/{events-scope.js → events-scope.ts} +1 -1
  145. package/src/common/events/{events.js → events.ts} +0 -0
  146. package/src/common/events/{trigger-proxy.js → trigger-proxy.ts} +1 -2
  147. package/src/common/events/{util.js → util.ts} +1 -1
  148. package/src/common/logs/{logger-config.js → logger-config.ts} +1 -2
  149. package/src/common/logs/{logger-proxy.js → logger-proxy.ts} +1 -1
  150. package/src/common/logs/{request.js → request.ts} +12 -2
  151. package/src/common/queue.ts +1 -2
  152. package/src/{config.js → config.ts} +1 -0
  153. package/src/constants.ts +1 -0
  154. package/src/locus-info/{controlsUtils.js → controlsUtils.ts} +4 -4
  155. package/src/locus-info/{embeddedAppsUtils.js → embeddedAppsUtils.ts} +5 -6
  156. package/src/locus-info/{fullState.js → fullState.ts} +1 -1
  157. package/src/locus-info/{hostUtils.js → hostUtils.ts} +5 -5
  158. package/src/locus-info/{index.js → index.ts} +67 -32
  159. package/src/locus-info/{infoUtils.js → infoUtils.ts} +3 -4
  160. package/src/locus-info/{mediaSharesUtils.js → mediaSharesUtils.ts} +13 -13
  161. package/src/locus-info/{parser.js → parser.ts} +22 -12
  162. package/src/locus-info/{selfUtils.js → selfUtils.ts} +17 -19
  163. package/src/media/{index.js → index.ts} +108 -39
  164. package/src/media/{properties.js → properties.ts} +16 -4
  165. package/src/media/{util.js → util.ts} +2 -3
  166. package/src/mediaQualityMetrics/{config.js → config.ts} +1 -1
  167. package/src/meeting/{effectsState.js → effectsState.ts} +12 -6
  168. package/src/meeting/{index.js → index.ts} +323 -147
  169. package/src/meeting/{muteState.js → muteState.ts} +16 -11
  170. package/src/meeting/{request.js → request.ts} +124 -36
  171. package/src/meeting/{state.js → state.ts} +6 -6
  172. package/src/meeting/{util.js → util.ts} +4 -4
  173. package/src/meeting-info/{collection.js → collection.ts} +4 -1
  174. package/src/meeting-info/{index.js → index.ts} +10 -6
  175. package/src/meeting-info/{meeting-info-v2.js → meeting-info-v2.ts} +28 -10
  176. package/src/meeting-info/{request.js → request.ts} +6 -2
  177. package/src/meeting-info/{util.js → util.ts} +6 -5
  178. package/src/meeting-info/{utilv2.js → utilv2.ts} +8 -7
  179. package/src/meetings/{collection.js → collection.ts} +5 -2
  180. package/src/meetings/{index.js → index.ts} +88 -22
  181. package/src/meetings/{request.js → request.ts} +6 -1
  182. package/src/meetings/{util.js → util.ts} +5 -3
  183. package/src/member/{index.js → index.ts} +46 -15
  184. package/src/member/{util.js → util.ts} +17 -16
  185. package/src/members/{collection.js → collection.ts} +2 -1
  186. package/src/members/{index.js → index.ts} +39 -26
  187. package/src/members/{request.js → request.ts} +16 -5
  188. package/src/members/{util.js → util.ts} +7 -7
  189. package/src/metrics/{config.js → config.ts} +0 -2
  190. package/src/metrics/{constants.js → constants.ts} +0 -0
  191. package/src/metrics/{index.js → index.ts} +27 -8
  192. package/src/networkQualityMonitor/{index.js → index.ts} +18 -3
  193. package/src/peer-connection-manager/{index.js → index.ts} +72 -28
  194. package/src/personal-meeting-room/{index.js → index.ts} +17 -4
  195. package/src/personal-meeting-room/{request.js → request.ts} +3 -1
  196. package/src/personal-meeting-room/{util.js → util.ts} +1 -1
  197. package/src/reachability/{index.js → index.ts} +28 -17
  198. package/src/reachability/request.ts +4 -2
  199. package/src/reconnection-manager/{index.js → index.ts} +42 -13
  200. package/src/roap/{collection.js → collection.ts} +1 -0
  201. package/src/roap/{handler.js → handler.ts} +15 -4
  202. package/src/roap/{index.js → index.ts} +23 -10
  203. package/src/roap/{request.js → request.ts} +19 -3
  204. package/src/roap/{state.js → state.ts} +3 -2
  205. package/src/roap/turnDiscovery.ts +14 -5
  206. package/src/roap/{util.js → util.ts} +1 -2
  207. package/src/statsAnalyzer/{global.js → global.ts} +0 -0
  208. package/src/statsAnalyzer/{index.js → index.ts} +36 -17
  209. package/src/statsAnalyzer/{mqaUtil.js → mqaUtil.ts} +6 -1
  210. package/src/transcription/{index.js → index.ts} +16 -11
  211. package/test/integration/spec/space-meeting.js +1 -2
  212. package/test/unit/spec/roap/util.js +1 -1
@@ -18,6 +18,7 @@ import {
18
18
  } from './config';
19
19
 
20
20
  const OSMap = {
21
+ // @ts-ignore
21
22
  'Chrome OS': OS_NAME.chrome,
22
23
  macOS: OS_NAME.MAC,
23
24
  Windows: OS_NAME.WINDOWS,
@@ -76,6 +77,13 @@ const triggerTimers = ({event, meeting, data}) => {
76
77
  * @class Metrics
77
78
  */
78
79
  class Metrics {
80
+ static instance: Metrics;
81
+
82
+ _events: any;
83
+ keys: any;
84
+ meetingCollection: any;
85
+ webex: any;
86
+
79
87
  /**
80
88
  * Create Metrics Object
81
89
  * @constructor
@@ -125,7 +133,7 @@ class Metrics {
125
133
  *
126
134
  * @returns {void}
127
135
  */
128
- initialSetup(meetingCollection, webex) {
136
+ initialSetup(meetingCollection: object, webex: object) {
129
137
  this.meetingCollection = meetingCollection;
130
138
  this.webex = webex;
131
139
  }
@@ -139,7 +147,7 @@ class Metrics {
139
147
  * @param {object} options.event
140
148
  * @returns {object} null
141
149
  */
142
- postEvent(options) {
150
+ postEvent(options: { meeting?: any; meetingId?: string; data?: object; event?: any } | any) {
143
151
  const {meetingId, data = {}, event} = options;
144
152
  let {meeting} = options;
145
153
 
@@ -181,7 +189,7 @@ class Metrics {
181
189
  */
182
190
 
183
191
  initPayload(eventType, identifiers, options) {
184
- const payload = {
192
+ const payload: any = {
185
193
  eventId: uuid.v4(),
186
194
  version: 1,
187
195
  origin: {
@@ -252,7 +260,7 @@ class Metrics {
252
260
  * @private
253
261
  * @memberof Metrics
254
262
  */
255
- getOsName() {
263
+ private getOsName() {
256
264
  return OSMap[getOSName()] ?? OS_NAME.OTHERS;
257
265
  }
258
266
 
@@ -270,7 +278,18 @@ class Metrics {
270
278
  * @public
271
279
  * @memberof Metrics
272
280
  */
273
- initMediaPayload(eventType, identifiers, options = {}) {
281
+ public initMediaPayload(
282
+ eventType: string,
283
+ identifiers: {
284
+ correlationId: string;
285
+ locusUrl: string;
286
+ locusId: string;
287
+ },
288
+ options: {
289
+ intervalData: object;
290
+ clientType: string;
291
+ } | any = {}
292
+ ) {
274
293
  const {audioSetupDelay, videoSetupDelay, joinTimes} = options;
275
294
 
276
295
  const payload = {
@@ -329,7 +348,7 @@ class Metrics {
329
348
  * @returns {{showToUser: boolean, category: string, errorDescription: string,
330
349
  * errorCode: number, errorData: *, fatal: boolean, name: string}}
331
350
  */
332
- parseLocusError(err, showToUser) {
351
+ parseLocusError(err: any, showToUser: boolean) {
333
352
  let errorCode;
334
353
 
335
354
  if (err && err.statusCode && err.statusCode >= 500) {
@@ -447,7 +466,7 @@ class Metrics {
447
466
 
448
467
  generateErrorPayload(errorCode, shownToUser, name, err) {
449
468
  if (error.errors[errorCode]) {
450
- const errorPayload = {
469
+ const errorPayload: any = {
451
470
  shownToUser: shownToUser || false,
452
471
  category: error.errors[errorCode][2],
453
472
  errorDescription: error.errors[errorCode][0],
@@ -515,7 +534,7 @@ class Metrics {
515
534
  *
516
535
  * @returns {void}
517
536
  */
518
- sendBehavioralMetric(metricName, metricFields = {}, metricTags = {}) {
537
+ sendBehavioralMetric(metricName: string, metricFields: object = {}, metricTags: object = {}) {
519
538
  this.webex.internal.metrics.submitClientMetrics(metricName, {
520
539
  type: this.webex.config.metrics.type,
521
540
  fields: metricFields,
@@ -18,6 +18,13 @@ import {EVENT_TRIGGERS, STATS} from '../constants';
18
18
  * @extends {EventsScope}
19
19
  */
20
20
  export default class NetworkQualityMonitor extends EventsScope {
21
+ config: any;
22
+ frequencyTypes: any;
23
+ indicatorTypes: any;
24
+ mediaType: any;
25
+ networkQualityScore: any;
26
+ networkQualityStatus: any;
27
+
21
28
  /**
22
29
  * Creates a new instance of NetworkQualityMonitor
23
30
  * @constructor
@@ -29,7 +36,7 @@ export default class NetworkQualityMonitor extends EventsScope {
29
36
  * @property {Object} networkQualityStatus - hash object based on indicatorTypes and frequencyTypes
30
37
  * @property {string} mediaType - audio|video
31
38
  */
32
- constructor(config) {
39
+ constructor(config: any) {
33
40
  super();
34
41
  this.config = config;
35
42
  this.indicatorTypes = Object.freeze({
@@ -96,7 +103,15 @@ export default class NetworkQualityMonitor extends EventsScope {
96
103
  * @public
97
104
  * @memberof NetworkQualityMonitor
98
105
  */
99
- determineUplinkNetworkQuality({mediaType, remoteRtpResults, statsAnalyzerCurrentStats}) {
106
+ public determineUplinkNetworkQuality({
107
+ mediaType,
108
+ remoteRtpResults,
109
+ statsAnalyzerCurrentStats,
110
+ }: {
111
+ mediaType: string;
112
+ remoteRtpResults: any;
113
+ statsAnalyzerCurrentStats: object;
114
+ }) {
100
115
  const roundTripTimeInMilliseconds = remoteRtpResults.roundTripTime * 1000;
101
116
  const jitterInMilliseconds = remoteRtpResults.jitter * 1000;
102
117
  const {currentPacketLossRatio} = statsAnalyzerCurrentStats[mediaType].send;
@@ -157,7 +172,7 @@ export default class NetworkQualityMonitor extends EventsScope {
157
172
  * @param {(number|undefined)} value
158
173
  * @returns {(number|null)}
159
174
  */
160
- const determineIfUndefined = (value) => (typeof value === 'undefined' ? null : value);
175
+ const determineIfUndefined = (value: number | undefined) => (typeof value === 'undefined' ? null : value);
161
176
 
162
177
  /**
163
178
  * Values for some browsers specifically Safari will be undefined we explicitly set to null
@@ -1,4 +1,3 @@
1
-
2
1
  // We need to figure out how to pass a webex logger instance to these util files
3
2
 
4
3
  /* globals RTCSessionDescription */
@@ -37,7 +36,7 @@ const {isBrowser} = BrowserDetection();
37
36
  * @export
38
37
  * @public
39
38
  */
40
- const pc = {};
39
+ const pc: any = {};
41
40
 
42
41
  /**
43
42
  * munges the bandwidth limit into the sdp
@@ -45,7 +44,7 @@ const pc = {};
45
44
  * @param {Number} index
46
45
  * @returns {String}
47
46
  */
48
- const insertBandwidthLimit = (sdpLines, index) => {
47
+ const insertBandwidthLimit = (sdpLines: any, index: number) => {
49
48
  // eslint-disable-next-line no-warning-comments
50
49
  // TODO convert to sdp parser
51
50
  let limit;
@@ -70,7 +69,7 @@ const insertBandwidthLimit = (sdpLines, index) => {
70
69
  * @param {String} [level=QUALITY_LEVELS.HIGH] quality level for max-fs
71
70
  * @returns {String}
72
71
  */
73
- const setRemoteVideoConstraints = (sdp, level = QUALITY_LEVELS.HIGH) => {
72
+ const setRemoteVideoConstraints = (sdp: string, level: string = QUALITY_LEVELS.HIGH) => {
74
73
  const maxFs = REMOTE_VIDEO_CONSTRAINTS.MAX_FS[level];
75
74
 
76
75
  if (!maxFs) {
@@ -96,7 +95,7 @@ const setStartBitrateOnRemoteSdp = (sdp) => {
96
95
  * @param {String} sdp
97
96
  * @returns {boolean}
98
97
  */
99
- const checkH264Support = (sdp) => {
98
+ const checkH264Support = (sdp: string) => {
100
99
  // eslint-disable-next-line no-warning-comments
101
100
  // TODO convert to sdp parser to read rtp.codec
102
101
  const videoPresent = sdp.match(/\nm=video.*/g);
@@ -114,7 +113,7 @@ const checkH264Support = (sdp) => {
114
113
  * @param {String} sdp
115
114
  * @returns {String}
116
115
  */
117
- const isSdpInvalid = (sdp) => {
116
+ const isSdpInvalid = (sdp: string) => {
118
117
  const parsedSdp = sdpTransform.parse(sdp);
119
118
 
120
119
  for (const mediaLine of parsedSdp.media) {
@@ -144,7 +143,7 @@ const isSdpInvalid = (sdp) => {
144
143
  * @param {String} sdp
145
144
  * @returns {String}
146
145
  */
147
- const limitBandwidth = (sdp) => {
146
+ const limitBandwidth = (sdp: string) => {
148
147
  // TODO convert to sdp parser
149
148
  let offerSdp = sdp;
150
149
  let sdpLines = offerSdp.split(SDP.CARRIAGE_RETURN);
@@ -164,7 +163,7 @@ const limitBandwidth = (sdp) => {
164
163
  * @param {RTCPeerConnection} screenPc
165
164
  * @returns {RTCPeerConnection}
166
165
  */
167
- pc.setContentSlides = (screenPc) => {
166
+ pc.setContentSlides = (screenPc: any) => {
168
167
  if (screenPc && screenPc.sdp) {
169
168
  screenPc.sdp += `${SDP.A_CONTENT_SLIDES}${SDP.CARRIAGE_RETURN}`;
170
169
  }
@@ -179,10 +178,18 @@ pc.setContentSlides = (screenPc) => {
179
178
  * @param {String} options.remoteQualityLevel
180
179
  * @returns {Promise.RTCPeerConnection}
181
180
  */
182
- pc.iceCandidate = (peerConnection, {remoteQualityLevel}) =>
183
- new Promise((resolve, reject) => {
181
+ pc.iceCandidate = (
182
+ peerConnection: any,
183
+ {
184
+ remoteQualityLevel,
185
+ }: {
186
+ remoteQualityLevel: string;
187
+ }
188
+ ) =>
189
+ new Promise<void>((resolve, reject) => {
184
190
  const now = Date.now();
185
191
  const doneGatheringIceCandidate = () => {
192
+ // @ts-ignore
186
193
  const miliseconds = parseInt(Math.abs(Date.now() - now), 4);
187
194
 
188
195
  peerConnection.sdp = limitBandwidth(peerConnection.localDescription.sdp);
@@ -208,6 +215,7 @@ pc.iceCandidate = (peerConnection, {remoteQualityLevel}) =>
208
215
 
209
216
  peerConnection.onIceGatheringStateChange = () => {
210
217
  if (peerConnection.iceGatheringState === COMPLETE) {
218
+ // @ts-ignore
211
219
  doneGatheringIceCandidate(peerConnection);
212
220
  }
213
221
  if (peerConnection.iceGatheringState === GATHERING) {
@@ -217,6 +225,7 @@ pc.iceCandidate = (peerConnection, {remoteQualityLevel}) =>
217
225
 
218
226
  peerConnection.onicecandidate = (evt) => {
219
227
  if (evt.candidate === null) {
228
+ // @ts-ignore
220
229
  doneGatheringIceCandidate(peerConnection);
221
230
  }
222
231
  else {
@@ -237,7 +246,7 @@ pc.iceCandidate = (peerConnection, {remoteQualityLevel}) =>
237
246
  * @param {Object} track
238
247
  * @returns {undefined}
239
248
  */
240
- pc.replaceTrack = (peerConnection, track) => {
249
+ pc.replaceTrack = (peerConnection: any, track: any) => {
241
250
  try {
242
251
  const senders = peerConnection.getSenders();
243
252
 
@@ -260,7 +269,7 @@ pc.replaceTrack = (peerConnection, track) => {
260
269
  * @param {Object} stream
261
270
  * @returns {undefined}
262
271
  */
263
- pc.addStream = (peerConnection, stream) => {
272
+ pc.addStream = (peerConnection: any, stream: any) => {
264
273
  try {
265
274
  if (stream && !isBrowser('edge')) {
266
275
  const tracksPresent = peerConnection.getSenders && peerConnection.getSenders().find((sender) => sender.track != null);
@@ -297,12 +306,7 @@ pc.addStream = (peerConnection, stream) => {
297
306
  * @param {String} meetingId
298
307
  * @returns {undefined}
299
308
  */
300
- pc.setRemoteSessionDetails = (
301
- peerConnection,
302
- typeStr,
303
- remoteSdp,
304
- meetingId,
305
- ) => {
309
+ pc.setRemoteSessionDetails = (peerConnection: any, typeStr: string, remoteSdp: string, meetingId: string) => {
306
310
  LoggerProxy.logger.log(`PeerConnectionManager:index#setRemoteSessionDetails --> Setting the remote description type: ${typeStr}State: ${peerConnection.signalingState}`);
307
311
  let sdp = remoteSdp;
308
312
 
@@ -385,12 +389,20 @@ pc.setRemoteSessionDetails = (
385
389
  * @param {string} meetingProperties.enableExtmap
386
390
  * @returns {RTCPeerConnection}
387
391
  */
388
- pc.createOffer = (peerConnection, {
389
- meetingId,
390
- remoteQualityLevel,
391
- enableRtx,
392
- enableExtmap
393
- }) => {
392
+ pc.createOffer = (
393
+ peerConnection: any,
394
+ {
395
+ meetingId,
396
+ remoteQualityLevel,
397
+ enableRtx,
398
+ enableExtmap,
399
+ }: {
400
+ meetingId: string;
401
+ remoteQualityLevel: string;
402
+ enableRtx: string;
403
+ enableExtmap: string;
404
+ }
405
+ ) => {
394
406
  LoggerProxy.logger.log('PeerConnectionManager:index#createOffer --> creating a new offer');
395
407
 
396
408
  // saving the extMap State to use in setRemoteDescription
@@ -462,6 +474,7 @@ pc.createOffer = (peerConnection, {
462
474
  data: {
463
475
  canProceed: false,
464
476
  errors: [
477
+ // @ts-ignore
465
478
  Metrics.generateErrorPayload(2001, true,
466
479
  error.name.MEDIA_ENGINE)]
467
480
  }
@@ -476,12 +489,14 @@ pc.createOffer = (peerConnection, {
476
489
  * @param {Object} peerConnection
477
490
  * @returns {Promise.RTCPeerConnection}
478
491
  */
479
- pc.rollBackLocalDescription = (peerConnection) => peerConnection
492
+ pc.rollBackLocalDescription = (peerConnection: any) => peerConnection
493
+ // @ts-ignore
480
494
  .setLocalDescription(new RTCSessionDescription({type: SDP.ROLLBACK}))
481
495
  .then(() => peerConnection)
482
496
  .catch((err) => {
483
497
  LoggerProxy.logger.error(`Peer-connection-manager:index#setLocalDescription --> ${err} `);
484
498
 
499
+ // @ts-ignore
485
500
  return Promise.error(err);
486
501
  });
487
502
 
@@ -496,7 +511,22 @@ pc.rollBackLocalDescription = (peerConnection) => peerConnection
496
511
  * @param {string} meetingProperties.remoteQualityLevel LOW|MEDIUM|HIGH
497
512
  * @returns {Promise.<Array>} [MediaSDP, ScreenSDP]
498
513
  */
499
- pc.updatePeerConnection = (params, {meetingId, remoteQualityLevel}) => {
514
+ pc.updatePeerConnection = (
515
+ params: {
516
+ offerToReceiveAudio: boolean;
517
+ offerToReceiveVideo: boolean;
518
+ offerSdp: string;
519
+ stream: MediaStream;
520
+ peerConnection: any
521
+ },
522
+ {
523
+ meetingId,
524
+ remoteQualityLevel,
525
+ }: {
526
+ meetingId: string;
527
+ remoteQualityLevel: string;
528
+ }
529
+ ) => {
500
530
  LoggerProxy.logger.log(`PeerConnectionManager:index#updatePeerConnection --> updating the peerConnection with params: ${params}`);
501
531
 
502
532
  const {peerConnection, offerSdp} = params;
@@ -521,7 +551,20 @@ pc.updatePeerConnection = (params, {meetingId, remoteQualityLevel}) => {
521
551
  * @param {string} meetingProperties.remoteQualityLevel LOW|MEDIUM|HIGH
522
552
  * @returns {RTCPeerConnection} peerConnection
523
553
  */
524
- pc.createAnswer = (params, {meetingId, remoteQualityLevel}) => {
554
+ pc.createAnswer = (
555
+ params: {
556
+ peerConnection: any;
557
+ sdpConstraints: object;
558
+ offerSdp: any;
559
+ },
560
+ {
561
+ meetingId,
562
+ remoteQualityLevel,
563
+ }: {
564
+ meetingId: string;
565
+ remoteQualityLevel: string;
566
+ }
567
+ ) => {
525
568
  const {peerConnection} = params;
526
569
 
527
570
  // TODO: Some times to many mercury event comes at the same time
@@ -579,7 +622,7 @@ pc.createAnswer = (params, {meetingId, remoteQualityLevel}) => {
579
622
  * @param {Object} peerConnection
580
623
  * @returns {undefined}
581
624
  */
582
- pc.close = (peerConnection) => {
625
+ pc.close = (peerConnection: any) => {
583
626
  // peerConnection.close() fails on firefox on network changes and gives a Dom exception
584
627
  // To avoid this we have added a try catch block.
585
628
  // Please refer to https://bugzilla.mozilla.org/show_bug.cgi?id=1274407 for more information
@@ -619,6 +662,7 @@ pc.setPeerConnectionEvents = (meeting) => {
619
662
  data: {
620
663
  canProceed: false,
621
664
  errors: [
665
+ // @ts-ignore
622
666
  Metrics.generateErrorPayload(
623
667
  2004, false, error.name.MEDIA_ENGINE
624
668
  )]
@@ -1,3 +1,4 @@
1
+ // @ts-ignore
1
2
  import {StatelessWebexPlugin} from '@webex/webex-core';
2
3
 
3
4
  import {MEETINGS, _PERSONAL_ROOM_} from '../constants';
@@ -10,6 +11,16 @@ import PersonalMeetingRoomRequest from './request';
10
11
  * @class PersonalMeetingRoom
11
12
  */
12
13
  export default class PersonalMeetingRoom extends StatelessWebexPlugin {
14
+ link: any;
15
+ meetingInfo: any;
16
+ name: any;
17
+ personalMeetingRoomRequest: any;
18
+ pmr: any;
19
+ sipUri: any;
20
+ userId: any;
21
+ meetingLink: any;
22
+ number: any;
23
+
13
24
  namespace = MEETINGS;
14
25
 
15
26
  /**
@@ -17,7 +28,7 @@ export default class PersonalMeetingRoom extends StatelessWebexPlugin {
17
28
  * @param {Object} attrs
18
29
  * @param {Object} options
19
30
  */
20
- constructor(attrs, options) {
31
+ constructor(attrs: any, options: any) {
21
32
  super({}, options);
22
33
  /**
23
34
  * The pmr server object
@@ -74,6 +85,7 @@ export default class PersonalMeetingRoom extends StatelessWebexPlugin {
74
85
  * @private
75
86
  * @memberof PersonalMeetingRoom
76
87
  */
88
+ // @ts-ignore
77
89
  this.personalMeetingRoomRequest = new PersonalMeetingRoomRequest({}, options);
78
90
  }
79
91
 
@@ -86,8 +98,9 @@ export default class PersonalMeetingRoom extends StatelessWebexPlugin {
86
98
  * @public
87
99
  * @memberof PersonalMeetingRoom
88
100
  */
89
- claim(link, pin, preferred = true) {
101
+ public claim(link: string, pin: string, preferred: boolean = true) {
90
102
  const options = {
103
+ // @ts-ignore
91
104
  userId: this.webex.internal.device.userId,
92
105
  passcode: pin,
93
106
  meetingAddress: link,
@@ -112,7 +125,7 @@ export default class PersonalMeetingRoom extends StatelessWebexPlugin {
112
125
  * @private
113
126
  * @memberof PersonalMeetingRoom
114
127
  */
115
- set(body) {
128
+ private set(body: any) {
116
129
  this.pmr = body;
117
130
  this.sipUri = body.sipMeetingUri;
118
131
  this.meetingLink = body.webExMeetingLink || body.meetingLink;
@@ -128,7 +141,7 @@ export default class PersonalMeetingRoom extends StatelessWebexPlugin {
128
141
  * @public
129
142
  * @memberof PersonalMeetingRoom
130
143
  */
131
- get() {
144
+ public get() {
132
145
  const options = {
133
146
  type: _PERSONAL_ROOM_
134
147
 
@@ -1,3 +1,4 @@
1
+ // @ts-ignore
1
2
  import {StatelessWebexPlugin} from '@webex/webex-core';
2
3
 
3
4
  import {MEETINGS} from '../constants';
@@ -18,7 +19,7 @@ export default class PersonalMeetingRoomRequest extends StatelessWebexPlugin {
18
19
  * @returns {Promise} returns a promise that resolves/rejects the result of the request
19
20
  * @memberof PersonalMeetingRoomRequest
20
21
  */
21
- claimPmr(options) {
22
+ claimPmr(options: any) {
22
23
  if (!options || !options.userId || !options.passcode || !options.meetingAddress || !options.preferred) {
23
24
  throw new ParameterError('Claiming a PMR should be done with userId, passcode, preferred, and meetingAddress in options.');
24
25
  }
@@ -34,6 +35,7 @@ export default class PersonalMeetingRoomRequest extends StatelessWebexPlugin {
34
35
  }
35
36
  const request = PersonalMeetingRoomUtil.getClaimedRequestParams(validLink, validPin, options);
36
37
 
38
+ // @ts-ignore
37
39
  return this.request(request);
38
40
  }
39
41
  }
@@ -9,7 +9,7 @@ import {
9
9
  WEBEX_DOT_COM
10
10
  } from '../constants';
11
11
 
12
- const PersonalMeetingRoomUtil = {};
12
+ const PersonalMeetingRoomUtil: any = {};
13
13
 
14
14
  PersonalMeetingRoomUtil.getClaimPmrLink = (pmrLink) => {
15
15
  let validator = VALID_PMR_ADDRESS.test(pmrLink);
@@ -23,12 +23,16 @@ const VIDEO_MESH_TIMEOUT = 1000;
23
23
  * @export
24
24
  */
25
25
  export default class Reachability {
26
+ webex: object;
27
+ reachabilityRequest: any;
28
+ clusterLatencyResults: any;
29
+
26
30
  /**
27
31
  * Creates an instance of Reachability.
28
32
  * @param {object} webex
29
33
  * @memberof Reachability
30
34
  */
31
- constructor(webex) {
35
+ constructor(webex: object) {
32
36
  this.webex = webex;
33
37
 
34
38
  /**
@@ -58,7 +62,7 @@ export default class Reachability {
58
62
  * @async
59
63
  * @memberof Reachability
60
64
  */
61
- async gatherReachability() {
65
+ public async gatherReachability() {
62
66
  this.setup();
63
67
 
64
68
  // Remove stored reachability results to ensure no stale data
@@ -105,7 +109,7 @@ export default class Reachability {
105
109
  try {
106
110
  const reachabilityResults = JSON.parse(reachabilityData);
107
111
 
108
- reachable = Object.values(reachabilityResults).some((result) => result.udp?.reachable === 'true' || result.tcp?.reachable === 'true');
112
+ reachable = Object.values(reachabilityResults).some((result: any) => result.udp?.reachable === 'true' || result.tcp?.reachable === 'true');
109
113
  }
110
114
  catch (e) {
111
115
  LoggerProxy.logger.error(`Roap:request#attachReachabilityData --> Error in parsing reachability data: ${e}`);
@@ -123,7 +127,7 @@ export default class Reachability {
123
127
  * @private
124
128
  * @memberof Reachability
125
129
  */
126
- buildPeerConnectionConfig(cluster) {
130
+ private buildPeerConnectionConfig(cluster: any) {
127
131
  const iceServers = _.uniq([
128
132
  ...cluster.udp,
129
133
  ...cluster.tcp
@@ -150,12 +154,13 @@ export default class Reachability {
150
154
  * @private
151
155
  * @memberof Reachability
152
156
  */
153
- createPeerConnection(cluster) {
157
+ private createPeerConnection(cluster: any) {
154
158
  const {key, config} = cluster;
155
159
 
156
160
  try {
157
161
  const peerConnection = new window.RTCPeerConnection(config);
158
162
 
163
+ // @ts-ignore
159
164
  peerConnection.key = key;
160
165
 
161
166
  return peerConnection;
@@ -175,7 +180,7 @@ export default class Reachability {
175
180
  * @private
176
181
  * @memberof Reachability
177
182
  */
178
- getElapsedTime(peerConnection) {
183
+ private getElapsedTime(peerConnection: any) {
179
184
  const startTime = peerConnection.begin;
180
185
 
181
186
  delete peerConnection.begin;
@@ -191,8 +196,8 @@ export default class Reachability {
191
196
  * @private
192
197
  * @memberof Reachability
193
198
  */
194
- getLocalSDPForClusters(clusterList) {
195
- let clusters = [...Object.keys(clusterList)];
199
+ private getLocalSDPForClusters(clusterList: object) {
200
+ let clusters: any[] = [...Object.keys(clusterList)];
196
201
 
197
202
  clusters = clusters.map(async (key) => {
198
203
  const cluster = clusterList[key];
@@ -200,6 +205,7 @@ export default class Reachability {
200
205
  const peerConnection = this.createPeerConnection({key, config});
201
206
  const description = await peerConnection.createOffer({offerToReceiveAudio: true});
202
207
 
208
+ // @ts-ignore
203
209
  peerConnection.begin = Date.now();
204
210
  peerConnection.setLocalDescription(description);
205
211
 
@@ -226,7 +232,7 @@ export default class Reachability {
226
232
  * @private
227
233
  * @memberof Reachability
228
234
  */
229
- getUnreachablClusters() {
235
+ private getUnreachablClusters() {
230
236
  const unreachableList = [];
231
237
  const clusters = this.clusterLatencyResults;
232
238
 
@@ -250,13 +256,14 @@ export default class Reachability {
250
256
  * @private
251
257
  * @memberof Reachability
252
258
  */
253
- handleIceGatheringStateChange(peerConnection) {
259
+ private handleIceGatheringStateChange(peerConnection: RTCPeerConnection) {
254
260
  peerConnection.onicegatheringstatechange = () => {
255
261
  const {COMPLETE} = ICE_GATHERING_STATE;
256
262
 
257
263
  if (peerConnection.iceConnectionState === COMPLETE) {
258
264
  const elapsed = this.getElapsedTime(peerConnection);
259
265
 
266
+ // @ts-ignore
260
267
  LoggerProxy.logger.log(`Reachability:index#onIceGatheringStateChange --> Successfully pinged ${peerConnection.key}:`, elapsed);
261
268
  this.setLatencyAndClose(peerConnection, elapsed);
262
269
  }
@@ -272,13 +279,14 @@ export default class Reachability {
272
279
  * @private
273
280
  * @memberof Reachability
274
281
  */
275
- handleOnIceCandidate(peerConnection) {
282
+ private handleOnIceCandidate(peerConnection: RTCPeerConnection) {
276
283
  peerConnection.onicecandidate = (e) => {
277
284
  const SERVER_REFLEXIVE = 'srflx';
278
285
 
279
286
  if (e.candidate && String(e.candidate.type).toLowerCase() === SERVER_REFLEXIVE) {
280
287
  const elapsed = this.getElapsedTime(peerConnection);
281
288
 
289
+ // @ts-ignore
282
290
  LoggerProxy.logger.log(`Reachability:index#onIceCandidate --> Successfully pinged ${peerConnection.key}:`, elapsed);
283
291
  this.setLatencyAndClose(peerConnection, elapsed);
284
292
  }
@@ -294,7 +302,7 @@ export default class Reachability {
294
302
  * @param {number} timeout
295
303
  * @returns {Promise}
296
304
  */
297
- iceGatheringState(peerConnection, timeout) {
305
+ private iceGatheringState(peerConnection: RTCPeerConnection, timeout: number) {
298
306
  const ELAPSED = 'elapsed';
299
307
 
300
308
  return new Promise((resolve) => {
@@ -311,6 +319,7 @@ export default class Reachability {
311
319
  set: (target, property, value) => {
312
320
  // only intercept elapsed property
313
321
  if (property === ELAPSED) {
322
+ // @ts-ignore
314
323
  resolve({clusterId: peerConnection.key, elapsed: value});
315
324
 
316
325
  return true;
@@ -345,7 +354,7 @@ export default class Reachability {
345
354
  * @private
346
355
  * @memberof Reachability
347
356
  */
348
- logUnreachableClusters() {
357
+ private logUnreachableClusters() {
349
358
  const list = this.getUnreachablClusters();
350
359
 
351
360
  list.forEach((cluster) => {
@@ -361,7 +370,7 @@ export default class Reachability {
361
370
  * @private
362
371
  * @memberof Reachability
363
372
  */
364
- parseIceResultsToReachabilityResults(iceResults) {
373
+ private parseIceResultsToReachabilityResults(iceResults: Array<any>) {
365
374
  const reachabilityMap = {};
366
375
 
367
376
  iceResults.forEach(({clusterId, elapsed}) => {
@@ -394,7 +403,7 @@ export default class Reachability {
394
403
  * @private
395
404
  * @memberof Reachability
396
405
  */
397
- performReachabilityCheck(clusterList) {
406
+ private performReachabilityCheck(clusterList: object) {
398
407
  if (!clusterList || !Object.keys(clusterList).length) {
399
408
  return Promise.resolve({});
400
409
  }
@@ -427,10 +436,11 @@ export default class Reachability {
427
436
  * @private
428
437
  * @memberof Reachability
429
438
  */
430
- setLatencyAndClose(peerConnection, elapsed) {
439
+ private setLatencyAndClose(peerConnection: RTCPeerConnection, elapsed: number) {
431
440
  const REACHABLE = 'reachable';
432
441
  const UNREACHABLE = 'unreachable';
433
442
  const {CLOSED} = CONNECTION_STATE;
443
+ // @ts-ignore
434
444
  const {key} = peerConnection;
435
445
  const resultKey = elapsed === null ? UNREACHABLE : REACHABLE;
436
446
  const intialState = {[REACHABLE]: 0, [UNREACHABLE]: 0};
@@ -448,6 +458,7 @@ export default class Reachability {
448
458
  // an event other than onIceCandidate
449
459
  peerConnection.onicecandidate = null;
450
460
  peerConnection.close();
461
+ // @ts-ignore
451
462
  peerConnection.elapsed = elapsed;
452
463
  }
453
464
 
@@ -458,7 +469,7 @@ export default class Reachability {
458
469
  * @private
459
470
  * @memberof Reachability
460
471
  */
461
- setup() {
472
+ private setup() {
462
473
  this.clusterLatencyResults = {};
463
474
  }
464
475
  }