@webex/plugin-meetings 3.12.0-next.49 → 3.12.0-next.50
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.
- package/dist/aiEnableRequest/index.js +1 -1
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/meetings/index.js +25 -0
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js +6 -1
- package/dist/meetings/meetings.types.js.map +1 -1
- package/dist/meetings/request.js +39 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +18 -0
- package/dist/meetings/util.js.map +1 -1
- package/dist/types/config.d.ts +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/meetings/index.d.ts +18 -1
- package/dist/types/meetings/meetings.types.d.ts +15 -0
- package/dist/types/meetings/request.d.ts +14 -0
- package/dist/webinar/index.js +1 -1
- package/package.json +1 -1
- package/src/config.ts +1 -0
- package/src/index.ts +5 -0
- package/src/meetings/index.ts +27 -0
- package/src/meetings/meetings.types.ts +19 -0
- package/src/meetings/request.ts +43 -0
- package/src/meetings/util.ts +24 -0
- package/test/unit/spec/meetings/index.js +83 -0
- package/test/unit/spec/meetings/request.js +141 -0
- package/test/unit/spec/meetings/utils.js +24 -0
|
@@ -14,12 +14,14 @@ import StaticConfig from '@webex/plugin-meetings/src/common/config';
|
|
|
14
14
|
import TriggerProxy from '@webex/plugin-meetings/src/common/events/trigger-proxy';
|
|
15
15
|
import LoggerProxy from '@webex/plugin-meetings/src/common/logs/logger-proxy';
|
|
16
16
|
import LoggerConfig from '@webex/plugin-meetings/src/common/logs/logger-config';
|
|
17
|
+
import ParameterError from '@webex/plugin-meetings/src/common/errors/parameter';
|
|
17
18
|
import Meeting, {CallStateForMetrics} from '@webex/plugin-meetings/src/meeting';
|
|
18
19
|
import {Services} from '@webex/webex-core';
|
|
19
20
|
import MeetingUtil from '@webex/plugin-meetings/src/meeting/util';
|
|
20
21
|
import Meetings from '@webex/plugin-meetings/src/meetings';
|
|
21
22
|
import MeetingCollection from '@webex/plugin-meetings/src/meetings/collection';
|
|
22
23
|
import MeetingsUtil from '@webex/plugin-meetings/src/meetings/util';
|
|
24
|
+
import {SitePreferenceSelectOption} from '@webex/plugin-meetings/src/meetings/meetings.types';
|
|
23
25
|
import PersonalMeetingRoom from '@webex/plugin-meetings/src/personal-meeting-room';
|
|
24
26
|
import Reachability from '@webex/plugin-meetings/src/reachability';
|
|
25
27
|
import Metrics from '@webex/plugin-meetings/src/metrics';
|
|
@@ -1356,6 +1358,87 @@ describe('plugin-meetings', () => {
|
|
|
1356
1358
|
);
|
|
1357
1359
|
});
|
|
1358
1360
|
});
|
|
1361
|
+
describe('#fetchSitePreferencesMeViaSite', () => {
|
|
1362
|
+
const sitePreferencesResponse = {
|
|
1363
|
+
scheduling: {
|
|
1364
|
+
supportScheduleWebinar: true,
|
|
1365
|
+
webinarWebLink: 'https://go.webex.com/webappng/sites/go/webinar/scheduler',
|
|
1366
|
+
},
|
|
1367
|
+
};
|
|
1368
|
+
|
|
1369
|
+
beforeEach(() => {
|
|
1370
|
+
webex.meetings.request.fetchSitePreferencesMeViaSite = sinon
|
|
1371
|
+
.stub()
|
|
1372
|
+
.resolves(sitePreferencesResponse);
|
|
1373
|
+
});
|
|
1374
|
+
|
|
1375
|
+
it('should have #fetchSitePreferencesMeViaSite', () => {
|
|
1376
|
+
assert.exists(webex.meetings.fetchSitePreferencesMeViaSite);
|
|
1377
|
+
});
|
|
1378
|
+
|
|
1379
|
+
it('fetches scheduling preferences for the preferred Webex site by default', async () => {
|
|
1380
|
+
webex.meetings.preferredWebexSite = 'go.webex.com';
|
|
1381
|
+
|
|
1382
|
+
const result = await webex.meetings.fetchSitePreferencesMeViaSite();
|
|
1383
|
+
|
|
1384
|
+
assert.deepEqual(result, sitePreferencesResponse);
|
|
1385
|
+
assert.calledOnceWithExactly(
|
|
1386
|
+
webex.meetings.request.fetchSitePreferencesMeViaSite,
|
|
1387
|
+
{
|
|
1388
|
+
siteUrl: 'go.webex.com',
|
|
1389
|
+
}
|
|
1390
|
+
);
|
|
1391
|
+
});
|
|
1392
|
+
|
|
1393
|
+
it('uses the provided Webex site instead of the preferred Webex site', async () => {
|
|
1394
|
+
webex.meetings.preferredWebexSite = 'preferred.webex.com';
|
|
1395
|
+
|
|
1396
|
+
await webex.meetings.fetchSitePreferencesMeViaSite({siteUrl: 'go.webex.com'});
|
|
1397
|
+
|
|
1398
|
+
assert.calledOnceWithExactly(
|
|
1399
|
+
webex.meetings.request.fetchSitePreferencesMeViaSite,
|
|
1400
|
+
{
|
|
1401
|
+
siteUrl: 'go.webex.com',
|
|
1402
|
+
}
|
|
1403
|
+
);
|
|
1404
|
+
});
|
|
1405
|
+
|
|
1406
|
+
it('forwards custom site name and preference sections to the request helper', async () => {
|
|
1407
|
+
webex.meetings.preferredWebexSite = 'go.webex.com';
|
|
1408
|
+
|
|
1409
|
+
await webex.meetings.fetchSitePreferencesMeViaSite({
|
|
1410
|
+
siteName: 'custom-site',
|
|
1411
|
+
selectOptions: [SitePreferenceSelectOption.SCHEDULING],
|
|
1412
|
+
});
|
|
1413
|
+
|
|
1414
|
+
assert.calledOnceWithExactly(
|
|
1415
|
+
webex.meetings.request.fetchSitePreferencesMeViaSite,
|
|
1416
|
+
{
|
|
1417
|
+
siteUrl: 'go.webex.com',
|
|
1418
|
+
siteName: 'custom-site',
|
|
1419
|
+
selectOptions: [SitePreferenceSelectOption.SCHEDULING],
|
|
1420
|
+
}
|
|
1421
|
+
);
|
|
1422
|
+
});
|
|
1423
|
+
|
|
1424
|
+
it('throws when no Webex site is available', () => {
|
|
1425
|
+
webex.meetings.preferredWebexSite = '';
|
|
1426
|
+
webex.meetings.request.fetchSitePreferencesMeViaSite.throws(
|
|
1427
|
+
new ParameterError(
|
|
1428
|
+
'No siteUrl available. Call register() before fetching site preferences or provide options.siteUrl.'
|
|
1429
|
+
)
|
|
1430
|
+
);
|
|
1431
|
+
|
|
1432
|
+
assert.throws(
|
|
1433
|
+
() => webex.meetings.fetchSitePreferencesMeViaSite(),
|
|
1434
|
+
ParameterError,
|
|
1435
|
+
'No siteUrl available. Call register() before fetching site preferences or provide options.siteUrl.'
|
|
1436
|
+
);
|
|
1437
|
+
assert.calledOnceWithExactly(webex.meetings.request.fetchSitePreferencesMeViaSite, {
|
|
1438
|
+
siteUrl: '',
|
|
1439
|
+
});
|
|
1440
|
+
});
|
|
1441
|
+
});
|
|
1359
1442
|
describe('Static shortcut proxy methods', () => {
|
|
1360
1443
|
describe('MeetingCollection getByKey proxies', () => {
|
|
1361
1444
|
beforeEach(() => {
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import 'jsdom-global/register';
|
|
2
|
+
import sinon from 'sinon';
|
|
3
|
+
import {assert} from '@webex/test-helper-chai';
|
|
4
|
+
import MockWebex from '@webex/test-helper-mock-webex';
|
|
5
|
+
import Meetings from '@webex/plugin-meetings';
|
|
6
|
+
import ParameterError from '@webex/plugin-meetings/src/common/errors/parameter';
|
|
7
|
+
import MeetingRequest from '@webex/plugin-meetings/src/meetings/request';
|
|
8
|
+
import {SitePreferenceSelectOption} from '@webex/plugin-meetings/src/meetings/meetings.types';
|
|
9
|
+
|
|
10
|
+
const multipartSitePrefixList = ['.my.', '.mydmz.', '.mybts.', '.mydev.', '.myats2.', '.myats.'];
|
|
11
|
+
|
|
12
|
+
describe('plugin-meetings/meetings/request', () => {
|
|
13
|
+
let meetingRequest;
|
|
14
|
+
let request;
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
const webex = new MockWebex({
|
|
18
|
+
children: {
|
|
19
|
+
meetings: Meetings,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
request = sinon.stub().resolves({
|
|
24
|
+
body: {
|
|
25
|
+
scheduling: {
|
|
26
|
+
supportScheduleWebinar: true,
|
|
27
|
+
webinarWebLink: 'https://go.webex.com/webappng/sites/go/webinar/scheduler',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
meetingRequest = new MeetingRequest(
|
|
33
|
+
{},
|
|
34
|
+
{
|
|
35
|
+
parent: webex,
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
meetingRequest.request = request;
|
|
39
|
+
meetingRequest.config.meetings.multipartSitePrefixList = multipartSitePrefixList;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
afterEach(() => {
|
|
43
|
+
sinon.restore();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
describe('#fetchSitePreferencesMeViaSite', () => {
|
|
47
|
+
const assertRequest = (expectedOptions) => {
|
|
48
|
+
assert.calledOnceWithExactly(request, expectedOptions);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
it('throws a parameter error when no Webex site is available', () => {
|
|
52
|
+
assert.throws(
|
|
53
|
+
() => meetingRequest.fetchSitePreferencesMeViaSite(),
|
|
54
|
+
ParameterError,
|
|
55
|
+
'No siteUrl available. Call register() before fetching site preferences or provide options.siteUrl.'
|
|
56
|
+
);
|
|
57
|
+
assert.notCalled(request);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('fetches scheduling preferences by default', async () => {
|
|
61
|
+
const result = await meetingRequest.fetchSitePreferencesMeViaSite({siteUrl: 'go.webex.com'});
|
|
62
|
+
|
|
63
|
+
assert.deepEqual(result, {
|
|
64
|
+
scheduling: {
|
|
65
|
+
supportScheduleWebinar: true,
|
|
66
|
+
webinarWebLink: 'https://go.webex.com/webappng/sites/go/webinar/scheduler',
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
assertRequest({
|
|
70
|
+
method: 'GET',
|
|
71
|
+
uri: 'https://go.webex.com/wbxappapi/v1/users/me/preference?select=scheduling&siteurl=go',
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('derives the site name for my.webex.com sites', async () => {
|
|
76
|
+
await meetingRequest.fetchSitePreferencesMeViaSite({siteUrl: 'go.my.webex.com'});
|
|
77
|
+
|
|
78
|
+
assertRequest({
|
|
79
|
+
method: 'GET',
|
|
80
|
+
uri: 'https://go.my.webex.com/wbxappapi/v1/users/me/preference?select=scheduling&siteurl=go.my',
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('uses the configured multipart site prefix list to derive the site name', async () => {
|
|
85
|
+
meetingRequest.config.meetings.multipartSitePrefixList = ['.custom.'];
|
|
86
|
+
|
|
87
|
+
await meetingRequest.fetchSitePreferencesMeViaSite({siteUrl: 'go.my.webex.com'});
|
|
88
|
+
|
|
89
|
+
assertRequest({
|
|
90
|
+
method: 'GET',
|
|
91
|
+
uri: 'https://go.my.webex.com/wbxappapi/v1/users/me/preference?select=scheduling&siteurl=go',
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('falls back to the first label when no multipart site prefix list is configured', async () => {
|
|
96
|
+
delete meetingRequest.config.meetings.multipartSitePrefixList;
|
|
97
|
+
|
|
98
|
+
await meetingRequest.fetchSitePreferencesMeViaSite({siteUrl: 'go.my.webex.com'});
|
|
99
|
+
|
|
100
|
+
assertRequest({
|
|
101
|
+
method: 'GET',
|
|
102
|
+
uri: 'https://go.my.webex.com/wbxappapi/v1/users/me/preference?select=scheduling&siteurl=go',
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it('supports custom site name overrides', async () => {
|
|
107
|
+
await meetingRequest.fetchSitePreferencesMeViaSite({
|
|
108
|
+
siteUrl: 'go.my.webex.com',
|
|
109
|
+
siteName: 'custom-site',
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
assertRequest({
|
|
113
|
+
method: 'GET',
|
|
114
|
+
uri: 'https://go.my.webex.com/wbxappapi/v1/users/me/preference?select=scheduling&siteurl=custom-site',
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it('supports enum-backed preference sections', async () => {
|
|
119
|
+
await meetingRequest.fetchSitePreferencesMeViaSite({
|
|
120
|
+
siteUrl: 'go.webex.com',
|
|
121
|
+
selectOptions: [SitePreferenceSelectOption.SCHEDULING],
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
assertRequest({
|
|
125
|
+
method: 'GET',
|
|
126
|
+
uri: 'https://go.webex.com/wbxappapi/v1/users/me/preference?select=scheduling&siteurl=go',
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it('does not suppress request errors', async () => {
|
|
131
|
+
const error = new Error('site preferences failed');
|
|
132
|
+
|
|
133
|
+
request.rejects(error);
|
|
134
|
+
|
|
135
|
+
await assert.isRejected(
|
|
136
|
+
meetingRequest.fetchSitePreferencesMeViaSite({siteUrl: 'go.webex.com'}),
|
|
137
|
+
'site preferences failed'
|
|
138
|
+
);
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
});
|
|
@@ -5,6 +5,8 @@ import MeetingsUtil from '@webex/plugin-meetings/src/meetings/util';
|
|
|
5
5
|
import Metrics from '@webex/plugin-meetings/src/metrics';
|
|
6
6
|
import BEHAVIORAL_METRICS from '@webex/plugin-meetings/src/metrics/constants';
|
|
7
7
|
|
|
8
|
+
const multipartSitePrefixList = ['.my.', '.mydmz.', '.mybts.', '.mydev.', '.myats2.', '.myats.'];
|
|
9
|
+
|
|
8
10
|
describe('plugin-meetings', () => {
|
|
9
11
|
beforeEach(() => {
|
|
10
12
|
sinon.stub(Metrics, 'sendBehavioralMetric');
|
|
@@ -75,6 +77,28 @@ describe('plugin-meetings', () => {
|
|
|
75
77
|
});
|
|
76
78
|
});
|
|
77
79
|
|
|
80
|
+
describe('#getSiteName', () => {
|
|
81
|
+
it('gets the site name from a standard Webex site', () => {
|
|
82
|
+
assert.equal(MeetingsUtil.getSiteName('go.webex.com', multipartSitePrefixList), 'go');
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('gets the site name from a my Webex site', () => {
|
|
86
|
+
assert.equal(MeetingsUtil.getSiteName('go.my.webex.com', multipartSitePrefixList), 'go.my');
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('uses the configured multipart site prefix list', () => {
|
|
90
|
+
assert.equal(MeetingsUtil.getSiteName('go.custom.webex.com', ['.custom.']), 'go.custom');
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('falls back to the first label when the multipart site prefix list does not match', () => {
|
|
94
|
+
assert.equal(MeetingsUtil.getSiteName('go.my.webex.com', ['.custom.']), 'go');
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it('returns null when the site is empty', () => {
|
|
98
|
+
assert.equal(MeetingsUtil.getSiteName('', multipartSitePrefixList), null);
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
|
|
78
102
|
describe('#getThisDevice', () => {
|
|
79
103
|
it('return null if no devices in self', () => {
|
|
80
104
|
const newLocus = {};
|