@webex/plugin-meetings 3.0.0-bnr.5 → 3.0.0-stream-classes.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. package/README.md +46 -8
  2. package/dist/annotation/annotation.types.js +7 -0
  3. package/dist/annotation/annotation.types.js.map +1 -0
  4. package/dist/annotation/constants.js +49 -0
  5. package/dist/annotation/constants.js.map +1 -0
  6. package/dist/annotation/index.js +342 -0
  7. package/dist/annotation/index.js.map +1 -0
  8. package/dist/breakouts/breakout.js +70 -32
  9. package/dist/breakouts/breakout.js.map +1 -1
  10. package/dist/breakouts/events.js +45 -0
  11. package/dist/breakouts/events.js.map +1 -0
  12. package/dist/breakouts/index.js +422 -217
  13. package/dist/breakouts/index.js.map +1 -1
  14. package/dist/breakouts/utils.js +12 -1
  15. package/dist/breakouts/utils.js.map +1 -1
  16. package/dist/common/errors/webex-errors.js +3 -2
  17. package/dist/common/errors/webex-errors.js.map +1 -1
  18. package/dist/common/logs/logger-proxy.js +1 -1
  19. package/dist/common/logs/logger-proxy.js.map +1 -1
  20. package/dist/common/logs/request.d.ts +1 -1
  21. package/dist/common/queue.js +24 -9
  22. package/dist/common/queue.js.map +1 -1
  23. package/dist/config.js +1 -7
  24. package/dist/config.js.map +1 -1
  25. package/dist/constants.js +118 -24
  26. package/dist/constants.js.map +1 -1
  27. package/dist/controls-options-manager/enums.js +2 -0
  28. package/dist/controls-options-manager/enums.js.map +1 -1
  29. package/dist/controls-options-manager/index.js +19 -14
  30. package/dist/controls-options-manager/index.js.map +1 -1
  31. package/dist/controls-options-manager/types.js.map +1 -1
  32. package/dist/controls-options-manager/util.js +80 -11
  33. package/dist/controls-options-manager/util.js.map +1 -1
  34. package/dist/index.js +62 -20
  35. package/dist/index.js.map +1 -1
  36. package/dist/interpretation/collection.js +23 -0
  37. package/dist/interpretation/collection.js.map +1 -0
  38. package/dist/interpretation/index.js +366 -0
  39. package/dist/interpretation/index.js.map +1 -0
  40. package/dist/interpretation/siLanguage.js +25 -0
  41. package/dist/interpretation/siLanguage.js.map +1 -0
  42. package/dist/locus-info/controlsUtils.js +71 -1
  43. package/dist/locus-info/controlsUtils.js.map +1 -1
  44. package/dist/locus-info/index.js +305 -57
  45. package/dist/locus-info/index.js.map +1 -1
  46. package/dist/locus-info/infoUtils.js +7 -1
  47. package/dist/locus-info/infoUtils.js.map +1 -1
  48. package/dist/locus-info/mediaSharesUtils.js +43 -1
  49. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  50. package/dist/locus-info/parser.js +219 -63
  51. package/dist/locus-info/parser.js.map +1 -1
  52. package/dist/locus-info/selfUtils.js +44 -22
  53. package/dist/locus-info/selfUtils.js.map +1 -1
  54. package/dist/media/index.js +57 -104
  55. package/dist/media/index.js.map +1 -1
  56. package/dist/media/properties.js +60 -121
  57. package/dist/media/properties.js.map +1 -1
  58. package/dist/meeting/in-meeting-actions.js +61 -3
  59. package/dist/meeting/in-meeting-actions.js.map +1 -1
  60. package/dist/meeting/index.js +2530 -2534
  61. package/dist/meeting/index.js.map +1 -1
  62. package/dist/meeting/locusMediaRequest.js +292 -0
  63. package/dist/meeting/locusMediaRequest.js.map +1 -0
  64. package/dist/meeting/muteState.js +125 -205
  65. package/dist/meeting/muteState.js.map +1 -1
  66. package/dist/meeting/request.js +150 -150
  67. package/dist/meeting/request.js.map +1 -1
  68. package/dist/meeting/util.js +568 -438
  69. package/dist/meeting/util.js.map +1 -1
  70. package/dist/meeting-info/index.js +48 -7
  71. package/dist/meeting-info/index.js.map +1 -1
  72. package/dist/meeting-info/meeting-info-v2.js +94 -38
  73. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  74. package/dist/meeting-info/utilv2.js +4 -2
  75. package/dist/meeting-info/utilv2.js.map +1 -1
  76. package/dist/meetings/index.d.ts +0 -2
  77. package/dist/meetings/index.js +260 -85
  78. package/dist/meetings/index.js.map +1 -1
  79. package/dist/meetings/meetings.types.js +7 -0
  80. package/dist/meetings/meetings.types.js.map +1 -0
  81. package/dist/meetings/util.js +42 -7
  82. package/dist/meetings/util.js.map +1 -1
  83. package/dist/member/index.d.ts +2 -0
  84. package/dist/member/index.js +26 -0
  85. package/dist/member/index.js.map +1 -1
  86. package/dist/member/member.types.d.ts +11 -0
  87. package/dist/member/member.types.js +18 -0
  88. package/dist/member/member.types.js.map +1 -0
  89. package/dist/member/types.js +11 -1
  90. package/dist/member/types.js.map +1 -1
  91. package/dist/member/util.js +60 -23
  92. package/dist/member/util.js.map +1 -1
  93. package/dist/members/index.js +4 -1
  94. package/dist/members/index.js.map +1 -1
  95. package/dist/members/request.js +75 -45
  96. package/dist/members/request.js.map +1 -1
  97. package/dist/members/util.js +308 -317
  98. package/dist/members/util.js.map +1 -1
  99. package/dist/metrics/config.js +1 -3
  100. package/dist/metrics/config.js.map +1 -1
  101. package/dist/metrics/constants.js +1 -0
  102. package/dist/metrics/constants.js.map +1 -1
  103. package/dist/metrics/index.d.ts +1 -1
  104. package/dist/metrics/index.js +1 -451
  105. package/dist/metrics/index.js.map +1 -1
  106. package/dist/multistream/mediaRequestManager.js +136 -40
  107. package/dist/multistream/mediaRequestManager.js.map +1 -1
  108. package/dist/multistream/receiveSlot.js.map +1 -1
  109. package/dist/multistream/receiveSlotManager.js +4 -4
  110. package/dist/multistream/receiveSlotManager.js.map +1 -1
  111. package/dist/multistream/remoteMedia.js.map +1 -1
  112. package/dist/multistream/remoteMediaGroup.js +60 -3
  113. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  114. package/dist/multistream/remoteMediaManager.js +36 -0
  115. package/dist/multistream/remoteMediaManager.js.map +1 -1
  116. package/dist/multistream/sendSlotManager.js +233 -0
  117. package/dist/multistream/sendSlotManager.js.map +1 -0
  118. package/dist/reachability/index.js +18 -3
  119. package/dist/reachability/index.js.map +1 -1
  120. package/dist/reachability/request.js +5 -3
  121. package/dist/reachability/request.js.map +1 -1
  122. package/dist/reconnection-manager/index.js +181 -153
  123. package/dist/reconnection-manager/index.js.map +1 -1
  124. package/dist/recording-controller/index.js +21 -2
  125. package/dist/recording-controller/index.js.map +1 -1
  126. package/dist/recording-controller/util.js +9 -8
  127. package/dist/recording-controller/util.js.map +1 -1
  128. package/dist/roap/index.js +25 -32
  129. package/dist/roap/index.js.map +1 -1
  130. package/dist/roap/request.js +42 -51
  131. package/dist/roap/request.js.map +1 -1
  132. package/dist/roap/turnDiscovery.js +97 -38
  133. package/dist/roap/turnDiscovery.js.map +1 -1
  134. package/dist/rtcMetrics/constants.js +12 -0
  135. package/dist/rtcMetrics/constants.js.map +1 -0
  136. package/dist/rtcMetrics/index.js +117 -0
  137. package/dist/rtcMetrics/index.js.map +1 -0
  138. package/dist/statsAnalyzer/index.js +0 -1
  139. package/dist/statsAnalyzer/index.js.map +1 -1
  140. package/dist/types/annotation/annotation.types.d.ts +43 -0
  141. package/dist/types/annotation/constants.d.ts +31 -0
  142. package/dist/types/annotation/index.d.ts +124 -0
  143. package/dist/types/breakouts/events.d.ts +2 -0
  144. package/dist/types/breakouts/utils.d.ts +7 -0
  145. package/dist/types/common/errors/webex-errors.d.ts +1 -1
  146. package/dist/types/config.d.ts +0 -6
  147. package/dist/types/constants.d.ts +51 -21
  148. package/dist/types/controls-options-manager/enums.d.ts +2 -0
  149. package/dist/types/controls-options-manager/index.d.ts +1 -1
  150. package/dist/types/controls-options-manager/types.d.ts +7 -1
  151. package/dist/types/index.d.ts +1 -1
  152. package/dist/types/interpretation/collection.d.ts +5 -0
  153. package/dist/types/interpretation/index.d.ts +5 -0
  154. package/dist/types/interpretation/siLanguage.d.ts +5 -0
  155. package/dist/types/locus-info/index.d.ts +39 -1
  156. package/dist/types/media/index.d.ts +2 -0
  157. package/dist/types/media/properties.d.ts +16 -38
  158. package/dist/types/meeting/in-meeting-actions.d.ts +46 -2
  159. package/dist/types/meeting/index.d.ts +179 -379
  160. package/dist/types/meeting/locusMediaRequest.d.ts +70 -0
  161. package/dist/types/meeting/muteState.d.ts +39 -40
  162. package/dist/types/meeting/request.d.ts +25 -26
  163. package/dist/types/meeting/util.d.ts +74 -1
  164. package/dist/types/meeting-info/meeting-info-v2.d.ts +14 -3
  165. package/dist/types/meetings/index.d.ts +49 -1
  166. package/dist/types/meetings/meetings.types.d.ts +4 -0
  167. package/dist/types/member/index.d.ts +2 -0
  168. package/dist/types/members/request.d.ts +56 -11
  169. package/dist/types/members/util.d.ts +209 -1
  170. package/dist/types/metrics/config.d.ts +26 -2
  171. package/dist/types/metrics/constants.d.ts +1 -0
  172. package/dist/types/metrics/index.d.ts +17 -0
  173. package/dist/types/multistream/mediaRequestManager.d.ts +27 -10
  174. package/dist/types/multistream/receiveSlot.d.ts +3 -3
  175. package/dist/types/multistream/remoteMedia.d.ts +2 -2
  176. package/dist/types/multistream/remoteMediaManager.d.ts +14 -0
  177. package/dist/types/roap/request.d.ts +6 -8
  178. package/dist/types/roap/turnDiscovery.d.ts +18 -1
  179. package/package.json +21 -20
  180. package/src/annotation/annotation.types.ts +50 -0
  181. package/src/annotation/constants.ts +36 -0
  182. package/src/annotation/index.ts +328 -0
  183. package/src/breakouts/README.md +3 -2
  184. package/src/breakouts/breakout.ts +62 -27
  185. package/src/breakouts/events.ts +56 -0
  186. package/src/breakouts/index.ts +244 -64
  187. package/src/breakouts/utils.ts +13 -0
  188. package/src/common/errors/webex-errors.ts +6 -2
  189. package/src/common/logs/logger-proxy.ts +1 -1
  190. package/src/common/queue.ts +22 -8
  191. package/src/config.ts +0 -6
  192. package/src/constants.ts +111 -19
  193. package/src/controls-options-manager/enums.ts +2 -0
  194. package/src/controls-options-manager/index.ts +13 -10
  195. package/src/controls-options-manager/types.ts +10 -0
  196. package/src/controls-options-manager/util.ts +82 -11
  197. package/src/index.ts +18 -11
  198. package/src/interpretation/README.md +60 -0
  199. package/src/interpretation/collection.ts +19 -0
  200. package/src/interpretation/index.ts +332 -0
  201. package/src/interpretation/siLanguage.ts +18 -0
  202. package/src/locus-info/controlsUtils.ts +81 -0
  203. package/src/locus-info/index.ts +318 -57
  204. package/src/locus-info/infoUtils.ts +10 -2
  205. package/src/locus-info/mediaSharesUtils.ts +48 -0
  206. package/src/locus-info/parser.ts +224 -39
  207. package/src/locus-info/selfUtils.ts +32 -20
  208. package/src/media/index.ts +94 -108
  209. package/src/media/properties.ts +69 -109
  210. package/src/meeting/in-meeting-actions.ts +120 -4
  211. package/src/meeting/index.ts +1967 -2120
  212. package/src/meeting/locusMediaRequest.ts +314 -0
  213. package/src/meeting/muteState.ts +119 -194
  214. package/src/meeting/request.ts +122 -115
  215. package/src/meeting/util.ts +549 -413
  216. package/src/meeting-info/index.ts +54 -8
  217. package/src/meeting-info/meeting-info-v2.ts +89 -24
  218. package/src/meeting-info/utilv2.ts +6 -2
  219. package/src/meetings/index.ts +247 -87
  220. package/src/meetings/meetings.types.ts +12 -0
  221. package/src/meetings/util.ts +47 -12
  222. package/src/member/index.ts +28 -1
  223. package/src/member/types.ts +14 -0
  224. package/src/member/util.ts +75 -26
  225. package/src/members/index.ts +7 -1
  226. package/src/members/request.ts +61 -21
  227. package/src/members/util.ts +316 -326
  228. package/src/metrics/constants.ts +1 -0
  229. package/src/metrics/index.ts +1 -474
  230. package/src/multistream/mediaRequestManager.ts +183 -67
  231. package/src/multistream/receiveSlot.ts +4 -4
  232. package/src/multistream/receiveSlotManager.ts +4 -4
  233. package/src/multistream/remoteMedia.ts +2 -2
  234. package/src/multistream/remoteMediaGroup.ts +59 -0
  235. package/src/multistream/remoteMediaManager.ts +33 -0
  236. package/src/multistream/sendSlotManager.ts +170 -0
  237. package/src/reachability/index.ts +15 -4
  238. package/src/reachability/request.ts +7 -3
  239. package/src/reconnection-manager/index.ts +36 -29
  240. package/src/recording-controller/index.ts +20 -3
  241. package/src/recording-controller/util.ts +26 -9
  242. package/src/roap/index.ts +25 -30
  243. package/src/roap/request.ts +44 -51
  244. package/src/roap/turnDiscovery.ts +51 -25
  245. package/src/rtcMetrics/constants.ts +3 -0
  246. package/src/rtcMetrics/index.ts +100 -0
  247. package/src/statsAnalyzer/index.ts +0 -1
  248. package/test/integration/spec/converged-space-meetings.js +60 -3
  249. package/test/integration/spec/journey.js +336 -259
  250. package/test/integration/spec/space-meeting.js +76 -3
  251. package/test/unit/spec/annotation/index.ts +418 -0
  252. package/test/unit/spec/breakouts/breakout.ts +85 -26
  253. package/test/unit/spec/breakouts/events.ts +89 -0
  254. package/test/unit/spec/breakouts/index.ts +636 -98
  255. package/test/unit/spec/breakouts/utils.js +19 -1
  256. package/test/unit/spec/common/queue.js +31 -2
  257. package/test/unit/spec/controls-options-manager/index.js +8 -1
  258. package/test/unit/spec/controls-options-manager/util.js +576 -397
  259. package/test/unit/spec/fixture/locus.js +1 -0
  260. package/test/unit/spec/interpretation/collection.ts +15 -0
  261. package/test/unit/spec/interpretation/index.ts +589 -0
  262. package/test/unit/spec/interpretation/siLanguage.ts +28 -0
  263. package/test/unit/spec/locus-info/controlsUtils.js +195 -1
  264. package/test/unit/spec/locus-info/index.js +950 -45
  265. package/test/unit/spec/locus-info/infoUtils.js +37 -15
  266. package/test/unit/spec/locus-info/mediaSharesUtils.ts +22 -0
  267. package/test/unit/spec/locus-info/parser.js +62 -22
  268. package/test/unit/spec/locus-info/selfConstant.js +19 -0
  269. package/test/unit/spec/locus-info/selfUtils.js +131 -26
  270. package/test/unit/spec/media/index.ts +82 -79
  271. package/test/unit/spec/meeting/in-meeting-actions.ts +60 -2
  272. package/test/unit/spec/meeting/index.js +3208 -1734
  273. package/test/unit/spec/meeting/locusMediaRequest.ts +443 -0
  274. package/test/unit/spec/meeting/muteState.js +328 -417
  275. package/test/unit/spec/meeting/request.js +393 -48
  276. package/test/unit/spec/meeting/utils.js +552 -76
  277. package/test/unit/spec/meeting-info/index.js +181 -0
  278. package/test/unit/spec/meeting-info/meetinginfov2.js +258 -20
  279. package/test/unit/spec/meeting-info/utilv2.js +21 -0
  280. package/test/unit/spec/meetings/index.js +631 -145
  281. package/test/unit/spec/meetings/utils.js +164 -9
  282. package/test/unit/spec/member/index.js +44 -14
  283. package/test/unit/spec/member/util.js +296 -155
  284. package/test/unit/spec/members/index.js +23 -3
  285. package/test/unit/spec/members/request.js +167 -35
  286. package/test/unit/spec/metrics/index.js +1 -50
  287. package/test/unit/spec/multistream/mediaRequestManager.ts +366 -8
  288. package/test/unit/spec/multistream/receiveSlot.ts +1 -1
  289. package/test/unit/spec/multistream/remoteMediaGroup.ts +266 -0
  290. package/test/unit/spec/multistream/remoteMediaManager.ts +123 -0
  291. package/test/unit/spec/multistream/sendSlotManager.ts +242 -0
  292. package/test/unit/spec/reachability/index.ts +66 -5
  293. package/test/unit/spec/reachability/request.js +3 -1
  294. package/test/unit/spec/reconnection-manager/index.js +55 -5
  295. package/test/unit/spec/recording-controller/index.js +294 -218
  296. package/test/unit/spec/recording-controller/util.js +223 -96
  297. package/test/unit/spec/roap/index.ts +21 -48
  298. package/test/unit/spec/roap/request.ts +74 -60
  299. package/test/unit/spec/roap/turnDiscovery.ts +30 -6
  300. package/test/unit/spec/rtcMetrics/index.ts +68 -0
  301. package/test/utils/integrationTestUtils.js +46 -0
  302. package/test/utils/testUtils.js +0 -60
  303. package/src/metrics/config.ts +0 -487
@@ -18,22 +18,27 @@ import {
18
18
  HTTP_VERBS,
19
19
  LEAVE,
20
20
  LOCI,
21
- LOCUS,
22
- MEDIA,
23
21
  PARTICIPANT,
24
22
  PROVISIONAL_TYPE_DIAL_IN,
25
23
  PROVISIONAL_TYPE_DIAL_OUT,
26
24
  REACHABILITY,
27
25
  SEND_DTMF_ENDPOINT,
28
26
  _SLIDES_,
27
+ ANNOTATION,
28
+ IP_VERSION,
29
29
  } from '../constants';
30
30
  import {SendReactionOptions, ToggleReactionsOptions} from './request.type';
31
+ import MeetingUtil from './util';
32
+ import {AnnotationInfo} from '../annotation/annotation.types';
31
33
 
32
34
  /**
33
35
  * @class MeetingRequest
34
36
  */
35
37
  export default class MeetingRequest extends StatelessWebexPlugin {
36
38
  changeVideoLayoutDebounced: any;
39
+ meetingRef: WeakRef<any>;
40
+ locusDeltaRequest: (options: object) => Promise<any>;
41
+ buildLocusDeltaRequestOptions: (options: object) => Promise<any>;
37
42
 
38
43
  /**
39
44
  * Constructor
@@ -41,7 +46,13 @@ export default class MeetingRequest extends StatelessWebexPlugin {
41
46
  * @param {Object} options
42
47
  */
43
48
  constructor(attrs: any, options: any) {
44
- super(attrs, options);
49
+ const {meeting, ...otherAttrs} = attrs;
50
+
51
+ super(otherAttrs, options);
52
+
53
+ this.locusDeltaRequest = MeetingUtil.generateLocusDeltaRequest(meeting);
54
+ this.buildLocusDeltaRequestOptions = MeetingUtil.generateBuildLocusDeltaRequestOptions(meeting);
55
+
45
56
  this.changeVideoLayoutDebounced = debounce(this.changeVideoLayout, 2000, {
46
57
  leading: true,
47
58
  trailing: true,
@@ -88,6 +99,9 @@ export default class MeetingRequest extends StatelessWebexPlugin {
88
99
  * @param {boolean} options.moveToResource
89
100
  * @param {Object} options.roapMessage
90
101
  * @param {boolean} options.breakoutsSupported
102
+ * @param {String} options.locale,
103
+ * @param {Array} options.deviceCapabilities
104
+ * @param {boolean} options.liveAnnotationSupported
91
105
  * @returns {Promise}
92
106
  */
93
107
  async joinMeeting(options: {
@@ -107,6 +121,10 @@ export default class MeetingRequest extends StatelessWebexPlugin {
107
121
  permissionToken: any;
108
122
  preferTranscoding: any;
109
123
  breakoutsSupported: boolean;
124
+ locale?: string;
125
+ deviceCapabilities?: Array<string>;
126
+ liveAnnotationSupported: boolean;
127
+ ipVersion: IP_VERSION;
110
128
  }) {
111
129
  const {
112
130
  asResourceOccupant,
@@ -124,6 +142,10 @@ export default class MeetingRequest extends StatelessWebexPlugin {
124
142
  roapMessage,
125
143
  preferTranscoding,
126
144
  breakoutsSupported,
145
+ locale,
146
+ deviceCapabilities = [],
147
+ liveAnnotationSupported,
148
+ ipVersion,
127
149
  } = options;
128
150
 
129
151
  LoggerProxy.logger.info('Meeting:request#joinMeeting --> Joining a meeting', correlationId);
@@ -149,19 +171,31 @@ export default class MeetingRequest extends StatelessWebexPlugin {
149
171
  clientMediaPreferences: {
150
172
  preferTranscoding: preferTranscoding ?? true,
151
173
  joinCookie,
174
+ ipver: ipVersion,
152
175
  },
153
176
  };
154
177
 
155
178
  if (breakoutsSupported) {
156
- body.deviceCapabilities = [BREAKOUTS.BREAKOUTS_SUPPORTED];
179
+ deviceCapabilities.push(BREAKOUTS.BREAKOUTS_SUPPORTED);
180
+ }
181
+ if (liveAnnotationSupported) {
182
+ deviceCapabilities.push(ANNOTATION.ANNOTATION_ON_SHARE_SUPPORTED);
157
183
  }
158
184
 
185
+ if (locale) {
186
+ body.locale = locale;
187
+ }
188
+
189
+ // add deviceCapabilities prop
190
+ if (deviceCapabilities.length) {
191
+ body.deviceCapabilities = deviceCapabilities;
192
+ }
159
193
  // @ts-ignore
160
- if (this.webex.meetings.clientRegion) {
194
+ if (this.webex.meetings.geoHintInfo) {
161
195
  // @ts-ignore
162
- body.device.countryCode = this.webex.meetings.clientRegion.countryCode;
196
+ body.device.countryCode = this.webex.meetings.geoHintInfo.countryCode;
163
197
  // @ts-ignore
164
- body.device.regionCode = this.webex.meetings.clientRegion.regionCode;
198
+ body.device.regionCode = this.webex.meetings.geoHintInfo.regionCode;
165
199
  }
166
200
 
167
201
  if (moderator !== undefined) {
@@ -285,7 +319,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
285
319
  };
286
320
 
287
321
  // @ts-ignore
288
- return this.request({
322
+ return this.locusDeltaRequest({
289
323
  method: HTTP_VERBS.POST,
290
324
  uri,
291
325
  body,
@@ -340,7 +374,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
340
374
  };
341
375
 
342
376
  // @ts-ignore
343
- return this.request({
377
+ return this.locusDeltaRequest({
344
378
  method: HTTP_VERBS.POST,
345
379
  uri,
346
380
  body,
@@ -354,62 +388,22 @@ export default class MeetingRequest extends StatelessWebexPlugin {
354
388
  }
355
389
 
356
390
  /**
357
- * Syns the missed delta event
358
- * @param {Object} options
359
- * @param {boolean} options.desync flag to get partial or whole locus object
360
- * @param {String} options.syncUrl sync url to get ht elatest locus delta
361
- * @returns {Promise}
362
- */
363
- syncMeeting(options: {desync: boolean; syncUrl: string}) {
364
- /* eslint-disable no-else-return */
365
- const {desync} = options;
366
- let {syncUrl} = options;
367
-
368
- /* istanbul ignore else */
369
- if (desync) {
370
- // check for existing URL parameters
371
- syncUrl = syncUrl
372
- .concat(syncUrl.split('?')[1] ? '&' : '?')
373
- .concat(`${LOCUS.SYNCDEBUG}=${desync}`);
374
- }
375
-
376
- // @ts-ignore
377
- return this.request({
378
- method: HTTP_VERBS.GET,
379
- uri: syncUrl,
380
- }) // TODO: Handle if delta sync failed . Get the full locus object
381
- .catch((err) => {
382
- LoggerProxy.logger.error(
383
- `Meeting:request#syncMeeting --> Error syncing meeting, error ${err}`
384
- );
385
-
386
- return err;
387
- });
388
- }
389
-
390
- /**
391
- * Request to get the complete locus object
391
+ * Sends a requests to get the latest locus DTO, it might be a full Locus or a delta, depending on the url provided
392
392
  * @param {Object} options
393
- * @param {boolean} options.desync flag to get partial or whole locus object
394
393
  * @param {String} options.locusUrl sync url to get ht elatest locus delta
395
394
  * @returns {Promise}
396
395
  */
397
- getFullLocus(options: {desync: boolean; locusUrl: string}) {
398
- let {locusUrl} = options;
399
- const {desync} = options;
400
-
401
- if (locusUrl) {
402
- if (desync) {
403
- locusUrl += `?${LOCUS.SYNCDEBUG}=${desync}`;
404
- }
396
+ getLocusDTO(options: {url: string}) {
397
+ const {url} = options;
405
398
 
399
+ if (url) {
406
400
  // @ts-ignore
407
401
  return this.request({
408
402
  method: HTTP_VERBS.GET,
409
- uri: locusUrl,
403
+ uri: url,
410
404
  }).catch((err) => {
411
405
  LoggerProxy.logger.error(
412
- `Meeting:request#getFullLocus --> Error getting full locus, error ${err}`
406
+ `Meeting:request#getLocusDTO --> Error getting latest locus, error ${err}`
413
407
  );
414
408
 
415
409
  return err;
@@ -455,7 +449,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
455
449
  };
456
450
 
457
451
  // @ts-ignore
458
- return this.request({
452
+ return this.locusDeltaRequest({
459
453
  method: HTTP_VERBS.PUT,
460
454
  uri,
461
455
  body,
@@ -469,13 +463,49 @@ export default class MeetingRequest extends StatelessWebexPlugin {
469
463
  }
470
464
 
471
465
  /**
472
- * Make a network request to leave a meeting
466
+ * Prepares request options to to leave a meeting
473
467
  * @param {Object} options
474
468
  * @param {Url} options.locusUrl
475
469
  * @param {String} options.selfId
476
470
  * @param {Url} options.deviceUrl
477
471
  * @param {String} options.resourceId,
478
472
  * @param {String} options.correlationId
473
+ * @returns {Object} request options
474
+ */
475
+ prepareLeaveMeetingRequestOptions({
476
+ locusUrl,
477
+ selfId,
478
+ deviceUrl: url,
479
+ resourceId,
480
+ correlationId,
481
+ }: {
482
+ locusUrl: string;
483
+ selfId: string;
484
+ deviceUrl: string;
485
+ resourceId: string;
486
+ correlationId: string;
487
+ }) {
488
+ const uri = `${locusUrl}/${PARTICIPANT}/${selfId}/${LEAVE}`;
489
+ const body = {
490
+ device: {
491
+ // @ts-ignore
492
+ deviceType: this.config.meetings.deviceType,
493
+ url,
494
+ },
495
+ usingResource: resourceId || null,
496
+ correlationId,
497
+ };
498
+
499
+ return {
500
+ method: HTTP_VERBS.PUT,
501
+ uri,
502
+ body,
503
+ };
504
+ }
505
+
506
+ /**
507
+ * Make a network request to leave a meeting
508
+ * @param {Object} options
479
509
  * @returns {Promise}
480
510
  */
481
511
  leaveMeeting({
@@ -504,14 +534,22 @@ export default class MeetingRequest extends StatelessWebexPlugin {
504
534
  correlationId,
505
535
  };
506
536
 
507
- // @ts-ignore
508
- return this.request({
537
+ return this.locusDeltaRequest({
509
538
  method: HTTP_VERBS.PUT,
510
539
  uri,
511
540
  body,
512
541
  });
513
542
  }
514
543
 
544
+ /**
545
+ * Builds request options to leave a meeting
546
+ * @param {Object} options
547
+ * @returns {Object} request options
548
+ */
549
+ buildLeaveMeetingRequestOptions(options: any) {
550
+ return this.buildLocusDeltaRequestOptions(this.prepareLeaveMeetingRequestOptions(options));
551
+ }
552
+
515
553
  /**
516
554
  * Make a network request to acknowledge a meeting
517
555
  * @param {Object} options
@@ -531,14 +569,19 @@ export default class MeetingRequest extends StatelessWebexPlugin {
531
569
  correlationId: options.correlationId,
532
570
  };
533
571
 
534
- // @ts-ignore
535
- return this.request({
572
+ return this.locusDeltaRequest({
536
573
  method: HTTP_VERBS.PUT,
537
574
  uri,
538
575
  body,
539
576
  });
540
577
  }
541
578
 
579
+ /**
580
+ * Makes a network request to lock the meeting
581
+ * @param {Object} options
582
+ * @param {Boolean} options.lock Whether it is locked or not
583
+ * @returns {Promise}
584
+ */
542
585
  lockMeeting(options) {
543
586
  const uri = `${options.locusUrl}/${CONTROLS}`;
544
587
  const body = {
@@ -547,8 +590,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
547
590
  },
548
591
  };
549
592
 
550
- // @ts-ignore
551
- return this.request({
593
+ return this.locusDeltaRequest({
552
594
  method: HTTP_VERBS.PATCH,
553
595
  uri,
554
596
  body,
@@ -574,54 +616,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
574
616
  ...(options.reason && {reason: options.reason}),
575
617
  };
576
618
 
577
- // @ts-ignore
578
- return this.request({
579
- method: HTTP_VERBS.PUT,
580
- uri,
581
- body,
582
- });
583
- }
584
-
585
- /**
586
- * Toggle remote audio and/or video
587
- * @param {Object} options options for toggling
588
- * @param {String} options.selfId Locus self id??
589
- * @param {String} options.locusUrl Locus url
590
- * @param {String} options.deviceUrl Url of a device
591
- * @param {String} options.resourceId Populated if you are paired to a device
592
- * @param {String} options.localMedias local sdps
593
- * @param {Boolean} options.preferTranscoding false for multistream (Homer), true for transcoded media (Edonus)
594
- * @returns {Promise}
595
- */
596
- remoteAudioVideoToggle(
597
- options:
598
- | {
599
- selfId: string;
600
- locusUrl: string;
601
- deviceUrl: string;
602
- resourceId: string;
603
- localMedias: string;
604
- }
605
- | any
606
- ) {
607
- const uri = `${options.locusUrl}/${PARTICIPANT}/${options.selfId}/${MEDIA}`;
608
- const body = {
609
- device: {
610
- // @ts-ignore
611
- deviceType: this.config.meetings.deviceType,
612
- url: options.deviceUrl,
613
- },
614
- usingResource: options.resourceId || null,
615
- correlationId: options.correlationId,
616
- respOnlySdp: true,
617
- localMedias: options.localMedias,
618
- clientMediaPreferences: {
619
- preferTranscoding: options.preferTranscoding ?? true,
620
- },
621
- };
622
-
623
- // @ts-ignore
624
- return this.request({
619
+ return this.locusDeltaRequest({
625
620
  method: HTTP_VERBS.PUT,
626
621
  uri,
627
622
  body,
@@ -646,6 +641,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
646
641
  deviceUrl: string;
647
642
  resourceId: string;
648
643
  uri: string;
644
+ annotationInfo: AnnotationInfo;
649
645
  }
650
646
  | any
651
647
  ) {
@@ -679,6 +675,9 @@ export default class MeetingRequest extends StatelessWebexPlugin {
679
675
  if (options?.resourceToken) {
680
676
  body.resourceToken = options?.resourceToken;
681
677
  }
678
+ if (options?.annotationInfo) {
679
+ body.annotation = options?.annotationInfo;
680
+ }
682
681
 
683
682
  // @ts-ignore
684
683
  return this.request({
@@ -698,7 +697,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
698
697
  */
699
698
  sendDTMF({locusUrl, deviceUrl, tones}: {locusUrl: string; deviceUrl: string; tones: string}) {
700
699
  // @ts-ignore
701
- return this.request({
700
+ return this.locusDeltaRequest({
702
701
  method: HTTP_VERBS.POST,
703
702
  uri: `${locusUrl}/${SEND_DTMF_ENDPOINT}`,
704
703
  body: {
@@ -779,7 +778,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
779
778
  : undefined;
780
779
 
781
780
  // @ts-ignore
782
- return this.request({
781
+ return this.locusDeltaRequest({
783
782
  method: HTTP_VERBS.PUT,
784
783
  uri: `${locusUrl}/${CONTROLS}`,
785
784
  body: {
@@ -802,7 +801,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
802
801
  const uri = `${locusUrl}/${END}`;
803
802
 
804
803
  // @ts-ignore
805
- return this.request({
804
+ return this.locusDeltaRequest({
806
805
  method: HTTP_VERBS.POST,
807
806
  uri,
808
807
  });
@@ -854,7 +853,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
854
853
  const uri = `${locusUrl}/${CONTROLS}`;
855
854
 
856
855
  // @ts-ignore
857
- return this.request({
856
+ return this.locusDeltaRequest({
858
857
  method: HTTP_VERBS.PUT,
859
858
  uri,
860
859
  body: {
@@ -865,4 +864,12 @@ export default class MeetingRequest extends StatelessWebexPlugin {
865
864
  },
866
865
  });
867
866
  }
867
+
868
+ getLocusStatusByUrl(locusUrl: string) {
869
+ // @ts-ignore
870
+ return this.request({
871
+ method: HTTP_VERBS.GET,
872
+ uri: locusUrl,
873
+ });
874
+ }
868
875
  }