@webex/plugin-meetings 2.35.3 → 2.36.0

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 (220) 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 +206 -46
  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 +82 -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/reactions/reactions.js +111 -0
  108. package/dist/reactions/reactions.js.map +1 -0
  109. package/dist/reactions/reactions.type.js +40 -0
  110. package/dist/reactions/reactions.type.js.map +1 -0
  111. package/dist/reconnection-manager/index.js +21 -2
  112. package/dist/reconnection-manager/index.js.map +1 -1
  113. package/dist/roap/collection.js +1 -0
  114. package/dist/roap/collection.js.map +1 -1
  115. package/dist/roap/handler.js +14 -2
  116. package/dist/roap/handler.js.map +1 -1
  117. package/dist/roap/index.js +11 -1
  118. package/dist/roap/index.js.map +1 -1
  119. package/dist/roap/request.js +7 -2
  120. package/dist/roap/request.js.map +1 -1
  121. package/dist/roap/state.js.map +1 -1
  122. package/dist/roap/turnDiscovery.js +9 -1
  123. package/dist/roap/turnDiscovery.js.map +1 -1
  124. package/dist/roap/util.js.map +1 -1
  125. package/dist/statsAnalyzer/global.js.map +1 -1
  126. package/dist/statsAnalyzer/index.js +19 -1
  127. package/dist/statsAnalyzer/index.js.map +1 -1
  128. package/dist/statsAnalyzer/mqaUtil.js +9 -3
  129. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  130. package/dist/transcription/index.js +10 -3
  131. package/dist/transcription/index.js.map +1 -1
  132. package/package.json +17 -17
  133. package/src/common/{browser-detection.js → browser-detection.ts} +1 -1
  134. package/src/common/collection.ts +6 -6
  135. package/src/common/{config.js → config.ts} +1 -1
  136. package/src/common/errors/{captcha-error.js → captcha-error.ts} +5 -1
  137. package/src/common/errors/{intent-to-join.js → intent-to-join.ts} +6 -1
  138. package/src/common/errors/{join-meeting.js → join-meeting.ts} +6 -1
  139. package/src/common/errors/{media.js → media.ts} +5 -1
  140. package/src/common/errors/parameter.ts +3 -2
  141. package/src/common/errors/{password-error.js → password-error.ts} +5 -1
  142. package/src/common/errors/{permission.js → permission.ts} +5 -1
  143. package/src/common/errors/{reconnection-in-progress.js → reconnection-in-progress.ts} +0 -0
  144. package/src/common/errors/{reconnection.js → reconnection.ts} +5 -1
  145. package/src/common/errors/{stats.js → stats.ts} +5 -1
  146. package/src/common/errors/{webex-errors.js → webex-errors.ts} +1 -2
  147. package/src/common/errors/{webex-meetings-error.js → webex-meetings-error.ts} +3 -1
  148. package/src/common/events/{events-scope.js → events-scope.ts} +1 -1
  149. package/src/common/events/{events.js → events.ts} +0 -0
  150. package/src/common/events/{trigger-proxy.js → trigger-proxy.ts} +1 -2
  151. package/src/common/events/{util.js → util.ts} +1 -1
  152. package/src/common/logs/{logger-config.js → logger-config.ts} +1 -2
  153. package/src/common/logs/{logger-proxy.js → logger-proxy.ts} +1 -1
  154. package/src/common/logs/{request.js → request.ts} +12 -2
  155. package/src/common/queue.ts +1 -2
  156. package/src/{config.js → config.ts} +1 -0
  157. package/src/constants.ts +1 -0
  158. package/src/locus-info/{controlsUtils.js → controlsUtils.ts} +4 -4
  159. package/src/locus-info/{embeddedAppsUtils.js → embeddedAppsUtils.ts} +5 -6
  160. package/src/locus-info/{fullState.js → fullState.ts} +1 -1
  161. package/src/locus-info/{hostUtils.js → hostUtils.ts} +5 -5
  162. package/src/locus-info/{index.js → index.ts} +67 -32
  163. package/src/locus-info/{infoUtils.js → infoUtils.ts} +3 -4
  164. package/src/locus-info/{mediaSharesUtils.js → mediaSharesUtils.ts} +13 -13
  165. package/src/locus-info/{parser.js → parser.ts} +22 -12
  166. package/src/locus-info/{selfUtils.js → selfUtils.ts} +17 -19
  167. package/src/media/{index.js → index.ts} +108 -39
  168. package/src/media/{properties.js → properties.ts} +16 -4
  169. package/src/media/{util.js → util.ts} +2 -3
  170. package/src/mediaQualityMetrics/{config.js → config.ts} +1 -1
  171. package/src/meeting/{effectsState.js → effectsState.ts} +12 -6
  172. package/src/meeting/{index.js → index.ts} +365 -157
  173. package/src/meeting/{muteState.js → muteState.ts} +16 -11
  174. package/src/meeting/{request.js → request.ts} +147 -36
  175. package/src/meeting/{state.js → state.ts} +6 -6
  176. package/src/meeting/{util.js → util.ts} +4 -4
  177. package/src/meeting-info/{collection.js → collection.ts} +4 -1
  178. package/src/meeting-info/{index.js → index.ts} +10 -6
  179. package/src/meeting-info/{meeting-info-v2.js → meeting-info-v2.ts} +28 -10
  180. package/src/meeting-info/{request.js → request.ts} +6 -2
  181. package/src/meeting-info/{util.js → util.ts} +6 -5
  182. package/src/meeting-info/{utilv2.js → utilv2.ts} +8 -7
  183. package/src/meetings/{collection.js → collection.ts} +5 -2
  184. package/src/meetings/{index.js → index.ts} +88 -22
  185. package/src/meetings/{request.js → request.ts} +6 -1
  186. package/src/meetings/{util.js → util.ts} +5 -3
  187. package/src/member/{index.js → index.ts} +46 -15
  188. package/src/member/{util.js → util.ts} +17 -16
  189. package/src/members/{collection.js → collection.ts} +2 -1
  190. package/src/members/{index.js → index.ts} +39 -26
  191. package/src/members/{request.js → request.ts} +16 -5
  192. package/src/members/{util.js → util.ts} +7 -7
  193. package/src/metrics/{config.js → config.ts} +0 -2
  194. package/src/metrics/{constants.js → constants.ts} +0 -0
  195. package/src/metrics/{index.js → index.ts} +27 -8
  196. package/src/networkQualityMonitor/{index.js → index.ts} +18 -3
  197. package/src/peer-connection-manager/{index.js → index.ts} +72 -28
  198. package/src/personal-meeting-room/{index.js → index.ts} +17 -4
  199. package/src/personal-meeting-room/{request.js → request.ts} +3 -1
  200. package/src/personal-meeting-room/{util.js → util.ts} +1 -1
  201. package/src/reachability/{index.js → index.ts} +28 -17
  202. package/src/reachability/request.ts +4 -2
  203. package/src/reactions/reactions.ts +104 -0
  204. package/src/reactions/reactions.type.ts +36 -0
  205. package/src/reconnection-manager/{index.js → index.ts} +42 -13
  206. package/src/roap/{collection.js → collection.ts} +1 -0
  207. package/src/roap/{handler.js → handler.ts} +15 -4
  208. package/src/roap/{index.js → index.ts} +23 -10
  209. package/src/roap/{request.js → request.ts} +19 -3
  210. package/src/roap/{state.js → state.ts} +3 -2
  211. package/src/roap/turnDiscovery.ts +14 -5
  212. package/src/roap/{util.js → util.ts} +1 -2
  213. package/src/statsAnalyzer/{global.js → global.ts} +0 -0
  214. package/src/statsAnalyzer/{index.js → index.ts} +36 -17
  215. package/src/statsAnalyzer/{mqaUtil.js → mqaUtil.ts} +6 -1
  216. package/src/transcription/{index.js → index.ts} +16 -11
  217. package/test/integration/spec/space-meeting.js +1 -2
  218. package/test/unit/spec/meeting/index.js +113 -14
  219. package/test/unit/spec/meeting/request.js +25 -1
  220. package/test/unit/spec/roap/util.js +1 -1
@@ -1,4 +1,3 @@
1
-
2
1
  import LoggerProxy from '../common/logs/logger-proxy';
3
2
  import ParameterError from '../common/errors/parameter';
4
3
  import PermissionError from '../common/errors/permission';
@@ -11,6 +10,7 @@ import {AUDIO, VIDEO} from '../constants';
11
10
  If we ever need to support it, search for REMOTE_MUTE_VIDEO_MISSING_IMPLEMENTATION string to find the places that need updating
12
11
  */
13
12
 
13
+
14
14
  const createMuteState = (type, meeting, mediaDirection) => {
15
15
  if (type === AUDIO && !mediaDirection.sendAudio) {
16
16
  return null;
@@ -30,13 +30,18 @@ const createMuteState = (type, meeting, mediaDirection) => {
30
30
  More info about Locus muting API: https://sqbu-github.cisco.com/pages/WebExSquared/locus/guides/mute.html#
31
31
  */
32
32
  class MuteState {
33
+ pendingPromiseReject: any;
34
+ pendingPromiseResolve: any;
35
+ state: any;
36
+ type: any;
37
+
33
38
  /**
34
39
  * Constructor
35
40
  *
36
41
  * @param {String} type - audio or video
37
42
  * @param {Object} meeting - the meeting object (used for reading current remote mute status)
38
43
  */
39
- constructor(type, meeting) {
44
+ constructor(type: string, meeting: any) {
40
45
  if ((type !== AUDIO) && (type !== VIDEO)) {
41
46
  throw new ParameterError('Mute state is designed for handling audio or video only');
42
47
  }
@@ -72,7 +77,7 @@ class MuteState {
72
77
  * @param {Boolean} [mute] true for muting, false for unmuting request
73
78
  * @returns {Promise}
74
79
  */
75
- handleClientRequest(meeting, mute) {
80
+ public handleClientRequest(meeting?: object, mute?: boolean) {
76
81
  LoggerProxy.logger.info(`Meeting:muteState#handleClientRequest --> ${this.type}: user requesting new mute state: ${mute}`);
77
82
 
78
83
  if (!mute && !this.state.server.unmuteAllowed) {
@@ -103,7 +108,7 @@ class MuteState {
103
108
  * @memberof MuteState
104
109
  * @returns {void}
105
110
  */
106
- applyClientStateLocally(meeting) {
111
+ public applyClientStateLocally(meeting?: any) {
107
112
  Media.setLocalTrack(
108
113
  !this.state.client.localMute,
109
114
  (this.type === AUDIO) ? meeting.mediaProperties.audioTrack : meeting.mediaProperties.videoTrack
@@ -118,7 +123,7 @@ class MuteState {
118
123
  * @memberof MuteState
119
124
  * @returns {void}
120
125
  */
121
- applyClientStateToServer(meeting) {
126
+ private applyClientStateToServer(meeting?: object) {
122
127
  if (this.state.syncToServerInProgress) {
123
128
  LoggerProxy.logger.info(`Meeting:muteState#applyClientStateToServer --> ${this.type}: request to server in progress, we need to wait for it to complete`);
124
129
 
@@ -178,7 +183,7 @@ class MuteState {
178
183
  * @memberof MuteState
179
184
  * @returns {Promise}
180
185
  */
181
- sendLocalMuteRequestToServer(meeting) {
186
+ private sendLocalMuteRequestToServer(meeting?: any) {
182
187
  const audioMuted = (this.type === AUDIO) ? this.state.client.localMute : meeting.audio?.state.client.localMute;
183
188
  const videoMuted = (this.type === VIDEO) ? this.state.client.localMute : meeting.video?.state.client.localMute;
184
189
 
@@ -214,7 +219,7 @@ class MuteState {
214
219
  * @memberof MuteState
215
220
  * @returns {Promise}
216
221
  */
217
- sendRemoteMuteRequestToServer(meeting) {
222
+ private sendRemoteMuteRequestToServer(meeting?: any) {
218
223
  if (this.type === AUDIO) {
219
224
  const remoteMute = this.state.client.localMute;
220
225
 
@@ -252,7 +257,7 @@ class MuteState {
252
257
  * @param {Boolean} [unmuteAllowed] indicates if user is allowed to unmute self (false when "hard mute" feature is used)
253
258
  * @returns {undefined}
254
259
  */
255
- handleServerRemoteMuteUpdate(muted, unmuteAllowed) {
260
+ public handleServerRemoteMuteUpdate(muted?: boolean, unmuteAllowed?: boolean) {
256
261
  LoggerProxy.logger.info(`Meeting:muteState#handleServerRemoteMuteUpdate --> ${this.type}: updating server remoteMute to (${muted})`);
257
262
  this.state.server.remoteMute = muted;
258
263
  this.state.server.unmuteAllowed = unmuteAllowed;
@@ -266,7 +271,7 @@ class MuteState {
266
271
  * @param {Object} [meeting] the meeting object
267
272
  * @returns {undefined}
268
273
  */
269
- handleServerLocalUnmuteRequired(meeting) {
274
+ public handleServerLocalUnmuteRequired(meeting?: object) {
270
275
  LoggerProxy.logger.info(`Meeting:muteState#handleServerLocalUnmuteRequired --> ${this.type}: localAudioUnmuteRequired received -> doing local unmute`);
271
276
 
272
277
  this.state.server.remoteMute = false;
@@ -289,7 +294,7 @@ class MuteState {
289
294
  * @memberof MuteState
290
295
  * @returns {Boolean}
291
296
  */
292
- isMuted() {
297
+ public isMuted() {
293
298
  return this.state.client.localMute || this.state.server.localMute || this.state.server.remoteMute;
294
299
  }
295
300
 
@@ -300,7 +305,7 @@ class MuteState {
300
305
  * @memberof MuteState
301
306
  * @returns {Boolean}
302
307
  */
303
- isSelf() {
308
+ public isSelf() {
304
309
  return this.state.client.localMute && !this.state.server.remoteMute;
305
310
  }
306
311
 
@@ -1,6 +1,8 @@
1
1
  import uuid from 'uuid';
2
2
  import {debounce} from 'lodash';
3
+ // @ts-ignore
3
4
  import {StatelessWebexPlugin} from '@webex/webex-core';
5
+ // @ts-ignore
4
6
  import {deviceType} from '@webex/common';
5
7
 
6
8
  import LoggerProxy from '../common/logs/logger-proxy';
@@ -23,12 +25,15 @@ import {
23
25
  SEND_DTMF_ENDPOINT,
24
26
  _SLIDES_
25
27
  } from '../constants';
28
+ import {Reaction} from '../reactions/reactions.type';
26
29
 
27
30
  /**
28
31
  * @class MeetingRequest
29
32
  */
30
33
  export default class MeetingRequest extends StatelessWebexPlugin {
31
- constructor(attrs, options) {
34
+ changeVideoLayoutDebounced: any;
35
+
36
+ constructor(attrs: any, options: any) {
32
37
  super(attrs, options);
33
38
  this.changeVideoLayoutDebounced = debounce(this.changeVideoLayout, 2000, {leading: true, trailing: true});
34
39
  }
@@ -48,7 +53,23 @@ export default class MeetingRequest extends StatelessWebexPlugin {
48
53
  * @param {Object} options.roapMessage
49
54
  * @returns {Promise}
50
55
  */
51
- async joinMeeting(options) {
56
+ async joinMeeting(options: {
57
+ sipUri: string;
58
+ deviceUrl: string;
59
+ locusUrl: string;
60
+ resourceId: string;
61
+ correlationId: string;
62
+ ensureConversation: boolean;
63
+ moderator: boolean;
64
+ pin: boolean;
65
+ moveToResource: boolean;
66
+ roapMessage: any;
67
+ asResourceOccupant: any;
68
+ inviteeAddress: any;
69
+ meetingNumber: any;
70
+ permissionToken: any;
71
+ preferTranscoding: any;
72
+ }) {
52
73
  const {
53
74
  asResourceOccupant,
54
75
  inviteeAddress,
@@ -73,10 +94,11 @@ export default class MeetingRequest extends StatelessWebexPlugin {
73
94
 
74
95
  let url = '';
75
96
 
76
- const body = {
97
+ const body: any = {
77
98
  asResourceOccupant,
78
99
  device: {
79
100
  url: deviceUrl,
101
+ // @ts-ignore - config comes from registerPlugin
80
102
  deviceType: this.config.meetings.deviceType
81
103
  },
82
104
  usingResource: resourceId || null,
@@ -91,8 +113,11 @@ export default class MeetingRequest extends StatelessWebexPlugin {
91
113
  }
92
114
  };
93
115
 
116
+ // @ts-ignore
94
117
  if (this.webex.meetings.clientRegion) {
118
+ // @ts-ignore
95
119
  body.device.countryCode = this.webex.meetings.clientRegion.countryCode;
120
+ // @ts-ignore
96
121
  body.device.regionCode = this.webex.meetings.clientRegion.regionCode;
97
122
  }
98
123
 
@@ -113,7 +138,9 @@ export default class MeetingRequest extends StatelessWebexPlugin {
113
138
  }
114
139
  else if (inviteeAddress || meetingNumber) {
115
140
  try {
141
+ // @ts-ignore
116
142
  await this.webex.internal.services.waitForCatalog('postauth');
143
+ // @ts-ignore
117
144
  url = `${this.webex.internal.services.get('locus')}/${LOCI}/${CALL}`;
118
145
  body.invitee = {
119
146
  address: inviteeAddress || `wbxmn:${meetingNumber}`
@@ -139,6 +166,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
139
166
  body.localMedias = roapMessage.localMedias;
140
167
  }
141
168
 
169
+ /// @ts-ignore
142
170
  return this.request({
143
171
  method: HTTP_VERBS.POST,
144
172
  uri: url,
@@ -154,14 +182,12 @@ export default class MeetingRequest extends StatelessWebexPlugin {
154
182
  * @returns {Promise}
155
183
  * @private
156
184
  */
157
- refreshCaptcha({
158
- captchaRefreshUrl,
159
- captchaId
160
- }) {
185
+ private refreshCaptcha({ captchaRefreshUrl, captchaId }: { captchaRefreshUrl: string; captchaId: string }) {
161
186
  const body = {
162
187
  captchaId
163
188
  };
164
189
 
190
+ // @ts-ignore
165
191
  return this.request({
166
192
  method: HTTP_VERBS.POST,
167
193
  uri: captchaRefreshUrl,
@@ -177,17 +203,22 @@ export default class MeetingRequest extends StatelessWebexPlugin {
177
203
  * Make a network request to add a dial in device
178
204
  * @param {Object} options
179
205
  * @param {String} options.correlationId
180
- * @param {String} options.localUrl url for the meeting
206
+ * @param {String} options.locusUrl url for the meeting
181
207
  * @param {String} options.dialInUrl identifier for the to-be provisioned device
182
208
  * @param {String} options.clientUrl identifier for the web device
183
209
  * @returns {Promise}
184
210
  * @private
185
211
  */
186
- dialIn({
212
+ private dialIn({
187
213
  locusUrl,
188
214
  dialInUrl,
189
215
  clientUrl,
190
- correlationId
216
+ correlationId,
217
+ }: {
218
+ correlationId: string;
219
+ locusUrl: string;
220
+ dialInUrl: string;
221
+ clientUrl: string;
191
222
  }) {
192
223
  LoggerProxy.logger.info(
193
224
  'Meeting:request#dialIn --> Provisioning a dial in device',
@@ -205,6 +236,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
205
236
  correlationId
206
237
  };
207
238
 
239
+ // @ts-ignore
208
240
  return this.request({
209
241
  method: HTTP_VERBS.POST,
210
242
  uri,
@@ -220,19 +252,25 @@ export default class MeetingRequest extends StatelessWebexPlugin {
220
252
  * Make a network request to add a dial out device
221
253
  * @param {Object} options
222
254
  * @param {String} options.correlationId
223
- * @param {String} options.localUrl url for the meeting
255
+ * @param {String} options.locusUrl url for the meeting
224
256
  * @param {String} options.dialOutUrl identifier for the to-be provisioned device
225
257
  * @param {String} options.phoneNumber phone number to dial out to
226
258
  * @param {String} options.clientUrl identifier for the web device
227
259
  * @returns {Promise}
228
260
  * @private
229
261
  */
230
- dialOut({
262
+ private dialOut({
231
263
  locusUrl,
232
264
  dialOutUrl,
233
265
  phoneNumber,
234
266
  clientUrl,
235
- correlationId
267
+ correlationId,
268
+ }: {
269
+ correlationId: string;
270
+ locusUrl: string;
271
+ dialOutUrl: string;
272
+ phoneNumber: string;
273
+ clientUrl: string;
236
274
  }) {
237
275
  LoggerProxy.logger.info(
238
276
  'Meeting:request#dialOut --> Provisioning a dial out device',
@@ -251,6 +289,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
251
289
  correlationId
252
290
  };
253
291
 
292
+ // @ts-ignore
254
293
  return this.request({
255
294
  method: HTTP_VERBS.POST,
256
295
  uri,
@@ -265,11 +304,11 @@ export default class MeetingRequest extends StatelessWebexPlugin {
265
304
  /**
266
305
  * Syns the missed delta event
267
306
  * @param {Object} options
268
- * @param {boolen} options.desync flag to get partial or whole locus object
307
+ * @param {boolean} options.desync flag to get partial or whole locus object
269
308
  * @param {String} options.syncUrl sync url to get ht elatest locus delta
270
309
  * @returns {Promise}
271
310
  */
272
- syncMeeting(options) {
311
+ syncMeeting(options: { desync: boolean; syncUrl: string }) {
273
312
  /* eslint-disable no-else-return */
274
313
  const {desync} = options;
275
314
  let {syncUrl} = options;
@@ -280,6 +319,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
280
319
  syncUrl = syncUrl.concat(syncUrl.split('?')[1] ? '&' : '?').concat(`${LOCUS.SYNCDEBUG}=${desync}`);
281
320
  }
282
321
 
322
+ // @ts-ignore
283
323
  return this.request({
284
324
  method: HTTP_VERBS.GET,
285
325
  uri: syncUrl
@@ -294,11 +334,11 @@ export default class MeetingRequest extends StatelessWebexPlugin {
294
334
  /**
295
335
  * Request to get the complete locus object
296
336
  * @param {Object} options
297
- * @param {boolen} options.desync flag to get partial or whole locus object
337
+ * @param {boolean} options.desync flag to get partial or whole locus object
298
338
  * @param {String} options.locusUrl sync url to get ht elatest locus delta
299
339
  * @returns {Promise}
300
340
  */
301
- getFullLocus(options) {
341
+ getFullLocus(options: { desync: boolean; locusUrl: string }) {
302
342
  let {locusUrl} = options;
303
343
  const {desync} = options;
304
344
 
@@ -307,6 +347,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
307
347
  locusUrl += `?${LOCUS.SYNCDEBUG}=${desync}`;
308
348
  }
309
349
 
350
+ // @ts-ignore
310
351
  return this.request({
311
352
  method: HTTP_VERBS.GET,
312
353
  uri: locusUrl
@@ -330,11 +371,16 @@ export default class MeetingRequest extends StatelessWebexPlugin {
330
371
  * @returns {Promise}
331
372
  * @private
332
373
  */
333
- disconnectPhoneAudio({
374
+ private disconnectPhoneAudio({
334
375
  locusUrl,
335
376
  phoneUrl,
336
377
  correlationId,
337
- selfId
378
+ selfId,
379
+ }: {
380
+ locusUrl: string;
381
+ phoneUrl: string;
382
+ correlationId: string;
383
+ selfId: string;
338
384
  }) {
339
385
  LoggerProxy.logger.info(
340
386
  `Meeting:request#disconnectPhoneAudio --> request phone ${phoneUrl} to leave`,
@@ -350,6 +396,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
350
396
  correlationId
351
397
  };
352
398
 
399
+ // @ts-ignore
353
400
  return this.request({
354
401
  method: HTTP_VERBS.PUT,
355
402
  uri,
@@ -378,7 +425,13 @@ export default class MeetingRequest extends StatelessWebexPlugin {
378
425
  selfId,
379
426
  deviceUrl: url,
380
427
  resourceId,
381
- correlationId
428
+ correlationId,
429
+ }: {
430
+ locusUrl: string;
431
+ selfId: string;
432
+ deviceUrl: string;
433
+ resourceId: string;
434
+ correlationId: string;
382
435
  }) {
383
436
  LoggerProxy.logger.info(
384
437
  'Meeting:request#leaveMeeting --> Leaving a meeting',
@@ -388,6 +441,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
388
441
  const uri = `${locusUrl}/${PARTICIPANT}/${selfId}/${LEAVE}`;
389
442
  const body = {
390
443
  device: {
444
+ // @ts-ignore
391
445
  deviceType: this.config.meetings.deviceType,
392
446
  url
393
447
  },
@@ -395,6 +449,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
395
449
  correlationId
396
450
  };
397
451
 
452
+ // @ts-ignore
398
453
  return this.request({
399
454
  method: HTTP_VERBS.PUT,
400
455
  uri,
@@ -410,16 +465,18 @@ export default class MeetingRequest extends StatelessWebexPlugin {
410
465
  * @param {String} options.correlationId
411
466
  * @returns {Promise}
412
467
  */
413
- acknowledgeMeeting(options) {
468
+ acknowledgeMeeting(options: { locusUrl: string; deviceUrl: string; correlationId: string }) {
414
469
  const uri = `${options.locusUrl}/${PARTICIPANT}/${ALERT}`;
415
470
  const body = {
416
471
  device: {
472
+ // @ts-ignore
417
473
  deviceType: this.config.meetings.deviceType,
418
474
  url: options.deviceUrl
419
475
  },
420
476
  correlationId: options.correlationId
421
477
  };
422
478
 
479
+ // @ts-ignore
423
480
  return this.request({
424
481
  method: HTTP_VERBS.PUT,
425
482
  uri,
@@ -435,7 +492,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
435
492
  * @param {String} options.id
436
493
  * @returns {Promise}
437
494
  */
438
- recordMeeting(options) {
495
+ recordMeeting(options: { locusUrl: string; deviceUrl: string; id: string, recording: any, paused: any }) {
439
496
  const uri = `${options.locusUrl}/${CONTROLS}`;
440
497
  const body = {
441
498
  record: {
@@ -444,6 +501,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
444
501
  }
445
502
  };
446
503
 
504
+ // @ts-ignore
447
505
  return this.request({
448
506
  method: HTTP_VERBS.PATCH,
449
507
  uri,
@@ -459,6 +517,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
459
517
  }
460
518
  };
461
519
 
520
+ // @ts-ignore
462
521
  return this.request({
463
522
  method: HTTP_VERBS.PATCH,
464
523
  uri,
@@ -474,16 +533,18 @@ export default class MeetingRequest extends StatelessWebexPlugin {
474
533
  * @param {String} options.reason
475
534
  * @returns {Promise}
476
535
  */
477
- declineMeeting(options) {
536
+ declineMeeting(options: { locusUrl: string; deviceUrl: string; reason: string }) {
478
537
  const uri = `${options.locusUrl}/${PARTICIPANT}/${DECLINE}`;
479
538
  const body = {
480
539
  device: {
540
+ // @ts-ignore
481
541
  deviceType: this.config.meetings.deviceType,
482
542
  url: options.deviceUrl
483
543
  },
484
- ...(options.reason && {reason: options.reason})
544
+ ...(options.reason && {reason: options.reason}),
485
545
  };
486
546
 
547
+ // @ts-ignore
487
548
  return this.request({
488
549
  method: HTTP_VERBS.PUT,
489
550
  uri,
@@ -501,10 +562,17 @@ export default class MeetingRequest extends StatelessWebexPlugin {
501
562
  * @param {String} options.localMedias local sdps
502
563
  * @returns {Promise}
503
564
  */
504
- remoteAudioVideoToggle(options) {
565
+ remoteAudioVideoToggle(options: {
566
+ selfId: string;
567
+ locusUrl: string;
568
+ deviceUrl: string;
569
+ resourceId: string;
570
+ localMedias: string;
571
+ } | any) {
505
572
  const uri = `${options.locusUrl}/${PARTICIPANT}/${options.selfId}/${MEDIA}`;
506
573
  const body = {
507
574
  device: {
575
+ // @ts-ignore
508
576
  deviceType: this.config.meetings.deviceType,
509
577
  url: options.deviceUrl
510
578
  },
@@ -517,6 +585,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
517
585
  }
518
586
  };
519
587
 
588
+ // @ts-ignore
520
589
  return this.request({
521
590
  method: HTTP_VERBS.PUT,
522
591
  uri,
@@ -534,8 +603,14 @@ export default class MeetingRequest extends StatelessWebexPlugin {
534
603
  * @param {String} options.uri floor grant uri
535
604
  * @returns {Promise}
536
605
  */
537
- changeMeetingFloor(options) {
538
- let floorReq = {disposition: options.disposition};
606
+ changeMeetingFloor(options: {
607
+ disposition: string;
608
+ personUrl: string;
609
+ deviceUrl: string;
610
+ resourceId: string;
611
+ uri: string;
612
+ } | any) {
613
+ let floorReq: any = {disposition: options.disposition};
539
614
 
540
615
  /* istanbul ignore else */
541
616
  if (options.disposition === FLOOR_ACTION.GRANTED) {
@@ -544,6 +619,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
544
619
  url: options.personUrl,
545
620
  devices: [
546
621
  {
622
+ // @ts-ignore
547
623
  deviceType: this.config.meetings.deviceType,
548
624
  url: options.deviceUrl
549
625
  }
@@ -556,7 +632,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
556
632
  };
557
633
  }
558
634
 
559
- const body = {
635
+ const body: any = {
560
636
  floor: floorReq,
561
637
  resourceUrl: options.resourceUrl
562
638
  };
@@ -565,6 +641,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
565
641
  body.resourceToken = options?.resourceToken;
566
642
  }
567
643
 
644
+ // @ts-ignore
568
645
  return this.request({
569
646
  uri: options.uri,
570
647
  method: HTTP_VERBS.PUT,
@@ -580,7 +657,8 @@ export default class MeetingRequest extends StatelessWebexPlugin {
580
657
  * @param {String} options.tones a string of one or more DTMF tones to send
581
658
  * @returns {Promise}
582
659
  */
583
- sendDTMF({locusUrl, deviceUrl, tones}) {
660
+ sendDTMF({ locusUrl, deviceUrl, tones }: { locusUrl: string; deviceUrl: string; tones: string }) {
661
+ // @ts-ignore
584
662
  return this.request({
585
663
  method: HTTP_VERBS.POST,
586
664
  uri: `${locusUrl}/${SEND_DTMF_ENDPOINT}`,
@@ -613,7 +691,19 @@ export default class MeetingRequest extends StatelessWebexPlugin {
613
691
  deviceUrl,
614
692
  layoutType,
615
693
  main,
616
- content
694
+ content,
695
+ }: {
696
+ locusUrl: string;
697
+ deviceUrl: string;
698
+ layoutType: string;
699
+ main: {
700
+ width: number;
701
+ height: number;
702
+ };
703
+ content: {
704
+ width: number;
705
+ height: number;
706
+ };
617
707
  }) {
618
708
  // send main/content renderInfo only if both width and height are specified
619
709
  if (main && (!main.width || !main.height)) {
@@ -636,6 +726,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
636
726
  }
637
727
  } : undefined;
638
728
 
729
+ // @ts-ignore
639
730
  return this.request({
640
731
  method: HTTP_VERBS.PUT,
641
732
  uri: `${locusUrl}/${CONTROLS}`,
@@ -655,11 +746,10 @@ export default class MeetingRequest extends StatelessWebexPlugin {
655
746
  * @param {Url} options.locusUrl
656
747
  * @returns {Promise}
657
748
  */
658
- endMeetingForAll({
659
- locusUrl,
660
- }) {
749
+ endMeetingForAll({ locusUrl }: { locusUrl: string }) {
661
750
  const uri = `${locusUrl}/${END}`;
662
751
 
752
+ // @ts-ignore
663
753
  return this.request({
664
754
  method: HTTP_VERBS.POST,
665
755
  uri
@@ -672,12 +762,33 @@ export default class MeetingRequest extends StatelessWebexPlugin {
672
762
  * @param {Url} options.keepAliveUrl
673
763
  * @returns {Promise}
674
764
  */
675
- keepAlive({
676
- keepAliveUrl,
677
- }) {
765
+ keepAlive({ keepAliveUrl }: { keepAliveUrl: string }) {
766
+ // @ts-ignore
678
767
  return this.request({
679
768
  method: HTTP_VERBS.GET,
680
769
  uri: keepAliveUrl
681
770
  });
682
771
  }
772
+
773
+ /**
774
+ * Make a network request to send a reaction.
775
+ * @param {Object} options
776
+ * @param {Url} options.reactionChannelUrl
777
+ * @param {Reaction} options.reaction
778
+ * @param {string} options.senderID
779
+ * @returns {Promise}
780
+ */
781
+ sendReaction({ reactionChannelUrl, reaction, participantId }: { reactionChannelUrl: string, reaction: Reaction, participantId: string }) {
782
+ const uri = reactionChannelUrl;
783
+
784
+ // @ts-ignore
785
+ return this.request({
786
+ method: HTTP_VERBS.POST,
787
+ uri,
788
+ body: {
789
+ sender: {participantId},
790
+ reaction,
791
+ }
792
+ });
793
+ }
683
794
  }
@@ -13,7 +13,7 @@ const MeetingStateMachine = {
13
13
  * @param {Meeting} meetingRef A reference to a meeting instance
14
14
  * @returns {StateMachine}
15
15
  */
16
- create(meetingRef) {
16
+ create(meetingRef: any) {
17
17
  if (!meetingRef) {
18
18
  throw new ParameterError('You must initialize the meeting state machine with a meeting reference.');
19
19
  }
@@ -44,7 +44,7 @@ const MeetingStateMachine = {
44
44
  * @param {Boolean} remote.remoteDeclined
45
45
  * @returns {String}
46
46
  */
47
- to(remote) {
47
+ to(remote: { remoteAnswered: boolean; remoteDeclined: boolean }) {
48
48
  // other user answered the call
49
49
  if (remote.remoteAnswered) {
50
50
  return MEETING_STATE_MACHINE.STATES.ANSWERED;
@@ -114,7 +114,7 @@ const MeetingStateMachine = {
114
114
  * @param {Object} stop -- {remoteAnswered: {Boolean}, remoteDeclined: {Boolean}}
115
115
  * @returns {Boolean}
116
116
  */
117
- onRemote(transition, stop) {
117
+ onRemote(transition: object, stop: object) {
118
118
  if (this.meeting) {
119
119
  Trigger.trigger(
120
120
  this.meeting,
@@ -136,7 +136,7 @@ const MeetingStateMachine = {
136
136
  * @param {String} type -- incoming call === INCOMING / or other meetings have a ring type of JOIN
137
137
  * @returns {Boolean}
138
138
  */
139
- onRing(transition, type) {
139
+ onRing(transition: object, type: string) {
140
140
  if (this.meeting) {
141
141
  Trigger.trigger(
142
142
  this.meeting,
@@ -158,7 +158,7 @@ const MeetingStateMachine = {
158
158
  * @param {Error} error
159
159
  * @returns {Boolean}
160
160
  */
161
- onEnterError(transition, error) {
161
+ onEnterError(transition: any, error: Error) {
162
162
  LoggerProxy.logger.error(`Meeting:state#onEnterError --> state->onEnterError#meeting.id: ${this.meeting.id} | Transition '${transition?.transition}' : ${transition?.from} -> ${transition?.to}, with error ${error}. Last states: ${this.history}`);
163
163
  },
164
164
  /**
@@ -166,7 +166,7 @@ const MeetingStateMachine = {
166
166
  * @param {Object} transition
167
167
  * @returns {Boolean}
168
168
  */
169
- onAfterTransition(transition) {
169
+ onAfterTransition(transition: any) {
170
170
  LoggerProxy.logger.log(`Meeting:state#onAfterTransition --> state->onAfterTransition#meeting.id: ${this.meeting.id} | Transition '${transition.transition}' : ${transition.from} -> ${transition.to} executed. Last states: ${this.history}`);
171
171
  }
172
172
  },
@@ -19,10 +19,10 @@ import PermissionError from '../common/errors/permission';
19
19
  import PasswordError from '../common/errors/password-error';
20
20
  import CaptchaError from '../common/errors/captcha-error';
21
21
 
22
- const MeetingUtil = {};
22
+ const MeetingUtil: any = {};
23
23
 
24
24
  MeetingUtil.parseLocusJoin = (response) => {
25
- const parsed = {};
25
+ const parsed: any = {};
26
26
 
27
27
  // First todo: add check for existance
28
28
  parsed.locus = response.body.locus;
@@ -168,7 +168,7 @@ MeetingUtil.disconnectPhoneAudio = (meeting, phoneUrl) => {
168
168
  // if you explicity want it not to leave on resource id, pass
169
169
  // {resourceId: null}
170
170
  // TODO: chris, you can modify this however you want
171
- MeetingUtil.leaveMeeting = (meeting, options = {}) => {
171
+ MeetingUtil.leaveMeeting = (meeting, options: any = {}) => {
172
172
  if (meeting.meetingState === FULL_STATE.INACTIVE) {
173
173
  // TODO: clean up if the meeting is already inactive
174
174
  return Promise.reject(new MeetingNotActiveError());
@@ -237,7 +237,7 @@ MeetingUtil.isMediaEstablished = (currentMediaStatus) =>
237
237
  currentMediaStatus && (currentMediaStatus.audio || currentMediaStatus.video || currentMediaStatus.share);
238
238
 
239
239
 
240
- MeetingUtil.joinMeetingOptions = (meeting, options = {}) => {
240
+ MeetingUtil.joinMeetingOptions = (meeting, options: any = {}) => {
241
241
  meeting.resourceId = meeting.resourceId || options.resourceId;
242
242
 
243
243
  if (meeting.requiredCaptcha) {