@webex/plugin-meetings 3.0.0-bnr.4 → 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 +3 -2
  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
@@ -3,9 +3,14 @@ import {assert} from '@webex/test-helper-chai';
3
3
  import MockWebex from '@webex/test-helper-mock-webex';
4
4
  import Meetings from '@webex/plugin-meetings';
5
5
  import MeetingRequest from '@webex/plugin-meetings/src/meeting/request';
6
+ import uuid from 'uuid';
7
+ import { merge } from 'lodash';
8
+ import {IP_VERSION} from '@webex/plugin-meetings/src/constants';
9
+
6
10
 
7
11
  describe('plugin-meetings', () => {
8
12
  let meetingsRequest;
13
+ let locusDeltaRequestSpy;
9
14
 
10
15
  beforeEach(() => {
11
16
  const webex = new MockWebex({
@@ -14,7 +19,7 @@ describe('plugin-meetings', () => {
14
19
  },
15
20
  });
16
21
 
17
- webex.meetings.clientRegion = {
22
+ webex.meetings.geoHintInfo = {
18
23
  countryCode: 'US',
19
24
  regionCode: 'WEST-COAST',
20
25
  };
@@ -26,19 +31,47 @@ describe('plugin-meetings', () => {
26
31
  },
27
32
  };
28
33
 
29
- webex.boundedStorage.get = sinon.mock().returns(Promise.resolve(JSON.stringify({anycastEntryPoint: "aws-eu-west-1"})))
34
+ webex.boundedStorage.get = sinon
35
+ .mock()
36
+ .returns(Promise.resolve(JSON.stringify({anycastEntryPoint: 'aws-eu-west-1'})));
37
+
38
+ const request = sinon.mock().returns(Promise.resolve({}));
30
39
 
31
40
  meetingsRequest = new MeetingRequest(
32
- {},
41
+ {
42
+ meeting: {
43
+ request,
44
+ locusInfo: {
45
+ sequence: {},
46
+ },
47
+ },
48
+ },
33
49
  {
34
50
  parent: webex,
35
51
  }
36
52
  );
37
53
 
38
- meetingsRequest.request = sinon.mock().returns(Promise.resolve({}));
54
+ meetingsRequest.request = request;
55
+ locusDeltaRequestSpy = sinon.spy(meetingsRequest, 'locusDeltaRequest');
39
56
  });
40
57
 
58
+ const checkRequest = (expectedParams) => {
59
+ assert.calledOnceWithExactly(locusDeltaRequestSpy, expectedParams);
60
+ assert.calledOnceWithExactly(
61
+ meetingsRequest.request,
62
+ merge(expectedParams, {body: {sequence: {}}})
63
+ );
64
+ };
65
+
41
66
  describe('meeting request library', () => {
67
+ beforeEach(() => {
68
+ sinon.stub(uuid, 'v4').returns('12345');
69
+ });
70
+
71
+ afterEach(() => {
72
+ uuid.v4.restore();
73
+ });
74
+
42
75
  describe('#sendDTMF', () => {
43
76
  it('sends a POST to the sendDtmf locus endpoint', async () => {
44
77
  const locusUrl = 'locusURL';
@@ -50,12 +83,18 @@ describe('plugin-meetings', () => {
50
83
  deviceUrl,
51
84
  tones,
52
85
  });
53
- const requestParams = meetingsRequest.request.getCall(0).args[0];
54
86
 
55
- assert.equal(requestParams.method, 'POST');
56
- assert.equal(requestParams.uri, `${locusUrl}/sendDtmf`);
57
- assert.equal(requestParams.body.dtmf.tones, tones);
58
- assert.equal(requestParams.body.deviceUrl, deviceUrl);
87
+ checkRequest({
88
+ method: 'POST',
89
+ uri: `${locusUrl}/sendDtmf`,
90
+ body: {
91
+ deviceUrl: 'deviceUrl',
92
+ dtmf: {
93
+ correlationId: '12345',
94
+ tones: '1234',
95
+ },
96
+ },
97
+ });
59
98
  });
60
99
  });
61
100
 
@@ -72,14 +111,19 @@ describe('plugin-meetings', () => {
72
111
  main: {width: 640, height: 480},
73
112
  content: {width: 1280, height: 720},
74
113
  });
75
- const requestParams = meetingsRequest.request.getCall(0).args[0];
76
114
 
77
- assert.equal(requestParams.method, 'PUT');
78
- assert.equal(requestParams.uri, `${locusUrl}/controls`);
79
- assert.equal(requestParams.body.layout.type, layoutType);
80
- assert.equal(requestParams.body.layout.deviceUrl, deviceUrl);
81
- assert.deepEqual(requestParams.body.layout.layoutParams, {
82
- renderInfo: {main: {width: 640, height: 480}, content: {width: 1280, height: 720}},
115
+ checkRequest({
116
+ method: 'PUT',
117
+ uri: `${locusUrl}/controls`,
118
+ body: {
119
+ layout: {
120
+ deviceUrl,
121
+ type: layoutType,
122
+ layoutParams: {
123
+ renderInfo: {main: {width: 640, height: 480}, content: {width: 1280, height: 720}},
124
+ },
125
+ },
126
+ },
83
127
  });
84
128
  });
85
129
 
@@ -195,23 +239,61 @@ describe('plugin-meetings', () => {
195
239
 
196
240
  it('adds deviceCapabilities to request when breakouts are supported', async () => {
197
241
  await meetingsRequest.joinMeeting({
198
- breakoutsSupported: true
242
+ breakoutsSupported: true,
199
243
  });
200
244
  const requestParams = meetingsRequest.request.getCall(0).args[0];
201
245
 
202
246
  assert.deepEqual(requestParams.body.deviceCapabilities, ['BREAKOUTS_SUPPORTED']);
203
247
  });
204
248
 
205
- it('does not add deviceCapabilities to request when breakouts are not supported', async () => {
249
+ it('adds deviceCapabilities to request when live annotation are supported', async () => {
250
+ await meetingsRequest.joinMeeting({
251
+ liveAnnotationSupported: true,
252
+ });
253
+ const requestParams = meetingsRequest.request.getCall(0).args[0];
254
+ assert.deepEqual(requestParams.body.deviceCapabilities, ['ANNOTATION_ON_SHARE_SUPPORTED']);
255
+ });
256
+ it('adds deviceCapabilities to request when breakouts and live annotation are supported', async () => {
257
+ await meetingsRequest.joinMeeting({
258
+ liveAnnotationSupported: true,
259
+ breakoutsSupported: true,
260
+ });
261
+ const requestParams = meetingsRequest.request.getCall(0).args[0];
262
+ assert.deepEqual(requestParams.body.deviceCapabilities, [
263
+ 'BREAKOUTS_SUPPORTED',
264
+ 'ANNOTATION_ON_SHARE_SUPPORTED',
265
+ ]);
266
+ });
267
+ it('does not add deviceCapabilities to request when breakouts and live annotation are not supported', async () => {
206
268
  await meetingsRequest.joinMeeting({});
207
269
 
208
270
  const requestParams = meetingsRequest.request.getCall(0).args[0];
209
271
 
210
272
  assert.deepEqual(requestParams.body.deviceCapabilities, undefined);
273
+ });
274
+
275
+ it('adds deviceCapabilities and locale to request when they are provided', async () => {
276
+ await meetingsRequest.joinMeeting({
277
+ locale: 'en_UK',
278
+ deviceCapabilities: ['SERVER_AUDIO_ANNOUNCEMENT_SUPPORTED'],
279
+ });
280
+ const requestParams = meetingsRequest.request.getCall(0).args[0];
281
+
282
+ assert.deepEqual(requestParams.body.deviceCapabilities, [
283
+ 'SERVER_AUDIO_ANNOUNCEMENT_SUPPORTED',
284
+ ]);
285
+ assert.deepEqual(requestParams.body.locale, 'en_UK');
286
+ });
287
+
288
+ it('does not add deviceCapabilities and locale to request when they are not provided', async () => {
289
+ await meetingsRequest.joinMeeting({});
290
+ const requestParams = meetingsRequest.request.getCall(0).args[0];
211
291
 
292
+ assert.deepEqual(requestParams.body.deviceCapabilities, undefined);
293
+ assert.deepEqual(requestParams.body.locale, undefined);
212
294
  });
213
295
 
214
- it('includes joinCookie correctly', async () => {
296
+ it('includes joinCookie and ipver correctly', async () => {
215
297
  const locusUrl = 'locusURL';
216
298
  const deviceUrl = 'deviceUrl';
217
299
  const correlationId = 'random-uuid';
@@ -224,6 +306,7 @@ describe('plugin-meetings', () => {
224
306
  correlationId,
225
307
  roapMessage,
226
308
  permissionToken,
309
+ ipVersion: IP_VERSION.ipv4_and_ipv6
227
310
  });
228
311
  const requestParams = meetingsRequest.request.getCall(0).args[0];
229
312
 
@@ -231,7 +314,8 @@ describe('plugin-meetings', () => {
231
314
  assert.equal(requestParams.uri, `${locusUrl}/participant?alternateRedirect=true`);
232
315
  assert.deepEqual(requestParams.body.clientMediaPreferences, {
233
316
  "joinCookie": {anycastEntryPoint: "aws-eu-west-1"},
234
- "preferTranscoding": true
317
+ "preferTranscoding": true,
318
+ "ipver": 1
235
319
  });
236
320
  });
237
321
  });
@@ -249,14 +333,20 @@ describe('plugin-meetings', () => {
249
333
  correlationId,
250
334
  dialInUrl,
251
335
  });
252
- const requestParams = meetingsRequest.request.getCall(0).args[0];
253
336
 
254
- assert.equal(requestParams.method, 'POST');
255
- assert.equal(requestParams.uri, `${locusUrl}/participant`);
256
- assert.equal(requestParams.body.device.url, dialInUrl);
257
- assert.equal(requestParams.body.device.deviceType, 'PROVISIONAL');
258
- assert.equal(requestParams.body.device.provisionalType, 'DIAL_IN');
259
- assert.equal(requestParams.body.device.clientUrl, 'clientUrl');
337
+ checkRequest({
338
+ method: 'POST',
339
+ uri: `${locusUrl}/participant`,
340
+ body: {
341
+ device: {
342
+ url: dialInUrl,
343
+ deviceType: 'PROVISIONAL',
344
+ provisionalType: 'DIAL_IN',
345
+ clientUrl,
346
+ },
347
+ correlationId,
348
+ },
349
+ });
260
350
  });
261
351
 
262
352
  it('sends dial out pstn request', async () => {
@@ -273,15 +363,21 @@ describe('plugin-meetings', () => {
273
363
  dialOutUrl,
274
364
  phoneNumber,
275
365
  });
276
- const requestParams = meetingsRequest.request.getCall(0).args[0];
277
366
 
278
- assert.equal(requestParams.method, 'POST');
279
- assert.equal(requestParams.uri, `${locusUrl}/participant`);
280
- assert.equal(requestParams.body.device.url, dialOutUrl);
281
- assert.equal(requestParams.body.device.deviceType, 'PROVISIONAL');
282
- assert.equal(requestParams.body.device.provisionalType, 'DIAL_OUT');
283
- assert.equal(requestParams.body.device.clientUrl, 'clientUrl');
284
- assert.equal(requestParams.body.device.dialoutAddress, phoneNumber);
367
+ checkRequest({
368
+ method: 'POST',
369
+ uri: `${locusUrl}/participant`,
370
+ body: {
371
+ device: {
372
+ url: dialOutUrl,
373
+ deviceType: 'PROVISIONAL',
374
+ provisionalType: 'DIAL_OUT',
375
+ clientUrl,
376
+ dialoutAddress: phoneNumber,
377
+ },
378
+ correlationId,
379
+ },
380
+ });
285
381
  });
286
382
 
287
383
  it('sends disconnect phone audio request', async () => {
@@ -296,12 +392,92 @@ describe('plugin-meetings', () => {
296
392
  correlationId,
297
393
  phoneUrl,
298
394
  });
299
- const requestParams = meetingsRequest.request.getCall(0).args[0];
300
395
 
301
- assert.equal(requestParams.method, 'PUT');
302
- assert.equal(requestParams.uri, `${locusUrl}/participant/${selfId}/leave`);
303
- assert.equal(requestParams.body.device.url, phoneUrl);
304
- assert.equal(requestParams.body.device.deviceType, 'PROVISIONAL');
396
+ checkRequest({
397
+ method: 'PUT',
398
+ uri: `${locusUrl}/participant/${selfId}/leave`,
399
+ body: {
400
+ device: {
401
+ url: phoneUrl,
402
+ deviceType: 'PROVISIONAL',
403
+ },
404
+ correlationId,
405
+ },
406
+ });
407
+ });
408
+ });
409
+
410
+ describe('#leaveMeeting', () => {
411
+ it('sends the request to leave the meeting', async () => {
412
+ const locusUrl = 'locusUrl';
413
+ const selfId = 'selfId';
414
+ const correlationId = 'random-uuid';
415
+ const resourceId = 'resourceId';
416
+ const deviceUrl = 'deviceUrl';
417
+
418
+ meetingsRequest.config.meetings.deviceType = 'deviceType';
419
+
420
+ await meetingsRequest.leaveMeeting({
421
+ locusUrl,
422
+ selfId,
423
+ deviceUrl,
424
+ resourceId,
425
+ correlationId,
426
+ });
427
+
428
+ checkRequest({
429
+ method: 'PUT',
430
+ uri: 'locusUrl/participant/selfId/leave',
431
+ body: {
432
+ device: {deviceType: 'deviceType', url: 'deviceUrl'},
433
+ usingResource: 'resourceId',
434
+ correlationId: 'random-uuid',
435
+ },
436
+ });
437
+ });
438
+ });
439
+
440
+ describe('#acknowledgeMeeting', () => {
441
+ it('sends the request to acknowledge the meeting', async () => {
442
+ const locusUrl = 'locusUrl';
443
+ const correlationId = 'random-uuid';
444
+ const deviceUrl = 'deviceUrl';
445
+
446
+ meetingsRequest.config.meetings.deviceType = 'deviceType';
447
+
448
+ await meetingsRequest.acknowledgeMeeting({
449
+ locusUrl,
450
+ deviceUrl,
451
+ correlationId,
452
+ });
453
+
454
+ checkRequest({
455
+ method: 'PUT',
456
+ uri: 'locusUrl/participant/alert',
457
+ body: {
458
+ device: {deviceType: 'deviceType', url: 'deviceUrl'},
459
+ correlationId: 'random-uuid',
460
+ },
461
+ });
462
+ });
463
+ });
464
+
465
+ describe('#lockMeeting', () => {
466
+ it('sends request to lock the meeting', async () => {
467
+ const locusUrl = 'locusURL';
468
+
469
+ await meetingsRequest.lockMeeting({
470
+ locusUrl,
471
+ lock: true,
472
+ });
473
+
474
+ checkRequest({
475
+ method: 'PATCH',
476
+ uri: `${locusUrl}/controls`,
477
+ body: {
478
+ lock: {locked: true},
479
+ },
480
+ });
305
481
  });
306
482
  });
307
483
 
@@ -312,10 +488,11 @@ describe('plugin-meetings', () => {
312
488
  await meetingsRequest.endMeetingForAll({
313
489
  locusUrl,
314
490
  });
315
- const requestParams = meetingsRequest.request.getCall(0).args[0];
316
491
 
317
- assert.equal(requestParams.method, 'POST');
318
- assert.equal(requestParams.uri, `${locusUrl}/end`);
492
+ checkRequest({
493
+ method: 'POST',
494
+ uri: `${locusUrl}/end`,
495
+ });
319
496
  });
320
497
  });
321
498
 
@@ -368,12 +545,180 @@ describe('plugin-meetings', () => {
368
545
  locusUrl,
369
546
  requestingParticipantId,
370
547
  });
371
- const requestParams = meetingsRequest.request.getCall(0).args[0];
372
548
 
373
- assert.equal(requestParams.method, 'PUT');
374
- assert.equal(requestParams.uri, `${locusUrl}/controls`);
375
- assert.equal(requestParams.body.reactions.enabled, true);
376
- assert.equal(requestParams.body.requestingParticipantId, requestingParticipantId);
549
+ checkRequest({
550
+ method: 'PUT',
551
+ uri: `${locusUrl}/controls`,
552
+ body: {
553
+ reactions: {
554
+ enabled: true,
555
+ },
556
+ requestingParticipantId,
557
+ },
558
+ });
559
+ });
560
+ });
561
+
562
+ describe('#prepareLeaveMeetingRequestOptions', () => {
563
+ it('returns expected result', async () => {
564
+ const result = meetingsRequest.prepareLeaveMeetingRequestOptions({
565
+ locusUrl: 'locusUrl',
566
+ selfId: 'selfId',
567
+ correlationId: 'correlationId',
568
+ resourceId: 'resourceId',
569
+ deviceUrl: 'deviceUrl',
570
+ });
571
+
572
+ assert.deepEqual(result, {
573
+ body: {
574
+ correlationId: 'correlationId',
575
+ device: {
576
+ deviceType: undefined,
577
+ url: 'deviceUrl',
578
+ },
579
+ usingResource: 'resourceId',
580
+ },
581
+ method: 'PUT',
582
+ uri: 'locusUrl/participant/selfId/leave',
583
+ });
584
+ });
585
+ });
586
+
587
+ describe('#buildLeaveMeetingRequestOptions', () => {
588
+ it('calls expected functions and returns expected result', async () => {
589
+ // return this.buildLocusDeltaRequestOptions(this.prepareLeaveMeetingRequestOptions(options));
590
+ const prepareLeaveMeetingRequestOptionsSpy = sinon.spy(
591
+ meetingsRequest,
592
+ 'prepareLeaveMeetingRequestOptions'
593
+ );
594
+ const buildLocusDeltaRequestOptionsSpy = sinon.spy(
595
+ meetingsRequest,
596
+ 'buildLocusDeltaRequestOptions'
597
+ );
598
+
599
+ const inputOpts = {
600
+ locusUrl: 'locusUrl',
601
+ selfId: 'selfId',
602
+ correlationId: 'correlationId',
603
+ resourceId: 'resourceId',
604
+ deviceUrl: 'deviceUrl',
605
+ };
606
+
607
+ const result = meetingsRequest.buildLeaveMeetingRequestOptions(inputOpts);
608
+
609
+ assert.calledOnceWithExactly(prepareLeaveMeetingRequestOptionsSpy, inputOpts);
610
+ assert.calledOnceWithExactly(buildLocusDeltaRequestOptionsSpy, {
611
+ method: 'PUT',
612
+ uri: 'locusUrl/participant/selfId/leave',
613
+ body: {
614
+ device: {deviceType: undefined, url: 'deviceUrl'},
615
+ usingResource: 'resourceId',
616
+ correlationId: 'correlationId',
617
+ },
618
+ });
619
+
620
+ assert.deepEqual(result, {
621
+ body: {
622
+ correlationId: 'correlationId',
623
+ device: {
624
+ deviceType: undefined,
625
+ url: 'deviceUrl',
626
+ },
627
+ sequence: {},
628
+ usingResource: 'resourceId',
629
+ },
630
+ method: 'PUT',
631
+ uri: 'locusUrl/participant/selfId/leave',
632
+ });
633
+ });
634
+ });
635
+ });
636
+
637
+ describe('#declineMeeting', () => {
638
+ it('sends a request to decline the meeting', async () => {
639
+ const reason = 'reason';
640
+ const deviceUrl = 'deviceUrl';
641
+ const locusUrl = 'locusUrl';
642
+ meetingsRequest.config.meetings.deviceType = 'deviceType';
643
+
644
+ await meetingsRequest.declineMeeting({
645
+ locusUrl,
646
+ deviceUrl,
647
+ reason,
648
+ });
649
+
650
+ const expectedBody = {
651
+ device: {
652
+ deviceType: 'deviceType',
653
+ url: deviceUrl,
654
+ },
655
+ reason,
656
+ };
657
+
658
+ checkRequest({
659
+ method: 'PUT',
660
+ uri: `${locusUrl}/participant/decline`,
661
+ body: expectedBody,
662
+ });
663
+ });
664
+ });
665
+
666
+ describe('#getLocusStatusByUrl', () => {
667
+ it('check locus status', async () => {
668
+ const locusUrl = 'locusUrl';
669
+
670
+ await meetingsRequest.getLocusStatusByUrl(locusUrl);
671
+ assert.deepEqual(meetingsRequest.request.getCall(0).args[0], {
672
+ method: 'GET',
673
+ uri: locusUrl,
674
+ });
675
+ });
676
+ });
677
+
678
+ describe('#changeMeetingFloor', () => {
679
+ it('change meeting floor', async () => {
680
+ const options = {
681
+ disposition: 'GRANTED',
682
+ personUrl: 'personUrl',
683
+ deviceUrl: 'deviceUrl',
684
+ resourceId: 'resourceId',
685
+ resourceUrl: 'resourceUrl',
686
+ uri: 'optionsUrl',
687
+ annotationInfo: {
688
+ version: '1',
689
+ policy: 'Approval',
690
+ },
691
+ };
692
+
693
+ const expectBody = {
694
+ annotation: {
695
+ policy: 'Approval',
696
+ version: '1',
697
+ },
698
+ floor: {
699
+ beneficiary: {
700
+ devices: [
701
+ {
702
+ deviceType: undefined,
703
+ url: 'deviceUrl',
704
+ },
705
+ ],
706
+ url: 'personUrl',
707
+ },
708
+ disposition: 'GRANTED',
709
+ requester: {
710
+ url: 'personUrl',
711
+ },
712
+ },
713
+ resourceUrl: 'resourceUrl',
714
+ };
715
+
716
+ await meetingsRequest.changeMeetingFloor(options);
717
+
718
+ assert.deepEqual(meetingsRequest.request.getCall(0).args[0], {
719
+ method: 'PUT',
720
+ uri: 'optionsUrl',
721
+ body: expectBody,
377
722
  });
378
723
  });
379
724
  });