@webex/plugin-meetings 3.3.1 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/dist/breakouts/breakout.js +1 -1
  2. package/dist/breakouts/index.js +7 -2
  3. package/dist/breakouts/index.js.map +1 -1
  4. package/dist/constants.js +11 -4
  5. package/dist/constants.js.map +1 -1
  6. package/dist/interpretation/index.js +1 -1
  7. package/dist/interpretation/siLanguage.js +1 -1
  8. package/dist/locus-info/selfUtils.js +0 -5
  9. package/dist/locus-info/selfUtils.js.map +1 -1
  10. package/dist/media/MediaConnectionAwaiter.js +70 -15
  11. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  12. package/dist/media/index.js +12 -0
  13. package/dist/media/index.js.map +1 -1
  14. package/dist/meeting/connectionStateHandler.js +67 -0
  15. package/dist/meeting/connectionStateHandler.js.map +1 -0
  16. package/dist/meeting/index.js +552 -357
  17. package/dist/meeting/index.js.map +1 -1
  18. package/dist/meeting/locusMediaRequest.js +7 -0
  19. package/dist/meeting/locusMediaRequest.js.map +1 -1
  20. package/dist/meeting/muteState.js +6 -1
  21. package/dist/meeting/muteState.js.map +1 -1
  22. package/dist/meeting/util.js +1 -0
  23. package/dist/meeting/util.js.map +1 -1
  24. package/dist/meeting-info/index.js +4 -4
  25. package/dist/meeting-info/index.js.map +1 -1
  26. package/dist/meeting-info/meeting-info-v2.js +2 -2
  27. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  28. package/dist/meeting-info/util.js +17 -17
  29. package/dist/meeting-info/util.js.map +1 -1
  30. package/dist/meeting-info/utilv2.js +16 -16
  31. package/dist/meeting-info/utilv2.js.map +1 -1
  32. package/dist/meetings/collection.js +1 -1
  33. package/dist/meetings/collection.js.map +1 -1
  34. package/dist/meetings/index.js +37 -33
  35. package/dist/meetings/index.js.map +1 -1
  36. package/dist/meetings/meetings.types.js +8 -0
  37. package/dist/meetings/meetings.types.js.map +1 -1
  38. package/dist/meetings/util.js +3 -2
  39. package/dist/meetings/util.js.map +1 -1
  40. package/dist/metrics/constants.js +2 -1
  41. package/dist/metrics/constants.js.map +1 -1
  42. package/dist/metrics/index.js +57 -0
  43. package/dist/metrics/index.js.map +1 -1
  44. package/dist/personal-meeting-room/index.js +1 -1
  45. package/dist/personal-meeting-room/index.js.map +1 -1
  46. package/dist/reachability/clusterReachability.js +108 -53
  47. package/dist/reachability/clusterReachability.js.map +1 -1
  48. package/dist/reachability/index.js +415 -56
  49. package/dist/reachability/index.js.map +1 -1
  50. package/dist/types/constants.d.ts +11 -3
  51. package/dist/types/media/MediaConnectionAwaiter.d.ts +24 -4
  52. package/dist/types/meeting/connectionStateHandler.d.ts +30 -0
  53. package/dist/types/meeting/index.d.ts +27 -7
  54. package/dist/types/meeting/locusMediaRequest.d.ts +2 -0
  55. package/dist/types/meeting-info/index.d.ts +3 -2
  56. package/dist/types/meeting-info/meeting-info-v2.d.ts +3 -2
  57. package/dist/types/meeting-info/util.d.ts +5 -4
  58. package/dist/types/meeting-info/utilv2.d.ts +3 -2
  59. package/dist/types/meetings/collection.d.ts +3 -2
  60. package/dist/types/meetings/index.d.ts +4 -3
  61. package/dist/types/meetings/meetings.types.d.ts +9 -0
  62. package/dist/types/metrics/constants.d.ts +1 -0
  63. package/dist/types/metrics/index.d.ts +15 -0
  64. package/dist/types/reachability/clusterReachability.d.ts +31 -3
  65. package/dist/types/reachability/index.d.ts +93 -2
  66. package/dist/webinar/index.js +1 -1
  67. package/package.json +23 -23
  68. package/src/breakouts/index.ts +7 -1
  69. package/src/constants.ts +13 -17
  70. package/src/locus-info/selfUtils.ts +0 -5
  71. package/src/media/MediaConnectionAwaiter.ts +89 -14
  72. package/src/media/index.ts +13 -0
  73. package/src/meeting/connectionStateHandler.ts +65 -0
  74. package/src/meeting/index.ts +526 -292
  75. package/src/meeting/locusMediaRequest.ts +5 -0
  76. package/src/meeting/muteState.ts +6 -1
  77. package/src/meeting/util.ts +1 -0
  78. package/src/meeting-info/index.ts +9 -6
  79. package/src/meeting-info/meeting-info-v2.ts +4 -4
  80. package/src/meeting-info/util.ts +23 -28
  81. package/src/meeting-info/utilv2.ts +18 -24
  82. package/src/meetings/collection.ts +3 -3
  83. package/src/meetings/index.ts +39 -40
  84. package/src/meetings/meetings.types.ts +11 -0
  85. package/src/meetings/util.ts +5 -4
  86. package/src/metrics/constants.ts +1 -0
  87. package/src/metrics/index.ts +44 -0
  88. package/src/personal-meeting-room/index.ts +2 -2
  89. package/src/reachability/clusterReachability.ts +86 -25
  90. package/src/reachability/index.ts +316 -27
  91. package/test/unit/spec/breakouts/index.ts +51 -32
  92. package/test/unit/spec/locus-info/selfUtils.js +25 -23
  93. package/test/unit/spec/media/MediaConnectionAwaiter.ts +131 -32
  94. package/test/unit/spec/media/index.ts +42 -27
  95. package/test/unit/spec/meeting/connectionStateHandler.ts +102 -0
  96. package/test/unit/spec/meeting/index.js +758 -179
  97. package/test/unit/spec/meeting/locusMediaRequest.ts +7 -0
  98. package/test/unit/spec/meeting/muteState.js +24 -0
  99. package/test/unit/spec/meeting-info/index.js +4 -4
  100. package/test/unit/spec/meeting-info/meetinginfov2.js +24 -28
  101. package/test/unit/spec/meeting-info/request.js +2 -2
  102. package/test/unit/spec/meeting-info/utilv2.js +41 -49
  103. package/test/unit/spec/meetings/index.js +14 -0
  104. package/test/unit/spec/metrics/index.js +126 -0
  105. package/test/unit/spec/multistream/mediaRequestManager.ts +2 -2
  106. package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -2
  107. package/test/unit/spec/reachability/clusterReachability.ts +116 -22
  108. package/test/unit/spec/reachability/index.ts +1153 -84
  109. package/test/unit/spec/rtcMetrics/index.ts +1 -0
  110. package/dist/mediaQualityMetrics/config.js +0 -321
  111. package/dist/mediaQualityMetrics/config.js.map +0 -1
  112. package/dist/statsAnalyzer/global.js +0 -44
  113. package/dist/statsAnalyzer/global.js.map +0 -1
  114. package/dist/statsAnalyzer/index.js +0 -1072
  115. package/dist/statsAnalyzer/index.js.map +0 -1
  116. package/dist/statsAnalyzer/mqaUtil.js +0 -368
  117. package/dist/statsAnalyzer/mqaUtil.js.map +0 -1
  118. package/dist/types/mediaQualityMetrics/config.d.ts +0 -247
  119. package/dist/types/statsAnalyzer/global.d.ts +0 -36
  120. package/dist/types/statsAnalyzer/index.d.ts +0 -217
  121. package/dist/types/statsAnalyzer/mqaUtil.d.ts +0 -48
  122. package/src/mediaQualityMetrics/config.ts +0 -255
  123. package/src/statsAnalyzer/global.ts +0 -37
  124. package/src/statsAnalyzer/index.ts +0 -1318
  125. package/src/statsAnalyzer/mqaUtil.ts +0 -463
  126. package/test/unit/spec/stats-analyzer/index.js +0 -1819
@@ -414,6 +414,8 @@ describe('LocusMediaRequest.send()', () => {
414
414
 
415
415
  describe('confluence creation', () => {
416
416
  it('resolves without sending the request if LocalMute is requested before Roap Offer is sent (confluence state is "not created")', async () => {
417
+ assert.equal(locusMediaRequest.isConfluenceCreated(), false);
418
+
417
419
  const result = await sendLocalMute({audioMuted: false, videoMuted: true});
418
420
 
419
421
  assert.notCalled(webexRequestStub);
@@ -440,12 +442,15 @@ describe('LocusMediaRequest.send()', () => {
440
442
  body: createExpectedRoapBody('OFFER', {audioMuted: true, videoMuted: true}),
441
443
  });
442
444
  assert.equal(result, undefined); // sendLocalMute shouldn't resolve yet, as the request should be queued
445
+ assert.equal(locusMediaRequest.isConfluenceCreated(), false);
443
446
 
444
447
  // now let the Offer be completed - so confluence state will be "complete"
445
448
  webexRequestStub.resetHistory();
446
449
  requestsToLocus[0].resolve({});
447
450
  await testUtils.flushPromises();
448
451
 
452
+ assert.equal(locusMediaRequest.isConfluenceCreated(), true);
453
+
449
454
  // now the queued up local mute request should have been sent out
450
455
  assert.calledOnceWithExactly(webexRequestStub, {
451
456
  method: 'PUT',
@@ -471,6 +476,8 @@ describe('LocusMediaRequest.send()', () => {
471
476
  await testUtils.flushPromises();
472
477
  webexRequestStub.resetHistory();
473
478
 
479
+ assert.equal(locusMediaRequest.isConfluenceCreated(), true);
480
+
474
481
  // now send local mute
475
482
  sendLocalMute({audioMuted: false, videoMuted: true})
476
483
  .then((response) => {
@@ -113,6 +113,30 @@ describe('plugin-meetings', () => {
113
113
  assert.isTrue(audio.isRemotelyMuted());
114
114
  });
115
115
 
116
+ it('does not locally unmute on a server unmute', async () => {
117
+ const setServerMutedSpy = meeting.mediaProperties.audioStream.setServerMuted;
118
+
119
+ // simulate remote mute
120
+ audio.handleServerRemoteMuteUpdate(meeting, true, true);
121
+
122
+ assert.isTrue(audio.isRemotelyMuted());
123
+ assert.isTrue(audio.isLocallyMuted());
124
+
125
+ // mutes local
126
+ assert.calledOnceWithExactly(setServerMutedSpy, true, 'remotelyMuted');
127
+
128
+ setServerMutedSpy.resetHistory();
129
+
130
+ // simulate remote unmute
131
+ audio.handleServerRemoteMuteUpdate(meeting, false, true);
132
+
133
+ assert.isFalse(audio.isRemotelyMuted());
134
+ assert.isTrue(audio.isLocallyMuted());
135
+
136
+ // does not unmute local
137
+ assert.notCalled(setServerMutedSpy);
138
+ });
139
+
116
140
  it('does local audio unmute if localAudioUnmuteRequired is received', async () => {
117
141
  // first we need to have the local stream user muted
118
142
  meeting.mediaProperties.audioStream.userMuted = true;
@@ -1,7 +1,7 @@
1
1
  import {assert} from '@webex/test-helper-chai';
2
2
  import sinon from 'sinon';
3
3
  import MockWebex from '@webex/test-helper-mock-webex';
4
- import {_MEETING_ID_} from '@webex/plugin-meetings/src/constants';
4
+ import {DESTINATION_TYPE} from '@webex/plugin-meetings/src/constants';
5
5
 
6
6
  import MeetingInfo from '@webex/plugin-meetings/src/meeting-info/index';
7
7
  import MeetingInfoUtil from '@webex/plugin-meetings/src/meeting-info/util';
@@ -34,7 +34,7 @@ describe('plugin-meetings', () => {
34
34
  .resolves({type: 'MEETING_ID', destination: '123456'});
35
35
  sinon.stub(MeetingInfoRequest.prototype, 'fetchMeetingInfo').returns(Promise.resolve(confIdStrProp ? bodyConfIdStr : body));
36
36
 
37
- await meetingInfo.fetchMeetingInfo('1234323', _MEETING_ID_, null, null, null, null, null, {
37
+ await meetingInfo.fetchMeetingInfo('1234323', DESTINATION_TYPE.MEETING_ID, null, null, null, null, null, {
38
38
  meetingId,
39
39
  sendCAevents,
40
40
  });
@@ -113,7 +113,7 @@ describe('plugin-meetings', () => {
113
113
  try {
114
114
  await meetingInfo.fetchMeetingInfo(
115
115
  '1234323',
116
- _MEETING_ID_,
116
+ DESTINATION_TYPE.MEETING_ID,
117
117
  null,
118
118
  null,
119
119
  null,
@@ -196,7 +196,7 @@ describe('plugin-meetings', () => {
196
196
  try {
197
197
  await meetingInfo.fetchMeetingInfo(
198
198
  '1234323',
199
- _MEETING_ID_,
199
+ DESTINATION_TYPE.MEETING_ID,
200
200
  null,
201
201
  null,
202
202
  null,
@@ -8,12 +8,8 @@ import MockWebex from '@webex/test-helper-mock-webex';
8
8
  import Device from '@webex/internal-plugin-device';
9
9
  import Mercury from '@webex/internal-plugin-mercury';
10
10
  import {
11
- _MEETING_ID_,
12
- _PERSONAL_ROOM_,
13
- _CONVERSATION_URL_,
14
- _SIP_URI_,
11
+ DESTINATION_TYPE,
15
12
  WBXAPPAPI_SERVICE,
16
- _LOCUS_ID_,
17
13
  } from '@webex/plugin-meetings/src/constants';
18
14
 
19
15
  import Meetings from '@webex/plugin-meetings/src/meetings';
@@ -108,7 +104,7 @@ describe('plugin-meetings', () => {
108
104
  webex.request.resolves(requestResponse);
109
105
 
110
106
  const result = await meetingInfo.fetchMeetingInfo({
111
- type: _MEETING_ID_,
107
+ type: DESTINATION_TYPE.MEETING_ID,
112
108
  destination: '1234323',
113
109
  });
114
110
 
@@ -135,7 +131,7 @@ describe('plugin-meetings', () => {
135
131
  webex.request.resolves(requestResponse);
136
132
 
137
133
  const result = await meetingInfo.fetchMeetingInfo({
138
- type: _PERSONAL_ROOM_,
134
+ type: DESTINATION_TYPE.PERSONAL_ROOM,
139
135
  });
140
136
 
141
137
  assert.calledWith(webex.request, {
@@ -156,21 +152,21 @@ describe('plugin-meetings', () => {
156
152
 
157
153
  sinon
158
154
  .stub(MeetingInfoUtil, 'getDestinationType')
159
- .returns(Promise.resolve({type: _SIP_URI_, destination: 'example@something.webex.com'}));
155
+ .returns(Promise.resolve({type: DESTINATION_TYPE.SIP_URI, destination: 'example@something.webex.com'}));
160
156
  sinon.stub(MeetingInfoUtil, 'getRequestBody').returns(Promise.resolve(body));
161
157
  sinon.stub(MeetingInfoUtil, 'getDirectMeetingInfoURI').returns('https://example.com');
162
158
  webex.request.resolves(requestResponse);
163
159
 
164
- const result = await meetingInfo.fetchMeetingInfo('example@something.webex.com', _SIP_URI_);
160
+ const result = await meetingInfo.fetchMeetingInfo('example@something.webex.com', DESTINATION_TYPE.SIP_URI);
165
161
 
166
162
  assert.calledWith(MeetingInfoUtil.getDestinationType, {
167
163
  destination: 'example@something.webex.com',
168
- type: _SIP_URI_,
164
+ type: DESTINATION_TYPE.SIP_URI,
169
165
  webex,
170
166
  });
171
167
  assert.calledWith(MeetingInfoUtil.getDirectMeetingInfoURI, {
172
168
  destination: 'example@something.webex.com',
173
- type: _SIP_URI_,
169
+ type: DESTINATION_TYPE.SIP_URI,
174
170
  });
175
171
  assert.calledWith(webex.request, {
176
172
  method: 'POST',
@@ -189,7 +185,7 @@ describe('plugin-meetings', () => {
189
185
 
190
186
  webex.request.resolves(requestResponse);
191
187
 
192
- const result = await meetingInfo.fetchMeetingInfo('1234323', _MEETING_ID_, 'abc', {
188
+ const result = await meetingInfo.fetchMeetingInfo('1234323', DESTINATION_TYPE.MEETING_ID, 'abc', {
193
189
  id: '999',
194
190
  code: 'aabbcc11',
195
191
  });
@@ -221,7 +217,7 @@ describe('plugin-meetings', () => {
221
217
 
222
218
  webex.request.resolves(requestResponse);
223
219
 
224
- const result = await meetingInfo.fetchMeetingInfo('1234323', _MEETING_ID_, null, null, installedOrgID);
220
+ const result = await meetingInfo.fetchMeetingInfo('1234323', DESTINATION_TYPE.MEETING_ID, null, null, installedOrgID);
225
221
 
226
222
  assert.calledWith(webex.request, {
227
223
  method: 'POST',
@@ -248,7 +244,7 @@ describe('plugin-meetings', () => {
248
244
 
249
245
  webex.request.resolves(requestResponse);
250
246
 
251
- const result = await meetingInfo.fetchMeetingInfo('1234323', _MEETING_ID_, null, null, null, locusId);
247
+ const result = await meetingInfo.fetchMeetingInfo('1234323', DESTINATION_TYPE.MEETING_ID, null, null, null, locusId);
252
248
 
253
249
  assert.calledWith(webex.request, {
254
250
  method: 'POST',
@@ -275,7 +271,7 @@ describe('plugin-meetings', () => {
275
271
 
276
272
  webex.request.resolves(requestResponse);
277
273
 
278
- const result = await meetingInfo.fetchMeetingInfo('1234323', _MEETING_ID_, null, null, null, null, extraParams);
274
+ const result = await meetingInfo.fetchMeetingInfo('1234323', DESTINATION_TYPE.MEETING_ID, null, null, null, null, extraParams);
279
275
 
280
276
  assert.calledWith(webex.request, {
281
277
  method: 'POST',
@@ -298,7 +294,7 @@ describe('plugin-meetings', () => {
298
294
 
299
295
  it('create adhoc meeting when conversationUrl passed with enableAdhocMeetings toggle', async () => {
300
296
  sinon.stub(meetingInfo, 'createAdhocSpaceMeeting').returns(Promise.resolve());
301
- await meetingInfo.fetchMeetingInfo('conversationUrl', _CONVERSATION_URL_);
297
+ await meetingInfo.fetchMeetingInfo('conversationUrl', DESTINATION_TYPE.CONVERSATION_URL);
302
298
 
303
299
  assert.calledWith(meetingInfo.createAdhocSpaceMeeting, 'conversationUrl');
304
300
  assert.notCalled(webex.request);
@@ -312,7 +308,7 @@ describe('plugin-meetings', () => {
312
308
 
313
309
  await meetingInfo.fetchMeetingInfo(
314
310
  'conversationUrl',
315
- _CONVERSATION_URL_,
311
+ DESTINATION_TYPE.CONVERSATION_URL,
316
312
  null,
317
313
  null,
318
314
  installedOrgID
@@ -332,7 +328,7 @@ describe('plugin-meetings', () => {
332
328
  webex.config.meetings.experimental.enableAdhocMeetings = false;
333
329
  sinon.stub(meetingInfo, 'createAdhocSpaceMeeting').returns(Promise.resolve());
334
330
 
335
- await meetingInfo.fetchMeetingInfo('conversationUrl', _CONVERSATION_URL_);
331
+ await meetingInfo.fetchMeetingInfo('conversationUrl', DESTINATION_TYPE.CONVERSATION_URL);
336
332
 
337
333
  assert.notCalled(meetingInfo.createAdhocSpaceMeeting);
338
334
  assert.called(webex.request);
@@ -343,7 +339,7 @@ describe('plugin-meetings', () => {
343
339
  sinon.stub(meetingInfo, 'createAdhocSpaceMeeting').returns(Promise.resolve());
344
340
  webex.meetings.preferredWebexSite = undefined;
345
341
 
346
- await meetingInfo.fetchMeetingInfo('conversationUrl', _CONVERSATION_URL_);
342
+ await meetingInfo.fetchMeetingInfo('conversationUrl', DESTINATION_TYPE.CONVERSATION_URL);
347
343
 
348
344
  assert.notCalled(meetingInfo.createAdhocSpaceMeeting);
349
345
  assert.called(webex.request);
@@ -406,7 +402,7 @@ describe('plugin-meetings', () => {
406
402
  try {
407
403
  await meetingInfo.fetchMeetingInfo(
408
404
  '1234323',
409
- _MEETING_ID_,
405
+ DESTINATION_TYPE.MEETING_ID,
410
406
  'abc',
411
407
  {
412
408
  id: '999',
@@ -493,7 +489,7 @@ describe('plugin-meetings', () => {
493
489
 
494
490
  const result = await meetingInfo.fetchMeetingInfo(
495
491
  '1234323',
496
- _MEETING_ID_,
492
+ DESTINATION_TYPE.MEETING_ID,
497
493
  null,
498
494
  null,
499
495
  null,
@@ -566,7 +562,7 @@ describe('plugin-meetings', () => {
566
562
 
567
563
  const result = await meetingInfo.fetchMeetingInfo(
568
564
  '1234323',
569
- _MEETING_ID_,
565
+ DESTINATION_TYPE.MEETING_ID,
570
566
  null,
571
567
  null,
572
568
  null,
@@ -642,7 +638,7 @@ describe('plugin-meetings', () => {
642
638
  try {
643
639
  await meetingInfo.fetchMeetingInfo(
644
640
  '1234323',
645
- _MEETING_ID_,
641
+ DESTINATION_TYPE.MEETING_ID,
646
642
  'abc',
647
643
  {
648
644
  id: '999',
@@ -670,7 +666,7 @@ describe('plugin-meetings', () => {
670
666
  .rejects({statusCode: 403, body: {code: 403000, data: {meetingInfo: FAKE_MEETING_INFO}}});
671
667
 
672
668
  try {
673
- await meetingInfo.fetchMeetingInfo('1234323', _MEETING_ID_, 'abc', {
669
+ await meetingInfo.fetchMeetingInfo('1234323', DESTINATION_TYPE.MEETING_ID, 'abc', {
674
670
  id: '999',
675
671
  code: 'aabbcc11',
676
672
  });
@@ -697,7 +693,7 @@ describe('plugin-meetings', () => {
697
693
  },
698
694
  });
699
695
  try {
700
- await meetingInfo.fetchMeetingInfo('1234323', _MEETING_ID_, 'abc', {
696
+ await meetingInfo.fetchMeetingInfo('1234323', DESTINATION_TYPE.MEETING_ID, 'abc', {
701
697
  id: '999',
702
698
  code: 'aabbcc11',
703
699
  });
@@ -739,13 +735,13 @@ describe('plugin-meetings', () => {
739
735
 
740
736
  sinon
741
737
  .stub(MeetingInfoUtil, 'getDestinationType')
742
- .returns(Promise.resolve({type: _LOCUS_ID_, destination: '123456'}));
738
+ .returns(Promise.resolve({type: DESTINATION_TYPE.LOCUS_ID, destination: '123456'}));
743
739
  sinon.stub(MeetingInfoUtil, 'getRequestBody').returns(Promise.resolve(body));
744
740
  webex.request.resolves(requestResponse);
745
741
 
746
742
  try {
747
743
  await meetingInfo.fetchMeetingInfo({
748
- type: _LOCUS_ID_,
744
+ type: DESTINATION_TYPE.LOCUS_ID,
749
745
  });
750
746
  assert.fail('fetchMeetingInfo should have thrown, but has not done that');
751
747
  } catch (err) {
@@ -754,7 +750,7 @@ describe('plugin-meetings', () => {
754
750
  BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_FAILURE,
755
751
  {
756
752
  reason: 'Not enough information to fetch meeting info',
757
- destinationType: _LOCUS_ID_,
753
+ destinationType: DESTINATION_TYPE.LOCUS_ID,
758
754
  webExMeetingId: undefined,
759
755
  sipUri: undefined,
760
756
  }
@@ -8,7 +8,7 @@ import MockWebex from '@webex/test-helper-mock-webex';
8
8
  import Device from '@webex/internal-plugin-device';
9
9
  import Mercury from '@webex/internal-plugin-mercury';
10
10
  import Meetings from '@webex/plugin-meetings/src/meetings';
11
- import {_LOCUS_ID_} from '@webex/plugin-meetings/src/constants';
11
+ import {DESTINATION_TYPE} from '@webex/plugin-meetings/src/constants';
12
12
 
13
13
  import MeetingInfoRequest from '../../../../src/meeting-info/request';
14
14
 
@@ -53,7 +53,7 @@ describe('plugin-meetings', () => {
53
53
 
54
54
  it('Should call request with valid parameter', () => {
55
55
  meetingInfoRequest.fetchMeetingInfo({
56
- type: _LOCUS_ID_,
56
+ type: DESTINATION_TYPE.LOCUS_ID,
57
57
  destination: 'locus_url',
58
58
  });
59
59
 
@@ -4,15 +4,7 @@
4
4
 
5
5
  import {assert, expect} from '@webex/test-helper-chai';
6
6
  import sinon from 'sinon';
7
- import {
8
- _MEETING_ID_,
9
- _SIP_URI_,
10
- _CONVERSATION_URL_,
11
- _MEETING_LINK_,
12
- _PERSONAL_ROOM_,
13
- _LOCUS_ID_,
14
- _MEETING_UUID_,
15
- } from '@webex/plugin-meetings/src/constants';
7
+ import {DESTINATION_TYPE} from '@webex/plugin-meetings/src/constants';
16
8
  import MeetingInfoUtil from '@webex/plugin-meetings/src/meeting-info/utilv2';
17
9
  import LoggerProxy from '@webex/plugin-meetings/src/common/logs/logger-proxy';
18
10
  import LoggerConfig from '@webex/plugin-meetings/src/common/logs/logger-config';
@@ -39,11 +31,11 @@ describe('plugin-meetings', () => {
39
31
  describe('#getDestinationType', () => {
40
32
  it('For destination with type', async () => {
41
33
  const res = await MeetingInfoUtil.getDestinationType({
42
- type: _MEETING_ID_,
34
+ type: DESTINATION_TYPE.MEETING_ID,
43
35
  destination: '1234323',
44
36
  });
45
37
 
46
- assert.equal(res.type, _MEETING_ID_);
38
+ assert.equal(res.type, DESTINATION_TYPE.MEETING_ID);
47
39
  assert.equal(res.destination, '1234323');
48
40
  });
49
41
 
@@ -52,7 +44,7 @@ describe('plugin-meetings', () => {
52
44
  destination: 'https://cisco.webex.com/meet/arungane',
53
45
  });
54
46
 
55
- assert.equal(res.type, _MEETING_LINK_);
47
+ assert.equal(res.type, DESTINATION_TYPE.MEETING_LINK);
56
48
  assert.equal(res.destination, 'https://cisco.webex.com/meet/arungane');
57
49
  });
58
50
 
@@ -61,7 +53,7 @@ describe('plugin-meetings', () => {
61
53
  destination: 'testing@webex.com',
62
54
  });
63
55
 
64
- assert.equal(res.type, _SIP_URI_);
56
+ assert.equal(res.type, DESTINATION_TYPE.SIP_URI);
65
57
  assert.equal(res.destination, 'testing@webex.com');
66
58
  });
67
59
 
@@ -70,7 +62,7 @@ describe('plugin-meetings', () => {
70
62
  destination: '+14252086070',
71
63
  });
72
64
 
73
- assert.equal(res.type, _SIP_URI_);
65
+ assert.equal(res.type, DESTINATION_TYPE.SIP_URI);
74
66
  assert.equal(res.destination, '+14252086070');
75
67
  });
76
68
 
@@ -80,7 +72,7 @@ describe('plugin-meetings', () => {
80
72
  destination: 'https://conv-a.wbx2.com/conversation/api/v1/conversations/bfb49280',
81
73
  });
82
74
 
83
- assert.equal(res.type, _CONVERSATION_URL_);
75
+ assert.equal(res.type, DESTINATION_TYPE.CONVERSATION_URL);
84
76
  assert.equal(
85
77
  res.destination,
86
78
  'https://conv-a.wbx2.com/conversation/api/v1/conversations/bfb49280'
@@ -104,7 +96,7 @@ describe('plugin-meetings', () => {
104
96
 
105
97
  it('should return a userID and orgID without passing a destination', async () => {
106
98
  const res = await MeetingInfoUtil.getDestinationType({
107
- type: _PERSONAL_ROOM_,
99
+ type: DESTINATION_TYPE.PERSONAL_ROOM,
108
100
  webex: {
109
101
  internal: {
110
102
  device: {
@@ -121,7 +113,7 @@ describe('plugin-meetings', () => {
121
113
 
122
114
  it('should return a userID and orgID when passing an email', async () => {
123
115
  const res = await MeetingInfoUtil.getDestinationType({
124
- type: _PERSONAL_ROOM_,
116
+ type: DESTINATION_TYPE.PERSONAL_ROOM,
125
117
  destination: 'amritesi@cisco.com',
126
118
  webex: {
127
119
  people: {list: sinon.stub().returns(mockedList)},
@@ -135,7 +127,7 @@ describe('plugin-meetings', () => {
135
127
 
136
128
  it('should return a userID and orgID when passing an id', async () => {
137
129
  const res = await MeetingInfoUtil.getDestinationType({
138
- type: _PERSONAL_ROOM_,
130
+ type: DESTINATION_TYPE.PERSONAL_ROOM,
139
131
  destination: '01824b9b-adef-4b10-b5c1-8a2fe2fb7c0e',
140
132
  webex: {
141
133
  people: {list: sinon.stub().returns(mockedList)},
@@ -151,9 +143,9 @@ describe('plugin-meetings', () => {
151
143
 
152
144
  describe('#getRequestBody', () => {
153
145
 
154
- it('for _PERSONAL_ROOM_', () => {
146
+ it('for DESTINATION_TYPE.PERSONAL_ROOM', () => {
155
147
  const res = MeetingInfoUtil.getRequestBody({
156
- type: _PERSONAL_ROOM_,
148
+ type: DESTINATION_TYPE.PERSONAL_ROOM,
157
149
  destination: {
158
150
  userId: '01824b9b-adef-4b10-b5c1-8a2fe2fb7c0e',
159
151
  orgId: '1eb65fdf-9643-417f-9974-ad72cae0e10f',
@@ -164,54 +156,54 @@ describe('plugin-meetings', () => {
164
156
  assert.equal(res.userId, '01824b9b-adef-4b10-b5c1-8a2fe2fb7c0e');
165
157
  });
166
158
 
167
- it('for _MEETING_ID_', () => {
159
+ it('for DESTINATION_TYPE.MEETING_ID', () => {
168
160
  const res = MeetingInfoUtil.getRequestBody({
169
- type: _MEETING_ID_,
161
+ type: DESTINATION_TYPE.MEETING_ID,
170
162
  destination: '1234323',
171
163
  });
172
164
 
173
165
  assert.equal(res.meetingKey, '1234323');
174
166
  });
175
167
 
176
- it('for _MEETING_LINK_', () => {
168
+ it('for DESTINATION_TYPE.MEETING_LINK', () => {
177
169
  const res = MeetingInfoUtil.getRequestBody({
178
- type: _MEETING_LINK_,
170
+ type: DESTINATION_TYPE.MEETING_LINK,
179
171
  destination: 'https://cisco.webex.com/meet/arungane',
180
172
  });
181
173
 
182
174
  assert.equal(res.meetingUrl, 'https://cisco.webex.com/meet/arungane');
183
175
  });
184
176
 
185
- it('for _SIP_URI_', () => {
177
+ it('for DESTINATION_TYPE.SIP_URI', () => {
186
178
  const res = MeetingInfoUtil.getRequestBody({
187
- type: _SIP_URI_,
179
+ type: DESTINATION_TYPE.SIP_URI,
188
180
  destination: 'testing@webex.com',
189
181
  });
190
182
 
191
183
  assert.equal(res.sipUrl, 'testing@webex.com');
192
184
  });
193
185
 
194
- it('for _MEETING_UUID_', () => {
186
+ it('for DESTINATION_TYPE.MEETING_UUID', () => {
195
187
  const res = MeetingInfoUtil.getRequestBody({
196
- type: _MEETING_UUID_,
188
+ type: DESTINATION_TYPE.MEETING_UUID,
197
189
  destination: 'xsddsdsdsdssdsdsdsdsd',
198
190
  });
199
191
 
200
192
  assert.equal(res.meetingUUID, 'xsddsdsdsdssdsdsdsdsd');
201
193
  });
202
194
 
203
- it('for _LOCUS_ID_', () => {
195
+ it('for DESTINATION_TYPE.LOCUS_ID', () => {
204
196
  const res = MeetingInfoUtil.getRequestBody({
205
- type: _LOCUS_ID_,
197
+ type: DESTINATION_TYPE.LOCUS_ID,
206
198
  destination: {info: {webExMeetingId: '123456'}},
207
199
  });
208
200
 
209
201
  assert.equal(res.meetingKey, '123456');
210
202
  });
211
203
 
212
- it('for _CONVERSATION_URL_', () => {
204
+ it('for DESTINATION_TYPE.CONVERSATION_URL', () => {
213
205
  const res = MeetingInfoUtil.getRequestBody({
214
- type: _CONVERSATION_URL_,
206
+ type: DESTINATION_TYPE.CONVERSATION_URL,
215
207
  destination: 'https://conv-a.wbx2.com/conversation/api/v1/conversations/bfb49280',
216
208
  });
217
209
 
@@ -225,7 +217,7 @@ describe('plugin-meetings', () => {
225
217
  const extraParams = {mtid: 'm9fe0afd8c435e892afcce9ea25b97046', joinTXId: 'TSmrX61wNF'}
226
218
 
227
219
  const res = MeetingInfoUtil.getRequestBody({
228
- type: _CONVERSATION_URL_,
220
+ type: DESTINATION_TYPE.CONVERSATION_URL,
229
221
  destination: 'https://conv-a.wbx2.com/conversation/api/v1/conversations/bfb49281',
230
222
  extraParams,
231
223
  });
@@ -264,20 +256,20 @@ describe('plugin-meetings', () => {
264
256
  });
265
257
 
266
258
  describe('#getDirectMeetingInfoURI', () => {
267
- it('for _SIP_URI_', () => {
259
+ it('for DESTINATION_TYPE.SIP_URI', () => {
268
260
  assert.equal(
269
261
  MeetingInfoUtil.getDirectMeetingInfoURI({
270
- type: _SIP_URI_,
262
+ type: DESTINATION_TYPE.SIP_URI,
271
263
  destination: 'testing@convergedats.webex.com',
272
264
  }),
273
265
  'https://convergedats.webex.com/wbxappapi/v1/meetingInfo'
274
266
  );
275
267
  });
276
268
 
277
- it('for _LOCUS_ID_ with webExSite', () => {
269
+ it('for DESTINATION_TYPE.LOCUS_ID with webExSite', () => {
278
270
  assert.equal(
279
271
  MeetingInfoUtil.getDirectMeetingInfoURI({
280
- type: _LOCUS_ID_,
272
+ type: DESTINATION_TYPE.LOCUS_ID,
281
273
  destination: {
282
274
  info: {
283
275
  webExMeetingId: '123456',
@@ -290,10 +282,10 @@ describe('plugin-meetings', () => {
290
282
  });
291
283
 
292
284
  // null means fall back to default meeting info URI
293
- it('for _PERSONAL_ROOM_', () => {
285
+ it('for DESTINATION_TYPE.PERSONAL_ROOM', () => {
294
286
  assert.equal(
295
287
  MeetingInfoUtil.getDirectMeetingInfoURI({
296
- type: _PERSONAL_ROOM_,
288
+ type: DESTINATION_TYPE.PERSONAL_ROOM,
297
289
  destination: {
298
290
  userId: '01824b9b-adef-4b10-b5c1-8a2fe2fb7c0e',
299
291
  orgId: '1eb65fdf-9643-417f-9974-ad72cae0e10f',
@@ -303,50 +295,50 @@ describe('plugin-meetings', () => {
303
295
  );
304
296
  });
305
297
 
306
- it('for _MEETING_ID_', () => {
298
+ it('for DESTINATION_TYPE.MEETING_ID', () => {
307
299
  assert.equal(
308
300
  MeetingInfoUtil.getDirectMeetingInfoURI({
309
- type: _MEETING_ID_,
301
+ type: DESTINATION_TYPE.MEETING_ID,
310
302
  destination: '1234323',
311
303
  }),
312
304
  null
313
305
  );
314
306
  });
315
307
 
316
- it('for _MEETING_UUID_', () => {
308
+ it('for DESTINATION_TYPE.MEETING_UUID', () => {
317
309
  assert.equal(
318
310
  MeetingInfoUtil.getDirectMeetingInfoURI({
319
- type: _MEETING_UUID_,
311
+ type: DESTINATION_TYPE.MEETING_UUID,
320
312
  destination: 'xsddsdsdsdssdsdsdsdsd',
321
313
  }),
322
314
  null
323
315
  );
324
316
  });
325
317
 
326
- it('for _LOCUS_ID_ with sipUri with excepted domain', () => {
318
+ it('for DESTINATION_TYPE.LOCUS_ID with sipUri with excepted domain', () => {
327
319
  assert.equal(
328
320
  MeetingInfoUtil.getDirectMeetingInfoURI({
329
- type: _LOCUS_ID_,
321
+ type: DESTINATION_TYPE.LOCUS_ID,
330
322
  destination: {info: {webExMeetingId: '123456', sipUri: 'testing@meetup.webex.com'}},
331
323
  }),
332
324
  null
333
325
  );
334
326
  });
335
327
 
336
- it('for _CONVERSATION_URL_', () => {
328
+ it('for DESTINATION_TYPE.CONVERSATION_URL', () => {
337
329
  assert.equal(
338
330
  MeetingInfoUtil.getDirectMeetingInfoURI({
339
- type: _CONVERSATION_URL_,
331
+ type: DESTINATION_TYPE.CONVERSATION_URL,
340
332
  destination: 'https://conv-a.wbx2.com/conversation/api/v1/conversations/bfb49280',
341
333
  }),
342
334
  null
343
335
  );
344
336
  });
345
337
 
346
- it('for _SIP_URI_ with an email address', () => {
338
+ it('for DESTINATION_TYPE.SIP_URI with an email address', () => {
347
339
  assert.equal(
348
340
  MeetingInfoUtil.getDirectMeetingInfoURI({
349
- type: _SIP_URI_,
341
+ type: DESTINATION_TYPE.SIP_URI,
350
342
  destination: 'testing@email.com',
351
343
  }),
352
344
  null
@@ -35,6 +35,7 @@ import {
35
35
  ROAP,
36
36
  LOCUSINFO,
37
37
  EVENT_TRIGGERS,
38
+ DESTINATION_TYPE,
38
39
  } from '../../../../src/constants';
39
40
  import CaptchaError from '@webex/plugin-meetings/src/common/errors/captcha-error';
40
41
  import {forEach} from 'lodash';
@@ -1782,6 +1783,19 @@ describe('plugin-meetings', () => {
1782
1783
  it('creates the meeting from a rejected meeting info fetch and destroys it if failOnMissingMeetingInfo', async () => {
1783
1784
  checkCreateMeetingWithNoMeetingInfo(true, true);
1784
1785
  });
1786
+
1787
+ it('creates the meeting avoiding meeting info fetch by passing type as DESTINATION_TYPE.ONE_ON_ONE_CALL', async () => {
1788
+ const meeting = await webex.meetings.createMeeting('test destination', DESTINATION_TYPE.ONE_ON_ONE_CALL);
1789
+
1790
+ assert.instanceOf(
1791
+ meeting,
1792
+ Meeting,
1793
+ 'createMeeting should eventually resolve to a Meeting Object'
1794
+ );
1795
+
1796
+ assert.notCalled(webex.meetings.meetingInfo.fetchMeetingInfo);
1797
+ });
1798
+
1785
1799
  });
1786
1800
 
1787
1801
  describe('rejected MeetingInfo.#fetchMeetingInfo - does not log for known Error types', () => {