@webex/plugin-meetings 3.0.0-beta.13 → 3.0.0-beta.15

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 (252) hide show
  1. package/UPGRADING.md +9 -9
  2. package/browsers.js +19 -24
  3. package/dist/common/browser-detection.js +1 -0
  4. package/dist/common/browser-detection.js.map +1 -1
  5. package/dist/common/collection.js.map +1 -1
  6. package/dist/common/errors/captcha-error.js +5 -5
  7. package/dist/common/errors/captcha-error.js.map +1 -1
  8. package/dist/common/errors/intent-to-join.js +5 -5
  9. package/dist/common/errors/intent-to-join.js.map +1 -1
  10. package/dist/common/errors/join-meeting.js +6 -6
  11. package/dist/common/errors/join-meeting.js.map +1 -1
  12. package/dist/common/errors/media.js +5 -5
  13. package/dist/common/errors/media.js.map +1 -1
  14. package/dist/common/errors/parameter.js +5 -5
  15. package/dist/common/errors/parameter.js.map +1 -1
  16. package/dist/common/errors/password-error.js +5 -5
  17. package/dist/common/errors/password-error.js.map +1 -1
  18. package/dist/common/errors/permission.js +4 -4
  19. package/dist/common/errors/permission.js.map +1 -1
  20. package/dist/common/errors/reconnection.js +5 -5
  21. package/dist/common/errors/reconnection.js.map +1 -1
  22. package/dist/common/errors/stats.js +5 -5
  23. package/dist/common/errors/stats.js.map +1 -1
  24. package/dist/common/errors/webex-errors.js.map +1 -1
  25. package/dist/common/errors/webex-meetings-error.js.map +1 -1
  26. package/dist/common/events/events-scope.js.map +1 -1
  27. package/dist/common/events/events.js.map +1 -1
  28. package/dist/common/events/trigger-proxy.js.map +1 -1
  29. package/dist/common/events/util.js.map +1 -1
  30. package/dist/common/logs/logger-proxy.js.map +1 -1
  31. package/dist/common/logs/request.js.map +1 -1
  32. package/dist/config.js.map +1 -1
  33. package/dist/constants.js.map +1 -1
  34. package/dist/index.js.map +1 -1
  35. package/dist/locus-info/controlsUtils.js.map +1 -1
  36. package/dist/locus-info/fullState.js.map +1 -1
  37. package/dist/locus-info/hostUtils.js.map +1 -1
  38. package/dist/locus-info/index.js +11 -8
  39. package/dist/locus-info/index.js.map +1 -1
  40. package/dist/locus-info/infoUtils.js.map +1 -1
  41. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  42. package/dist/locus-info/parser.js +2 -1
  43. package/dist/locus-info/parser.js.map +1 -1
  44. package/dist/locus-info/selfUtils.js +2 -1
  45. package/dist/locus-info/selfUtils.js.map +1 -1
  46. package/dist/media/index.js.map +1 -1
  47. package/dist/media/internal-media-core-wrapper.js.map +1 -1
  48. package/dist/media/properties.js.map +1 -1
  49. package/dist/media/util.js +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 +1 -1
  53. package/dist/meeting/effectsState.js.map +1 -1
  54. package/dist/meeting/in-meeting-actions.js.map +1 -1
  55. package/dist/meeting/index.js +118 -89
  56. package/dist/meeting/index.js.map +1 -1
  57. package/dist/meeting/muteState.js +1 -1
  58. package/dist/meeting/muteState.js.map +1 -1
  59. package/dist/meeting/request.js +25 -0
  60. package/dist/meeting/request.js.map +1 -1
  61. package/dist/meeting/request.type.js +8 -0
  62. package/dist/meeting/request.type.js.map +1 -0
  63. package/dist/meeting/state.js +5 -5
  64. package/dist/meeting/state.js.map +1 -1
  65. package/dist/meeting/util.js.map +1 -1
  66. package/dist/meeting-info/collection.js.map +1 -1
  67. package/dist/meeting-info/index.js +2 -2
  68. package/dist/meeting-info/index.js.map +1 -1
  69. package/dist/meeting-info/meeting-info-v2.js +48 -48
  70. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  71. package/dist/meeting-info/request.js.map +1 -1
  72. package/dist/meeting-info/util.js.map +1 -1
  73. package/dist/meeting-info/utilv2.js +1 -1
  74. package/dist/meeting-info/utilv2.js.map +1 -1
  75. package/dist/meetings/collection.js.map +1 -1
  76. package/dist/meetings/index.js +251 -250
  77. package/dist/meetings/index.js.map +1 -1
  78. package/dist/meetings/request.js +2 -2
  79. package/dist/meetings/request.js.map +1 -1
  80. package/dist/meetings/util.js +14 -14
  81. package/dist/meetings/util.js.map +1 -1
  82. package/dist/member/index.js +31 -31
  83. package/dist/member/index.js.map +1 -1
  84. package/dist/member/util.js.map +1 -1
  85. package/dist/members/collection.js.map +1 -1
  86. package/dist/members/index.js +43 -43
  87. package/dist/members/index.js.map +1 -1
  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 +23 -20
  93. package/dist/metrics/index.js.map +1 -1
  94. package/dist/multistream/multistreamMedia.js +2 -1
  95. package/dist/multistream/multistreamMedia.js.map +1 -1
  96. package/dist/multistream/receiveSlot.js.map +1 -1
  97. package/dist/multistream/receiveSlotManager.js +2 -0
  98. package/dist/multistream/receiveSlotManager.js.map +1 -1
  99. package/dist/multistream/remoteMedia.js.map +1 -1
  100. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  101. package/dist/multistream/remoteMediaManager.js.map +1 -1
  102. package/dist/networkQualityMonitor/index.js +8 -8
  103. package/dist/networkQualityMonitor/index.js.map +1 -1
  104. package/dist/personal-meeting-room/index.js +7 -7
  105. package/dist/personal-meeting-room/index.js.map +1 -1
  106. package/dist/personal-meeting-room/request.js.map +1 -1
  107. package/dist/personal-meeting-room/util.js.map +1 -1
  108. package/dist/reachability/index.js.map +1 -1
  109. package/dist/reachability/request.js.map +1 -1
  110. package/dist/reactions/reactions.js.map +1 -1
  111. package/dist/reactions/reactions.type.js +3 -1
  112. package/dist/reactions/reactions.type.js.map +1 -1
  113. package/dist/reconnection-manager/index.js +4 -4
  114. package/dist/reconnection-manager/index.js.map +1 -1
  115. package/dist/roap/index.js +5 -5
  116. package/dist/roap/index.js.map +1 -1
  117. package/dist/roap/request.js.map +1 -1
  118. package/dist/roap/turnDiscovery.js.map +1 -1
  119. package/dist/statsAnalyzer/global.js.map +1 -1
  120. package/dist/statsAnalyzer/index.js.map +1 -1
  121. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  122. package/dist/transcription/index.js +4 -1
  123. package/dist/transcription/index.js.map +1 -1
  124. package/internal-README.md +7 -6
  125. package/package.json +18 -18
  126. package/src/common/browser-detection.ts +9 -6
  127. package/src/common/collection.ts +3 -1
  128. package/src/common/errors/captcha-error.ts +6 -6
  129. package/src/common/errors/intent-to-join.ts +6 -6
  130. package/src/common/errors/join-meeting.ts +12 -8
  131. package/src/common/errors/media.ts +6 -6
  132. package/src/common/errors/parameter.ts +9 -6
  133. package/src/common/errors/password-error.ts +6 -6
  134. package/src/common/errors/permission.ts +5 -5
  135. package/src/common/errors/reconnection.ts +6 -6
  136. package/src/common/errors/stats.ts +6 -6
  137. package/src/common/errors/webex-errors.ts +7 -5
  138. package/src/common/errors/webex-meetings-error.ts +1 -1
  139. package/src/common/events/events-scope.ts +5 -1
  140. package/src/common/events/events.ts +5 -1
  141. package/src/common/events/trigger-proxy.ts +8 -3
  142. package/src/common/events/util.ts +1 -2
  143. package/src/common/logs/logger-proxy.ts +21 -10
  144. package/src/common/logs/request.ts +11 -8
  145. package/src/config.ts +11 -11
  146. package/src/constants.ts +1 -1
  147. package/src/index.js +1 -1
  148. package/src/locus-info/controlsUtils.ts +34 -24
  149. package/src/locus-info/fullState.ts +15 -11
  150. package/src/locus-info/hostUtils.ts +4 -3
  151. package/src/locus-info/index.ts +25 -34
  152. package/src/locus-info/infoUtils.ts +12 -4
  153. package/src/locus-info/mediaSharesUtils.ts +4 -4
  154. package/src/locus-info/parser.ts +45 -68
  155. package/src/locus-info/selfUtils.ts +106 -57
  156. package/src/media/index.ts +123 -135
  157. package/src/media/internal-media-core-wrapper.ts +2 -2
  158. package/src/media/properties.ts +30 -20
  159. package/src/media/util.ts +1 -1
  160. package/src/mediaQualityMetrics/config.ts +46 -46
  161. package/src/meeting/effectsState.ts +35 -35
  162. package/src/meeting/in-meeting-actions.ts +7 -3
  163. package/src/meeting/index.ts +1576 -1291
  164. package/src/meeting/muteState.ts +62 -31
  165. package/src/meeting/request.ts +174 -113
  166. package/src/meeting/request.type.ts +11 -0
  167. package/src/meeting/state.ts +45 -30
  168. package/src/meeting/util.ts +101 -70
  169. package/src/meeting-info/collection.ts +2 -1
  170. package/src/meeting-info/index.ts +32 -30
  171. package/src/meeting-info/meeting-info-v2.ts +106 -108
  172. package/src/meeting-info/request.ts +9 -3
  173. package/src/meeting-info/util.ts +54 -46
  174. package/src/meeting-info/utilv2.ts +59 -53
  175. package/src/meetings/collection.ts +1 -1
  176. package/src/meetings/index.ts +512 -440
  177. package/src/meetings/request.ts +26 -24
  178. package/src/meetings/util.ts +29 -29
  179. package/src/member/index.ts +55 -49
  180. package/src/member/util.ts +26 -13
  181. package/src/members/collection.ts +0 -1
  182. package/src/members/index.ts +182 -126
  183. package/src/members/request.ts +46 -14
  184. package/src/members/util.ts +44 -42
  185. package/src/metrics/config.ts +254 -81
  186. package/src/metrics/constants.ts +0 -2
  187. package/src/metrics/index.ts +84 -71
  188. package/src/multistream/multistreamMedia.ts +1 -0
  189. package/src/multistream/receiveSlot.ts +1 -0
  190. package/src/multistream/receiveSlotManager.ts +1 -0
  191. package/src/multistream/remoteMedia.ts +1 -1
  192. package/src/multistream/remoteMediaGroup.ts +2 -1
  193. package/src/multistream/remoteMediaManager.ts +3 -0
  194. package/src/networkQualityMonitor/index.ts +20 -23
  195. package/src/personal-meeting-room/index.ts +12 -16
  196. package/src/personal-meeting-room/request.ts +10 -3
  197. package/src/personal-meeting-room/util.ts +3 -3
  198. package/src/reachability/index.ts +61 -59
  199. package/src/reachability/request.ts +36 -32
  200. package/src/reactions/reactions.ts +4 -4
  201. package/src/reactions/reactions.type.ts +4 -3
  202. package/src/reconnection-manager/index.ts +139 -84
  203. package/src/roap/index.ts +46 -38
  204. package/src/roap/request.ts +44 -31
  205. package/src/roap/turnDiscovery.ts +59 -30
  206. package/src/statsAnalyzer/global.ts +30 -33
  207. package/src/statsAnalyzer/index.ts +432 -175
  208. package/src/statsAnalyzer/mqaUtil.ts +178 -72
  209. package/src/transcription/index.ts +34 -32
  210. package/test/integration/spec/journey.js +663 -462
  211. package/test/integration/spec/space-meeting.js +318 -203
  212. package/test/integration/spec/transcription.js +6 -7
  213. package/test/unit/spec/common/browser-detection.js +9 -28
  214. package/test/unit/spec/fixture/locus.js +92 -90
  215. package/test/unit/spec/locus-info/controlsUtils.js +5 -5
  216. package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
  217. package/test/unit/spec/locus-info/index.js +1 -2
  218. package/test/unit/spec/locus-info/infoUtils.js +26 -33
  219. package/test/unit/spec/locus-info/lib/BasicSeqCmp.json +88 -430
  220. package/test/unit/spec/locus-info/lib/SeqCmp.json +513 -685
  221. package/test/unit/spec/locus-info/parser.js +3 -9
  222. package/test/unit/spec/locus-info/selfConstant.js +72 -103
  223. package/test/unit/spec/locus-info/selfUtils.js +21 -12
  224. package/test/unit/spec/meeting/effectsState.js +36 -46
  225. package/test/unit/spec/meeting/in-meeting-actions.ts +2 -3
  226. package/test/unit/spec/meeting/index.js +1342 -684
  227. package/test/unit/spec/meeting/muteState.js +42 -33
  228. package/test/unit/spec/meeting/request.js +75 -45
  229. package/test/unit/spec/meeting/utils.js +78 -53
  230. package/test/unit/spec/meeting-info/meetinginfov2.js +100 -73
  231. package/test/unit/spec/meeting-info/request.js +7 -9
  232. package/test/unit/spec/meeting-info/util.js +11 -12
  233. package/test/unit/spec/meeting-info/utilv2.js +110 -74
  234. package/test/unit/spec/meetings/collection.js +1 -1
  235. package/test/unit/spec/meetings/index.js +438 -257
  236. package/test/unit/spec/meetings/utils.js +14 -12
  237. package/test/unit/spec/member/index.js +0 -1
  238. package/test/unit/spec/member/util.js +5 -6
  239. package/test/unit/spec/members/index.js +104 -54
  240. package/test/unit/spec/members/request.js +29 -20
  241. package/test/unit/spec/members/utils.js +8 -5
  242. package/test/unit/spec/metrics/index.js +16 -21
  243. package/test/unit/spec/networkQualityMonitor/index.js +21 -15
  244. package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -7
  245. package/test/unit/spec/reachability/index.ts +9 -11
  246. package/test/unit/spec/reconnection-manager/index.js +16 -18
  247. package/test/unit/spec/roap/turnDiscovery.ts +22 -19
  248. package/test/unit/spec/stats-analyzer/index.js +25 -20
  249. package/test/utils/cmr.js +44 -42
  250. package/test/utils/testUtils.js +83 -74
  251. package/test/utils/webex-config.js +18 -18
  252. package/test/utils/webex-test-users.js +53 -50
@@ -23,9 +23,10 @@ import {
23
23
  PROVISIONAL_TYPE_DIAL_IN,
24
24
  PROVISIONAL_TYPE_DIAL_OUT,
25
25
  SEND_DTMF_ENDPOINT,
26
- _SLIDES_
26
+ _SLIDES_,
27
27
  } from '../constants';
28
28
  import {Reaction} from '../reactions/reactions.type';
29
+ import {SendReactionOptions, ToggleReactionsOptions} from './request.type';
29
30
 
30
31
  /**
31
32
  * @class MeetingRequest
@@ -35,7 +36,10 @@ export default class MeetingRequest extends StatelessWebexPlugin {
35
36
 
36
37
  constructor(attrs: any, options: any) {
37
38
  super(attrs, options);
38
- this.changeVideoLayoutDebounced = debounce(this.changeVideoLayout, 2000, {leading: true, trailing: true});
39
+ this.changeVideoLayoutDebounced = debounce(this.changeVideoLayout, 2000, {
40
+ leading: true,
41
+ trailing: true,
42
+ });
39
43
  }
40
44
 
41
45
  /**
@@ -84,13 +88,10 @@ export default class MeetingRequest extends StatelessWebexPlugin {
84
88
  pin,
85
89
  moveToResource,
86
90
  roapMessage,
87
- preferTranscoding
91
+ preferTranscoding,
88
92
  } = options;
89
93
 
90
- LoggerProxy.logger.info(
91
- 'Meeting:request#joinMeeting --> Joining a meeting',
92
- correlationId
93
- );
94
+ LoggerProxy.logger.info('Meeting:request#joinMeeting --> Joining a meeting', correlationId);
94
95
 
95
96
  let url = '';
96
97
 
@@ -99,18 +100,18 @@ export default class MeetingRequest extends StatelessWebexPlugin {
99
100
  device: {
100
101
  url: deviceUrl,
101
102
  // @ts-ignore - config comes from registerPlugin
102
- deviceType: this.config.meetings.deviceType
103
+ deviceType: this.config.meetings.deviceType,
103
104
  },
104
105
  usingResource: resourceId || null,
105
- moveMediaToResource: resourceId && moveToResource || false,
106
+ moveMediaToResource: (resourceId && moveToResource) || false,
106
107
  correlationId,
107
108
  respOnlySdp: true,
108
109
  allowMultiDevice: true,
109
110
  ensureConversation: ensureConversation || false,
110
111
  supportsNativeLobby: 1,
111
112
  clientMediaPreferences: {
112
- preferTranscoding: preferTranscoding ?? true
113
- }
113
+ preferTranscoding: preferTranscoding ?? true,
114
+ },
114
115
  };
115
116
 
116
117
  // @ts-ignore
@@ -135,30 +136,29 @@ export default class MeetingRequest extends StatelessWebexPlugin {
135
136
 
136
137
  if (locusUrl) {
137
138
  url = `${locusUrl}/${PARTICIPANT}`;
138
- }
139
- else if (inviteeAddress || meetingNumber) {
139
+ } else if (inviteeAddress || meetingNumber) {
140
140
  try {
141
141
  // @ts-ignore
142
142
  await this.webex.internal.services.waitForCatalog('postauth');
143
143
  // @ts-ignore
144
144
  url = `${this.webex.internal.services.get('locus')}/${LOCI}/${CALL}`;
145
145
  body.invitee = {
146
- address: inviteeAddress || `wbxmn:${meetingNumber}`
146
+ address: inviteeAddress || `wbxmn:${meetingNumber}`,
147
147
  };
148
- }
149
- catch (e) {
150
- LoggerProxy.logger.error(`Meeting:request#joinMeeting Error Joining ${inviteeAddress || meetingNumber} --> ${e}`);
151
- throw (e);
148
+ } catch (e) {
149
+ LoggerProxy.logger.error(
150
+ `Meeting:request#joinMeeting Error Joining ${inviteeAddress || meetingNumber} --> ${e}`
151
+ );
152
+ throw e;
152
153
  }
153
154
  }
154
155
 
155
-
156
156
  // TODO: -- this will be resolved in SDK request
157
157
  url = url.concat(`?${ALTERNATE_REDIRECT_TRUE}`);
158
158
 
159
159
  if (resourceId === inviteeAddress) {
160
160
  body.callPreferences = {
161
- requestedMedia: [_SLIDES_]
161
+ requestedMedia: [_SLIDES_],
162
162
  };
163
163
  }
164
164
 
@@ -170,7 +170,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
170
170
  return this.request({
171
171
  method: HTTP_VERBS.POST,
172
172
  uri: url,
173
- body
173
+ body,
174
174
  });
175
175
  }
176
176
 
@@ -182,16 +182,22 @@ export default class MeetingRequest extends StatelessWebexPlugin {
182
182
  * @returns {Promise}
183
183
  * @private
184
184
  */
185
- private refreshCaptcha({ captchaRefreshUrl, captchaId }: { captchaRefreshUrl: string; captchaId: string }) {
185
+ private refreshCaptcha({
186
+ captchaRefreshUrl,
187
+ captchaId,
188
+ }: {
189
+ captchaRefreshUrl: string;
190
+ captchaId: string;
191
+ }) {
186
192
  const body = {
187
- captchaId
193
+ captchaId,
188
194
  };
189
195
 
190
196
  // @ts-ignore
191
197
  return this.request({
192
198
  method: HTTP_VERBS.POST,
193
199
  uri: captchaRefreshUrl,
194
- body
200
+ body,
195
201
  }).catch((err) => {
196
202
  LoggerProxy.logger.error(`Meeting:request#refreshCaptcha --> Error: ${err}`);
197
203
 
@@ -231,18 +237,20 @@ export default class MeetingRequest extends StatelessWebexPlugin {
231
237
  deviceType: deviceType.PROVISIONAL,
232
238
  provisionalType: PROVISIONAL_TYPE_DIAL_IN,
233
239
  url: dialInUrl,
234
- clientUrl
240
+ clientUrl,
235
241
  },
236
- correlationId
242
+ correlationId,
237
243
  };
238
244
 
239
245
  // @ts-ignore
240
246
  return this.request({
241
247
  method: HTTP_VERBS.POST,
242
248
  uri,
243
- body
249
+ body,
244
250
  }).catch((err) => {
245
- LoggerProxy.logger.error(`Meeting:request#dialIn --> Error provisioning a dial in device, error ${err}`);
251
+ LoggerProxy.logger.error(
252
+ `Meeting:request#dialIn --> Error provisioning a dial in device, error ${err}`
253
+ );
246
254
 
247
255
  throw err;
248
256
  });
@@ -284,18 +292,20 @@ export default class MeetingRequest extends StatelessWebexPlugin {
284
292
  provisionalType: PROVISIONAL_TYPE_DIAL_OUT,
285
293
  url: dialOutUrl,
286
294
  dialoutAddress: phoneNumber,
287
- clientUrl
295
+ clientUrl,
288
296
  },
289
- correlationId
297
+ correlationId,
290
298
  };
291
299
 
292
300
  // @ts-ignore
293
301
  return this.request({
294
302
  method: HTTP_VERBS.POST,
295
303
  uri,
296
- body
304
+ body,
297
305
  }).catch((err) => {
298
- LoggerProxy.logger.error(`Meeting:request#dialOut --> Error provisioning a dial out device, error ${err}`);
306
+ LoggerProxy.logger.error(
307
+ `Meeting:request#dialOut --> Error provisioning a dial out device, error ${err}`
308
+ );
299
309
 
300
310
  throw err;
301
311
  });
@@ -308,7 +318,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
308
318
  * @param {String} options.syncUrl sync url to get ht elatest locus delta
309
319
  * @returns {Promise}
310
320
  */
311
- syncMeeting(options: { desync: boolean; syncUrl: string }) {
321
+ syncMeeting(options: {desync: boolean; syncUrl: string}) {
312
322
  /* eslint-disable no-else-return */
313
323
  const {desync} = options;
314
324
  let {syncUrl} = options;
@@ -316,16 +326,20 @@ export default class MeetingRequest extends StatelessWebexPlugin {
316
326
  /* istanbul ignore else */
317
327
  if (desync) {
318
328
  // check for existing URL parameters
319
- syncUrl = syncUrl.concat(syncUrl.split('?')[1] ? '&' : '?').concat(`${LOCUS.SYNCDEBUG}=${desync}`);
329
+ syncUrl = syncUrl
330
+ .concat(syncUrl.split('?')[1] ? '&' : '?')
331
+ .concat(`${LOCUS.SYNCDEBUG}=${desync}`);
320
332
  }
321
333
 
322
334
  // @ts-ignore
323
335
  return this.request({
324
336
  method: HTTP_VERBS.GET,
325
- uri: syncUrl
337
+ uri: syncUrl,
326
338
  }) // TODO: Handle if delta sync failed . Get the full locus object
327
339
  .catch((err) => {
328
- LoggerProxy.logger.error(`Meeting:request#syncMeeting --> Error syncing meeting, error ${err}`);
340
+ LoggerProxy.logger.error(
341
+ `Meeting:request#syncMeeting --> Error syncing meeting, error ${err}`
342
+ );
329
343
 
330
344
  return err;
331
345
  });
@@ -338,7 +352,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
338
352
  * @param {String} options.locusUrl sync url to get ht elatest locus delta
339
353
  * @returns {Promise}
340
354
  */
341
- getFullLocus(options: { desync: boolean; locusUrl: string }) {
355
+ getFullLocus(options: {desync: boolean; locusUrl: string}) {
342
356
  let {locusUrl} = options;
343
357
  const {desync} = options;
344
358
 
@@ -350,9 +364,11 @@ export default class MeetingRequest extends StatelessWebexPlugin {
350
364
  // @ts-ignore
351
365
  return this.request({
352
366
  method: HTTP_VERBS.GET,
353
- uri: locusUrl
367
+ uri: locusUrl,
354
368
  }).catch((err) => {
355
- LoggerProxy.logger.error(`Meeting:request#getFullLocus --> Error getting full locus, error ${err}`);
369
+ LoggerProxy.logger.error(
370
+ `Meeting:request#getFullLocus --> Error getting full locus, error ${err}`
371
+ );
356
372
 
357
373
  return err;
358
374
  });
@@ -391,16 +407,16 @@ export default class MeetingRequest extends StatelessWebexPlugin {
391
407
  const body = {
392
408
  device: {
393
409
  deviceType: deviceType.PROVISIONAL,
394
- url: phoneUrl
410
+ url: phoneUrl,
395
411
  },
396
- correlationId
412
+ correlationId,
397
413
  };
398
414
 
399
415
  // @ts-ignore
400
416
  return this.request({
401
417
  method: HTTP_VERBS.PUT,
402
418
  uri,
403
- body
419
+ body,
404
420
  }).catch((err) => {
405
421
  LoggerProxy.logger.error(
406
422
  `Meeting:request#disconnectPhoneAudio --> Error when requesting phone ${phoneUrl} to leave, error ${err}`
@@ -433,27 +449,24 @@ export default class MeetingRequest extends StatelessWebexPlugin {
433
449
  resourceId: string;
434
450
  correlationId: string;
435
451
  }) {
436
- LoggerProxy.logger.info(
437
- 'Meeting:request#leaveMeeting --> Leaving a meeting',
438
- correlationId
439
- );
452
+ LoggerProxy.logger.info('Meeting:request#leaveMeeting --> Leaving a meeting', correlationId);
440
453
 
441
454
  const uri = `${locusUrl}/${PARTICIPANT}/${selfId}/${LEAVE}`;
442
455
  const body = {
443
456
  device: {
444
457
  // @ts-ignore
445
458
  deviceType: this.config.meetings.deviceType,
446
- url
459
+ url,
447
460
  },
448
461
  usingResource: resourceId || null,
449
- correlationId
462
+ correlationId,
450
463
  };
451
464
 
452
465
  // @ts-ignore
453
466
  return this.request({
454
467
  method: HTTP_VERBS.PUT,
455
468
  uri,
456
- body
469
+ body,
457
470
  });
458
471
  }
459
472
 
@@ -465,22 +478,22 @@ export default class MeetingRequest extends StatelessWebexPlugin {
465
478
  * @param {String} options.correlationId
466
479
  * @returns {Promise}
467
480
  */
468
- acknowledgeMeeting(options: { locusUrl: string; deviceUrl: string; correlationId: string }) {
481
+ acknowledgeMeeting(options: {locusUrl: string; deviceUrl: string; correlationId: string}) {
469
482
  const uri = `${options.locusUrl}/${PARTICIPANT}/${ALERT}`;
470
483
  const body = {
471
484
  device: {
472
485
  // @ts-ignore
473
486
  deviceType: this.config.meetings.deviceType,
474
- url: options.deviceUrl
487
+ url: options.deviceUrl,
475
488
  },
476
- correlationId: options.correlationId
489
+ correlationId: options.correlationId,
477
490
  };
478
491
 
479
492
  // @ts-ignore
480
493
  return this.request({
481
494
  method: HTTP_VERBS.PUT,
482
495
  uri,
483
- body
496
+ body,
484
497
  });
485
498
  }
486
499
 
@@ -492,20 +505,26 @@ export default class MeetingRequest extends StatelessWebexPlugin {
492
505
  * @param {String} options.id
493
506
  * @returns {Promise}
494
507
  */
495
- recordMeeting(options: { locusUrl: string; deviceUrl: string; id: string, recording: any, paused: any }) {
508
+ recordMeeting(options: {
509
+ locusUrl: string;
510
+ deviceUrl: string;
511
+ id: string;
512
+ recording: any;
513
+ paused: any;
514
+ }) {
496
515
  const uri = `${options.locusUrl}/${CONTROLS}`;
497
516
  const body = {
498
517
  record: {
499
518
  recording: options.recording,
500
- paused: options.paused
501
- }
519
+ paused: options.paused,
520
+ },
502
521
  };
503
522
 
504
523
  // @ts-ignore
505
524
  return this.request({
506
525
  method: HTTP_VERBS.PATCH,
507
526
  uri,
508
- body
527
+ body,
509
528
  });
510
529
  }
511
530
 
@@ -513,15 +532,15 @@ export default class MeetingRequest extends StatelessWebexPlugin {
513
532
  const uri = `${options.locusUrl}/${CONTROLS}`;
514
533
  const body = {
515
534
  lock: {
516
- locked: options.lock
517
- }
535
+ locked: options.lock,
536
+ },
518
537
  };
519
538
 
520
539
  // @ts-ignore
521
540
  return this.request({
522
541
  method: HTTP_VERBS.PATCH,
523
542
  uri,
524
- body
543
+ body,
525
544
  });
526
545
  }
527
546
 
@@ -533,13 +552,13 @@ export default class MeetingRequest extends StatelessWebexPlugin {
533
552
  * @param {String} options.reason
534
553
  * @returns {Promise}
535
554
  */
536
- declineMeeting(options: { locusUrl: string; deviceUrl: string; reason: string }) {
555
+ declineMeeting(options: {locusUrl: string; deviceUrl: string; reason: string}) {
537
556
  const uri = `${options.locusUrl}/${PARTICIPANT}/${DECLINE}`;
538
557
  const body = {
539
558
  device: {
540
559
  // @ts-ignore
541
560
  deviceType: this.config.meetings.deviceType,
542
- url: options.deviceUrl
561
+ url: options.deviceUrl,
543
562
  },
544
563
  ...(options.reason && {reason: options.reason}),
545
564
  };
@@ -548,7 +567,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
548
567
  return this.request({
549
568
  method: HTTP_VERBS.PUT,
550
569
  uri,
551
- body
570
+ body,
552
571
  });
553
572
  }
554
573
 
@@ -563,34 +582,38 @@ export default class MeetingRequest extends StatelessWebexPlugin {
563
582
  * @param {Boolean} options.preferTranscoding false for multistream (Homer), true for transcoded media (Edonus)
564
583
  * @returns {Promise}
565
584
  */
566
- remoteAudioVideoToggle(options: {
567
- selfId: string;
568
- locusUrl: string;
569
- deviceUrl: string;
570
- resourceId: string;
571
- localMedias: string;
572
- } | any) {
585
+ remoteAudioVideoToggle(
586
+ options:
587
+ | {
588
+ selfId: string;
589
+ locusUrl: string;
590
+ deviceUrl: string;
591
+ resourceId: string;
592
+ localMedias: string;
593
+ }
594
+ | any
595
+ ) {
573
596
  const uri = `${options.locusUrl}/${PARTICIPANT}/${options.selfId}/${MEDIA}`;
574
597
  const body = {
575
598
  device: {
576
599
  // @ts-ignore
577
600
  deviceType: this.config.meetings.deviceType,
578
- url: options.deviceUrl
601
+ url: options.deviceUrl,
579
602
  },
580
603
  usingResource: options.resourceId || null,
581
604
  correlationId: options.correlationId,
582
605
  respOnlySdp: true,
583
606
  localMedias: options.localMedias,
584
607
  clientMediaPreferences: {
585
- preferTranscoding: options.preferTranscoding ?? true
586
- }
608
+ preferTranscoding: options.preferTranscoding ?? true,
609
+ },
587
610
  };
588
611
 
589
612
  // @ts-ignore
590
613
  return this.request({
591
614
  method: HTTP_VERBS.PUT,
592
615
  uri,
593
- body
616
+ body,
594
617
  });
595
618
  }
596
619
 
@@ -604,13 +627,17 @@ export default class MeetingRequest extends StatelessWebexPlugin {
604
627
  * @param {String} options.uri floor grant uri
605
628
  * @returns {Promise}
606
629
  */
607
- changeMeetingFloor(options: {
608
- disposition: string;
609
- personUrl: string;
610
- deviceUrl: string;
611
- resourceId: string;
612
- uri: string;
613
- } | any) {
630
+ changeMeetingFloor(
631
+ options:
632
+ | {
633
+ disposition: string;
634
+ personUrl: string;
635
+ deviceUrl: string;
636
+ resourceId: string;
637
+ uri: string;
638
+ }
639
+ | any
640
+ ) {
614
641
  let floorReq: any = {disposition: options.disposition};
615
642
 
616
643
  /* istanbul ignore else */
@@ -622,20 +649,20 @@ export default class MeetingRequest extends StatelessWebexPlugin {
622
649
  {
623
650
  // @ts-ignore
624
651
  deviceType: this.config.meetings.deviceType,
625
- url: options.deviceUrl
626
- }
627
- ]
652
+ url: options.deviceUrl,
653
+ },
654
+ ],
628
655
  },
629
656
  disposition: options.disposition,
630
657
  requester: {
631
- url: options.personUrl
632
- }
658
+ url: options.personUrl,
659
+ },
633
660
  };
634
661
  }
635
662
 
636
663
  const body: any = {
637
664
  floor: floorReq,
638
- resourceUrl: options.resourceUrl
665
+ resourceUrl: options.resourceUrl,
639
666
  };
640
667
 
641
668
  if (options?.resourceToken) {
@@ -646,7 +673,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
646
673
  return this.request({
647
674
  uri: options.uri,
648
675
  method: HTTP_VERBS.PUT,
649
- body
676
+ body,
650
677
  });
651
678
  }
652
679
 
@@ -658,7 +685,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
658
685
  * @param {String} options.tones a string of one or more DTMF tones to send
659
686
  * @returns {Promise}
660
687
  */
661
- sendDTMF({ locusUrl, deviceUrl, tones }: { locusUrl: string; deviceUrl: string; tones: string }) {
688
+ sendDTMF({locusUrl, deviceUrl, tones}: {locusUrl: string; deviceUrl: string; tones: string}) {
662
689
  // @ts-ignore
663
690
  return this.request({
664
691
  method: HTTP_VERBS.POST,
@@ -667,9 +694,9 @@ export default class MeetingRequest extends StatelessWebexPlugin {
667
694
  deviceUrl,
668
695
  dtmf: {
669
696
  correlationId: uuid.v4(),
670
- tones
671
- }
672
- }
697
+ tones,
698
+ },
699
+ },
673
700
  });
674
701
  }
675
702
 
@@ -708,24 +735,37 @@ export default class MeetingRequest extends StatelessWebexPlugin {
708
735
  }) {
709
736
  // send main/content renderInfo only if both width and height are specified
710
737
  if (main && (!main.width || !main.height)) {
711
- return Promise.reject(new Error(`Both width and height must be specified. One of them is missing for main: ${JSON.stringify(main)}`));
738
+ return Promise.reject(
739
+ new Error(
740
+ `Both width and height must be specified. One of them is missing for main: ${JSON.stringify(
741
+ main
742
+ )}`
743
+ )
744
+ );
712
745
  }
713
746
 
714
747
  if (content && (!content.width || !content.height)) {
715
- return Promise.reject(new Error(`Both width and height must be specified. One of them is missing for content: ${JSON.stringify(content)}`));
748
+ return Promise.reject(
749
+ new Error(
750
+ `Both width and height must be specified. One of them is missing for content: ${JSON.stringify(
751
+ content
752
+ )}`
753
+ )
754
+ );
716
755
  }
717
756
 
718
- const renderInfoMain = (main) ? {width: main.width, height: main.height} : undefined;
719
- const renderInfoContent = (content) ? {width: content.width, height: content.height} : undefined;
757
+ const renderInfoMain = main ? {width: main.width, height: main.height} : undefined;
758
+ const renderInfoContent = content ? {width: content.width, height: content.height} : undefined;
720
759
 
721
- const layoutParams = (renderInfoMain || renderInfoContent) ?
722
- {
723
- renderInfo:
724
- {
725
- main: renderInfoMain,
726
- content: renderInfoContent
727
- }
728
- } : undefined;
760
+ const layoutParams =
761
+ renderInfoMain || renderInfoContent
762
+ ? {
763
+ renderInfo: {
764
+ main: renderInfoMain,
765
+ content: renderInfoContent,
766
+ },
767
+ }
768
+ : undefined;
729
769
 
730
770
  // @ts-ignore
731
771
  return this.request({
@@ -735,9 +775,9 @@ export default class MeetingRequest extends StatelessWebexPlugin {
735
775
  layout: {
736
776
  deviceUrl,
737
777
  type: layoutType,
738
- layoutParams
739
- }
740
- }
778
+ layoutParams,
779
+ },
780
+ },
741
781
  });
742
782
  }
743
783
 
@@ -747,13 +787,13 @@ export default class MeetingRequest extends StatelessWebexPlugin {
747
787
  * @param {Url} options.locusUrl
748
788
  * @returns {Promise}
749
789
  */
750
- endMeetingForAll({ locusUrl }: { locusUrl: string }) {
790
+ endMeetingForAll({locusUrl}: {locusUrl: string}) {
751
791
  const uri = `${locusUrl}/${END}`;
752
792
 
753
793
  // @ts-ignore
754
794
  return this.request({
755
795
  method: HTTP_VERBS.POST,
756
- uri
796
+ uri,
757
797
  });
758
798
  }
759
799
 
@@ -763,11 +803,11 @@ export default class MeetingRequest extends StatelessWebexPlugin {
763
803
  * @param {Url} options.keepAliveUrl
764
804
  * @returns {Promise}
765
805
  */
766
- keepAlive({ keepAliveUrl }: { keepAliveUrl: string }) {
806
+ keepAlive({keepAliveUrl}: {keepAliveUrl: string}) {
767
807
  // @ts-ignore
768
808
  return this.request({
769
809
  method: HTTP_VERBS.GET,
770
- uri: keepAliveUrl
810
+ uri: keepAliveUrl,
771
811
  });
772
812
  }
773
813
 
@@ -779,7 +819,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
779
819
  * @param {string} options.senderID
780
820
  * @returns {Promise}
781
821
  */
782
- sendReaction({ reactionChannelUrl, reaction, participantId }: { reactionChannelUrl: string, reaction: Reaction, participantId: string }) {
822
+ sendReaction({reactionChannelUrl, reaction, participantId}: SendReactionOptions) {
783
823
  const uri = reactionChannelUrl;
784
824
 
785
825
  // @ts-ignore
@@ -789,7 +829,28 @@ export default class MeetingRequest extends StatelessWebexPlugin {
789
829
  body: {
790
830
  sender: {participantId},
791
831
  reaction,
792
- }
832
+ },
833
+ });
834
+ }
835
+
836
+ /**
837
+ * Make a network request to enable or disable reactions.
838
+ * @param {boolean} options.enable - determines if we need to enable or disable.
839
+ * @param {locusUrl} options.locusUrl
840
+ * @returns {Promise}
841
+ */
842
+ toggleReactions({enable, locusUrl, requestingParticipantId}: ToggleReactionsOptions) {
843
+ const uri = `${locusUrl}/${CONTROLS}`;
844
+
845
+ return this.request({
846
+ method: HTTP_VERBS.PUT,
847
+ uri,
848
+ body: {
849
+ reactions: {
850
+ enabled: enable,
851
+ },
852
+ requestingParticipantId,
853
+ },
793
854
  });
794
855
  }
795
856
  }
@@ -0,0 +1,11 @@
1
+ export type SendReactionOptions = {
2
+ reactionChannelUrl: string;
3
+ reaction: Reaction;
4
+ participantId: string;
5
+ };
6
+
7
+ export type ToggleReactionsOptions = {
8
+ enable: boolean;
9
+ locusUrl: string;
10
+ requestingParticipantId: string;
11
+ };