@webex/plugin-meetings 3.8.0 → 3.8.1-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/README.md +26 -13
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +70 -6
- package/dist/breakouts/index.js.map +1 -1
- package/dist/common/errors/webex-errors.js +12 -2
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/config.js +5 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.js +28 -123
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/enums.js +3 -0
- package/dist/controls-options-manager/enums.js.map +1 -1
- package/dist/controls-options-manager/types.js.map +1 -1
- package/dist/controls-options-manager/util.js +78 -0
- package/dist/controls-options-manager/util.js.map +1 -1
- package/dist/interpretation/index.js +4 -4
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/controlsUtils.js +37 -11
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +92 -12
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/selfUtils.js +432 -418
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js +17 -17
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +94 -6
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/brbState.js +9 -2
- package/dist/meeting/brbState.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +21 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +678 -344
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +21 -22
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +4 -4
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +30 -0
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js.map +1 -1
- package/dist/meeting/util.js +13 -2
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +373 -68
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/utilv2.js +5 -1
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/index.js +136 -1
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/util.js +14 -0
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +55 -9
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js +3 -0
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js +335 -353
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +137 -29
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +38 -0
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js +36 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +10 -0
- package/dist/metrics/constants.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +40 -8
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/reachability/clusterReachability.js +63 -27
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +107 -47
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/reachability.types.js +14 -0
- package/dist/reachability/reachability.types.js.map +1 -1
- package/dist/reachability/request.js +19 -3
- package/dist/reachability/request.js.map +1 -1
- package/dist/reconnection-manager/index.js +2 -2
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/recording-controller/util.js +5 -5
- package/dist/recording-controller/util.js.map +1 -1
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/turnDiscovery.js +45 -27
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/roap/types.js +17 -0
- package/dist/roap/types.js.map +1 -0
- package/dist/types/common/errors/webex-errors.d.ts +7 -1
- package/dist/types/config.d.ts +3 -0
- package/dist/types/constants.d.ts +20 -85
- package/dist/types/controls-options-manager/enums.d.ts +4 -1
- package/dist/types/controls-options-manager/types.d.ts +10 -1
- package/dist/types/locus-info/index.d.ts +3 -3
- package/dist/types/locus-info/selfUtils.d.ts +216 -1
- package/dist/types/media/properties.d.ts +15 -0
- package/dist/types/meeting/in-meeting-actions.d.ts +20 -0
- package/dist/types/meeting/index.d.ts +65 -1
- package/dist/types/meeting/muteState.d.ts +0 -1
- package/dist/types/meeting/request.d.ts +12 -1
- package/dist/types/meeting/request.type.d.ts +6 -0
- package/dist/types/meeting/util.d.ts +3 -1
- package/dist/types/meeting-info/meeting-info-v2.d.ts +82 -1
- package/dist/types/meetings/index.d.ts +57 -0
- package/dist/types/member/index.d.ts +21 -6
- package/dist/types/member/types.d.ts +73 -14
- package/dist/types/member/util.d.ts +156 -1
- package/dist/types/members/collection.d.ts +6 -5
- package/dist/types/members/index.d.ts +32 -43
- package/dist/types/members/request.d.ts +26 -0
- package/dist/types/members/util.d.ts +27 -0
- package/dist/types/metrics/constants.d.ts +10 -0
- package/dist/types/multistream/remoteMediaManager.d.ts +10 -1
- package/dist/types/reachability/clusterReachability.d.ts +15 -7
- package/dist/types/reachability/index.d.ts +10 -1
- package/dist/types/reachability/reachability.types.d.ts +5 -0
- package/dist/types/roap/index.d.ts +3 -2
- package/dist/types/roap/turnDiscovery.d.ts +5 -17
- package/dist/types/roap/types.d.ts +16 -0
- package/dist/webinar/index.js +2 -2
- package/dist/webinar/index.js.map +1 -1
- package/package.json +24 -23
- package/src/breakouts/index.ts +69 -0
- package/src/common/errors/webex-errors.ts +8 -1
- package/src/config.ts +3 -0
- package/src/constants.ts +30 -90
- package/src/controls-options-manager/enums.ts +3 -0
- package/src/controls-options-manager/types.ts +16 -1
- package/src/controls-options-manager/util.ts +93 -0
- package/src/interpretation/index.ts +3 -3
- package/src/locus-info/controlsUtils.ts +59 -14
- package/src/locus-info/index.ts +97 -13
- package/src/locus-info/selfUtils.ts +496 -442
- package/src/media/index.ts +23 -21
- package/src/media/properties.ts +96 -0
- package/src/meeting/brbState.ts +11 -2
- package/src/meeting/in-meeting-actions.ts +40 -0
- package/src/meeting/index.ts +470 -105
- package/src/meeting/locusMediaRequest.ts +27 -22
- package/src/meeting/muteState.ts +4 -4
- package/src/meeting/request.ts +36 -1
- package/src/meeting/request.type.ts +7 -0
- package/src/meeting/util.ts +11 -2
- package/src/meeting-info/meeting-info-v2.ts +254 -8
- package/src/meeting-info/utilv2.ts +5 -0
- package/src/meetings/index.ts +148 -1
- package/src/meetings/util.ts +18 -0
- package/src/member/index.ts +68 -22
- package/src/member/types.ts +82 -16
- package/src/member/util.ts +357 -350
- package/src/members/collection.ts +4 -3
- package/src/members/index.ts +137 -18
- package/src/members/request.ts +44 -0
- package/src/members/util.ts +43 -1
- package/src/metrics/constants.ts +10 -0
- package/src/multistream/remoteMediaManager.ts +32 -10
- package/src/reachability/clusterReachability.ts +73 -26
- package/src/reachability/index.ts +62 -1
- package/src/reachability/reachability.types.ts +6 -0
- package/src/reachability/request.ts +7 -0
- package/src/reconnection-manager/index.ts +2 -2
- package/src/recording-controller/util.ts +17 -13
- package/src/roap/index.ts +3 -7
- package/src/roap/turnDiscovery.ts +34 -39
- package/src/roap/types.ts +23 -0
- package/src/webinar/index.ts +1 -1
- package/test/unit/spec/breakouts/index.ts +167 -95
- package/test/unit/spec/controls-options-manager/util.js +178 -0
- package/test/unit/spec/interpretation/index.ts +39 -1
- package/test/unit/spec/locus-info/controlsUtils.js +155 -9
- package/test/unit/spec/locus-info/index.js +209 -73
- package/test/unit/spec/locus-info/selfUtils.js +98 -24
- package/test/unit/spec/media/index.ts +150 -18
- package/test/unit/spec/media/properties.ts +130 -0
- package/test/unit/spec/meeting/brbState.ts +40 -2
- package/test/unit/spec/meeting/in-meeting-actions.ts +23 -4
- package/test/unit/spec/meeting/index.js +804 -139
- package/test/unit/spec/meeting/locusMediaRequest.ts +95 -87
- package/test/unit/spec/meeting/muteState.js +73 -2
- package/test/unit/spec/meeting/request.js +32 -1
- package/test/unit/spec/meeting/utils.js +119 -18
- package/test/unit/spec/meeting-info/meetinginfov2.js +484 -114
- package/test/unit/spec/meeting-info/utilv2.js +19 -0
- package/test/unit/spec/meetings/index.js +146 -2
- package/test/unit/spec/member/index.js +7 -0
- package/test/unit/spec/member/util.js +24 -0
- package/test/unit/spec/members/index.js +304 -78
- package/test/unit/spec/members/request.js +68 -22
- package/test/unit/spec/members/utils.js +75 -0
- package/test/unit/spec/multistream/remoteMediaManager.ts +397 -118
- package/test/unit/spec/reachability/clusterReachability.ts +88 -56
- package/test/unit/spec/reachability/index.ts +97 -0
- package/test/unit/spec/reachability/request.js +47 -2
- package/test/unit/spec/reconnection-manager/index.js +4 -4
- package/test/unit/spec/roap/turnDiscovery.ts +110 -28
- package/test/unit/spec/webinar/index.ts +5 -0
- package/dist/annotation/annotation.types.d.ts +0 -42
- package/dist/annotation/constants.d.ts +0 -31
- package/dist/annotation/index.d.ts +0 -117
- package/dist/breakouts/breakout.d.ts +0 -8
- package/dist/breakouts/collection.d.ts +0 -5
- package/dist/breakouts/edit-lock-error.d.ts +0 -15
- package/dist/breakouts/events.d.ts +0 -8
- package/dist/breakouts/index.d.ts +0 -5
- package/dist/breakouts/request.d.ts +0 -22
- package/dist/breakouts/utils.d.ts +0 -15
- package/dist/common/browser-detection.d.ts +0 -9
- package/dist/common/collection.d.ts +0 -48
- package/dist/common/config.d.ts +0 -2
- package/dist/common/errors/captcha-error.d.ts +0 -15
- package/dist/common/errors/intent-to-join.d.ts +0 -16
- package/dist/common/errors/join-meeting.d.ts +0 -17
- package/dist/common/errors/media.d.ts +0 -15
- package/dist/common/errors/no-meeting-info.d.ts +0 -14
- package/dist/common/errors/parameter.d.ts +0 -15
- package/dist/common/errors/password-error.d.ts +0 -15
- package/dist/common/errors/permission.d.ts +0 -14
- package/dist/common/errors/reclaim-host-role-error.js +0 -149
- package/dist/common/errors/reclaim-host-role-error.js.map +0 -1
- package/dist/common/errors/reclaim-host-role-errors.d.ts +0 -60
- package/dist/common/errors/reconnection-in-progress.d.ts +0 -9
- package/dist/common/errors/reconnection-in-progress.js +0 -33
- package/dist/common/errors/reconnection-in-progress.js.map +0 -1
- package/dist/common/errors/reconnection.d.ts +0 -15
- package/dist/common/errors/stats.d.ts +0 -15
- package/dist/common/errors/webex-errors.d.ts +0 -93
- package/dist/common/errors/webex-meetings-error.d.ts +0 -20
- package/dist/common/events/events-scope.d.ts +0 -17
- package/dist/common/events/events.d.ts +0 -12
- package/dist/common/events/trigger-proxy.d.ts +0 -2
- package/dist/common/events/util.d.ts +0 -2
- package/dist/common/logs/logger-config.d.ts +0 -2
- package/dist/common/logs/logger-proxy.d.ts +0 -2
- package/dist/common/logs/request.d.ts +0 -36
- package/dist/common/queue.d.ts +0 -34
- package/dist/config.d.ts +0 -72
- package/dist/constants.d.ts +0 -1088
- package/dist/controls-options-manager/constants.d.ts +0 -4
- package/dist/controls-options-manager/enums.d.ts +0 -15
- package/dist/controls-options-manager/index.d.ts +0 -136
- package/dist/controls-options-manager/types.d.ts +0 -43
- package/dist/controls-options-manager/util.d.ts +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/interceptors/index.d.ts +0 -2
- package/dist/interceptors/locusRetry.d.ts +0 -27
- package/dist/interpretation/collection.d.ts +0 -5
- package/dist/interpretation/index.d.ts +0 -5
- package/dist/interpretation/siLanguage.d.ts +0 -5
- package/dist/locus-info/controlsUtils.d.ts +0 -2
- package/dist/locus-info/embeddedAppsUtils.d.ts +0 -2
- package/dist/locus-info/fullState.d.ts +0 -2
- package/dist/locus-info/hostUtils.d.ts +0 -2
- package/dist/locus-info/index.d.ts +0 -322
- package/dist/locus-info/infoUtils.d.ts +0 -2
- package/dist/locus-info/mediaSharesUtils.d.ts +0 -2
- package/dist/locus-info/parser.d.ts +0 -272
- package/dist/locus-info/selfUtils.d.ts +0 -2
- package/dist/media/index.d.ts +0 -34
- package/dist/media/properties.d.ts +0 -93
- package/dist/media/util.d.ts +0 -2
- package/dist/mediaQualityMetrics/config.d.ts +0 -241
- package/dist/mediaQualityMetrics/config.js +0 -502
- package/dist/mediaQualityMetrics/config.js.map +0 -1
- package/dist/meeting/effectsState.js +0 -260
- package/dist/meeting/effectsState.js.map +0 -1
- package/dist/meeting/in-meeting-actions.d.ts +0 -167
- package/dist/meeting/index.d.ts +0 -1825
- package/dist/meeting/locusMediaRequest.d.ts +0 -74
- package/dist/meeting/muteState.d.ts +0 -178
- package/dist/meeting/request.d.ts +0 -295
- package/dist/meeting/request.type.d.ts +0 -11
- package/dist/meeting/state.d.ts +0 -9
- package/dist/meeting/util.d.ts +0 -119
- package/dist/meeting/voicea-meeting.d.ts +0 -16
- package/dist/meeting-info/collection.d.ts +0 -20
- package/dist/meeting-info/index.d.ts +0 -69
- package/dist/meeting-info/meeting-info-v2.d.ts +0 -123
- package/dist/meeting-info/request.d.ts +0 -22
- package/dist/meeting-info/util.d.ts +0 -2
- package/dist/meeting-info/utilv2.d.ts +0 -2
- package/dist/meetings/collection.d.ts +0 -40
- package/dist/meetings/index.d.ts +0 -390
- package/dist/meetings/meetings.types.d.ts +0 -4
- package/dist/meetings/request.d.ts +0 -27
- package/dist/meetings/util.d.ts +0 -18
- package/dist/member/index.d.ts +0 -160
- package/dist/member/member.types.js +0 -17
- package/dist/member/member.types.js.map +0 -1
- package/dist/member/types.d.ts +0 -32
- package/dist/member/util.d.ts +0 -2
- package/dist/members/collection.d.ts +0 -29
- package/dist/members/index.d.ts +0 -353
- package/dist/members/request.d.ts +0 -114
- package/dist/members/types.d.ts +0 -25
- package/dist/members/util.d.ts +0 -215
- package/dist/metrics/config.js +0 -276
- package/dist/metrics/config.js.map +0 -1
- package/dist/metrics/constants.d.ts +0 -70
- package/dist/metrics/index.d.ts +0 -45
- package/dist/multistream/mediaRequestManager.d.ts +0 -119
- package/dist/multistream/receiveSlot.d.ts +0 -68
- package/dist/multistream/receiveSlotManager.d.ts +0 -56
- package/dist/multistream/remoteMedia.d.ts +0 -72
- package/dist/multistream/remoteMediaGroup.d.ts +0 -49
- package/dist/multistream/remoteMediaManager.d.ts +0 -300
- package/dist/multistream/sendSlotManager.d.ts +0 -69
- package/dist/networkQualityMonitor/index.d.ts +0 -70
- package/dist/networkQualityMonitor/index.js +0 -221
- package/dist/networkQualityMonitor/index.js.map +0 -1
- package/dist/peer-connection-manager/index.js +0 -671
- package/dist/peer-connection-manager/index.js.map +0 -1
- package/dist/peer-connection-manager/util.js +0 -109
- package/dist/peer-connection-manager/util.js.map +0 -1
- package/dist/personal-meeting-room/index.d.ts +0 -47
- package/dist/personal-meeting-room/request.d.ts +0 -14
- package/dist/personal-meeting-room/util.d.ts +0 -2
- package/dist/reachability/clusterReachability.d.ts +0 -109
- package/dist/reachability/index.d.ts +0 -105
- package/dist/reachability/request.d.ts +0 -39
- package/dist/reachability/util.d.ts +0 -8
- package/dist/reactions/constants.d.ts +0 -3
- package/dist/reactions/reactions.d.ts +0 -4
- package/dist/reactions/reactions.type.d.ts +0 -52
- package/dist/reconnection-manager/index.d.ts +0 -136
- package/dist/recording-controller/enums.d.ts +0 -7
- package/dist/recording-controller/index.d.ts +0 -207
- package/dist/recording-controller/util.d.ts +0 -14
- package/dist/roap/collection.js +0 -62
- package/dist/roap/collection.js.map +0 -1
- package/dist/roap/handler.js +0 -275
- package/dist/roap/handler.js.map +0 -1
- package/dist/roap/index.d.ts +0 -86
- package/dist/roap/request.d.ts +0 -39
- package/dist/roap/state.js +0 -126
- package/dist/roap/state.js.map +0 -1
- package/dist/roap/turnDiscovery.d.ts +0 -155
- package/dist/roap/util.js +0 -75
- package/dist/roap/util.js.map +0 -1
- package/dist/rtcMetrics/constants.d.ts +0 -4
- package/dist/rtcMetrics/constants.js +0 -11
- package/dist/rtcMetrics/constants.js.map +0 -1
- package/dist/rtcMetrics/index.d.ts +0 -61
- package/dist/rtcMetrics/index.js +0 -197
- package/dist/rtcMetrics/index.js.map +0 -1
- package/dist/statsAnalyzer/global.d.ts +0 -36
- package/dist/statsAnalyzer/global.js +0 -126
- package/dist/statsAnalyzer/global.js.map +0 -1
- package/dist/statsAnalyzer/index.d.ts +0 -217
- package/dist/statsAnalyzer/index.js +0 -1013
- package/dist/statsAnalyzer/index.js.map +0 -1
- package/dist/statsAnalyzer/mqaUtil.d.ts +0 -48
- package/dist/statsAnalyzer/mqaUtil.js +0 -179
- package/dist/statsAnalyzer/mqaUtil.js.map +0 -1
- package/dist/transcription/index.d.ts +0 -64
- package/dist/types/common/errors/reconnection-in-progress.d.ts +0 -9
- package/dist/types/mediaQualityMetrics/config.d.ts +0 -241
- package/dist/types/networkQualityMonitor/index.d.ts +0 -70
- package/dist/types/rtcMetrics/constants.d.ts +0 -4
- package/dist/types/rtcMetrics/index.d.ts +0 -71
- package/dist/types/statsAnalyzer/global.d.ts +0 -36
- package/dist/types/statsAnalyzer/index.d.ts +0 -217
- package/dist/types/statsAnalyzer/mqaUtil.d.ts +0 -48
- package/dist/webinar/collection.d.ts +0 -16
- package/dist/webinar/index.d.ts +0 -5
@@ -7,10 +7,7 @@ import sinon from 'sinon';
|
|
7
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
|
-
import {
|
11
|
-
DESTINATION_TYPE,
|
12
|
-
WBXAPPAPI_SERVICE,
|
13
|
-
} from '@webex/plugin-meetings/src/constants';
|
10
|
+
import {DESTINATION_TYPE, WBXAPPAPI_SERVICE} from '@webex/plugin-meetings/src/constants';
|
14
11
|
|
15
12
|
import Meetings from '@webex/plugin-meetings/src/meetings';
|
16
13
|
import MeetingInfo, {
|
@@ -20,6 +17,9 @@ import MeetingInfo, {
|
|
20
17
|
MeetingInfoV2PolicyError,
|
21
18
|
MeetingInfoV2JoinWebinarError,
|
22
19
|
MeetingInfoV2JoinForbiddenError,
|
20
|
+
MeetingInfoV2MeetingIsInProgressError,
|
21
|
+
MeetingInfoV2StaticMeetingLinkAlreadyExists,
|
22
|
+
MeetingInfoV2StaticLinkDoesNotExistError,
|
23
23
|
} from '@webex/plugin-meetings/src/meeting-info/meeting-info-v2';
|
24
24
|
import MeetingInfoUtil from '@webex/plugin-meetings/src/meeting-info/utilv2';
|
25
25
|
import Metrics from '@webex/plugin-meetings/src/metrics';
|
@@ -93,6 +93,304 @@ describe('plugin-meetings', () => {
|
|
93
93
|
meetingInfo = new MeetingInfo(webex);
|
94
94
|
});
|
95
95
|
|
96
|
+
describe('#fetchStaticMeetingLink', () => {
|
97
|
+
it('should fetch static meeting link for given conversation url', async () => {
|
98
|
+
const conversationUrl = 'conv.fakeconversationurl.com';
|
99
|
+
const body = {spaceUrl: conversationUrl};
|
100
|
+
const requestResponse = {statusCode: 200, body};
|
101
|
+
webex.request.resolves(requestResponse);
|
102
|
+
const result = await meetingInfo.fetchStaticMeetingLink(conversationUrl);
|
103
|
+
|
104
|
+
assert.calledWith(webex.request, {
|
105
|
+
method: 'POST',
|
106
|
+
uri: `https://${webex.meetings.preferredWebexSite}/wbxappapi/v2/meetings/spaceInstant/query`,
|
107
|
+
body,
|
108
|
+
});
|
109
|
+
|
110
|
+
assert(Metrics.sendBehavioralMetric.calledOnce);
|
111
|
+
assert.calledWith(
|
112
|
+
Metrics.sendBehavioralMetric,
|
113
|
+
BEHAVIORAL_METRICS.FETCH_STATIC_MEETING_LINK_SUCCESS
|
114
|
+
);
|
115
|
+
|
116
|
+
assert.deepEqual(result, requestResponse);
|
117
|
+
});
|
118
|
+
|
119
|
+
it('should not fetch static meeting link for given conversation url if no preferred webex site', async () => {
|
120
|
+
webex.meetings.preferredWebexSite = undefined;
|
121
|
+
|
122
|
+
const conversationUrl = 'conv.fakeconversationurl.com';
|
123
|
+
try {
|
124
|
+
await meetingInfo.fetchStaticMeetingLink(conversationUrl);
|
125
|
+
|
126
|
+
assert.calledWith(webex.request, {
|
127
|
+
method: 'POST',
|
128
|
+
uri: `https://${webex.meetings.preferredWebexSite}/wbxappapi/v2/meetings/spaceInstant/query`,
|
129
|
+
body,
|
130
|
+
});
|
131
|
+
} catch (err) {
|
132
|
+
assert.deepEqual(err.message, 'No preferred webex site found');
|
133
|
+
assert.notCalled(webex.request);
|
134
|
+
}
|
135
|
+
});
|
136
|
+
|
137
|
+
it('handles error for MeetingInfoV2StaticLinkDoesNotExistError', async () => {
|
138
|
+
const conversationUrl = 'conv.fakeconversationurl.com';
|
139
|
+
webex.request = sinon
|
140
|
+
.stub()
|
141
|
+
.rejects({stack: 'a stack', message: 'a message', statusCode: 403, body: {code: 400000}});
|
142
|
+
try {
|
143
|
+
await meetingInfo.fetchStaticMeetingLink(conversationUrl);
|
144
|
+
} catch (err) {
|
145
|
+
assert.equal(err.wbxAppApiCode, 400000);
|
146
|
+
assert.instanceOf(err, MeetingInfoV2StaticLinkDoesNotExistError);
|
147
|
+
assert.deepEqual(
|
148
|
+
err.message,
|
149
|
+
'Meeting link does not exists for conversation, code=400000'
|
150
|
+
);
|
151
|
+
assert.calledWith(
|
152
|
+
Metrics.sendBehavioralMetric,
|
153
|
+
BEHAVIORAL_METRICS.MEETING_LINK_DOES_NOT_EXIST_ERROR,
|
154
|
+
{reason: 'a message', stack: 'a stack'}
|
155
|
+
);
|
156
|
+
}
|
157
|
+
});
|
158
|
+
|
159
|
+
it('handles generic error when fetching static link', async () => {
|
160
|
+
const conversationUrl = 'conv.fakeconversationurl.com';
|
161
|
+
webex.request = sinon
|
162
|
+
.stub()
|
163
|
+
.rejects({stack: 'a stack', message: 'a message', statusCode: 500, body: {code: 400000}});
|
164
|
+
try {
|
165
|
+
await meetingInfo.fetchStaticMeetingLink(conversationUrl);
|
166
|
+
} catch (err) {
|
167
|
+
assert(Metrics.sendBehavioralMetric.calledOnce);
|
168
|
+
assert.calledWith(
|
169
|
+
Metrics.sendBehavioralMetric,
|
170
|
+
BEHAVIORAL_METRICS.FETCH_STATIC_MEETING_LINK_FAILURE,
|
171
|
+
{reason: 'a message', stack: 'a stack'}
|
172
|
+
);
|
173
|
+
}
|
174
|
+
});
|
175
|
+
});
|
176
|
+
|
177
|
+
describe('#enableStaticMeetingLink', () => {
|
178
|
+
const setup = () => {
|
179
|
+
const invitee = [];
|
180
|
+
|
181
|
+
invitee.push({
|
182
|
+
email: conversation.participants.items[0].emailAddress,
|
183
|
+
ciUserUuid: conversation.participants.items[0].entryUUID,
|
184
|
+
});
|
185
|
+
|
186
|
+
invitee.push({
|
187
|
+
email: conversation.participants.items[1].emailAddress,
|
188
|
+
ciUserUuid: conversation.participants.items[1].entryUUID,
|
189
|
+
});
|
190
|
+
|
191
|
+
return {invitee};
|
192
|
+
};
|
193
|
+
|
194
|
+
it('should enable static meeting link', async () => {
|
195
|
+
const {invitee} = setup();
|
196
|
+
const installedOrgID = '12345';
|
197
|
+
const conversationUrl = 'conv.fakeconversationurl.com';
|
198
|
+
webex.request.resolves({
|
199
|
+
statusCode: 200,
|
200
|
+
body: conversation,
|
201
|
+
});
|
202
|
+
const result = await meetingInfo.enableStaticMeetingLink(conversationUrl);
|
203
|
+
|
204
|
+
assert.calledWith(webex.request, {
|
205
|
+
uri: conversationUrl,
|
206
|
+
qs: {includeParticipants: true},
|
207
|
+
disableTransform: true,
|
208
|
+
});
|
209
|
+
|
210
|
+
assert.calledWith(webex.request, {
|
211
|
+
method: 'POST',
|
212
|
+
uri: `https://${webex.meetings.preferredWebexSite}/wbxappapi/v2/meetings/spaceInstant`,
|
213
|
+
body: {
|
214
|
+
title: conversation.displayName,
|
215
|
+
spaceUrl: conversation.url,
|
216
|
+
keyUrl: conversation.encryptionKeyUrl,
|
217
|
+
kroUrl: conversation.kmsResourceObjectUrl,
|
218
|
+
invitees: invitee,
|
219
|
+
installedOrgID: undefined,
|
220
|
+
schedule: true,
|
221
|
+
},
|
222
|
+
});
|
223
|
+
|
224
|
+
assert(Metrics.sendBehavioralMetric.calledOnce);
|
225
|
+
assert.calledWith(
|
226
|
+
Metrics.sendBehavioralMetric,
|
227
|
+
BEHAVIORAL_METRICS.ENABLE_STATIC_METTING_LINK_SUCCESS
|
228
|
+
);
|
229
|
+
|
230
|
+
assert.deepEqual(result, {
|
231
|
+
body: conversation,
|
232
|
+
statusCode: 200,
|
233
|
+
});
|
234
|
+
});
|
235
|
+
|
236
|
+
it('should not enable static meeting link for given conversation url if no preferred webex site', async () => {
|
237
|
+
webex.meetings.preferredWebexSite = undefined;
|
238
|
+
|
239
|
+
const conversationUrl = 'conv.fakeconversationurl.com';
|
240
|
+
try {
|
241
|
+
await meetingInfo.enableStaticMeetingLink(conversationUrl);
|
242
|
+
|
243
|
+
assert.calledWith(webex.request, {
|
244
|
+
method: 'POST',
|
245
|
+
uri: `https://${webex.meetings.preferredWebexSite}/wbxappapi/v2/meetings/spaceInstant`,
|
246
|
+
body,
|
247
|
+
});
|
248
|
+
} catch (err) {
|
249
|
+
assert.deepEqual(err.message, 'No preferred webex site found');
|
250
|
+
assert.notCalled(webex.request);
|
251
|
+
}
|
252
|
+
});
|
253
|
+
|
254
|
+
it('handles error for MeetingInfoV2MeetingIsInProgressError', async () => {
|
255
|
+
const conversationUrl = 'conv.fakeconversationurl.com';
|
256
|
+
webex.request = sinon
|
257
|
+
.stub()
|
258
|
+
.rejects({stack: 'a stack', message: 'a message', statusCode: 403, body: {code: 33003}});
|
259
|
+
try {
|
260
|
+
await meetingInfo.enableStaticMeetingLink(conversationUrl);
|
261
|
+
} catch (err) {
|
262
|
+
assert.equal(err.wbxAppApiCode, 33003);
|
263
|
+
assert.instanceOf(err, MeetingInfoV2MeetingIsInProgressError);
|
264
|
+
assert.deepEqual(err.message, 'Meeting is in progress, code=33003, enable=true');
|
265
|
+
assert.calledWith(
|
266
|
+
Metrics.sendBehavioralMetric,
|
267
|
+
BEHAVIORAL_METRICS.MEETING_IS_IN_PROGRESS_ERROR,
|
268
|
+
{reason: 'a message', stack: 'a stack'}
|
269
|
+
);
|
270
|
+
}
|
271
|
+
});
|
272
|
+
|
273
|
+
it('handles error for MeetingInfoV2StaticMeetingLinkAlreadyExists', async () => {
|
274
|
+
const conversationUrl = 'conv.fakeconversationurl.com';
|
275
|
+
webex.request = sinon
|
276
|
+
.stub()
|
277
|
+
.rejects({stack: 'a stack', message: 'a message', statusCode: 409, body: {code: 409000}});
|
278
|
+
try {
|
279
|
+
await meetingInfo.enableStaticMeetingLink(conversationUrl);
|
280
|
+
} catch (err) {
|
281
|
+
assert.equal(err.wbxAppApiCode, 409000);
|
282
|
+
assert.instanceOf(err, MeetingInfoV2StaticMeetingLinkAlreadyExists);
|
283
|
+
assert.deepEqual(err.message, 'Static meeting link already exists, code=409000');
|
284
|
+
assert.calledWith(
|
285
|
+
Metrics.sendBehavioralMetric,
|
286
|
+
BEHAVIORAL_METRICS.STATIC_MEETING_LINK_ALREADY_EXISTS_ERROR,
|
287
|
+
{reason: 'a message', stack: 'a stack'}
|
288
|
+
);
|
289
|
+
}
|
290
|
+
});
|
291
|
+
|
292
|
+
it('handles generic error when enabling static link', async () => {
|
293
|
+
const conversationUrl = 'conv.fakeconversationurl.com';
|
294
|
+
webex.request = sinon
|
295
|
+
.stub()
|
296
|
+
.rejects({stack: 'a stack', message: 'a message', statusCode: 500, body: {code: 400000}});
|
297
|
+
try {
|
298
|
+
await meetingInfo.enableStaticMeetingLink(conversationUrl);
|
299
|
+
} catch (err) {
|
300
|
+
assert(Metrics.sendBehavioralMetric.calledOnce);
|
301
|
+
assert.calledWith(
|
302
|
+
Metrics.sendBehavioralMetric,
|
303
|
+
BEHAVIORAL_METRICS.ENABLE_STATIC_METTING_LINK_FAILURE,
|
304
|
+
{reason: 'a message', stack: 'a stack'}
|
305
|
+
);
|
306
|
+
}
|
307
|
+
});
|
308
|
+
});
|
309
|
+
|
310
|
+
describe('#disableStaticMeetingLink', () => {
|
311
|
+
it('should disable static meeting link for given conversation url', async () => {
|
312
|
+
const conversationUrl = 'conv.fakeconversationurl.com';
|
313
|
+
const body = {spaceUrl: conversationUrl};
|
314
|
+
const requestResponse = {statusCode: 204};
|
315
|
+
webex.request.resolves(requestResponse);
|
316
|
+
const result = await meetingInfo.disableStaticMeetingLink(conversationUrl);
|
317
|
+
|
318
|
+
assert.calledWith(webex.request, {
|
319
|
+
method: 'POST',
|
320
|
+
uri: `https://${webex.meetings.preferredWebexSite}/wbxappapi/v2/meetings/spaceInstant/deletePersistentMeeting`,
|
321
|
+
body,
|
322
|
+
});
|
323
|
+
|
324
|
+
assert(Metrics.sendBehavioralMetric.calledOnce);
|
325
|
+
assert.calledWith(
|
326
|
+
Metrics.sendBehavioralMetric,
|
327
|
+
BEHAVIORAL_METRICS.DISABLE_STATIC_MEETING_LINK_SUCCESS
|
328
|
+
);
|
329
|
+
|
330
|
+
assert.deepEqual(result, requestResponse);
|
331
|
+
});
|
332
|
+
|
333
|
+
it('should not disable static meeting link for given conversation url if no preferred webex site', async () => {
|
334
|
+
webex.meetings.preferredWebexSite = undefined;
|
335
|
+
|
336
|
+
const conversationUrl = 'conv.fakeconversationurl.com';
|
337
|
+
try {
|
338
|
+
await meetingInfo.disableStaticMeetingLink(conversationUrl);
|
339
|
+
|
340
|
+
assert.calledWith(webex.request, {
|
341
|
+
method: 'POST',
|
342
|
+
uri: `https://${webex.meetings.preferredWebexSite}/wbxappapi/v2/meetings/spaceInstant/deletePersistentMeeting`,
|
343
|
+
body,
|
344
|
+
});
|
345
|
+
} catch (err) {
|
346
|
+
assert.deepEqual(err.message, 'No preferred webex site found');
|
347
|
+
assert.notCalled(webex.request);
|
348
|
+
}
|
349
|
+
});
|
350
|
+
|
351
|
+
it('handles error for MeetingInfoV2MeetingIsInProgressError for disable', async () => {
|
352
|
+
const conversationUrl = 'conv.fakeconversationurl.com';
|
353
|
+
webex.request = sinon.stub().rejects({
|
354
|
+
stack: 'a stack',
|
355
|
+
message: 'a message',
|
356
|
+
statusCode: 403,
|
357
|
+
body: {code: 33003},
|
358
|
+
});
|
359
|
+
try {
|
360
|
+
await meetingInfo.disableStaticMeetingLink(conversationUrl);
|
361
|
+
} catch (err) {
|
362
|
+
assert.equal(err.wbxAppApiCode, 33003);
|
363
|
+
assert.instanceOf(err, MeetingInfoV2MeetingIsInProgressError);
|
364
|
+
assert.deepEqual(err.message, 'Meeting is in progress, code=33003, enable=false');
|
365
|
+
assert.calledWith(
|
366
|
+
Metrics.sendBehavioralMetric,
|
367
|
+
BEHAVIORAL_METRICS.MEETING_IS_IN_PROGRESS_ERROR,
|
368
|
+
{reason: 'a message', stack: 'a stack'}
|
369
|
+
);
|
370
|
+
}
|
371
|
+
});
|
372
|
+
|
373
|
+
it('handles generic error when disabling static link', async () => {
|
374
|
+
const conversationUrl = 'conv.fakeconversationurl.com';
|
375
|
+
webex.request = sinon.stub().rejects({
|
376
|
+
stack: 'a stack',
|
377
|
+
message: 'a message',
|
378
|
+
statusCode: 500,
|
379
|
+
body: {code: 400000},
|
380
|
+
});
|
381
|
+
try {
|
382
|
+
await meetingInfo.disableStaticMeetingLink(conversationUrl);
|
383
|
+
} catch (err) {
|
384
|
+
assert(Metrics.sendBehavioralMetric.calledOnce);
|
385
|
+
assert.calledWith(
|
386
|
+
Metrics.sendBehavioralMetric,
|
387
|
+
BEHAVIORAL_METRICS.DISABLE_STATIC_MEETING_LINK_FAILURE,
|
388
|
+
{reason: 'a message', stack: 'a stack'}
|
389
|
+
);
|
390
|
+
}
|
391
|
+
});
|
392
|
+
});
|
393
|
+
|
96
394
|
describe('#fetchMeetingInfo', () => {
|
97
395
|
it('should fetch meeting info for the destination type', async () => {
|
98
396
|
const body = {meetingKey: '1234323'};
|
@@ -151,14 +449,20 @@ describe('plugin-meetings', () => {
|
|
151
449
|
const body = {meetingKey: '1234323'};
|
152
450
|
const requestResponse = {statusCode: 200, body};
|
153
451
|
|
154
|
-
sinon
|
155
|
-
.
|
156
|
-
|
452
|
+
sinon.stub(MeetingInfoUtil, 'getDestinationType').returns(
|
453
|
+
Promise.resolve({
|
454
|
+
type: DESTINATION_TYPE.SIP_URI,
|
455
|
+
destination: 'example@something.webex.com',
|
456
|
+
})
|
457
|
+
);
|
157
458
|
sinon.stub(MeetingInfoUtil, 'getRequestBody').returns(Promise.resolve(body));
|
158
459
|
sinon.stub(MeetingInfoUtil, 'getDirectMeetingInfoURI').returns('https://example.com');
|
159
460
|
webex.request.resolves(requestResponse);
|
160
461
|
|
161
|
-
const result = await meetingInfo.fetchMeetingInfo(
|
462
|
+
const result = await meetingInfo.fetchMeetingInfo(
|
463
|
+
'example@something.webex.com',
|
464
|
+
DESTINATION_TYPE.SIP_URI
|
465
|
+
);
|
162
466
|
|
163
467
|
assert.calledWith(MeetingInfoUtil.getDestinationType, {
|
164
468
|
destination: 'example@something.webex.com',
|
@@ -186,10 +490,15 @@ describe('plugin-meetings', () => {
|
|
186
490
|
|
187
491
|
webex.request.resolves(requestResponse);
|
188
492
|
|
189
|
-
const result = await meetingInfo.fetchMeetingInfo(
|
190
|
-
|
191
|
-
|
192
|
-
|
493
|
+
const result = await meetingInfo.fetchMeetingInfo(
|
494
|
+
'1234323',
|
495
|
+
DESTINATION_TYPE.MEETING_ID,
|
496
|
+
'abc',
|
497
|
+
{
|
498
|
+
id: '999',
|
499
|
+
code: 'aabbcc11',
|
500
|
+
}
|
501
|
+
);
|
193
502
|
|
194
503
|
assert.calledWith(webex.request, {
|
195
504
|
method: 'POST',
|
@@ -202,6 +511,7 @@ describe('plugin-meetings', () => {
|
|
202
511
|
password: 'abc',
|
203
512
|
captchaID: '999',
|
204
513
|
captchaVerifyCode: 'aabbcc11',
|
514
|
+
disableWebRedirect: true,
|
205
515
|
},
|
206
516
|
});
|
207
517
|
assert.deepEqual(result, requestResponse);
|
@@ -218,7 +528,13 @@ describe('plugin-meetings', () => {
|
|
218
528
|
|
219
529
|
webex.request.resolves(requestResponse);
|
220
530
|
|
221
|
-
const result = await meetingInfo.fetchMeetingInfo(
|
531
|
+
const result = await meetingInfo.fetchMeetingInfo(
|
532
|
+
'1234323',
|
533
|
+
DESTINATION_TYPE.MEETING_ID,
|
534
|
+
null,
|
535
|
+
null,
|
536
|
+
installedOrgID
|
537
|
+
);
|
222
538
|
|
223
539
|
assert.calledWith(webex.request, {
|
224
540
|
method: 'POST',
|
@@ -229,6 +545,7 @@ describe('plugin-meetings', () => {
|
|
229
545
|
supportCountryList: true,
|
230
546
|
meetingKey: '1234323',
|
231
547
|
installedOrgID,
|
548
|
+
disableWebRedirect: true,
|
232
549
|
},
|
233
550
|
});
|
234
551
|
assert.deepEqual(result, requestResponse);
|
@@ -245,7 +562,14 @@ describe('plugin-meetings', () => {
|
|
245
562
|
|
246
563
|
webex.request.resolves(requestResponse);
|
247
564
|
|
248
|
-
const result = await meetingInfo.fetchMeetingInfo(
|
565
|
+
const result = await meetingInfo.fetchMeetingInfo(
|
566
|
+
'1234323',
|
567
|
+
DESTINATION_TYPE.MEETING_ID,
|
568
|
+
null,
|
569
|
+
null,
|
570
|
+
null,
|
571
|
+
locusId
|
572
|
+
);
|
249
573
|
|
250
574
|
assert.calledWith(webex.request, {
|
251
575
|
method: 'POST',
|
@@ -256,6 +580,7 @@ describe('plugin-meetings', () => {
|
|
256
580
|
supportCountryList: true,
|
257
581
|
meetingKey: '1234323',
|
258
582
|
locusId,
|
583
|
+
disableWebRedirect: true,
|
259
584
|
},
|
260
585
|
});
|
261
586
|
assert.deepEqual(result, requestResponse);
|
@@ -268,11 +593,19 @@ describe('plugin-meetings', () => {
|
|
268
593
|
|
269
594
|
it('should fetch meeting info with provided extraParams', async () => {
|
270
595
|
const requestResponse = {statusCode: 200, body: {meetingKey: '1234323'}};
|
271
|
-
const extraParams = {mtid: 'm9fe0afd8c435e892afcce9ea25b97046', joinTXId: 'TSmrX61wNF'}
|
596
|
+
const extraParams = {mtid: 'm9fe0afd8c435e892afcce9ea25b97046', joinTXId: 'TSmrX61wNF'};
|
272
597
|
|
273
598
|
webex.request.resolves(requestResponse);
|
274
599
|
|
275
|
-
const result = await meetingInfo.fetchMeetingInfo(
|
600
|
+
const result = await meetingInfo.fetchMeetingInfo(
|
601
|
+
'1234323',
|
602
|
+
DESTINATION_TYPE.MEETING_ID,
|
603
|
+
null,
|
604
|
+
null,
|
605
|
+
null,
|
606
|
+
null,
|
607
|
+
extraParams
|
608
|
+
);
|
276
609
|
|
277
610
|
assert.calledWith(webex.request, {
|
278
611
|
method: 'POST',
|
@@ -283,6 +616,7 @@ describe('plugin-meetings', () => {
|
|
283
616
|
supportCountryList: true,
|
284
617
|
meetingKey: '1234323',
|
285
618
|
...extraParams,
|
619
|
+
disableWebRedirect: true,
|
286
620
|
},
|
287
621
|
});
|
288
622
|
assert.deepEqual(result, requestResponse);
|
@@ -305,7 +639,7 @@ describe('plugin-meetings', () => {
|
|
305
639
|
it('create adhoc meeting when conversationUrl and installedOrgID passed with enableAdhocMeetings toggle', async () => {
|
306
640
|
sinon.stub(meetingInfo, 'createAdhocSpaceMeeting').returns(Promise.resolve());
|
307
641
|
|
308
|
-
const installedOrgID = '12345'
|
642
|
+
const installedOrgID = '12345';
|
309
643
|
|
310
644
|
await meetingInfo.fetchMeetingInfo(
|
311
645
|
'conversationUrl',
|
@@ -324,7 +658,6 @@ describe('plugin-meetings', () => {
|
|
324
658
|
meetingInfo.createAdhocSpaceMeeting.restore();
|
325
659
|
});
|
326
660
|
|
327
|
-
|
328
661
|
it('should not call createAdhocSpaceMeeting if enableAdhocMeetings toggle is off', async () => {
|
329
662
|
webex.config.meetings.experimental.enableAdhocMeetings = false;
|
330
663
|
sinon.stub(meetingInfo, 'createAdhocSpaceMeeting').returns(Promise.resolve());
|
@@ -350,7 +683,9 @@ describe('plugin-meetings', () => {
|
|
350
683
|
it('should throw an error MeetingInfoV2AdhocMeetingError if not able to start adhoc meeting for a conversation', async () => {
|
351
684
|
webex.config.meetings.experimental.enableAdhocMeetings = true;
|
352
685
|
|
353
|
-
webex.request = sinon
|
686
|
+
webex.request = sinon
|
687
|
+
.stub()
|
688
|
+
.rejects({stack: 'a stack', message: 'a message', statusCode: 403, body: {code: 400000}});
|
354
689
|
try {
|
355
690
|
await meetingInfo.createAdhocSpaceMeeting('conversationUrl');
|
356
691
|
} catch (err) {
|
@@ -416,7 +751,8 @@ describe('plugin-meetings', () => {
|
|
416
751
|
);
|
417
752
|
assert.fail('fetchMeetingInfo should have thrown, but has not done that');
|
418
753
|
} catch (err) {
|
419
|
-
const submitInternalEventCalls =
|
754
|
+
const submitInternalEventCalls =
|
755
|
+
webex.internal.newMetrics.submitInternalEvent.getCalls();
|
420
756
|
const submitClientEventCalls = webex.internal.newMetrics.submitClientEvent.getCalls();
|
421
757
|
|
422
758
|
if (sendCAevents) {
|
@@ -427,7 +763,7 @@ describe('plugin-meetings', () => {
|
|
427
763
|
assert.deepEqual(submitClientEventCalls[0].args[0], {
|
428
764
|
name: 'client.meetinginfo.request',
|
429
765
|
options: {
|
430
|
-
meetingId: 'meeting-id'
|
766
|
+
meetingId: 'meeting-id',
|
431
767
|
},
|
432
768
|
});
|
433
769
|
|
@@ -480,11 +816,14 @@ describe('plugin-meetings', () => {
|
|
480
816
|
],
|
481
817
|
({meetingId, sendCAevents, shouldSendCAevents, confIdStr}) => {
|
482
818
|
it('should send CA metric if meetingId is provided and send CA events is authorized', async () => {
|
483
|
-
const requestResponse = {
|
819
|
+
const requestResponse = {
|
820
|
+
statusCode: 200,
|
821
|
+
body: {meetingKey: '1234323', meetingId: '123', confID: '321'},
|
822
|
+
};
|
484
823
|
if (confIdStr) {
|
485
824
|
requestResponse.body.confIdStr = confIdStr;
|
486
825
|
}
|
487
|
-
const extraParams = {mtid: 'm9fe0afd8c435e892afcce9ea25b97046', joinTXId: 'TSmrX61wNF'}
|
826
|
+
const extraParams = {mtid: 'm9fe0afd8c435e892afcce9ea25b97046', joinTXId: 'TSmrX61wNF'};
|
488
827
|
|
489
828
|
webex.request.resolves(requestResponse);
|
490
829
|
|
@@ -508,6 +847,7 @@ describe('plugin-meetings', () => {
|
|
508
847
|
supportCountryList: true,
|
509
848
|
meetingKey: '1234323',
|
510
849
|
...extraParams,
|
850
|
+
disableWebRedirect: true,
|
511
851
|
},
|
512
852
|
});
|
513
853
|
assert.deepEqual(result, requestResponse);
|
@@ -517,10 +857,11 @@ describe('plugin-meetings', () => {
|
|
517
857
|
BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_SUCCESS
|
518
858
|
);
|
519
859
|
|
520
|
-
const submitInternalEventCalls =
|
860
|
+
const submitInternalEventCalls =
|
861
|
+
webex.internal.newMetrics.submitInternalEvent.getCalls();
|
521
862
|
const submitClientEventCalls = webex.internal.newMetrics.submitClientEvent.getCalls();
|
522
863
|
|
523
|
-
if(shouldSendCAevents) {
|
864
|
+
if (shouldSendCAevents) {
|
524
865
|
assert.deepEqual(submitInternalEventCalls[0].args[0], {
|
525
866
|
name: 'internal.client.meetinginfo.request',
|
526
867
|
});
|
@@ -528,7 +869,7 @@ describe('plugin-meetings', () => {
|
|
528
869
|
name: 'client.meetinginfo.request',
|
529
870
|
options: {
|
530
871
|
meetingId,
|
531
|
-
}
|
872
|
+
},
|
532
873
|
});
|
533
874
|
|
534
875
|
assert.deepEqual(submitInternalEventCalls[1].args[0], {
|
@@ -544,20 +885,25 @@ describe('plugin-meetings', () => {
|
|
544
885
|
options: {
|
545
886
|
meetingId,
|
546
887
|
globalMeetingId: requestResponse.body?.meetingId,
|
547
|
-
webexConferenceIdStr: confIdStr
|
548
|
-
|
888
|
+
webexConferenceIdStr: confIdStr
|
889
|
+
? requestResponse.body?.confIdStr
|
890
|
+
: requestResponse.body?.confID,
|
891
|
+
},
|
549
892
|
});
|
550
893
|
} else {
|
551
894
|
assert.notCalled(webex.internal.newMetrics.submitClientEvent);
|
552
895
|
assert.notCalled(webex.internal.newMetrics.submitInternalEvent);
|
553
896
|
}
|
554
|
-
})
|
897
|
+
});
|
555
898
|
}
|
556
|
-
)
|
899
|
+
);
|
557
900
|
|
558
901
|
it('should send CA metric if meetingId is provided and send CA events is authorized', async () => {
|
559
|
-
const requestResponse = {
|
560
|
-
|
902
|
+
const requestResponse = {
|
903
|
+
statusCode: 200,
|
904
|
+
body: {meetingKey: '1234323', confID: '123', meetingId: '321'},
|
905
|
+
};
|
906
|
+
const extraParams = {mtid: 'm9fe0afd8c435e892afcce9ea25b97046', joinTXId: 'TSmrX61wNF'};
|
561
907
|
|
562
908
|
webex.request.resolves(requestResponse);
|
563
909
|
|
@@ -581,6 +927,7 @@ describe('plugin-meetings', () => {
|
|
581
927
|
supportCountryList: true,
|
582
928
|
meetingKey: '1234323',
|
583
929
|
...extraParams,
|
930
|
+
disableWebRedirect: true,
|
584
931
|
},
|
585
932
|
});
|
586
933
|
assert.deepEqual(result, requestResponse);
|
@@ -600,7 +947,7 @@ describe('plugin-meetings', () => {
|
|
600
947
|
name: 'client.meetinginfo.request',
|
601
948
|
options: {
|
602
949
|
meetingId: 'meetingId',
|
603
|
-
}
|
950
|
+
},
|
604
951
|
});
|
605
952
|
|
606
953
|
assert.deepEqual(submitInternalEventCalls[1].args[0], {
|
@@ -617,47 +964,41 @@ describe('plugin-meetings', () => {
|
|
617
964
|
meetingId: 'meetingId',
|
618
965
|
globalMeetingId: requestResponse.body?.meetingId,
|
619
966
|
webexConferenceIdStr: requestResponse.body?.confID,
|
620
|
-
}
|
967
|
+
},
|
621
968
|
});
|
622
969
|
});
|
623
970
|
|
624
|
-
forEach(
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
],
|
629
|
-
({sendCAevents}) => {
|
630
|
-
it(`should not send CA metric if meetingId is not provided disregarding if sendCAevents is ${sendCAevents}`, async () => {
|
631
|
-
const message = 'a message';
|
632
|
-
const meetingInfoData = 'meeting info';
|
971
|
+
forEach([{sendCAevents: true}, {sendCAevents: false}], ({sendCAevents}) => {
|
972
|
+
it(`should not send CA metric if meetingId is not provided disregarding if sendCAevents is ${sendCAevents}`, async () => {
|
973
|
+
const message = 'a message';
|
974
|
+
const meetingInfoData = 'meeting info';
|
633
975
|
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
});
|
639
|
-
try {
|
640
|
-
await meetingInfo.fetchMeetingInfo(
|
641
|
-
'1234323',
|
642
|
-
DESTINATION_TYPE.MEETING_ID,
|
643
|
-
'abc',
|
644
|
-
{
|
645
|
-
id: '999',
|
646
|
-
code: 'aabbcc11',
|
647
|
-
},
|
648
|
-
null,
|
649
|
-
null,
|
650
|
-
undefined,
|
651
|
-
{meetingId: undefined, sendCAevents}
|
652
|
-
);
|
653
|
-
assert.fail('fetchMeetingInfo should have thrown, but has not done that');
|
654
|
-
} catch (err) {
|
655
|
-
assert.notCalled(webex.internal.newMetrics.submitClientEvent);
|
656
|
-
assert.notCalled(webex.internal.newMetrics.submitInternalEvent);
|
657
|
-
}
|
976
|
+
webex.request = sinon.stub().rejects({
|
977
|
+
statusCode: 403,
|
978
|
+
body: {message, code: 403102, data: {meetingInfo: meetingInfoData}},
|
979
|
+
url: 'http://api-url.com',
|
658
980
|
});
|
659
|
-
|
660
|
-
|
981
|
+
try {
|
982
|
+
await meetingInfo.fetchMeetingInfo(
|
983
|
+
'1234323',
|
984
|
+
DESTINATION_TYPE.MEETING_ID,
|
985
|
+
'abc',
|
986
|
+
{
|
987
|
+
id: '999',
|
988
|
+
code: 'aabbcc11',
|
989
|
+
},
|
990
|
+
null,
|
991
|
+
null,
|
992
|
+
undefined,
|
993
|
+
{meetingId: undefined, sendCAevents}
|
994
|
+
);
|
995
|
+
assert.fail('fetchMeetingInfo should have thrown, but has not done that');
|
996
|
+
} catch (err) {
|
997
|
+
assert.notCalled(webex.internal.newMetrics.submitClientEvent);
|
998
|
+
assert.notCalled(webex.internal.newMetrics.submitInternalEvent);
|
999
|
+
}
|
1000
|
+
});
|
1001
|
+
});
|
661
1002
|
|
662
1003
|
it('should throw MeetingInfoV2PasswordError for 403 response', async () => {
|
663
1004
|
const FAKE_MEETING_INFO = {blablabla: 'some_fake_meeting_info'};
|
@@ -730,6 +1071,41 @@ describe('plugin-meetings', () => {
|
|
730
1071
|
});
|
731
1072
|
});
|
732
1073
|
|
1074
|
+
describe('should stop call fetchMeetingInfo if siteFullUrl is empty for 404 response', () => {
|
1075
|
+
|
1076
|
+
const runTest = async (wbxAppApiCode, expectedIsPasswordRequired) => {
|
1077
|
+
webex.request = sinon.stub().rejects({
|
1078
|
+
statusCode: 404,
|
1079
|
+
body: {
|
1080
|
+
code: wbxAppApiCode,
|
1081
|
+
message: 'Alternate Meeting Server',
|
1082
|
+
data: {
|
1083
|
+
'siteFullUrl': ''
|
1084
|
+
}
|
1085
|
+
},
|
1086
|
+
});
|
1087
|
+
|
1088
|
+
|
1089
|
+
try {
|
1090
|
+
await meetingInfo.fetchMeetingInfo('1234323', DESTINATION_TYPE.MEETING_ID, 'abc', {
|
1091
|
+
id: '999',
|
1092
|
+
code: 'aabbcc11',
|
1093
|
+
});
|
1094
|
+
assert.fail('fetchMeetingInfo should have thrown, but has not done that');
|
1095
|
+
} catch (err) {
|
1096
|
+
assert(Metrics.sendBehavioralMetric.calledOnce);
|
1097
|
+
assert.deepEqual(err.body.data, {
|
1098
|
+
siteFullUrl: ''
|
1099
|
+
});
|
1100
|
+
}
|
1101
|
+
};
|
1102
|
+
|
1103
|
+
it('should throw MeetingInfoV2CaptchaError for 404 response (wbxappapi code 404100)', async () => {
|
1104
|
+
await runTest(404100, false);
|
1105
|
+
});
|
1106
|
+
});
|
1107
|
+
|
1108
|
+
|
733
1109
|
it('should throw an error and not fetch with an "empty" body', async () => {
|
734
1110
|
const body = {supportHostKey: 'foo', supportCountryList: 'bar'};
|
735
1111
|
const requestResponse = {statusCode: 200, body};
|
@@ -786,23 +1162,24 @@ describe('plugin-meetings', () => {
|
|
786
1162
|
ciUserUuid: conversation.participants.items[1].entryUUID,
|
787
1163
|
});
|
788
1164
|
|
789
|
-
return {invitee}
|
790
|
-
}
|
1165
|
+
return {invitee};
|
1166
|
+
};
|
791
1167
|
|
792
1168
|
it('Make a request to /spaceInstant when conversationUrl', async () => {
|
793
1169
|
const {invitee} = setup();
|
794
1170
|
|
795
1171
|
webex.request.resolves({
|
796
1172
|
statusCode: 200,
|
797
|
-
body: conversation
|
1173
|
+
body: conversation,
|
798
1174
|
});
|
799
1175
|
|
800
|
-
const result = await meetingInfo.createAdhocSpaceMeeting(conversationUrl,installedOrgID);
|
1176
|
+
const result = await meetingInfo.createAdhocSpaceMeeting(conversationUrl, installedOrgID);
|
801
1177
|
|
802
|
-
assert.calledWith(
|
803
|
-
|
804
|
-
|
805
|
-
|
1178
|
+
assert.calledWith(webex.request, {
|
1179
|
+
uri: conversationUrl,
|
1180
|
+
qs: {includeParticipants: true},
|
1181
|
+
disableTransform: true,
|
1182
|
+
});
|
806
1183
|
|
807
1184
|
assert.calledWith(webex.request, {
|
808
1185
|
method: 'POST',
|
@@ -813,14 +1190,15 @@ describe('plugin-meetings', () => {
|
|
813
1190
|
keyUrl: conversation.encryptionKeyUrl,
|
814
1191
|
kroUrl: conversation.kmsResourceObjectUrl,
|
815
1192
|
invitees: invitee,
|
816
|
-
installedOrgID: installedOrgID
|
1193
|
+
installedOrgID: installedOrgID,
|
1194
|
+
schedule: false,
|
817
1195
|
},
|
818
1196
|
});
|
819
1197
|
assert.calledOnce(Metrics.sendBehavioralMetric);
|
820
1198
|
assert.calledWith(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.ADHOC_MEETING_SUCCESS);
|
821
1199
|
assert.deepEqual(result, {
|
822
1200
|
body: conversation,
|
823
|
-
statusCode: 200
|
1201
|
+
statusCode: 200,
|
824
1202
|
});
|
825
1203
|
});
|
826
1204
|
it('Make a request to /spaceInstant when conversationUrl with installed org ID', async () => {
|
@@ -845,13 +1223,13 @@ describe('plugin-meetings', () => {
|
|
845
1223
|
kroUrl: conversation.kmsResourceObjectUrl,
|
846
1224
|
invitees: invitee,
|
847
1225
|
installedOrgID,
|
1226
|
+
schedule: false,
|
848
1227
|
},
|
849
1228
|
});
|
850
1229
|
assert(Metrics.sendBehavioralMetric.calledOnce);
|
851
1230
|
assert.calledWith(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.ADHOC_MEETING_SUCCESS);
|
852
1231
|
});
|
853
1232
|
|
854
|
-
|
855
1233
|
forEach(
|
856
1234
|
[
|
857
1235
|
{errorCode: 403049},
|
@@ -885,7 +1263,6 @@ describe('plugin-meetings', () => {
|
|
885
1263
|
BEHAVIORAL_METRICS.MEETING_INFO_POLICY_ERROR,
|
886
1264
|
{code: errorCode}
|
887
1265
|
);
|
888
|
-
|
889
1266
|
}
|
890
1267
|
});
|
891
1268
|
}
|
@@ -926,47 +1303,40 @@ describe('plugin-meetings', () => {
|
|
926
1303
|
BEHAVIORAL_METRICS.JOIN_WEBINAR_ERROR,
|
927
1304
|
{code: errorCode}
|
928
1305
|
);
|
929
|
-
|
930
1306
|
}
|
931
1307
|
});
|
932
1308
|
}
|
933
1309
|
);
|
934
1310
|
|
935
|
-
forEach(
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
({errorCode}) => {
|
940
|
-
it(`should throw a MeetingInfoV2JoinForbiddenError for error code ${errorCode}`, async () => {
|
941
|
-
const message = 'a message';
|
942
|
-
const meetingInfoData = 'meeting info';
|
1311
|
+
forEach([{errorCode: 403003}], ({errorCode}) => {
|
1312
|
+
it(`should throw a MeetingInfoV2JoinForbiddenError for error code ${errorCode}`, async () => {
|
1313
|
+
const message = 'a message';
|
1314
|
+
const meetingInfoData = 'meeting info';
|
943
1315
|
|
944
|
-
|
945
|
-
|
946
|
-
|
1316
|
+
webex.request = sinon.stub().rejects({
|
1317
|
+
statusCode: 403,
|
1318
|
+
body: {message, code: errorCode, data: {meetingInfo: meetingInfoData}},
|
1319
|
+
});
|
1320
|
+
try {
|
1321
|
+
await meetingInfo.fetchMeetingInfo('1234323', DESTINATION_TYPE.MEETING_ID, 'abc', {
|
1322
|
+
id: '999',
|
1323
|
+
code: 'aabbcc11',
|
947
1324
|
});
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
} catch (err) {
|
954
|
-
assert.instanceOf(err, MeetingInfoV2JoinForbiddenError);
|
955
|
-
assert.deepEqual(err.message, `${message}, code=${errorCode}`);
|
956
|
-
assert.equal(err.wbxAppApiCode, errorCode);
|
957
|
-
assert.deepEqual(err.meetingInfo, meetingInfoData);
|
958
|
-
|
959
|
-
assert(Metrics.sendBehavioralMetric.calledOnce);
|
960
|
-
assert.calledWith(
|
961
|
-
Metrics.sendBehavioralMetric,
|
962
|
-
BEHAVIORAL_METRICS.JOIN_FORBIDDEN_ERROR,
|
963
|
-
{code: errorCode}
|
964
|
-
);
|
1325
|
+
} catch (err) {
|
1326
|
+
assert.instanceOf(err, MeetingInfoV2JoinForbiddenError);
|
1327
|
+
assert.deepEqual(err.message, `${message}, code=${errorCode}`);
|
1328
|
+
assert.equal(err.wbxAppApiCode, errorCode);
|
1329
|
+
assert.deepEqual(err.meetingInfo, meetingInfoData);
|
965
1330
|
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
1331
|
+
assert(Metrics.sendBehavioralMetric.calledOnce);
|
1332
|
+
assert.calledWith(
|
1333
|
+
Metrics.sendBehavioralMetric,
|
1334
|
+
BEHAVIORAL_METRICS.JOIN_FORBIDDEN_ERROR,
|
1335
|
+
{code: errorCode}
|
1336
|
+
);
|
1337
|
+
}
|
1338
|
+
});
|
1339
|
+
});
|
970
1340
|
});
|
971
1341
|
});
|
972
1342
|
});
|