@webex/plugin-meetings 3.10.0 → 3.11.0-next.10
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/annotation/annotation.types.js.map +1 -1
- package/dist/annotation/constants.js.map +1 -1
- package/dist/annotation/index.js +19 -22
- package/dist/annotation/index.js.map +1 -1
- package/dist/breakouts/breakout.js +6 -6
- package/dist/breakouts/breakout.js.map +1 -1
- package/dist/breakouts/collection.js.map +1 -1
- package/dist/breakouts/edit-lock-error.js +9 -11
- package/dist/breakouts/edit-lock-error.js.map +1 -1
- package/dist/breakouts/events.js.map +1 -1
- package/dist/breakouts/index.js +126 -127
- package/dist/breakouts/index.js.map +1 -1
- package/dist/breakouts/request.js +6 -8
- package/dist/breakouts/request.js.map +1 -1
- package/dist/breakouts/utils.js.map +1 -1
- package/dist/common/browser-detection.js.map +1 -1
- package/dist/common/collection.js +1 -2
- package/dist/common/collection.js.map +1 -1
- package/dist/common/config.js.map +1 -1
- package/dist/common/errors/captcha-error.js +9 -11
- package/dist/common/errors/captcha-error.js.map +1 -1
- package/dist/common/errors/intent-to-join.js +10 -12
- package/dist/common/errors/intent-to-join.js.map +1 -1
- package/dist/common/errors/join-forbidden-error.js +10 -12
- package/dist/common/errors/join-forbidden-error.js.map +1 -1
- package/dist/common/errors/join-meeting.js +10 -12
- package/dist/common/errors/join-meeting.js.map +1 -1
- package/dist/common/errors/join-webinar-error.js +9 -11
- package/dist/common/errors/join-webinar-error.js.map +1 -1
- package/dist/common/errors/media.js +9 -11
- package/dist/common/errors/media.js.map +1 -1
- package/dist/common/errors/multistream-not-supported-error.js +9 -11
- package/dist/common/errors/multistream-not-supported-error.js.map +1 -1
- package/dist/common/errors/no-meeting-info.js +9 -11
- package/dist/common/errors/no-meeting-info.js.map +1 -1
- package/dist/common/errors/parameter.js +11 -14
- package/dist/common/errors/parameter.js.map +1 -1
- package/dist/common/errors/password-error.js +9 -11
- package/dist/common/errors/password-error.js.map +1 -1
- package/dist/common/errors/permission.js +9 -11
- package/dist/common/errors/permission.js.map +1 -1
- package/dist/common/errors/reclaim-host-role-errors.js +32 -38
- package/dist/common/errors/reclaim-host-role-errors.js.map +1 -1
- package/dist/common/errors/reconnection-not-started.js +5 -6
- package/dist/common/errors/reconnection-not-started.js.map +1 -1
- package/dist/common/errors/reconnection.js +9 -11
- package/dist/common/errors/reconnection.js.map +1 -1
- package/dist/common/errors/stats.js +9 -11
- package/dist/common/errors/stats.js.map +1 -1
- package/dist/common/errors/webex-errors.js +38 -27
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/errors/webex-meetings-error.js +9 -12
- package/dist/common/errors/webex-meetings-error.js.map +1 -1
- package/dist/common/events/events-scope.js +9 -10
- package/dist/common/events/events-scope.js.map +1 -1
- package/dist/common/events/events.js +9 -10
- package/dist/common/events/events.js.map +1 -1
- package/dist/common/events/trigger-proxy.js.map +1 -1
- package/dist/common/events/util.js.map +1 -1
- package/dist/common/logs/logger-config.js.map +1 -1
- package/dist/common/logs/logger-proxy.js.map +1 -1
- package/dist/common/logs/request.js +17 -17
- package/dist/common/logs/request.js.map +1 -1
- package/dist/common/queue.js +1 -2
- package/dist/common/queue.js.map +1 -1
- package/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/constants.js +14 -8
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/constants.js.map +1 -1
- package/dist/controls-options-manager/enums.js.map +1 -1
- package/dist/controls-options-manager/index.js +1 -2
- package/dist/controls-options-manager/index.js.map +1 -1
- package/dist/controls-options-manager/types.js.map +1 -1
- package/dist/controls-options-manager/util.js +1 -2
- package/dist/controls-options-manager/util.js.map +1 -1
- package/dist/hashTree/constants.js +20 -0
- package/dist/hashTree/constants.js.map +1 -0
- package/dist/hashTree/hashTree.js +515 -0
- package/dist/hashTree/hashTree.js.map +1 -0
- package/dist/hashTree/hashTreeParser.js +1250 -0
- package/dist/hashTree/hashTreeParser.js.map +1 -0
- package/dist/hashTree/types.js +23 -0
- package/dist/hashTree/types.js.map +1 -0
- package/dist/hashTree/utils.js +59 -0
- package/dist/hashTree/utils.js.map +1 -0
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/interceptors/index.js.map +1 -1
- package/dist/interceptors/locusRetry.js +6 -8
- package/dist/interceptors/locusRetry.js.map +1 -1
- package/dist/interceptors/locusRouteToken.js +33 -13
- package/dist/interceptors/locusRouteToken.js.map +1 -1
- package/dist/interpretation/collection.js.map +1 -1
- package/dist/interpretation/index.js +1 -2
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/interpretation/siLanguage.js.map +1 -1
- package/dist/locus-info/controlsUtils.js +5 -3
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
- package/dist/locus-info/fullState.js.map +1 -1
- package/dist/locus-info/hostUtils.js.map +1 -1
- package/dist/locus-info/index.js +619 -177
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +3 -4
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/locus-info/types.js +7 -0
- package/dist/locus-info/types.js.map +1 -0
- package/dist/media/MediaConnectionAwaiter.js +58 -3
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/media/index.js +5 -2
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +19 -19
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.js.map +1 -1
- package/dist/meeting/brbState.js +8 -9
- package/dist/meeting/brbState.js.map +1 -1
- package/dist/meeting/connectionStateHandler.js +10 -13
- package/dist/meeting/connectionStateHandler.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +1672 -1553
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +13 -17
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +11 -12
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +101 -104
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js.map +1 -1
- package/dist/meeting/state.js.map +1 -1
- package/dist/meeting/type.js.map +1 -1
- package/dist/meeting/util.js +118 -25
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting/voicea-meeting.js +3 -3
- package/dist/meeting/voicea-meeting.js.map +1 -1
- package/dist/meeting-info/collection.js +7 -10
- package/dist/meeting-info/collection.js.map +1 -1
- package/dist/meeting-info/index.js +1 -2
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +135 -146
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.js +1 -2
- package/dist/meeting-info/request.js.map +1 -1
- package/dist/meeting-info/util.js +36 -37
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js +30 -31
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +6 -8
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +276 -174
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js.map +1 -1
- package/dist/meetings/request.js +6 -8
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +36 -30
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +1 -2
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js +6 -3
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js +1 -2
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +18 -21
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +8 -11
- package/dist/members/request.js.map +1 -1
- package/dist/members/types.js.map +1 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +5 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +3 -4
- package/dist/metrics/index.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +1 -2
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/receiveSlot.js +34 -45
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/receiveSlotManager.js +8 -9
- package/dist/multistream/receiveSlotManager.js.map +1 -1
- package/dist/multistream/remoteMedia.js +12 -15
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.js +1 -2
- package/dist/multistream/remoteMediaGroup.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +122 -123
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +29 -30
- package/dist/multistream/sendSlotManager.js.map +1 -1
- package/dist/personal-meeting-room/index.js +16 -19
- package/dist/personal-meeting-room/index.js.map +1 -1
- package/dist/personal-meeting-room/request.js +7 -10
- package/dist/personal-meeting-room/request.js.map +1 -1
- package/dist/personal-meeting-room/util.js.map +1 -1
- package/dist/reachability/clusterReachability.js +188 -352
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +212 -204
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/reachability.types.js +14 -1
- package/dist/reachability/reachability.types.js.map +1 -1
- package/dist/reachability/reachabilityPeerConnection.js +445 -0
- package/dist/reachability/reachabilityPeerConnection.js.map +1 -0
- package/dist/reachability/request.js.map +1 -1
- package/dist/reachability/util.js.map +1 -1
- package/dist/reactions/constants.js.map +1 -1
- package/dist/reactions/reactions.js.map +1 -1
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/reconnection-manager/index.js +178 -176
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/recording-controller/enums.js.map +1 -1
- package/dist/recording-controller/index.js +1 -2
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/recording-controller/util.js.map +1 -1
- package/dist/roap/index.js +12 -15
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +24 -26
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/turnDiscovery.js +75 -76
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/roap/types.js.map +1 -1
- package/dist/transcription/index.js +4 -5
- package/dist/transcription/index.js.map +1 -1
- package/dist/types/common/errors/webex-errors.d.ts +12 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/constants.d.ts +28 -21
- package/dist/types/hashTree/constants.d.ts +8 -0
- package/dist/types/hashTree/hashTree.d.ts +129 -0
- package/dist/types/hashTree/hashTreeParser.d.ts +250 -0
- package/dist/types/hashTree/types.d.ts +33 -0
- package/dist/types/hashTree/utils.d.ts +16 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/interceptors/locusRouteToken.d.ts +2 -0
- package/dist/types/locus-info/index.d.ts +98 -80
- package/dist/types/locus-info/types.d.ts +54 -0
- package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
- package/dist/types/media/properties.d.ts +2 -1
- package/dist/types/meeting/index.d.ts +40 -12
- package/dist/types/meeting/util.d.ts +25 -0
- package/dist/types/meetings/index.d.ts +12 -3
- package/dist/types/metrics/constants.d.ts +4 -0
- package/dist/types/reachability/clusterReachability.d.ts +33 -84
- package/dist/types/reachability/reachability.types.d.ts +12 -1
- package/dist/types/reachability/reachabilityPeerConnection.d.ts +111 -0
- package/dist/types/reactions/reactions.type.d.ts +1 -0
- package/dist/types/webinar/utils.d.ts +6 -0
- package/dist/webinar/collection.js +1 -2
- package/dist/webinar/collection.js.map +1 -1
- package/dist/webinar/index.js +206 -158
- package/dist/webinar/index.js.map +1 -1
- package/dist/webinar/utils.js +25 -0
- package/dist/webinar/utils.js.map +1 -0
- package/package.json +24 -23
- package/src/common/errors/webex-errors.ts +19 -0
- package/src/config.ts +1 -0
- package/src/constants.ts +17 -2
- package/src/hashTree/constants.ts +9 -0
- package/src/hashTree/hashTree.ts +463 -0
- package/src/hashTree/hashTreeParser.ts +1143 -0
- package/src/hashTree/types.ts +39 -0
- package/src/hashTree/utils.ts +53 -0
- package/src/index.ts +2 -0
- package/src/interceptors/locusRouteToken.ts +22 -5
- package/src/locus-info/controlsUtils.ts +6 -0
- package/src/locus-info/index.ts +641 -164
- package/src/locus-info/types.ts +53 -0
- package/src/media/MediaConnectionAwaiter.ts +41 -1
- package/src/media/index.ts +6 -0
- package/src/media/properties.ts +3 -1
- package/src/meeting/index.ts +173 -37
- package/src/meeting/util.ts +119 -1
- package/src/meetings/index.ts +212 -67
- package/src/meetings/util.ts +10 -9
- package/src/metrics/constants.ts +4 -0
- package/src/reachability/clusterReachability.ts +159 -330
- package/src/reachability/index.ts +15 -1
- package/src/reachability/reachability.types.ts +15 -1
- package/src/reachability/reachabilityPeerConnection.ts +418 -0
- package/src/reactions/reactions.type.ts +1 -0
- package/src/webinar/index.ts +44 -1
- package/src/webinar/utils.ts +16 -0
- package/test/unit/spec/hashTree/hashTree.ts +655 -0
- package/test/unit/spec/hashTree/hashTreeParser.ts +1524 -0
- package/test/unit/spec/hashTree/utils.ts +140 -0
- package/test/unit/spec/interceptors/locusRouteToken.ts +44 -0
- package/test/unit/spec/locus-info/controlsUtils.js +27 -1
- package/test/unit/spec/locus-info/index.js +879 -16
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +41 -1
- package/test/unit/spec/media/index.ts +140 -9
- package/test/unit/spec/media/properties.ts +12 -3
- package/test/unit/spec/meeting/index.js +514 -130
- package/test/unit/spec/meeting/utils.js +341 -15
- package/test/unit/spec/meetings/index.js +822 -32
- package/test/unit/spec/meetings/utils.js +51 -1
- package/test/unit/spec/reachability/clusterReachability.ts +404 -137
- package/test/unit/spec/reachability/index.ts +26 -3
- package/test/unit/spec/webinar/index.ts +106 -0
- package/test/unit/spec/webinar/utils.ts +39 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {assert} from '@webex/test-helper-chai';
|
|
2
2
|
import MockWebex from '@webex/test-helper-mock-webex';
|
|
3
|
+
import { CapabilityState, WebCapabilities } from '@webex/web-capabilities';
|
|
3
4
|
import sinon from 'sinon';
|
|
4
5
|
import EventEmitter from 'events';
|
|
5
6
|
import testUtils from '../../../utils/testUtils';
|
|
@@ -8,6 +9,7 @@ import {ClusterNode} from '../../../../src/reachability/request';
|
|
|
8
9
|
import MeetingUtil from '@webex/plugin-meetings/src/meeting/util';
|
|
9
10
|
import * as ClusterReachabilityModule from '@webex/plugin-meetings/src/reachability/clusterReachability';
|
|
10
11
|
import Metrics from '@webex/plugin-meetings/src/metrics';
|
|
12
|
+
import * as InternalMediaCore from '@webex/internal-media-core';
|
|
11
13
|
|
|
12
14
|
import {IP_VERSION} from '@webex/plugin-meetings/src/constants';
|
|
13
15
|
import { ReachabilityResultsForBackend } from '@webex/plugin-meetings/src/reachability/reachability.types';
|
|
@@ -466,11 +468,13 @@ describe('gatherReachability', () => {
|
|
|
466
468
|
let clock;
|
|
467
469
|
let clusterReachabilityCtorStub;
|
|
468
470
|
let mockClusterReachabilityInstances: Record<string, MockClusterReachability>;
|
|
471
|
+
let supportsRTCPeerConnectionStub;
|
|
469
472
|
|
|
470
473
|
beforeEach(async () => {
|
|
471
474
|
webex = new MockWebex();
|
|
472
475
|
|
|
473
476
|
sinon.stub(Metrics, 'sendBehavioralMetric');
|
|
477
|
+
supportsRTCPeerConnectionStub = sinon.stub(WebCapabilities, 'supportsRTCPeerConnection').returns(CapabilityState.CAPABLE);
|
|
474
478
|
|
|
475
479
|
await webex.boundedStorage.put(
|
|
476
480
|
'Reachability',
|
|
@@ -545,6 +549,25 @@ describe('gatherReachability', () => {
|
|
|
545
549
|
await assert.isRejected(reachability.gatherReachability('test'), 'enableReachabilityChecks is disabled in config');
|
|
546
550
|
});
|
|
547
551
|
|
|
552
|
+
[CapabilityState.NOT_CAPABLE, CapabilityState.UNKNOWN].forEach((capabilityState) =>
|
|
553
|
+
it(`returns empty object if WebRTC API is not available (capabilityState=${capabilityState}`, async () => {
|
|
554
|
+
supportsRTCPeerConnectionStub.returns(capabilityState);
|
|
555
|
+
|
|
556
|
+
const reachability = new Reachability(webex);
|
|
557
|
+
|
|
558
|
+
const result = await reachability.gatherReachability('test');
|
|
559
|
+
|
|
560
|
+
assert.deepEqual(result, {});
|
|
561
|
+
|
|
562
|
+
// Verify that no new reachability result was stored - old results should remain unchanged
|
|
563
|
+
// This check is mainly to ensure that we don't put any "unreachable" results into storage
|
|
564
|
+
const storedResults = await webex.boundedStorage.get('Reachability', 'reachability.result');
|
|
565
|
+
assert.equal(storedResults, JSON.stringify({old: 'results'}));
|
|
566
|
+
|
|
567
|
+
assert.equal(await reachability.isWebexMediaBackendUnreachable(), false);
|
|
568
|
+
})
|
|
569
|
+
);
|
|
570
|
+
|
|
548
571
|
[
|
|
549
572
|
// ========================================================================
|
|
550
573
|
{
|
|
@@ -1693,7 +1716,7 @@ describe('gatherReachability', () => {
|
|
|
1693
1716
|
udp: ['testUDP1', 'testUDP2'],
|
|
1694
1717
|
tcp: [], // empty list because TCP is disabled in config
|
|
1695
1718
|
xtls: ['testXTLS1', 'testXTLS2'],
|
|
1696
|
-
});
|
|
1719
|
+
}, undefined);
|
|
1697
1720
|
});
|
|
1698
1721
|
|
|
1699
1722
|
it('does not do TLS reachability if it is disabled in config', async () => {
|
|
@@ -1728,7 +1751,7 @@ describe('gatherReachability', () => {
|
|
|
1728
1751
|
udp: ['testUDP1', 'testUDP2'],
|
|
1729
1752
|
tcp: ['testTCP1', 'testTCP2'],
|
|
1730
1753
|
xtls: [], // empty list because TLS is disabled in config
|
|
1731
|
-
});
|
|
1754
|
+
}, undefined);
|
|
1732
1755
|
});
|
|
1733
1756
|
|
|
1734
1757
|
it('does not do TCP or TLS reachability if it is disabled in config', async () => {
|
|
@@ -1763,7 +1786,7 @@ describe('gatherReachability', () => {
|
|
|
1763
1786
|
udp: ['testUDP1', 'testUDP2'],
|
|
1764
1787
|
tcp: [], // empty list because TCP is disabled in config
|
|
1765
1788
|
xtls: [], // empty list because TLS is disabled in config
|
|
1766
|
-
});
|
|
1789
|
+
}, undefined);
|
|
1767
1790
|
});
|
|
1768
1791
|
|
|
1769
1792
|
it('retry of getClusters is succesfull', async () => {
|
|
@@ -631,5 +631,111 @@ describe('plugin-meetings', () => {
|
|
|
631
631
|
}
|
|
632
632
|
});
|
|
633
633
|
});
|
|
634
|
+
|
|
635
|
+
describe("#searchLargeScaleWebinarAttendees", () => {
|
|
636
|
+
const attendeeSearchUrl = 'https://locusUrl/attendees/search';
|
|
637
|
+
const params = {
|
|
638
|
+
queryString: 'queryString',
|
|
639
|
+
limit: 50,
|
|
640
|
+
next: null,
|
|
641
|
+
};
|
|
642
|
+
beforeEach(() => {
|
|
643
|
+
// @ts-ignore
|
|
644
|
+
webinar.webex.meetings = {
|
|
645
|
+
getMeetingByType: sinon.stub().returns({
|
|
646
|
+
id: 'meeting-id',
|
|
647
|
+
locusInfo: {
|
|
648
|
+
links:{
|
|
649
|
+
resources: {
|
|
650
|
+
attendeeSearch: {
|
|
651
|
+
url: attendeeSearchUrl
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
})
|
|
657
|
+
};
|
|
658
|
+
});
|
|
659
|
+
|
|
660
|
+
it('throws an error if attendeeSearchUrl is not available', async () => {
|
|
661
|
+
webinar.webex.meetings = {
|
|
662
|
+
getMeetingByType: sinon.stub().returns({
|
|
663
|
+
id: 'meeting-id',
|
|
664
|
+
locusInfo: {
|
|
665
|
+
links:{
|
|
666
|
+
resources: {
|
|
667
|
+
attendeeSearch: {
|
|
668
|
+
url: null
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
})
|
|
674
|
+
};
|
|
675
|
+
try {
|
|
676
|
+
await webinar.searchLargeScaleWebinarAttendees(params);
|
|
677
|
+
assert.fail('searchLargeScaleWebinarAttendees should throw an error');
|
|
678
|
+
} catch (error) {
|
|
679
|
+
assert.equal(error.message,'Meeting:webinar5k#Attendee search url is not available', 'should throw the correct error');
|
|
680
|
+
}
|
|
681
|
+
});
|
|
682
|
+
|
|
683
|
+
it('sends a GET request to search the large scale webinar attendees', async () => {
|
|
684
|
+
const result = await webinar.searchLargeScaleWebinarAttendees(params);
|
|
685
|
+
assert.calledOnce(webex.request);
|
|
686
|
+
assert.calledWith(webex.request, {
|
|
687
|
+
method: 'GET',
|
|
688
|
+
uri: `${attendeeSearchUrl}?search_text=${encodeURIComponent(params.queryString)}&limit=50`,
|
|
689
|
+
headers: {
|
|
690
|
+
authorization: 'test-token',
|
|
691
|
+
trackingId: 'webex-js-sdk_test-uuid',
|
|
692
|
+
},
|
|
693
|
+
});
|
|
694
|
+
assert.equal(
|
|
695
|
+
result,
|
|
696
|
+
'REQUEST_RETURN_VALUE',
|
|
697
|
+
'should return the resolved value from the request'
|
|
698
|
+
);
|
|
699
|
+
});
|
|
700
|
+
|
|
701
|
+
it('queryString is empty string', async () => {
|
|
702
|
+
params.queryString = '';
|
|
703
|
+
const result = await webinar.searchLargeScaleWebinarAttendees(params);
|
|
704
|
+
assert.calledOnce(webex.request);
|
|
705
|
+
assert.calledWith(webex.request, {
|
|
706
|
+
method: 'GET',
|
|
707
|
+
uri: `${attendeeSearchUrl}?limit=50`,
|
|
708
|
+
headers: {
|
|
709
|
+
authorization: 'test-token',
|
|
710
|
+
trackingId: 'webex-js-sdk_test-uuid',
|
|
711
|
+
},
|
|
712
|
+
});
|
|
713
|
+
assert.equal(
|
|
714
|
+
result,
|
|
715
|
+
'REQUEST_RETURN_VALUE',
|
|
716
|
+
'should return the resolved value from the request'
|
|
717
|
+
);
|
|
718
|
+
});
|
|
719
|
+
|
|
720
|
+
it('handles API call failures gracefully', async () => {
|
|
721
|
+
webex.request.rejects(new Error('API_ERROR'));
|
|
722
|
+
const errorLogger = sinon.stub(LoggerProxy.logger, 'error');
|
|
723
|
+
|
|
724
|
+
try {
|
|
725
|
+
await webinar.searchLargeScaleWebinarAttendees(params);
|
|
726
|
+
assert.fail('searchLargeScaleWebinarAttendees should throw an error');
|
|
727
|
+
} catch (error) {
|
|
728
|
+
assert.equal(error.message, 'API_ERROR', 'should throw the correct error');
|
|
729
|
+
assert.calledOnce(errorLogger);
|
|
730
|
+
assert.calledWith(
|
|
731
|
+
errorLogger,
|
|
732
|
+
'Meeting:webinar5k#searchLargeScaleWebinarAttendees failed',
|
|
733
|
+
sinon.match.instanceOf(Error)
|
|
734
|
+
);
|
|
735
|
+
} finally {
|
|
736
|
+
errorLogger.restore();
|
|
737
|
+
}
|
|
738
|
+
});
|
|
739
|
+
});
|
|
634
740
|
})
|
|
635
741
|
})
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import chai from 'chai';
|
|
2
|
+
import {sanitizeParams} from '@webex/plugin-meetings/src/webinar/utils';
|
|
3
|
+
|
|
4
|
+
const {assert} = chai;
|
|
5
|
+
|
|
6
|
+
describe('plugin-meetings', () => {
|
|
7
|
+
describe('webinar utils', () => {
|
|
8
|
+
describe('#sanitizeParams', () => {
|
|
9
|
+
it('sanitizes params by removing undefined, "", or null values', () => {
|
|
10
|
+
const input = {
|
|
11
|
+
a: 1,
|
|
12
|
+
b: undefined,
|
|
13
|
+
c: null,
|
|
14
|
+
d: 'test',
|
|
15
|
+
e: false,
|
|
16
|
+
f: '',
|
|
17
|
+
};
|
|
18
|
+
const expectedOutput = {
|
|
19
|
+
a: 1,
|
|
20
|
+
d: 'test',
|
|
21
|
+
e: false,
|
|
22
|
+
};
|
|
23
|
+
const result = sanitizeParams(input);
|
|
24
|
+
assert.deepEqual(result, expectedOutput);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('returns an empty object when all values are invalid', () => {
|
|
28
|
+
const input = {
|
|
29
|
+
a: undefined,
|
|
30
|
+
b: null,
|
|
31
|
+
c: '',
|
|
32
|
+
};
|
|
33
|
+
const expectedOutput = {};
|
|
34
|
+
const result = sanitizeParams(input);
|
|
35
|
+
assert.deepEqual(result, expectedOutput);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
});
|