@webex/plugin-meetings 1.143.2 → 1.144.2

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 (39) hide show
  1. package/dist/config.js +2 -1
  2. package/dist/config.js.map +1 -1
  3. package/dist/constants.js +4 -2
  4. package/dist/constants.js.map +1 -1
  5. package/dist/locus-info/index.js +3 -1
  6. package/dist/locus-info/index.js.map +1 -1
  7. package/dist/locus-info/infoUtils.js +4 -0
  8. package/dist/locus-info/infoUtils.js.map +1 -1
  9. package/dist/meeting/index.js +12 -11
  10. package/dist/meeting/index.js.map +1 -1
  11. package/dist/meeting/request.js +39 -9
  12. package/dist/meeting/request.js.map +1 -1
  13. package/dist/meeting/util.js +2 -1
  14. package/dist/meeting/util.js.map +1 -1
  15. package/dist/meeting-info/meeting-info-v2.js +119 -0
  16. package/dist/meeting-info/meeting-info-v2.js.map +1 -0
  17. package/dist/meeting-info/utilv2.js +332 -0
  18. package/dist/meeting-info/utilv2.js.map +1 -0
  19. package/dist/meetings/index.js +5 -1
  20. package/dist/meetings/index.js.map +1 -1
  21. package/dist/metrics/config.js +1 -1
  22. package/dist/metrics/config.js.map +1 -1
  23. package/package.json +5 -5
  24. package/src/config.js +2 -1
  25. package/src/constants.js +1 -0
  26. package/src/locus-info/index.js +1 -1
  27. package/src/locus-info/infoUtils.js +4 -0
  28. package/src/meeting/index.js +8 -11
  29. package/src/meeting/request.js +16 -2
  30. package/src/meeting/util.js +2 -1
  31. package/src/meeting-info/meeting-info-v2.js +58 -0
  32. package/src/meeting-info/utilv2.js +231 -0
  33. package/src/meetings/index.js +6 -1
  34. package/src/metrics/config.js +1 -1
  35. package/test/integration/spec/space-meeting.js +11 -0
  36. package/test/unit/spec/locus-info/index.js +40 -1
  37. package/test/unit/spec/meeting/index.js +2 -0
  38. package/test/unit/spec/meeting-info/meetinginfov2.js +68 -0
  39. package/test/unit/spec/meeting-info/utilv2.js +139 -0
@@ -57,6 +57,17 @@ skipInNode(describe)('plugin-meetings', () => {
57
57
  {scope: chris.webex.meetings, event: 'meeting:added', user: chris}])
58
58
  ])));
59
59
 
60
+ // Enable this test when we are going to enable the unified space meeeting .
61
+ // We cannot change the config on load as the meetingInfo function loads dynamically
62
+ xit('Should fetch meeting Info using the new api', async () => {
63
+ alice.webex.meetings.config.experimental.enableUnifiedMeetings = true;
64
+ const res = await alice.webex.meetings.meetingInfo.fetchMeetingInfo(space.url, 'CONVERSATION_URL');
65
+
66
+ assert.exists(res.meetingNumber);
67
+
68
+ alice.webex.meetings.config.experimental.enableUnifiedMeetings = false;
69
+ });
70
+
60
71
  it('Bob and chris joins space meeting', () => testUtils.waitForStateChange(alice.meeting, 'JOINED')
61
72
  .then(() => testUtils.waitForStateChange(bob.meeting, 'IDLE'))
62
73
  .then(() => testUtils.waitForStateChange(chris.meeting, 'IDLE'))
@@ -10,7 +10,8 @@ import LocusDeltaParser from '@webex/plugin-meetings/src/locus-info/parser';
10
10
  import {
11
11
  LOCUSINFO,
12
12
  RECORDING_STATE,
13
- LOCUSEVENT
13
+ LOCUSEVENT,
14
+ EVENTS
14
15
  } from '../../../../src/constants';
15
16
 
16
17
  import {self, selfWithInactivity} from './selfConstant';
@@ -267,6 +268,44 @@ describe('plugin-meetings', () => {
267
268
  ];
268
269
  });
269
270
 
271
+ it('should assert that the correct recordingId, selfIdentity, selfId, and hostId are being set and emitted from updateParticipants', () => {
272
+ locusInfo.parsedLocus = {
273
+ controls: {
274
+ record: {
275
+ modifiedBy: '1'
276
+ }
277
+ },
278
+ self: {
279
+ selfIdentity: '123',
280
+ selfId: '2'
281
+ },
282
+ host: {
283
+ hostId: '3'
284
+ }
285
+ };
286
+ locusInfo.emitScoped = sinon.stub();
287
+ locusInfo.updateParticipants({});
288
+
289
+ // if this assertion fails, double-check the attributes used in
290
+ // the updateParticipants function in locus-info/index.js
291
+ assert.calledWith(locusInfo.emitScoped,
292
+ {
293
+ file: 'locus-info',
294
+ function: 'updateParticipants'
295
+ },
296
+ EVENTS.LOCUS_INFO_UPDATE_PARTICIPANTS,
297
+ {
298
+ participants: {},
299
+ recordingId: '1',
300
+ selfIdentity: '123',
301
+ selfId: '2',
302
+ hostId: '3'
303
+ });
304
+ // note: in a real use case, recordingId, selfId, and hostId would all be the same
305
+ // for this specific test, we are double-checking that each of the id's
306
+ // are being correctly grabbed from locusInfo.parsedLocus within updateParticipants
307
+ });
308
+
270
309
  it('should update the deltaParticipants object', () => {
271
310
  const prev = locusInfo.deltaParticipants;
272
311
 
@@ -2387,6 +2387,8 @@ describe('plugin-meetings', () => {
2387
2387
  });
2388
2388
  describe('#parseMeetingInfo', () => {
2389
2389
  it('should parse meeting info, set values, and return null', () => {
2390
+ meeting.config.experimental = {enableMediaNegotiatedEvent: true};
2391
+
2390
2392
  meeting.parseMeetingInfo({
2391
2393
  body: {
2392
2394
  conversationUrl: uuid1,
@@ -0,0 +1,68 @@
1
+ /*!
2
+ * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
+ */
4
+
5
+ import {assert} from '@webex/test-helper-chai';
6
+ import sinon from 'sinon';
7
+ import MockWebex from '@webex/test-helper-mock-webex';
8
+ import Device from '@webex/internal-plugin-device';
9
+ import Mercury from '@webex/internal-plugin-mercury';
10
+ import Meetings from '@webex/plugin-meetings/src/meetings';
11
+ import {
12
+ _MEETING_ID_
13
+ } from '@webex/plugin-meetings/src/constants';
14
+ import MeetingInfo from '@webex/plugin-meetings/src/meeting-info/meeting-info-v2';
15
+ import MeetingInfoUtil from '@webex/plugin-meetings/src/meeting-info/utilv2';
16
+
17
+ describe('plugin-meetings', () => {
18
+ let webex;
19
+ let meetingInfo = null;
20
+
21
+ describe('Meeting Info V2', () => {
22
+ beforeEach(() => {
23
+ webex = new MockWebex({
24
+ children: {
25
+ device: Device,
26
+ mercury: Mercury,
27
+ meetings: Meetings
28
+ }
29
+ });
30
+
31
+ Object.assign(webex.internal, {
32
+ device: {
33
+ deviceType: 'FAKE_DEVICE',
34
+ register: sinon.stub().returns(Promise.resolve()),
35
+ unregister: sinon.stub().returns(Promise.resolve())
36
+ },
37
+ mercury: {
38
+ connect: sinon.stub().returns(Promise.resolve()),
39
+ disconnect: sinon.stub().returns(Promise.resolve()),
40
+ on: () => {},
41
+ off: () => {}
42
+ }
43
+ });
44
+
45
+
46
+ meetingInfo = new MeetingInfo(webex);
47
+ });
48
+
49
+ describe('#fetchMeetingInfo', () => {
50
+ it('should fetch meeting info for the destination type', async () => {
51
+ sinon.stub(MeetingInfoUtil, 'getDestinationType').returns(Promise.resolve({type: 'MEETING_ID', destination: '123456'}));
52
+ sinon.stub(MeetingInfoUtil, 'getRequestBody').returns(Promise.resolve({meetingKey: '1234323'}));
53
+
54
+ await meetingInfo.fetchMeetingInfo({
55
+ type: _MEETING_ID_,
56
+ destination: '1234323'
57
+ });
58
+
59
+ assert.calledWith(webex.request, {
60
+ method: 'POST', service: 'webex-appapi-service', resource: 'meetingInfo', body: {meetingKey: '1234323'}
61
+ });
62
+
63
+ MeetingInfoUtil.getDestinationType.restore();
64
+ MeetingInfoUtil.getRequestBody.restore();
65
+ });
66
+ });
67
+ });
68
+ });
@@ -0,0 +1,139 @@
1
+ /*!
2
+ * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
+ */
4
+
5
+ import {assert} from '@webex/test-helper-chai';
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';
16
+ import MeetingInfoUtil from '@webex/plugin-meetings/src/meeting-info/utilv2';
17
+
18
+ describe('plugin-meetings', () => {
19
+ describe('Meeting Info Utils V2', () => {
20
+ beforeEach(() => {
21
+ MeetingInfoUtil.getHydraId = sinon.stub().returns(false);
22
+ });
23
+
24
+ describe('#getDestinationType', () => {
25
+ it('For destination with type', async () => {
26
+ const res = await MeetingInfoUtil.getDestinationType({
27
+ type: _MEETING_ID_,
28
+ destination: '1234323'
29
+ });
30
+
31
+ assert.equal(res.type, _MEETING_ID_);
32
+ assert.equal(res.destination, '1234323');
33
+ });
34
+
35
+ it('for meeting link', async () => {
36
+ const res = await MeetingInfoUtil.getDestinationType({
37
+ destination: 'https://cisco.webex.com/meet/arungane'
38
+ });
39
+
40
+ assert.equal(res.type, _MEETING_LINK_);
41
+ assert.equal(res.destination, 'https://cisco.webex.com/meet/arungane');
42
+ });
43
+
44
+ it('for sip url', async () => {
45
+ const res = await MeetingInfoUtil.getDestinationType({
46
+ destination: 'testing@webex.com'
47
+ });
48
+
49
+ assert.equal(res.type, _SIP_URI_);
50
+ assert.equal(res.destination, 'testing@webex.com');
51
+ });
52
+
53
+ it('for phone number', async () => {
54
+ const res = await MeetingInfoUtil.getDestinationType({
55
+ destination: '+14252086070'
56
+ });
57
+
58
+ assert.equal(res.type, _SIP_URI_);
59
+ assert.equal(res.destination, '+14252086070');
60
+ });
61
+
62
+ it('for conversation url ', async () => {
63
+ MeetingInfoUtil.isConversationUrl = sinon.stub().returns(true);
64
+ const res = await MeetingInfoUtil.getDestinationType({
65
+ destination: 'https://conv-a.wbx2.com/conversation/api/v1/conversations/bfb49280'
66
+ });
67
+
68
+ assert.equal(res.type, _CONVERSATION_URL_);
69
+ assert.equal(res.destination, 'https://conv-a.wbx2.com/conversation/api/v1/conversations/bfb49280');
70
+ });
71
+ });
72
+
73
+ describe('#getRequestBody', () => {
74
+ it('for _PERSONAL_ROOM_', () => {
75
+ const res = MeetingInfoUtil.getRequestBody({
76
+ type: _PERSONAL_ROOM_,
77
+ destination: 'userId_1234'
78
+ });
79
+
80
+ assert.equal(res.orgId, '');
81
+ assert.equal(res.userId, 'userId_1234');
82
+ });
83
+
84
+ it('for _MEETING_ID_', () => {
85
+ const res = MeetingInfoUtil.getRequestBody({
86
+ type: _MEETING_ID_,
87
+ destination: '1234323'
88
+ });
89
+
90
+ assert.equal(res.meetingKey, '1234323');
91
+ });
92
+
93
+ it('for _MEETING_LINK_', () => {
94
+ const res = MeetingInfoUtil.getRequestBody({
95
+ type: _MEETING_LINK_,
96
+ destination: 'https://cisco.webex.com/meet/arungane'
97
+ });
98
+
99
+ assert.equal(res.meetingUrl, 'https://cisco.webex.com/meet/arungane');
100
+ });
101
+
102
+ it('for _SIP_URI_', () => {
103
+ const res = MeetingInfoUtil.getRequestBody({
104
+ type: _SIP_URI_,
105
+ destination: 'testing@webex.com'
106
+ });
107
+
108
+ assert.equal(res.sipUrl, 'testing@webex.com');
109
+ });
110
+
111
+ it('for _MEETING_UUID_', () => {
112
+ const res = MeetingInfoUtil.getRequestBody({
113
+ type: _MEETING_UUID_,
114
+ destination: 'xsddsdsdsdssdsdsdsdsd'
115
+ });
116
+
117
+ assert.equal(res.meetingUUID, 'xsddsdsdsdssdsdsdsdsd');
118
+ });
119
+
120
+ it('for _LOCUS_ID_', () => {
121
+ const res = MeetingInfoUtil.getRequestBody({
122
+ type: _LOCUS_ID_,
123
+ destination: {info: {webExMeetingId: '123456'}}
124
+ });
125
+
126
+ assert.equal(res.meetingKey, '123456');
127
+ });
128
+
129
+ it('for _CONVERSATION_URL_', () => {
130
+ const res = MeetingInfoUtil.getRequestBody({
131
+ type: _CONVERSATION_URL_,
132
+ destination: 'https://conv-a.wbx2.com/conversation/api/v1/conversations/bfb49280'
133
+ });
134
+
135
+ assert.equal(res.conversationUrl, 'https://conv-a.wbx2.com/conversation/api/v1/conversations/bfb49280');
136
+ });
137
+ });
138
+ });
139
+ });