@webex/plugin-meetings 3.0.0-beta.31 → 3.0.0-beta.310
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 +46 -8
- package/dist/annotation/annotation.types.js +7 -0
- package/dist/annotation/annotation.types.js.map +1 -0
- package/dist/annotation/constants.js +49 -0
- package/dist/annotation/constants.js.map +1 -0
- package/dist/annotation/index.js +342 -0
- package/dist/annotation/index.js.map +1 -0
- package/dist/breakouts/breakout.js +94 -15
- package/dist/breakouts/breakout.js.map +1 -1
- package/dist/breakouts/edit-lock-error.js +52 -0
- package/dist/breakouts/edit-lock-error.js.map +1 -0
- package/dist/breakouts/events.js +45 -0
- package/dist/breakouts/events.js.map +1 -0
- package/dist/breakouts/index.js +709 -35
- package/dist/breakouts/index.js.map +1 -1
- package/dist/breakouts/utils.js +45 -1
- package/dist/breakouts/utils.js.map +1 -1
- package/dist/common/errors/no-meeting-info.js +51 -0
- package/dist/common/errors/no-meeting-info.js.map +1 -0
- package/dist/common/errors/reclaim-host-role-errors.js +158 -0
- package/dist/common/errors/reclaim-host-role-errors.js.map +1 -0
- package/dist/common/errors/webex-errors.js +48 -7
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/logs/logger-proxy.js +1 -1
- package/dist/common/logs/logger-proxy.js.map +1 -1
- package/dist/common/logs/request.js +5 -1
- package/dist/common/logs/request.js.map +1 -1
- package/dist/common/queue.js +24 -9
- package/dist/common/queue.js.map +1 -1
- package/dist/config.js +5 -11
- package/dist/config.js.map +1 -1
- package/dist/constants.js +233 -29
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/enums.js +14 -2
- package/dist/controls-options-manager/enums.js.map +1 -1
- package/dist/controls-options-manager/index.js +109 -15
- package/dist/controls-options-manager/index.js.map +1 -1
- package/dist/controls-options-manager/types.js +7 -0
- package/dist/controls-options-manager/types.js.map +1 -0
- package/dist/controls-options-manager/util.js +309 -18
- package/dist/controls-options-manager/util.js.map +1 -1
- package/dist/index.js +112 -1
- package/dist/index.js.map +1 -1
- package/dist/interpretation/collection.js +23 -0
- package/dist/interpretation/collection.js.map +1 -0
- package/dist/interpretation/index.js +366 -0
- package/dist/interpretation/index.js.map +1 -0
- package/dist/interpretation/siLanguage.js +25 -0
- package/dist/interpretation/siLanguage.js.map +1 -0
- package/dist/locus-info/controlsUtils.js +91 -2
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +383 -62
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +7 -1
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js +57 -1
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +249 -72
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js +89 -14
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js +61 -116
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +73 -124
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +82 -2
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +3777 -2929
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +292 -0
- package/dist/meeting/locusMediaRequest.js.map +1 -0
- package/dist/meeting/muteState.js +230 -124
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +260 -196
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/util.js +601 -417
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/index.js +73 -7
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +192 -51
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/util.js +1 -1
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js +36 -36
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +39 -0
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +415 -115
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js +7 -0
- package/dist/meetings/meetings.types.js.map +1 -0
- package/dist/meetings/request.js +2 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +72 -6
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +58 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js +25 -0
- package/dist/member/types.js.map +1 -0
- package/dist/member/util.js +132 -25
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js +10 -0
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +102 -6
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +106 -38
- package/dist/members/request.js.map +1 -1
- package/dist/members/types.js +15 -0
- package/dist/members/types.js.map +1 -0
- package/dist/members/util.js +326 -232
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +13 -5
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +1 -468
- package/dist/metrics/index.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +238 -49
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/receiveSlot.js +29 -16
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/receiveSlotManager.js +39 -36
- package/dist/multistream/receiveSlotManager.js.map +1 -1
- package/dist/multistream/remoteMedia.js +44 -18
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.js +60 -3
- package/dist/multistream/remoteMediaGroup.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +209 -59
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +233 -0
- package/dist/multistream/sendSlotManager.js.map +1 -0
- package/dist/reachability/index.js +225 -59
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js +17 -8
- package/dist/reachability/request.js.map +1 -1
- package/dist/reconnection-manager/index.js +201 -156
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/recording-controller/index.js +21 -2
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/recording-controller/util.js +9 -8
- package/dist/recording-controller/util.js.map +1 -1
- package/dist/roap/index.js +62 -32
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +112 -97
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/turnDiscovery.js +95 -36
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/rtcMetrics/constants.js +12 -0
- package/dist/rtcMetrics/constants.js.map +1 -0
- package/dist/rtcMetrics/index.js +117 -0
- package/dist/rtcMetrics/index.js.map +1 -0
- package/dist/statsAnalyzer/index.js +86 -78
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +11 -10
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/types/annotation/annotation.types.d.ts +42 -0
- package/dist/types/annotation/constants.d.ts +31 -0
- package/dist/types/annotation/index.d.ts +117 -0
- package/dist/types/breakouts/edit-lock-error.d.ts +15 -0
- package/dist/types/breakouts/events.d.ts +8 -0
- package/dist/types/breakouts/utils.d.ts +14 -0
- package/dist/types/common/errors/no-meeting-info.d.ts +14 -0
- package/dist/types/common/errors/reclaim-host-role-errors.d.ts +60 -0
- package/dist/types/common/errors/webex-errors.d.ts +25 -1
- package/dist/types/common/logs/request.d.ts +2 -0
- package/dist/types/common/queue.d.ts +9 -7
- package/dist/types/config.d.ts +1 -7
- package/dist/types/constants.d.ts +194 -24
- package/dist/types/controls-options-manager/enums.d.ts +11 -1
- package/dist/types/controls-options-manager/index.d.ts +17 -1
- package/dist/types/controls-options-manager/types.d.ts +43 -0
- package/dist/types/controls-options-manager/util.d.ts +1 -7
- package/dist/types/index.d.ts +6 -4
- package/dist/types/interpretation/collection.d.ts +5 -0
- package/dist/types/interpretation/index.d.ts +5 -0
- package/dist/types/interpretation/siLanguage.d.ts +5 -0
- package/dist/types/locus-info/index.d.ts +57 -4
- package/dist/types/locus-info/parser.d.ts +67 -6
- package/dist/types/media/index.d.ts +2 -0
- package/dist/types/media/properties.d.ts +34 -48
- package/dist/types/meeting/in-meeting-actions.d.ts +82 -2
- package/dist/types/meeting/index.d.ts +463 -510
- package/dist/types/meeting/locusMediaRequest.d.ts +74 -0
- package/dist/types/meeting/muteState.d.ts +99 -23
- package/dist/types/meeting/request.d.ts +72 -43
- package/dist/types/meeting/util.d.ts +101 -1
- package/dist/types/meeting-info/index.d.ts +13 -1
- package/dist/types/meeting-info/meeting-info-v2.d.ts +31 -1
- package/dist/types/meetings/collection.d.ts +17 -0
- package/dist/types/meetings/index.d.ts +98 -20
- package/dist/types/meetings/meetings.types.d.ts +4 -0
- package/dist/types/member/index.d.ts +14 -0
- package/dist/types/member/types.d.ts +32 -0
- package/dist/types/members/collection.d.ts +5 -0
- package/dist/types/members/index.d.ts +35 -2
- package/dist/types/members/request.d.ts +73 -9
- package/dist/types/members/types.d.ts +25 -0
- package/dist/types/members/util.d.ts +214 -1
- package/dist/types/metrics/constants.d.ts +12 -4
- package/dist/types/metrics/index.d.ts +4 -119
- package/dist/types/multistream/mediaRequestManager.d.ts +73 -5
- package/dist/types/multistream/receiveSlot.d.ts +13 -11
- package/dist/types/multistream/receiveSlotManager.d.ts +14 -4
- package/dist/types/multistream/remoteMedia.d.ts +8 -29
- package/dist/types/multistream/remoteMediaGroup.d.ts +0 -9
- package/dist/types/multistream/remoteMediaManager.d.ts +46 -2
- package/dist/types/multistream/sendSlotManager.d.ts +61 -0
- package/dist/types/reachability/index.d.ts +61 -7
- package/dist/types/reachability/request.d.ts +7 -3
- package/dist/types/reconnection-manager/index.d.ts +9 -0
- package/dist/types/recording-controller/index.d.ts +15 -1
- package/dist/types/recording-controller/util.d.ts +5 -4
- package/dist/types/roap/index.d.ts +2 -1
- package/dist/types/roap/request.d.ts +15 -11
- package/dist/types/roap/turnDiscovery.d.ts +21 -3
- package/dist/types/rtcMetrics/constants.d.ts +4 -0
- package/dist/types/rtcMetrics/index.d.ts +47 -0
- package/dist/types/statsAnalyzer/index.d.ts +7 -1
- package/dist/types/webinar/collection.d.ts +16 -0
- package/dist/types/webinar/index.d.ts +5 -0
- package/dist/webinar/collection.js +44 -0
- package/dist/webinar/collection.js.map +1 -0
- package/dist/webinar/index.js +69 -0
- package/dist/webinar/index.js.map +1 -0
- package/package.json +23 -20
- package/src/annotation/annotation.types.ts +50 -0
- package/src/annotation/constants.ts +36 -0
- package/src/annotation/index.ts +328 -0
- package/src/breakouts/README.md +42 -12
- package/src/breakouts/breakout.ts +67 -9
- package/src/breakouts/edit-lock-error.ts +25 -0
- package/src/breakouts/events.ts +56 -0
- package/src/breakouts/index.ts +592 -20
- package/src/breakouts/utils.ts +42 -0
- package/src/common/errors/no-meeting-info.ts +24 -0
- package/src/common/errors/reclaim-host-role-errors.ts +134 -0
- package/src/common/errors/webex-errors.ts +44 -2
- package/src/common/logs/logger-proxy.ts +1 -1
- package/src/common/logs/request.ts +5 -1
- package/src/common/queue.ts +22 -8
- package/src/config.ts +4 -10
- package/src/constants.ts +221 -19
- package/src/controls-options-manager/enums.ts +12 -0
- package/src/controls-options-manager/index.ts +116 -21
- package/src/controls-options-manager/types.ts +59 -0
- package/src/controls-options-manager/util.ts +294 -14
- package/src/index.ts +40 -0
- package/src/interpretation/README.md +60 -0
- package/src/interpretation/collection.ts +19 -0
- package/src/interpretation/index.ts +332 -0
- package/src/interpretation/siLanguage.ts +18 -0
- package/src/locus-info/controlsUtils.ts +108 -0
- package/src/locus-info/index.ts +413 -59
- package/src/locus-info/infoUtils.ts +10 -2
- package/src/locus-info/mediaSharesUtils.ts +64 -0
- package/src/locus-info/parser.ts +258 -47
- package/src/locus-info/selfUtils.ts +81 -5
- package/src/media/index.ts +102 -122
- package/src/media/properties.ts +87 -110
- package/src/meeting/in-meeting-actions.ts +163 -3
- package/src/meeting/index.ts +3132 -2541
- package/src/meeting/locusMediaRequest.ts +313 -0
- package/src/meeting/muteState.ts +229 -131
- package/src/meeting/request.ts +177 -121
- package/src/meeting/util.ts +588 -394
- package/src/meeting-info/index.ts +81 -8
- package/src/meeting-info/meeting-info-v2.ts +170 -14
- package/src/meeting-info/util.ts +1 -1
- package/src/meeting-info/utilv2.ts +23 -23
- package/src/meetings/collection.ts +33 -0
- package/src/meetings/index.ts +445 -123
- package/src/meetings/meetings.types.ts +12 -0
- package/src/meetings/request.ts +2 -0
- package/src/meetings/util.ts +80 -11
- package/src/member/index.ts +58 -0
- package/src/member/types.ts +38 -0
- package/src/member/util.ts +141 -25
- package/src/members/collection.ts +8 -0
- package/src/members/index.ts +134 -8
- package/src/members/request.ts +97 -17
- package/src/members/types.ts +29 -0
- package/src/members/util.ts +333 -240
- package/src/metrics/constants.ts +12 -4
- package/src/metrics/index.ts +1 -490
- package/src/multistream/mediaRequestManager.ts +289 -79
- package/src/multistream/receiveSlot.ts +31 -17
- package/src/multistream/receiveSlotManager.ts +34 -24
- package/src/multistream/remoteMedia.ts +27 -2
- package/src/multistream/remoteMediaGroup.ts +59 -0
- package/src/multistream/remoteMediaManager.ts +148 -30
- package/src/multistream/sendSlotManager.ts +170 -0
- package/src/reachability/index.ts +228 -37
- package/src/reachability/request.ts +17 -8
- package/src/reconnection-manager/index.ts +83 -56
- package/src/recording-controller/index.ts +20 -3
- package/src/recording-controller/util.ts +26 -9
- package/src/roap/index.ts +63 -32
- package/src/roap/request.ts +100 -104
- package/src/roap/turnDiscovery.ts +48 -26
- package/src/rtcMetrics/constants.ts +3 -0
- package/src/rtcMetrics/index.ts +100 -0
- package/src/statsAnalyzer/index.ts +105 -91
- package/src/statsAnalyzer/mqaUtil.ts +13 -14
- package/src/webinar/collection.ts +31 -0
- package/src/webinar/index.ts +62 -0
- package/test/integration/spec/converged-space-meetings.js +60 -3
- package/test/integration/spec/journey.js +320 -261
- package/test/integration/spec/space-meeting.js +76 -3
- package/test/unit/spec/annotation/index.ts +418 -0
- package/test/unit/spec/breakouts/breakout.ts +118 -28
- package/test/unit/spec/breakouts/edit-lock-error.ts +30 -0
- package/test/unit/spec/breakouts/events.ts +89 -0
- package/test/unit/spec/breakouts/index.ts +1395 -69
- package/test/unit/spec/breakouts/utils.js +52 -1
- package/test/unit/spec/common/queue.js +31 -2
- package/test/unit/spec/controls-options-manager/index.js +163 -0
- package/test/unit/spec/controls-options-manager/util.js +576 -60
- package/test/unit/spec/fixture/locus.js +1 -0
- package/test/unit/spec/interpretation/collection.ts +15 -0
- package/test/unit/spec/interpretation/index.ts +589 -0
- package/test/unit/spec/interpretation/siLanguage.ts +28 -0
- package/test/unit/spec/locus-info/controlsUtils.js +316 -43
- package/test/unit/spec/locus-info/index.js +1304 -33
- package/test/unit/spec/locus-info/infoUtils.js +37 -15
- package/test/unit/spec/locus-info/lib/SeqCmp.json +16 -0
- package/test/unit/spec/locus-info/mediaSharesUtils.ts +32 -0
- package/test/unit/spec/locus-info/parser.js +116 -35
- package/test/unit/spec/locus-info/selfConstant.js +27 -4
- package/test/unit/spec/locus-info/selfUtils.js +208 -17
- package/test/unit/spec/media/index.ts +104 -37
- package/test/unit/spec/media/properties.ts +2 -2
- package/test/unit/spec/meeting/in-meeting-actions.ts +81 -3
- package/test/unit/spec/meeting/index.js +5216 -1956
- package/test/unit/spec/meeting/locusMediaRequest.ts +442 -0
- package/test/unit/spec/meeting/muteState.js +408 -208
- package/test/unit/spec/meeting/request.js +483 -49
- package/test/unit/spec/meeting/utils.js +679 -64
- package/test/unit/spec/meeting-info/index.js +300 -0
- package/test/unit/spec/meeting-info/meetinginfov2.js +526 -5
- package/test/unit/spec/meeting-info/utilv2.js +21 -0
- package/test/unit/spec/meetings/collection.js +26 -0
- package/test/unit/spec/meetings/index.js +1011 -205
- package/test/unit/spec/meetings/utils.js +202 -2
- package/test/unit/spec/member/index.js +61 -6
- package/test/unit/spec/member/util.js +510 -34
- package/test/unit/spec/members/index.js +432 -1
- package/test/unit/spec/members/request.js +206 -27
- package/test/unit/spec/members/utils.js +210 -0
- package/test/unit/spec/metrics/index.js +1 -50
- package/test/unit/spec/multistream/mediaRequestManager.ts +803 -162
- package/test/unit/spec/multistream/receiveSlot.ts +28 -20
- package/test/unit/spec/multistream/receiveSlotManager.ts +32 -30
- package/test/unit/spec/multistream/remoteMedia.ts +30 -0
- package/test/unit/spec/multistream/remoteMediaGroup.ts +266 -0
- package/test/unit/spec/multistream/remoteMediaManager.ts +326 -0
- package/test/unit/spec/multistream/sendSlotManager.ts +242 -0
- package/test/unit/spec/reachability/index.ts +549 -9
- package/test/unit/spec/reachability/request.js +68 -0
- package/test/unit/spec/reconnection-manager/index.js +85 -9
- package/test/unit/spec/recording-controller/index.js +294 -218
- package/test/unit/spec/recording-controller/util.js +223 -96
- package/test/unit/spec/roap/index.ts +178 -64
- package/test/unit/spec/roap/request.ts +203 -85
- package/test/unit/spec/roap/turnDiscovery.ts +82 -36
- package/test/unit/spec/rtcMetrics/index.ts +73 -0
- package/test/unit/spec/stats-analyzer/index.js +136 -2
- package/test/unit/spec/webinar/collection.ts +13 -0
- package/test/unit/spec/webinar/index.ts +60 -0
- package/test/utils/integrationTestUtils.js +46 -0
- package/test/utils/testUtils.js +0 -52
- package/dist/meeting/effectsState.js +0 -262
- package/dist/meeting/effectsState.js.map +0 -1
- package/dist/metrics/config.js +0 -299
- package/dist/metrics/config.js.map +0 -1
- package/dist/types/meeting/effectsState.d.ts +0 -42
- package/dist/types/metrics/config.d.ts +0 -178
- package/src/index.js +0 -16
- package/src/meeting/effectsState.ts +0 -211
- package/src/metrics/config.ts +0 -495
- package/test/unit/spec/meeting/effectsState.js +0 -285
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
|
|
4
|
-
var _Object$
|
|
4
|
+
var _Object$keys2 = require("@babel/runtime-corejs2/core-js/object/keys");
|
|
5
5
|
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
|
|
6
6
|
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
|
|
7
7
|
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
|
|
@@ -11,7 +11,8 @@ var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequ
|
|
|
11
11
|
_Object$defineProperty(exports, "__esModule", {
|
|
12
12
|
value: true
|
|
13
13
|
});
|
|
14
|
-
exports.default = exports.MeetingInfoV2PasswordError = exports.MeetingInfoV2CaptchaError = exports.MeetingInfoV2AdhocMeetingError = void 0;
|
|
14
|
+
exports.default = exports.MeetingInfoV2PolicyError = exports.MeetingInfoV2PasswordError = exports.MeetingInfoV2CaptchaError = exports.MeetingInfoV2AdhocMeetingError = void 0;
|
|
15
|
+
var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
|
|
15
16
|
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
16
17
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
17
18
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
@@ -22,11 +23,12 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
22
23
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
|
|
23
24
|
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/wrapNativeSuper"));
|
|
24
25
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
26
|
+
var _difference2 = _interopRequireDefault(require("lodash/difference"));
|
|
25
27
|
var _constants = require("../constants");
|
|
26
28
|
var _metrics = _interopRequireDefault(require("../metrics"));
|
|
27
29
|
var _constants2 = _interopRequireDefault(require("../metrics/constants"));
|
|
28
30
|
var _utilv = _interopRequireDefault(require("./utilv2"));
|
|
29
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$
|
|
31
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys2(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
30
32
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
31
33
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
32
34
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -34,7 +36,7 @@ var PASSWORD_ERROR_DEFAULT_MESSAGE = 'Password required. Call fetchMeetingInfo()
|
|
|
34
36
|
var CAPTCHA_ERROR_DEFAULT_MESSAGE = 'Captcha required. Call fetchMeetingInfo() with captchaInfo argument';
|
|
35
37
|
var ADHOC_MEETING_DEFAULT_ERROR = 'Failed starting the adhoc meeting, Please contact support team ';
|
|
36
38
|
var CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES = [423005, 423006];
|
|
37
|
-
|
|
39
|
+
var POLICY_ERROR_CODES = [403049, 403104, 403103, 403048, 403102, 403101];
|
|
38
40
|
/**
|
|
39
41
|
* Error to indicate that wbxappapi requires a password
|
|
40
42
|
*/
|
|
@@ -95,37 +97,67 @@ var MeetingInfoV2AdhocMeetingError = /*#__PURE__*/function (_Error2) {
|
|
|
95
97
|
return (0, _createClass2.default)(MeetingInfoV2AdhocMeetingError);
|
|
96
98
|
}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
|
|
97
99
|
/**
|
|
98
|
-
* Error
|
|
100
|
+
* Error preventing join because of a meeting policy
|
|
99
101
|
*/
|
|
100
102
|
exports.MeetingInfoV2AdhocMeetingError = MeetingInfoV2AdhocMeetingError;
|
|
101
|
-
var
|
|
102
|
-
(0, _inherits2.default)(
|
|
103
|
-
var _super3 = _createSuper(
|
|
103
|
+
var MeetingInfoV2PolicyError = /*#__PURE__*/function (_Error3) {
|
|
104
|
+
(0, _inherits2.default)(MeetingInfoV2PolicyError, _Error3);
|
|
105
|
+
var _super3 = _createSuper(MeetingInfoV2PolicyError);
|
|
104
106
|
/**
|
|
105
107
|
*
|
|
106
108
|
* @constructor
|
|
107
109
|
* @param {Number} [wbxAppApiErrorCode]
|
|
108
|
-
* @param {Object} [
|
|
110
|
+
* @param {Object} [meetingInfo]
|
|
109
111
|
* @param {String} [message]
|
|
110
112
|
*/
|
|
111
|
-
function
|
|
113
|
+
function MeetingInfoV2PolicyError(wbxAppApiErrorCode, meetingInfo, message) {
|
|
112
114
|
var _this3;
|
|
113
|
-
|
|
114
|
-
(0, _classCallCheck2.default)(this, MeetingInfoV2CaptchaError);
|
|
115
|
+
(0, _classCallCheck2.default)(this, MeetingInfoV2PolicyError);
|
|
115
116
|
_this3 = _super3.call(this, "".concat(message, ", code=").concat(wbxAppApiErrorCode));
|
|
116
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this3), "
|
|
117
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this3), "isPasswordRequired", void 0);
|
|
117
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this3), "meetingInfo", void 0);
|
|
118
118
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this3), "sdkMessage", void 0);
|
|
119
119
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this3), "wbxAppApiCode", void 0);
|
|
120
|
-
|
|
121
|
-
_this3.name = 'MeetingInfoV2PasswordError';
|
|
120
|
+
_this3.name = 'MeetingInfoV2AdhocMeetingError';
|
|
122
121
|
_this3.sdkMessage = message;
|
|
123
122
|
_this3.stack = new Error().stack;
|
|
124
123
|
_this3.wbxAppApiCode = wbxAppApiErrorCode;
|
|
125
|
-
_this3.
|
|
126
|
-
_this3.captchaInfo = captchaInfo;
|
|
124
|
+
_this3.meetingInfo = meetingInfo;
|
|
127
125
|
return _this3;
|
|
128
126
|
}
|
|
127
|
+
return (0, _createClass2.default)(MeetingInfoV2PolicyError);
|
|
128
|
+
}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
|
|
129
|
+
/**
|
|
130
|
+
* Error to indicate that preferred webex site not present to start adhoc meeting
|
|
131
|
+
*/
|
|
132
|
+
exports.MeetingInfoV2PolicyError = MeetingInfoV2PolicyError;
|
|
133
|
+
var MeetingInfoV2CaptchaError = /*#__PURE__*/function (_Error4) {
|
|
134
|
+
(0, _inherits2.default)(MeetingInfoV2CaptchaError, _Error4);
|
|
135
|
+
var _super4 = _createSuper(MeetingInfoV2CaptchaError);
|
|
136
|
+
/**
|
|
137
|
+
*
|
|
138
|
+
* @constructor
|
|
139
|
+
* @param {Number} [wbxAppApiErrorCode]
|
|
140
|
+
* @param {Object} [captchaInfo]
|
|
141
|
+
* @param {String} [message]
|
|
142
|
+
*/
|
|
143
|
+
function MeetingInfoV2CaptchaError(wbxAppApiErrorCode, captchaInfo) {
|
|
144
|
+
var _this4;
|
|
145
|
+
var message = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : CAPTCHA_ERROR_DEFAULT_MESSAGE;
|
|
146
|
+
(0, _classCallCheck2.default)(this, MeetingInfoV2CaptchaError);
|
|
147
|
+
_this4 = _super4.call(this, "".concat(message, ", code=").concat(wbxAppApiErrorCode));
|
|
148
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this4), "captchaInfo", void 0);
|
|
149
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this4), "isPasswordRequired", void 0);
|
|
150
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this4), "sdkMessage", void 0);
|
|
151
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this4), "wbxAppApiCode", void 0);
|
|
152
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this4), "body", void 0);
|
|
153
|
+
_this4.name = 'MeetingInfoV2PasswordError';
|
|
154
|
+
_this4.sdkMessage = message;
|
|
155
|
+
_this4.stack = new Error().stack;
|
|
156
|
+
_this4.wbxAppApiCode = wbxAppApiErrorCode;
|
|
157
|
+
_this4.isPasswordRequired = CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES.includes(wbxAppApiErrorCode);
|
|
158
|
+
_this4.captchaInfo = captchaInfo;
|
|
159
|
+
return _this4;
|
|
160
|
+
}
|
|
129
161
|
return (0, _createClass2.default)(MeetingInfoV2CaptchaError);
|
|
130
162
|
}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
|
|
131
163
|
/**
|
|
@@ -140,6 +172,19 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
140
172
|
function MeetingInfoV2(webex) {
|
|
141
173
|
(0, _classCallCheck2.default)(this, MeetingInfoV2);
|
|
142
174
|
(0, _defineProperty2.default)(this, "webex", void 0);
|
|
175
|
+
(0, _defineProperty2.default)(this, "handlePolicyError", function (err) {
|
|
176
|
+
var _err$body;
|
|
177
|
+
if (!err.body) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
if (POLICY_ERROR_CODES.includes((_err$body = err.body) === null || _err$body === void 0 ? void 0 : _err$body.code)) {
|
|
181
|
+
var _err$body2, _err$body3, _err$body4, _err$body4$data, _err$body5;
|
|
182
|
+
_metrics.default.sendBehavioralMetric(_constants2.default.MEETING_INFO_POLICY_ERROR, {
|
|
183
|
+
code: (_err$body2 = err.body) === null || _err$body2 === void 0 ? void 0 : _err$body2.code
|
|
184
|
+
});
|
|
185
|
+
throw new MeetingInfoV2PolicyError((_err$body3 = err.body) === null || _err$body3 === void 0 ? void 0 : _err$body3.code, (_err$body4 = err.body) === null || _err$body4 === void 0 ? void 0 : (_err$body4$data = _err$body4.data) === null || _err$body4$data === void 0 ? void 0 : _err$body4$data.meetingInfo, (_err$body5 = err.body) === null || _err$body5 === void 0 ? void 0 : _err$body5.message);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
143
188
|
this.webex = webex;
|
|
144
189
|
}
|
|
145
190
|
|
|
@@ -162,18 +207,25 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
162
207
|
});
|
|
163
208
|
}
|
|
164
209
|
|
|
210
|
+
/**
|
|
211
|
+
* Raises a MeetingInfoV2PolicyError for policy error codes
|
|
212
|
+
* @param {any} err the error from the request
|
|
213
|
+
* @returns {void}
|
|
214
|
+
*/
|
|
215
|
+
}, {
|
|
216
|
+
key: "createAdhocSpaceMeeting",
|
|
217
|
+
value:
|
|
165
218
|
/**
|
|
166
219
|
* Creates adhoc space meetings for a space by fetching the conversation infomation
|
|
167
220
|
* @param {String} conversationUrl conversationUrl to start adhoc meeting on
|
|
221
|
+
* @param {String} installedOrgID org ID of user's machine
|
|
168
222
|
* @returns {Promise} returns a meeting info object
|
|
169
223
|
* @public
|
|
170
224
|
* @memberof MeetingInfo
|
|
171
225
|
*/
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
var _createAdhocSpaceMeeting = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(conversationUrl) {
|
|
176
|
-
var _this4 = this;
|
|
226
|
+
function () {
|
|
227
|
+
var _createAdhocSpaceMeeting = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(conversationUrl, installedOrgID) {
|
|
228
|
+
var _this5 = this;
|
|
177
229
|
var getInvitees;
|
|
178
230
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
179
231
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -211,20 +263,26 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
211
263
|
kroUrl: conversation.kmsResourceObjectUrl,
|
|
212
264
|
invitees: getInvitees((_conversation$partici = conversation.participants) === null || _conversation$partici === void 0 ? void 0 : _conversation$partici.items)
|
|
213
265
|
};
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
266
|
+
if (installedOrgID) {
|
|
267
|
+
body.installedOrgID = installedOrgID;
|
|
268
|
+
}
|
|
269
|
+
var uri = _this5.webex.meetings.preferredWebexSite ? "https://".concat(_this5.webex.meetings.preferredWebexSite, "/wbxappapi/v2/meetings/spaceInstant") : '';
|
|
270
|
+
return _this5.webex.request({
|
|
217
271
|
method: _constants.HTTP_VERBS.POST,
|
|
218
272
|
uri: uri,
|
|
219
273
|
body: body
|
|
220
274
|
});
|
|
275
|
+
}).then(function (requestResult) {
|
|
276
|
+
_metrics.default.sendBehavioralMetric(_constants2.default.ADHOC_MEETING_SUCCESS);
|
|
277
|
+
return requestResult;
|
|
221
278
|
}).catch(function (err) {
|
|
222
|
-
var _err$
|
|
279
|
+
var _err$body6, _err$body7;
|
|
280
|
+
_this5.handlePolicyError(err);
|
|
223
281
|
_metrics.default.sendBehavioralMetric(_constants2.default.ADHOC_MEETING_FAILURE, {
|
|
224
282
|
reason: err.message,
|
|
225
283
|
stack: err.stack
|
|
226
284
|
});
|
|
227
|
-
throw new MeetingInfoV2AdhocMeetingError((_err$
|
|
285
|
+
throw new MeetingInfoV2AdhocMeetingError((_err$body6 = err.body) === null || _err$body6 === void 0 ? void 0 : _err$body6.code, (_err$body7 = err.body) === null || _err$body7 === void 0 ? void 0 : _err$body7.message);
|
|
228
286
|
}));
|
|
229
287
|
case 4:
|
|
230
288
|
case "end":
|
|
@@ -232,7 +290,7 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
232
290
|
}
|
|
233
291
|
}, _callee, this);
|
|
234
292
|
}));
|
|
235
|
-
function createAdhocSpaceMeeting(_x) {
|
|
293
|
+
function createAdhocSpaceMeeting(_x, _x2) {
|
|
236
294
|
return _createAdhocSpaceMeeting.apply(this, arguments);
|
|
237
295
|
}
|
|
238
296
|
return createAdhocSpaceMeeting;
|
|
@@ -245,6 +303,10 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
245
303
|
* @param {Object} captchaInfo
|
|
246
304
|
* @param {String} captchaInfo.code
|
|
247
305
|
* @param {String} captchaInfo.id
|
|
306
|
+
* @param {String} installedOrgID org ID of user's machine
|
|
307
|
+
* @param {String} locusId
|
|
308
|
+
* @param {Object} extraParams
|
|
309
|
+
* @param {Object} options
|
|
248
310
|
* @returns {Promise} returns a meeting info object
|
|
249
311
|
* @public
|
|
250
312
|
* @memberof MeetingInfo
|
|
@@ -253,12 +315,22 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
253
315
|
key: "fetchMeetingInfo",
|
|
254
316
|
value: function () {
|
|
255
317
|
var _fetchMeetingInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(destination) {
|
|
318
|
+
var _this6 = this;
|
|
256
319
|
var type,
|
|
257
320
|
password,
|
|
258
321
|
captchaInfo,
|
|
322
|
+
installedOrgID,
|
|
323
|
+
locusId,
|
|
324
|
+
extraParams,
|
|
325
|
+
options,
|
|
326
|
+
meetingId,
|
|
327
|
+
sendCAevents,
|
|
259
328
|
destinationType,
|
|
260
329
|
body,
|
|
261
|
-
|
|
330
|
+
_destinationType$info,
|
|
331
|
+
_destinationType$info2,
|
|
332
|
+
err,
|
|
333
|
+
requestOptions,
|
|
262
334
|
directURI,
|
|
263
335
|
_args2 = arguments;
|
|
264
336
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
@@ -267,60 +339,129 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
267
339
|
type = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : null;
|
|
268
340
|
password = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : null;
|
|
269
341
|
captchaInfo = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : null;
|
|
270
|
-
|
|
342
|
+
installedOrgID = _args2.length > 4 && _args2[4] !== undefined ? _args2[4] : null;
|
|
343
|
+
locusId = _args2.length > 5 && _args2[5] !== undefined ? _args2[5] : null;
|
|
344
|
+
extraParams = _args2.length > 6 && _args2[6] !== undefined ? _args2[6] : {};
|
|
345
|
+
options = _args2.length > 7 && _args2[7] !== undefined ? _args2[7] : {};
|
|
346
|
+
meetingId = options.meetingId, sendCAevents = options.sendCAevents;
|
|
347
|
+
_context2.next = 10;
|
|
271
348
|
return _utilv.default.getDestinationType({
|
|
272
349
|
destination: destination,
|
|
273
350
|
type: type,
|
|
274
351
|
webex: this.webex
|
|
275
352
|
});
|
|
276
|
-
case
|
|
353
|
+
case 10:
|
|
277
354
|
destinationType = _context2.sent;
|
|
278
355
|
if (!(destinationType.type === _constants._CONVERSATION_URL_ && this.webex.config.meetings.experimental.enableAdhocMeetings && this.webex.meetings.preferredWebexSite)) {
|
|
279
|
-
_context2.next =
|
|
356
|
+
_context2.next = 13;
|
|
280
357
|
break;
|
|
281
358
|
}
|
|
282
|
-
return _context2.abrupt("return", this.createAdhocSpaceMeeting(destinationType.destination));
|
|
283
|
-
case
|
|
284
|
-
_context2.next =
|
|
359
|
+
return _context2.abrupt("return", this.createAdhocSpaceMeeting(destinationType.destination, installedOrgID));
|
|
360
|
+
case 13:
|
|
361
|
+
_context2.next = 15;
|
|
285
362
|
return _utilv.default.getRequestBody(_objectSpread(_objectSpread({}, destinationType), {}, {
|
|
286
363
|
password: password,
|
|
287
|
-
captchaInfo: captchaInfo
|
|
364
|
+
captchaInfo: captchaInfo,
|
|
365
|
+
installedOrgID: installedOrgID,
|
|
366
|
+
locusId: locusId,
|
|
367
|
+
extraParams: extraParams
|
|
288
368
|
}));
|
|
289
|
-
case
|
|
369
|
+
case 15:
|
|
290
370
|
body = _context2.sent;
|
|
291
|
-
|
|
371
|
+
if ((0, _difference2.default)((0, _keys.default)(body), (0, _keys.default)(_constants.DEFAULT_MEETING_INFO_REQUEST_BODY)).length) {
|
|
372
|
+
_context2.next = 20;
|
|
373
|
+
break;
|
|
374
|
+
}
|
|
375
|
+
err = new Error('Not enough information to fetch meeting info');
|
|
376
|
+
_metrics.default.sendBehavioralMetric(_constants2.default.FETCH_MEETING_INFO_V1_FAILURE, {
|
|
377
|
+
reason: err.message,
|
|
378
|
+
destinationType: destinationType === null || destinationType === void 0 ? void 0 : destinationType.type,
|
|
379
|
+
webExMeetingId: destinationType === null || destinationType === void 0 ? void 0 : (_destinationType$info = destinationType.info) === null || _destinationType$info === void 0 ? void 0 : _destinationType$info.webExMeetingId,
|
|
380
|
+
sipUri: destinationType === null || destinationType === void 0 ? void 0 : (_destinationType$info2 = destinationType.info) === null || _destinationType$info2 === void 0 ? void 0 : _destinationType$info2.sipUri
|
|
381
|
+
});
|
|
382
|
+
throw err;
|
|
383
|
+
case 20:
|
|
384
|
+
requestOptions = {
|
|
292
385
|
method: _constants.HTTP_VERBS.POST,
|
|
293
386
|
body: body
|
|
294
387
|
};
|
|
295
|
-
_context2.next =
|
|
388
|
+
_context2.next = 23;
|
|
296
389
|
return _utilv.default.getDirectMeetingInfoURI(destinationType);
|
|
297
|
-
case
|
|
390
|
+
case 23:
|
|
298
391
|
directURI = _context2.sent;
|
|
299
392
|
if (directURI) {
|
|
300
|
-
|
|
393
|
+
requestOptions.uri = directURI;
|
|
301
394
|
} else {
|
|
302
|
-
|
|
303
|
-
|
|
395
|
+
requestOptions.service = _constants.WBXAPPAPI_SERVICE;
|
|
396
|
+
requestOptions.resource = 'meetingInfo';
|
|
397
|
+
}
|
|
398
|
+
if (meetingId && sendCAevents) {
|
|
399
|
+
this.webex.internal.newMetrics.submitInternalEvent({
|
|
400
|
+
name: 'internal.client.meetinginfo.request'
|
|
401
|
+
});
|
|
402
|
+
this.webex.internal.newMetrics.submitClientEvent({
|
|
403
|
+
name: 'client.meetinginfo.request',
|
|
404
|
+
options: {
|
|
405
|
+
meetingId: meetingId
|
|
406
|
+
}
|
|
407
|
+
});
|
|
304
408
|
}
|
|
305
|
-
return _context2.abrupt("return", this.webex.request(
|
|
409
|
+
return _context2.abrupt("return", this.webex.request(requestOptions).then(function (response) {
|
|
410
|
+
if (meetingId && sendCAevents) {
|
|
411
|
+
var _response$body, _response$body2, _response$body3;
|
|
412
|
+
_this6.webex.internal.newMetrics.submitInternalEvent({
|
|
413
|
+
name: 'internal.client.meetinginfo.response'
|
|
414
|
+
});
|
|
415
|
+
_this6.webex.internal.newMetrics.submitClientEvent({
|
|
416
|
+
name: 'client.meetinginfo.response',
|
|
417
|
+
payload: {
|
|
418
|
+
identifiers: {
|
|
419
|
+
meetingLookupUrl: response === null || response === void 0 ? void 0 : response.url
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
options: {
|
|
423
|
+
meetingId: meetingId,
|
|
424
|
+
webexConferenceIdStr: (response === null || response === void 0 ? void 0 : (_response$body = response.body) === null || _response$body === void 0 ? void 0 : _response$body.confIdStr) || (response === null || response === void 0 ? void 0 : (_response$body2 = response.body) === null || _response$body2 === void 0 ? void 0 : _response$body2.confID),
|
|
425
|
+
globalMeetingId: response === null || response === void 0 ? void 0 : (_response$body3 = response.body) === null || _response$body3 === void 0 ? void 0 : _response$body3.meetingId
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
}
|
|
306
429
|
_metrics.default.sendBehavioralMetric(_constants2.default.FETCH_MEETING_INFO_V1_SUCCESS);
|
|
307
430
|
return response;
|
|
308
431
|
}).catch(function (err) {
|
|
432
|
+
if (meetingId && sendCAevents) {
|
|
433
|
+
_this6.webex.internal.newMetrics.submitInternalEvent({
|
|
434
|
+
name: 'internal.client.meetinginfo.response'
|
|
435
|
+
});
|
|
436
|
+
_this6.webex.internal.newMetrics.submitClientEvent({
|
|
437
|
+
name: 'client.meetinginfo.response',
|
|
438
|
+
payload: {
|
|
439
|
+
identifiers: {
|
|
440
|
+
meetingLookupUrl: err === null || err === void 0 ? void 0 : err.url
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
options: {
|
|
444
|
+
meetingId: meetingId,
|
|
445
|
+
rawError: err
|
|
446
|
+
}
|
|
447
|
+
});
|
|
448
|
+
}
|
|
309
449
|
if ((err === null || err === void 0 ? void 0 : err.statusCode) === 403) {
|
|
310
|
-
var _err$
|
|
450
|
+
var _err$body8, _err$body9, _err$body9$data;
|
|
451
|
+
_this6.handlePolicyError(err);
|
|
311
452
|
_metrics.default.sendBehavioralMetric(_constants2.default.VERIFY_PASSWORD_ERROR, {
|
|
312
453
|
reason: err.message,
|
|
313
454
|
stack: err.stack
|
|
314
455
|
});
|
|
315
|
-
throw new MeetingInfoV2PasswordError((_err$
|
|
456
|
+
throw new MeetingInfoV2PasswordError((_err$body8 = err.body) === null || _err$body8 === void 0 ? void 0 : _err$body8.code, (_err$body9 = err.body) === null || _err$body9 === void 0 ? void 0 : (_err$body9$data = _err$body9.data) === null || _err$body9$data === void 0 ? void 0 : _err$body9$data.meetingInfo);
|
|
316
457
|
}
|
|
317
458
|
if ((err === null || err === void 0 ? void 0 : err.statusCode) === 423) {
|
|
318
|
-
var _err$
|
|
459
|
+
var _err$body10;
|
|
319
460
|
_metrics.default.sendBehavioralMetric(_constants2.default.VERIFY_CAPTCHA_ERROR, {
|
|
320
461
|
reason: err.message,
|
|
321
462
|
stack: err.stack
|
|
322
463
|
});
|
|
323
|
-
throw new MeetingInfoV2CaptchaError((_err$
|
|
464
|
+
throw new MeetingInfoV2CaptchaError((_err$body10 = err.body) === null || _err$body10 === void 0 ? void 0 : _err$body10.code, {
|
|
324
465
|
captchaId: err.body.captchaID,
|
|
325
466
|
verificationImageURL: err.body.verificationImageURL,
|
|
326
467
|
verificationAudioURL: err.body.verificationAudioURL,
|
|
@@ -333,13 +474,13 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
333
474
|
});
|
|
334
475
|
throw err;
|
|
335
476
|
}));
|
|
336
|
-
case
|
|
477
|
+
case 27:
|
|
337
478
|
case "end":
|
|
338
479
|
return _context2.stop();
|
|
339
480
|
}
|
|
340
481
|
}, _callee2, this);
|
|
341
482
|
}));
|
|
342
|
-
function fetchMeetingInfo(
|
|
483
|
+
function fetchMeetingInfo(_x3) {
|
|
343
484
|
return _fetchMeetingInfo.apply(this, arguments);
|
|
344
485
|
}
|
|
345
486
|
return fetchMeetingInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PASSWORD_ERROR_DEFAULT_MESSAGE","CAPTCHA_ERROR_DEFAULT_MESSAGE","ADHOC_MEETING_DEFAULT_ERROR","CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES","MeetingInfoV2PasswordError","wbxAppApiErrorCode","meetingInfo","message","name","sdkMessage","stack","Error","wbxAppApiCode","MeetingInfoV2AdhocMeetingError","MeetingInfoV2CaptchaError","captchaInfo","isPasswordRequired","includes","MeetingInfoV2","webex","destination","type","MeetingInfoUtil","getDestinationType","conversationUrl","meetings","preferredWebexSite","getInvitees","particpants","invitees","forEach","participant","push","email","emailAddress","ciUserUuid","entryUUID","internal","conversation","get","url","includeParticipants","disableTransform","then","body","title","displayName","spaceUrl","keyUrl","encryptionKeyUrl","kroUrl","kmsResourceObjectUrl","participants","items","uri","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","ADHOC_MEETING_SUCCESS","request","method","HTTP_VERBS","POST","catch","err","ADHOC_MEETING_FAILURE","reason","code","password","destinationType","_CONVERSATION_URL_","config","experimental","enableAdhocMeetings","createAdhocSpaceMeeting","getRequestBody","options","getDirectMeetingInfoURI","directURI","service","WBXAPPAPI_SERVICE","resource","response","FETCH_MEETING_INFO_V1_SUCCESS","statusCode","VERIFY_PASSWORD_ERROR","data","VERIFY_CAPTCHA_ERROR","captchaId","captchaID","verificationImageURL","verificationAudioURL","refreshURL","FETCH_MEETING_INFO_V1_FAILURE"],"sources":["meeting-info-v2.ts"],"sourcesContent":["import {HTTP_VERBS, _CONVERSATION_URL_, WBXAPPAPI_SERVICE} from '../constants';\nimport Metrics from '../metrics';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\n\nimport MeetingInfoUtil from './utilv2';\n\nconst PASSWORD_ERROR_DEFAULT_MESSAGE =\n 'Password required. Call fetchMeetingInfo() with password argument';\nconst CAPTCHA_ERROR_DEFAULT_MESSAGE =\n 'Captcha required. Call fetchMeetingInfo() with captchaInfo argument';\nconst ADHOC_MEETING_DEFAULT_ERROR =\n 'Failed starting the adhoc meeting, Please contact support team ';\nconst CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES = [423005, 423006];\n\n/**\n * Error to indicate that wbxappapi requires a password\n */\nexport class MeetingInfoV2PasswordError extends Error {\n meetingInfo: any;\n sdkMessage: any;\n wbxAppApiCode: any;\n body: any;\n\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [meetingInfo]\n * @param {String} [message]\n */\n constructor(\n wbxAppApiErrorCode?: number,\n meetingInfo?: object,\n message: string = PASSWORD_ERROR_DEFAULT_MESSAGE\n ) {\n super(`${message}, code=${wbxAppApiErrorCode}`);\n this.name = 'MeetingInfoV2PasswordError';\n this.sdkMessage = message;\n this.stack = new Error().stack;\n this.wbxAppApiCode = wbxAppApiErrorCode;\n this.meetingInfo = meetingInfo;\n }\n}\n\n/**\n * Error generating a adhoc space meeting\n */\nexport class MeetingInfoV2AdhocMeetingError extends Error {\n sdkMessage: any;\n wbxAppApiCode: any;\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode?: number, message: string = ADHOC_MEETING_DEFAULT_ERROR) {\n super(`${message}, code=${wbxAppApiErrorCode}`);\n this.name = 'MeetingInfoV2AdhocMeetingError';\n this.sdkMessage = message;\n this.stack = new Error().stack;\n this.wbxAppApiCode = wbxAppApiErrorCode;\n }\n}\n\n/**\n * Error to indicate that preferred webex site not present to start adhoc meeting\n */\nexport class MeetingInfoV2CaptchaError extends Error {\n captchaInfo: any;\n isPasswordRequired: any;\n sdkMessage: any;\n wbxAppApiCode: any;\n body: any;\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [captchaInfo]\n * @param {String} [message]\n */\n constructor(\n wbxAppApiErrorCode?: number,\n captchaInfo?: object,\n message: string = CAPTCHA_ERROR_DEFAULT_MESSAGE\n ) {\n super(`${message}, code=${wbxAppApiErrorCode}`);\n this.name = 'MeetingInfoV2PasswordError';\n this.sdkMessage = message;\n this.stack = new Error().stack;\n this.wbxAppApiCode = wbxAppApiErrorCode;\n this.isPasswordRequired = CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES.includes(wbxAppApiErrorCode);\n this.captchaInfo = captchaInfo;\n }\n}\n\n/**\n * @class MeetingInfo\n */\nexport default class MeetingInfoV2 {\n webex: any;\n\n /**\n *\n * @param {WebexSDK} webex\n */\n constructor(webex) {\n this.webex = webex;\n }\n\n /**\n * converts hydra id into conversation url and persons Id\n * @param {String} destination one of many different types of destinations to look up info for\n * @param {String} [type] to match up with the destination value\n * @returns {Promise} destination and type\n * @public\n * @memberof MeetingInfo\n */\n fetchInfoOptions(destination: string, type: string = null) {\n return MeetingInfoUtil.getDestinationType({\n destination,\n type,\n webex: this.webex,\n });\n }\n\n /**\n * Creates adhoc space meetings for a space by fetching the conversation infomation\n * @param {String} conversationUrl conversationUrl to start adhoc meeting on\n * @returns {Promise} returns a meeting info object\n * @public\n * @memberof MeetingInfo\n */\n async createAdhocSpaceMeeting(conversationUrl: string) {\n if (!this.webex.meetings.preferredWebexSite) {\n throw Error('No preferred webex site found');\n }\n const getInvitees = (particpants = []) => {\n const invitees = [];\n\n if (particpants) {\n particpants.forEach((participant) => {\n invitees.push({\n email: participant.emailAddress,\n ciUserUuid: participant.entryUUID,\n });\n });\n }\n\n return invitees;\n };\n\n return this.webex.internal.conversation\n .get({url: conversationUrl}, {includeParticipants: true, disableTransform: true})\n .then((conversation) => {\n const body = {\n title: conversation.displayName,\n spaceUrl: conversation.url,\n keyUrl: conversation.encryptionKeyUrl,\n kroUrl: conversation.kmsResourceObjectUrl,\n invitees: getInvitees(conversation.participants?.items),\n };\n\n const uri = this.webex.meetings.preferredWebexSite\n ? `https://${this.webex.meetings.preferredWebexSite}/wbxappapi/v2/meetings/spaceInstant`\n : '';\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.ADHOC_MEETING_SUCCESS);\n\n return this.webex.request({\n method: HTTP_VERBS.POST,\n uri,\n body,\n });\n })\n .catch((err) => {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.ADHOC_MEETING_FAILURE, {\n reason: err.message,\n stack: err.stack,\n });\n throw new MeetingInfoV2AdhocMeetingError(err.body?.code, err.body?.message);\n });\n }\n\n /**\n * Fetches meeting info from the server\n * @param {String} destination one of many different types of destinations to look up info for\n * @param {String} [type] to match up with the destination value\n * @param {String} password\n * @param {Object} captchaInfo\n * @param {String} captchaInfo.code\n * @param {String} captchaInfo.id\n * @returns {Promise} returns a meeting info object\n * @public\n * @memberof MeetingInfo\n */\n async fetchMeetingInfo(\n destination: string,\n type: string = null,\n password: string = null,\n captchaInfo: {\n code: string;\n id: string;\n } = null\n ) {\n const destinationType = await MeetingInfoUtil.getDestinationType({\n destination,\n type,\n webex: this.webex,\n });\n\n if (\n destinationType.type === _CONVERSATION_URL_ &&\n this.webex.config.meetings.experimental.enableAdhocMeetings &&\n this.webex.meetings.preferredWebexSite\n ) {\n return this.createAdhocSpaceMeeting(destinationType.destination);\n }\n\n const body = await MeetingInfoUtil.getRequestBody({...destinationType, password, captchaInfo});\n\n const options: any = {\n method: HTTP_VERBS.POST,\n body,\n };\n\n const directURI = await MeetingInfoUtil.getDirectMeetingInfoURI(destinationType);\n\n if (directURI) {\n options.uri = directURI;\n } else {\n options.service = WBXAPPAPI_SERVICE;\n options.resource = 'meetingInfo';\n }\n\n return this.webex\n .request(options)\n .then((response) => {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_SUCCESS);\n\n return response;\n })\n .catch((err) => {\n if (err?.statusCode === 403) {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.VERIFY_PASSWORD_ERROR, {\n reason: err.message,\n stack: err.stack,\n });\n\n throw new MeetingInfoV2PasswordError(err.body?.code, err.body?.data?.meetingInfo);\n }\n if (err?.statusCode === 423) {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.VERIFY_CAPTCHA_ERROR, {\n reason: err.message,\n stack: err.stack,\n });\n\n throw new MeetingInfoV2CaptchaError(err.body?.code, {\n captchaId: err.body.captchaID,\n verificationImageURL: err.body.verificationImageURL,\n verificationAudioURL: err.body.verificationAudioURL,\n refreshURL: err.body.refreshURL,\n });\n }\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_FAILURE, {\n reason: err.message,\n stack: err.stack,\n });\n throw err;\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAEA;AAAuC;AAAA;AAAA;AAAA;AAEvC,IAAMA,8BAA8B,GAClC,mEAAmE;AACrE,IAAMC,6BAA6B,GACjC,qEAAqE;AACvE,IAAMC,2BAA2B,GAC/B,iEAAiE;AACnE,IAAMC,qCAAqC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;;AAE9D;AACA;AACA;AAFA,IAGaC,0BAA0B;EAAA;EAAA;EAM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,CAACpB,IAAI,CAACgD;kBACvB,CAAC,CAAC;gBACJ;gBAEArC,gBAAO,CAACC,oBAAoB,CAACC,mBAAkB,CAACoC,6BAA6B,EAAE;kBAC7E3B,MAAM,EAAEF,GAAG,CAACzD,OAAO;kBACnBG,KAAK,EAAEsD,GAAG,CAACtD;gBACb,CAAC,CAAC;gBACF,MAAMsD,GAAG;cACX,CAAC,CAAC;YAAA;YAAA;cAAA;UAAA;QAAA;MAAA,CACL;MAAA;QAAA;MAAA;MAAA;IAAA;EAAA;EAAA;AAAA;AAAA"}
|
|
1
|
+
{"version":3,"names":["PASSWORD_ERROR_DEFAULT_MESSAGE","CAPTCHA_ERROR_DEFAULT_MESSAGE","ADHOC_MEETING_DEFAULT_ERROR","CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES","POLICY_ERROR_CODES","MeetingInfoV2PasswordError","wbxAppApiErrorCode","meetingInfo","message","name","sdkMessage","stack","Error","wbxAppApiCode","MeetingInfoV2AdhocMeetingError","MeetingInfoV2PolicyError","MeetingInfoV2CaptchaError","captchaInfo","isPasswordRequired","includes","MeetingInfoV2","webex","err","body","code","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","MEETING_INFO_POLICY_ERROR","data","destination","type","MeetingInfoUtil","getDestinationType","conversationUrl","installedOrgID","meetings","preferredWebexSite","getInvitees","particpants","invitees","forEach","participant","push","email","emailAddress","ciUserUuid","entryUUID","internal","conversation","get","url","includeParticipants","disableTransform","then","title","displayName","spaceUrl","keyUrl","encryptionKeyUrl","kroUrl","kmsResourceObjectUrl","participants","items","uri","request","method","HTTP_VERBS","POST","requestResult","ADHOC_MEETING_SUCCESS","catch","handlePolicyError","ADHOC_MEETING_FAILURE","reason","password","locusId","extraParams","options","meetingId","sendCAevents","destinationType","_CONVERSATION_URL_","config","experimental","enableAdhocMeetings","createAdhocSpaceMeeting","getRequestBody","DEFAULT_MEETING_INFO_REQUEST_BODY","length","FETCH_MEETING_INFO_V1_FAILURE","webExMeetingId","info","sipUri","requestOptions","getDirectMeetingInfoURI","directURI","service","WBXAPPAPI_SERVICE","resource","newMetrics","submitInternalEvent","submitClientEvent","response","payload","identifiers","meetingLookupUrl","webexConferenceIdStr","confIdStr","confID","globalMeetingId","FETCH_MEETING_INFO_V1_SUCCESS","rawError","statusCode","VERIFY_PASSWORD_ERROR","VERIFY_CAPTCHA_ERROR","captchaId","captchaID","verificationImageURL","verificationAudioURL","refreshURL"],"sources":["meeting-info-v2.ts"],"sourcesContent":["import lodash from 'lodash';\nimport {\n HTTP_VERBS,\n _CONVERSATION_URL_,\n WBXAPPAPI_SERVICE,\n DEFAULT_MEETING_INFO_REQUEST_BODY,\n} from '../constants';\nimport Metrics from '../metrics';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\n\nimport MeetingInfoUtil from './utilv2';\n\nconst PASSWORD_ERROR_DEFAULT_MESSAGE =\n 'Password required. Call fetchMeetingInfo() with password argument';\nconst CAPTCHA_ERROR_DEFAULT_MESSAGE =\n 'Captcha required. Call fetchMeetingInfo() with captchaInfo argument';\nconst ADHOC_MEETING_DEFAULT_ERROR =\n 'Failed starting the adhoc meeting, Please contact support team ';\nconst CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES = [423005, 423006];\nconst POLICY_ERROR_CODES = [403049, 403104, 403103, 403048, 403102, 403101];\n/**\n * Error to indicate that wbxappapi requires a password\n */\nexport class MeetingInfoV2PasswordError extends Error {\n meetingInfo: any;\n sdkMessage: any;\n wbxAppApiCode: any;\n body: any;\n\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [meetingInfo]\n * @param {String} [message]\n */\n constructor(\n wbxAppApiErrorCode?: number,\n meetingInfo?: object,\n message: string = PASSWORD_ERROR_DEFAULT_MESSAGE\n ) {\n super(`${message}, code=${wbxAppApiErrorCode}`);\n this.name = 'MeetingInfoV2PasswordError';\n this.sdkMessage = message;\n this.stack = new Error().stack;\n this.wbxAppApiCode = wbxAppApiErrorCode;\n this.meetingInfo = meetingInfo;\n }\n}\n\n/**\n * Error generating a adhoc space meeting\n */\nexport class MeetingInfoV2AdhocMeetingError extends Error {\n sdkMessage: any;\n wbxAppApiCode: any;\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode?: number, message: string = ADHOC_MEETING_DEFAULT_ERROR) {\n super(`${message}, code=${wbxAppApiErrorCode}`);\n this.name = 'MeetingInfoV2AdhocMeetingError';\n this.sdkMessage = message;\n this.stack = new Error().stack;\n this.wbxAppApiCode = wbxAppApiErrorCode;\n }\n}\n\n/**\n * Error preventing join because of a meeting policy\n */\nexport class MeetingInfoV2PolicyError extends Error {\n meetingInfo: object;\n sdkMessage: string;\n wbxAppApiCode: number;\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [meetingInfo]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode?: number, meetingInfo?: object, message?: string) {\n super(`${message}, code=${wbxAppApiErrorCode}`);\n this.name = 'MeetingInfoV2AdhocMeetingError';\n this.sdkMessage = message;\n this.stack = new Error().stack;\n this.wbxAppApiCode = wbxAppApiErrorCode;\n this.meetingInfo = meetingInfo;\n }\n}\n\n/**\n * Error to indicate that preferred webex site not present to start adhoc meeting\n */\nexport class MeetingInfoV2CaptchaError extends Error {\n captchaInfo: any;\n isPasswordRequired: any;\n sdkMessage: any;\n wbxAppApiCode: any;\n body: any;\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [captchaInfo]\n * @param {String} [message]\n */\n constructor(\n wbxAppApiErrorCode?: number,\n captchaInfo?: object,\n message: string = CAPTCHA_ERROR_DEFAULT_MESSAGE\n ) {\n super(`${message}, code=${wbxAppApiErrorCode}`);\n this.name = 'MeetingInfoV2PasswordError';\n this.sdkMessage = message;\n this.stack = new Error().stack;\n this.wbxAppApiCode = wbxAppApiErrorCode;\n this.isPasswordRequired = CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES.includes(wbxAppApiErrorCode);\n this.captchaInfo = captchaInfo;\n }\n}\n\n/**\n * @class MeetingInfo\n */\nexport default class MeetingInfoV2 {\n webex: any;\n\n /**\n *\n * @param {WebexSDK} webex\n */\n constructor(webex) {\n this.webex = webex;\n }\n\n /**\n * converts hydra id into conversation url and persons Id\n * @param {String} destination one of many different types of destinations to look up info for\n * @param {String} [type] to match up with the destination value\n * @returns {Promise} destination and type\n * @public\n * @memberof MeetingInfo\n */\n fetchInfoOptions(destination: string, type: string = null) {\n return MeetingInfoUtil.getDestinationType({\n destination,\n type,\n webex: this.webex,\n });\n }\n\n /**\n * Raises a MeetingInfoV2PolicyError for policy error codes\n * @param {any} err the error from the request\n * @returns {void}\n */\n handlePolicyError = (err) => {\n if (!err.body) {\n return;\n }\n\n if (POLICY_ERROR_CODES.includes(err.body?.code)) {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.MEETING_INFO_POLICY_ERROR, {\n code: err.body?.code,\n });\n\n throw new MeetingInfoV2PolicyError(\n err.body?.code,\n err.body?.data?.meetingInfo,\n err.body?.message\n );\n }\n };\n\n /**\n * Creates adhoc space meetings for a space by fetching the conversation infomation\n * @param {String} conversationUrl conversationUrl to start adhoc meeting on\n * @param {String} installedOrgID org ID of user's machine\n * @returns {Promise} returns a meeting info object\n * @public\n * @memberof MeetingInfo\n */\n async createAdhocSpaceMeeting(conversationUrl: string, installedOrgID?: string) {\n if (!this.webex.meetings.preferredWebexSite) {\n throw Error('No preferred webex site found');\n }\n const getInvitees = (particpants = []) => {\n const invitees = [];\n\n if (particpants) {\n particpants.forEach((participant) => {\n invitees.push({\n email: participant.emailAddress,\n ciUserUuid: participant.entryUUID,\n });\n });\n }\n\n return invitees;\n };\n\n return this.webex.internal.conversation\n .get({url: conversationUrl}, {includeParticipants: true, disableTransform: true})\n .then((conversation) => {\n const body: {\n title: string;\n spaceUrl: string;\n keyUrl: string;\n kroUrl: string;\n invitees: any[];\n installedOrgID?: string;\n } = {\n title: conversation.displayName,\n spaceUrl: conversation.url,\n keyUrl: conversation.encryptionKeyUrl,\n kroUrl: conversation.kmsResourceObjectUrl,\n invitees: getInvitees(conversation.participants?.items),\n };\n\n if (installedOrgID) {\n body.installedOrgID = installedOrgID;\n }\n\n const uri = this.webex.meetings.preferredWebexSite\n ? `https://${this.webex.meetings.preferredWebexSite}/wbxappapi/v2/meetings/spaceInstant`\n : '';\n\n return this.webex.request({\n method: HTTP_VERBS.POST,\n uri,\n body,\n });\n })\n .then((requestResult) => {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.ADHOC_MEETING_SUCCESS);\n\n return requestResult;\n })\n .catch((err) => {\n this.handlePolicyError(err);\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.ADHOC_MEETING_FAILURE, {\n reason: err.message,\n stack: err.stack,\n });\n throw new MeetingInfoV2AdhocMeetingError(err.body?.code, err.body?.message);\n });\n }\n\n /**\n * Fetches meeting info from the server\n * @param {String} destination one of many different types of destinations to look up info for\n * @param {String} [type] to match up with the destination value\n * @param {String} password\n * @param {Object} captchaInfo\n * @param {String} captchaInfo.code\n * @param {String} captchaInfo.id\n * @param {String} installedOrgID org ID of user's machine\n * @param {String} locusId\n * @param {Object} extraParams\n * @param {Object} options\n * @returns {Promise} returns a meeting info object\n * @public\n * @memberof MeetingInfo\n */\n async fetchMeetingInfo(\n destination: string,\n type: string = null,\n password: string = null,\n captchaInfo: {\n code: string;\n id: string;\n } = null,\n installedOrgID = null,\n locusId = null,\n extraParams: object = {},\n options: {meetingId?: string; sendCAevents?: boolean} = {}\n ) {\n const {meetingId, sendCAevents} = options;\n\n const destinationType = await MeetingInfoUtil.getDestinationType({\n destination,\n type,\n webex: this.webex,\n });\n\n if (\n destinationType.type === _CONVERSATION_URL_ &&\n this.webex.config.meetings.experimental.enableAdhocMeetings &&\n this.webex.meetings.preferredWebexSite\n ) {\n return this.createAdhocSpaceMeeting(destinationType.destination, installedOrgID);\n }\n\n const body = await MeetingInfoUtil.getRequestBody({\n ...destinationType,\n password,\n captchaInfo,\n installedOrgID,\n locusId,\n extraParams,\n });\n\n // If the body only contains the default properties, we don't have enough to\n // fetch the meeting info so don't bother trying.\n if (\n !lodash.difference(Object.keys(body), Object.keys(DEFAULT_MEETING_INFO_REQUEST_BODY)).length\n ) {\n const err = new Error('Not enough information to fetch meeting info');\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_FAILURE, {\n reason: err.message,\n destinationType: destinationType?.type,\n webExMeetingId: destinationType?.info?.webExMeetingId,\n sipUri: destinationType?.info?.sipUri,\n });\n\n throw err;\n }\n\n const requestOptions: any = {\n method: HTTP_VERBS.POST,\n body,\n };\n\n const directURI = await MeetingInfoUtil.getDirectMeetingInfoURI(destinationType);\n\n if (directURI) {\n requestOptions.uri = directURI;\n } else {\n requestOptions.service = WBXAPPAPI_SERVICE;\n requestOptions.resource = 'meetingInfo';\n }\n\n if (meetingId && sendCAevents) {\n this.webex.internal.newMetrics.submitInternalEvent({\n name: 'internal.client.meetinginfo.request',\n });\n\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.meetinginfo.request',\n options: {\n meetingId,\n },\n });\n }\n\n return this.webex\n .request(requestOptions)\n .then((response) => {\n if (meetingId && sendCAevents) {\n this.webex.internal.newMetrics.submitInternalEvent({\n name: 'internal.client.meetinginfo.response',\n });\n\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.meetinginfo.response',\n payload: {\n identifiers: {\n meetingLookupUrl: response?.url,\n },\n },\n options: {\n meetingId,\n webexConferenceIdStr: response?.body?.confIdStr || response?.body?.confID,\n globalMeetingId: response?.body?.meetingId,\n },\n });\n }\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_SUCCESS);\n\n return response;\n })\n .catch((err) => {\n if (meetingId && sendCAevents) {\n this.webex.internal.newMetrics.submitInternalEvent({\n name: 'internal.client.meetinginfo.response',\n });\n\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.meetinginfo.response',\n payload: {\n identifiers: {\n meetingLookupUrl: err?.url,\n },\n },\n options: {\n meetingId,\n rawError: err,\n },\n });\n }\n\n if (err?.statusCode === 403) {\n this.handlePolicyError(err);\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.VERIFY_PASSWORD_ERROR, {\n reason: err.message,\n stack: err.stack,\n });\n\n throw new MeetingInfoV2PasswordError(err.body?.code, err.body?.data?.meetingInfo);\n }\n if (err?.statusCode === 423) {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.VERIFY_CAPTCHA_ERROR, {\n reason: err.message,\n stack: err.stack,\n });\n\n throw new MeetingInfoV2CaptchaError(err.body?.code, {\n captchaId: err.body.captchaID,\n verificationImageURL: err.body.verificationImageURL,\n verificationAudioURL: err.body.verificationAudioURL,\n refreshURL: err.body.refreshURL,\n });\n }\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_FAILURE, {\n reason: err.message,\n stack: err.stack,\n });\n throw err;\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AAMA;AACA;AAEA;AAAuC;AAAA;AAAA;AAAA;AAEvC,IAAMA,8BAA8B,GAClC,mEAAmE;AACrE,IAAMC,6BAA6B,GACjC,qEAAqE;AACvE,IAAMC,2BAA2B,GAC/B,iEAAiE;AACnE,IAAMC,qCAAqC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;AAC9D,IAAMC,kBAAkB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;AAC3E;AACA;AACA;AAFA,IAGaC,0BAA0B;EAAA;EAAA;EAMrC;AACF;AACA;AACA;AACA;AACA;AACA;EACE,oCACEC,kBAA2B,EAC3BC,WAAoB,EAEpB;IAAA;IAAA,IADAC,OAAe,uEAAGR,8BAA8B;IAAA;IAEhD,oCAASQ,OAAO,o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AC,CAAC;gBACJ;gBAEA/F,gBAAO,CAACC,oBAAoB,CAACC,mBAAkB,CAAC+D,6BAA6B,EAAE;kBAC7EhB,MAAM,EAAEpD,GAAG,CAACd,OAAO;kBACnBG,KAAK,EAAEW,GAAG,CAACX;gBACb,CAAC,CAAC;gBACF,MAAMW,GAAG;cACX,CAAC,CAAC;YAAA;YAAA;cAAA;UAAA;QAAA;MAAA,CACL;MAAA;QAAA;MAAA;MAAA;IAAA;EAAA;EAAA;AAAA;AAAA"}
|
|
@@ -224,7 +224,7 @@ MeetingInfoUtil.generateOptions = /*#__PURE__*/function () {
|
|
|
224
224
|
_context.next = 47;
|
|
225
225
|
break;
|
|
226
226
|
case 46:
|
|
227
|
-
throw new _parameter.default('MeetingInfo is fetched with meeting link,
|
|
227
|
+
throw new _parameter.default('MeetingInfo is fetched with the meeting link, SIP URI, phone number, Hydra people ID, or a conversation URL.');
|
|
228
228
|
case 47:
|
|
229
229
|
return _context.abrupt("return", _promise.default.resolve(options));
|
|
230
230
|
case 48:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MeetingInfoUtil","extractDestination","destination","type","dest","_LOCUS_ID_","url","ParameterError","getParsedUrl","link","parsedUrl","parse","protocol","HTTPS_PROTOCOL","error","LoggerProxy","logger","warn","isMeetingLink","value","hostNameBool","hostname","includes","WEBEX_DOT_COM","pathNameBool","pathname","MEET","MEET_M","JOIN","isConversationUrl","webex","clusterId","internal","services","getClusterId","endsWith","CONVERSATION_SERVICE","convertLinkToSip","user","userIndex","lastIndexOf","substring","company","companyIndex","replace","WWW_DOT","isSipUri","sipString","sipUri","DIALER_REGEX","SIP_ADDRESS","exec","isPhoneNumber","phoneNumber","isValidNumber","PHONE_NUMBER","test","getHydraId","deconstructHydraId","id","cluster","UUID_REG","_ROOM_","room","_PEOPLE_","people","getSipUriFromHydraPersonId","get","then","res","emails","length","catch","err","generateOptions","from","options","hydraId","_MEETING_LINK_","_SIP_URI_","_CONVERSATION_URL_","wasHydraPerson","resolve","waitForCatalog","conversationUrl","conversation","getUrlFromClusterId","getResourceUrl","resource","LOCI","MEETINGINFO","method","HTTP_VERBS","GET","uri","_PERSONAL_ROOM_","_MEETING_ID_","encodeURIComponent","TYPE","USE_URI_LOOKUP_FALSE","PUT","btoa","getRequestParams","resourceOptions","api","requestParams","concat","ALTERNATE_REDIRECT_TRUE","body","lookupType"],"sources":["util.ts"],"sourcesContent":["import url from 'url';\n\nimport btoa from 'btoa';\nimport {\n // @ts-ignore\n deconstructHydraId,\n} from '@webex/common';\n\nimport ParameterError from '../common/errors/parameter';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {\n _SIP_URI_,\n _PERSONAL_ROOM_,\n _MEETING_ID_,\n _CONVERSATION_URL_,\n _LOCUS_ID_,\n _MEETING_LINK_,\n _PEOPLE_,\n _ROOM_,\n HTTP_VERBS,\n USE_URI_LOOKUP_FALSE,\n TYPE,\n LOCI,\n MEETINGINFO,\n ALTERNATE_REDIRECT_TRUE,\n DIALER_REGEX,\n WEBEX_DOT_COM,\n CONVERSATION_SERVICE,\n WWW_DOT,\n JOIN,\n MEET,\n MEET_M,\n HTTPS_PROTOCOL,\n UUID_REG,\n} from '../constants';\n\nconst MeetingInfoUtil: any = {};\n\nMeetingInfoUtil.extractDestination = (destination, type) => {\n let dest = destination;\n\n if (type === _LOCUS_ID_) {\n if (!(destination && destination.url)) {\n throw new ParameterError('You cannot create a meeting by locus without a locus.url defined');\n }\n dest = destination.url;\n }\n\n return dest;\n};\n\nMeetingInfoUtil.getParsedUrl = (link) => {\n try {\n let parsedUrl = url.parse(link);\n\n if (!parsedUrl) {\n return false;\n }\n // hack for links such as <company>.webex.com/meet/<user> without a protocol\n if (!parsedUrl.protocol) {\n parsedUrl = url.parse(`${HTTPS_PROTOCOL}${link}`);\n }\n\n return parsedUrl;\n } catch (error) {\n LoggerProxy.logger.warn(\n `Meeting-info:util#getParsedUrl --> unable to parse the URL, error: ${error}`\n );\n\n return null;\n }\n};\n\n/**\n * Helper function to check if a string matches a known meeting link pattern\n * @param {String} value string to parse and see if it matches a meeting link\n * @returns {Boolean}\n */\nMeetingInfoUtil.isMeetingLink = (value: string) => {\n const parsedUrl = MeetingInfoUtil.getParsedUrl(value);\n const hostNameBool = parsedUrl.hostname && parsedUrl.hostname.includes(WEBEX_DOT_COM);\n const pathNameBool =\n parsedUrl.pathname &&\n (parsedUrl.pathname.includes(`/${MEET}`) ||\n parsedUrl.pathname.includes(`/${MEET_M}`) ||\n parsedUrl.pathname.includes(`/${JOIN}`));\n\n return hostNameBool && pathNameBool;\n};\n\nMeetingInfoUtil.isConversationUrl = (value, webex) => {\n const clusterId = webex.internal.services.getClusterId(value);\n\n if (clusterId) {\n return clusterId.endsWith(CONVERSATION_SERVICE);\n }\n\n return false;\n};\n\nMeetingInfoUtil.convertLinkToSip = (value) => {\n const parsedUrl = MeetingInfoUtil.getParsedUrl(value);\n\n if (!parsedUrl) {\n return null;\n }\n let user;\n\n if (parsedUrl.pathname) {\n const userIndex = parsedUrl.pathname.lastIndexOf('/');\n\n user = parsedUrl.pathname.substring(userIndex + 1);\n }\n if (!user) {\n return null;\n }\n let company;\n\n if (parsedUrl.hostname) {\n const companyIndex = parsedUrl.hostname.lastIndexOf(`.${WEBEX_DOT_COM}`);\n\n company = parsedUrl.hostname.substring(0, companyIndex).replace(WWW_DOT, '');\n }\n if (!company) {\n return null;\n }\n\n return `${user}@${company}.${WEBEX_DOT_COM}`;\n};\n\nMeetingInfoUtil.isSipUri = (sipString) => {\n // TODO: lets remove regex from this equation and user URI matchers and such\n // have not found a great sip uri parser library as of now\n const sipUri = DIALER_REGEX.SIP_ADDRESS.exec(sipString);\n\n return sipUri;\n};\n\nMeetingInfoUtil.isPhoneNumber = (phoneNumber) => {\n const isValidNumber = DIALER_REGEX.PHONE_NUMBER.test(phoneNumber);\n\n return isValidNumber;\n};\n\nMeetingInfoUtil.getHydraId = (destination) => {\n const {type, id, cluster} = deconstructHydraId(destination);\n\n if (id && UUID_REG.test(id)) {\n if (type === _ROOM_) {\n return {room: true, destination: id, cluster};\n }\n if (type === _PEOPLE_) {\n return {people: true, destination: id, cluster};\n }\n\n return {};\n }\n\n return {};\n};\n\nMeetingInfoUtil.getSipUriFromHydraPersonId = (destination, webex) =>\n webex.people\n .get(destination)\n .then((res) => {\n if (res.emails && res.emails.length) {\n return res.emails[0];\n }\n throw new ParameterError('Hydra Id Lookup was an invalid hydra person id.');\n })\n .catch((err) => {\n LoggerProxy.logger.error(\n `Meeting-info:util#MeetingInfoUtil.getSipUriFromHydraPersonId --> getSipUriFromHydraPersonId ${err} `\n );\n throw err;\n });\n\nMeetingInfoUtil.generateOptions = async (from) => {\n const {destination, type, webex} = from;\n\n if (type) {\n return {\n destination,\n type,\n };\n }\n const options: any = {};\n const hydraId = MeetingInfoUtil.getHydraId(destination);\n\n if (MeetingInfoUtil.isMeetingLink(destination)) {\n LoggerProxy.logger.warn(\n 'Meeting-info:util#generateOptions --> WARN, use of Meeting Link is deprecated, please use a SIP URI instead'\n );\n\n options.type = _MEETING_LINK_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isSipUri(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isPhoneNumber(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isConversationUrl(destination, webex)) {\n options.type = _CONVERSATION_URL_;\n options.destination = destination;\n } else if (hydraId.people) {\n options.type = _SIP_URI_;\n\n return MeetingInfoUtil.getSipUriFromHydraPersonId(hydraId.destination, webex).then((res) => {\n options.destination = res;\n\n // Since hydra person ids require a unique case in which they are\n // entirely converted to a SIP URI, we need to set a flag for detecting\n // this type of destination.\n options.wasHydraPerson = true;\n\n return Promise.resolve(options);\n });\n } else if (hydraId.room) {\n options.type = _CONVERSATION_URL_;\n try {\n await webex.internal.services.waitForCatalog('postauth');\n\n const conversationUrl = webex.internal.conversation.getUrlFromClusterId({\n cluster: hydraId.cluster,\n id: hydraId.destination,\n });\n\n options.destination = conversationUrl;\n } catch (e) {\n LoggerProxy.logger.error(`Meeting-info:util#generateOptions --> ${e}`);\n throw e;\n }\n } else {\n throw new ParameterError(\n 'MeetingInfo is fetched with meeting link, sip uri, phone number, hydra room id, hydra people id, or a conversation url.'\n );\n }\n\n return Promise.resolve(options);\n};\n\n/**\n * Helper function to build up a correct locus url depending on the value passed\n * @param {String} type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]\n * @param {Object} value ?? value.value\n * @returns {Object} returns an object with {resource, method}\n */\nMeetingInfoUtil.getResourceUrl = (type: string, value: any) => {\n let resource = `/${LOCI}/${MEETINGINFO}`;\n let method = HTTP_VERBS.GET;\n let uri = null;\n\n switch (type) {\n case _SIP_URI_:\n case _PERSONAL_ROOM_:\n case _MEETING_ID_:\n resource = `/${LOCI}/${MEETINGINFO}/${encodeURIComponent(\n value\n )}?${TYPE}=${type}&${USE_URI_LOOKUP_FALSE}`;\n break;\n case _CONVERSATION_URL_:\n method = HTTP_VERBS.PUT;\n break;\n case _LOCUS_ID_:\n uri = `${value}/${MEETINGINFO}`;\n method = HTTP_VERBS.PUT;\n break;\n case _MEETING_LINK_:\n resource = `$/${LOCI}/${MEETINGINFO}/${btoa(\n value\n )}?${TYPE}=${_MEETING_LINK_}&${USE_URI_LOOKUP_FALSE}`;\n break;\n default:\n }\n\n return {\n uri,\n resource,\n method,\n };\n};\n\nMeetingInfoUtil.getRequestParams = (resourceOptions, type, value, api) => {\n let requestParams: any = {\n method: resourceOptions.method,\n api,\n resource: resourceOptions.resource,\n };\n\n if (resourceOptions.method === HTTP_VERBS.GET) {\n // for handling URL redirections\n requestParams.resource = requestParams.resource.concat(`&${ALTERNATE_REDIRECT_TRUE}`);\n } else if (type !== _LOCUS_ID_) {\n // locus id check is a PUT not sure why\n requestParams.resource = requestParams.resource.concat(`?${ALTERNATE_REDIRECT_TRUE}`);\n requestParams.body = {\n value,\n lookupType: type,\n };\n } else if (type === _LOCUS_ID_) {\n requestParams = {\n method: resourceOptions.method,\n uri: resourceOptions.uri,\n };\n }\n\n return requestParams;\n};\n\nexport default MeetingInfoUtil;\n"],"mappings":";;;;;;;;;;;AAAA;AAEA;AACA;AAKA;AACA;AACA;AA0BA,IAAMA,eAAoB,GAAG,CAAC,CAAC;AAE/BA,eAAe,CAACC,kBAAkB,GAAG,UAACC,WAAW,EAAEC,IAAI,EAAK;EAC1D,IAAIC,IAAI,GAAGF,WAAW;EAEtB,IAAIC,IAAI,KAAKE,qBAAU,EAAE;IACvB,IAAI,EAAEH,WAAW,IAAIA,WAAW,CAACI,GAAG,CAAC,EAAE;MACrC,MAAM,IAAIC,kBAAc,CAAC,kEAAkE,CAAC;IAC9F;IACAH,IAAI,GAAGF,WAAW,CAACI,GAAG;EACxB;EAEA,OAAOF,IAAI;AACb,CAAC;AAEDJ,eAAe,CAACQ,YAAY,GAAG,UAACC,IAAI,EAAK;EACvC,IAAI;IACF,IAAIC,SAAS,GAAGJ,YAAG,CAACK,KAAK,CAACF,IAAI,CAAC;IAE/B,IAAI,CAACC,SAAS,EAAE;MACd,OAAO,KAAK;IACd;IACA;IACA,IAAI,CAACA,SAAS,CAACE,QAAQ,EAAE;MACvBF,SAAS,GAAGJ,YAAG,CAACK,KAAK,WAAIE,yBAAc,SAAGJ,IAAI,EAAG;IACnD;IAEA,OAAOC,SAAS;EAClB,CAAC,CAAC,OAAOI,KAAK,EAAE;IACdC,oBAAW,CAACC,MAAM,CAACC,IAAI,8EACiDH,KAAK,EAC5E;IAED,OAAO,IAAI;EACb;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACAd,eAAe,CAACkB,aAAa,GAAG,UAACC,KAAa,EAAK;EACjD,IAAMT,SAAS,GAAGV,eAAe,CAACQ,YAAY,CAACW,KAAK,CAAC;EACrD,IAAMC,YAAY,GAAGV,SAAS,CAACW,QAAQ,IAAIX,SAAS,CAACW,QAAQ,CAACC,QAAQ,CAACC,wBAAa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,MAAM;IAC9Ba,GAAG,EAAHA,GAAG;IACHhB,QAAQ,EAAEe,eAAe,CAACf;EAC5B,CAAC;EAED,IAAIe,eAAe,CAACZ,MAAM,KAAKC,qBAAU,CAACC,GAAG,EAAE;IAC7C;IACAY,aAAa,CAACjB,QAAQ,GAAGiB,aAAa,CAACjB,QAAQ,CAACkB,MAAM,YAAKC,kCAAuB,EAAG;EACvF,CAAC,MAAM,IAAIxG,IAAI,KAAKE,qBAAU,EAAE;IAC9B;IACAoG,aAAa,CAACjB,QAAQ,GAAGiB,aAAa,CAACjB,QAAQ,CAACkB,MAAM,YAAKC,kCAAuB,EAAG;IACrFF,aAAa,CAACG,IAAI,GAAG;MACnBzF,KAAK,EAALA,KAAK;MACL0F,UAAU,EAAE1G;IACd,CAAC;EACH,CAAC,MAAM,IAAIA,IAAI,KAAKE,qBAAU,EAAE;IAC9BoG,aAAa,GAAG;MACdd,MAAM,EAAEY,eAAe,CAACZ,MAAM;MAC9BG,GAAG,EAAES,eAAe,CAACT;IACvB,CAAC;EACH;EAEA,OAAOW,aAAa;AACtB,CAAC;AAAC,eAEazG,eAAe;AAAA"}
|
|
1
|
+
{"version":3,"names":["MeetingInfoUtil","extractDestination","destination","type","dest","_LOCUS_ID_","url","ParameterError","getParsedUrl","link","parsedUrl","parse","protocol","HTTPS_PROTOCOL","error","LoggerProxy","logger","warn","isMeetingLink","value","hostNameBool","hostname","includes","WEBEX_DOT_COM","pathNameBool","pathname","MEET","MEET_M","JOIN","isConversationUrl","webex","clusterId","internal","services","getClusterId","endsWith","CONVERSATION_SERVICE","convertLinkToSip","user","userIndex","lastIndexOf","substring","company","companyIndex","replace","WWW_DOT","isSipUri","sipString","sipUri","DIALER_REGEX","SIP_ADDRESS","exec","isPhoneNumber","phoneNumber","isValidNumber","PHONE_NUMBER","test","getHydraId","deconstructHydraId","id","cluster","UUID_REG","_ROOM_","room","_PEOPLE_","people","getSipUriFromHydraPersonId","get","then","res","emails","length","catch","err","generateOptions","from","options","hydraId","_MEETING_LINK_","_SIP_URI_","_CONVERSATION_URL_","wasHydraPerson","resolve","waitForCatalog","conversationUrl","conversation","getUrlFromClusterId","getResourceUrl","resource","LOCI","MEETINGINFO","method","HTTP_VERBS","GET","uri","_PERSONAL_ROOM_","_MEETING_ID_","encodeURIComponent","TYPE","USE_URI_LOOKUP_FALSE","PUT","btoa","getRequestParams","resourceOptions","api","requestParams","concat","ALTERNATE_REDIRECT_TRUE","body","lookupType"],"sources":["util.ts"],"sourcesContent":["import url from 'url';\n\nimport btoa from 'btoa';\nimport {\n // @ts-ignore\n deconstructHydraId,\n} from '@webex/common';\n\nimport ParameterError from '../common/errors/parameter';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {\n _SIP_URI_,\n _PERSONAL_ROOM_,\n _MEETING_ID_,\n _CONVERSATION_URL_,\n _LOCUS_ID_,\n _MEETING_LINK_,\n _PEOPLE_,\n _ROOM_,\n HTTP_VERBS,\n USE_URI_LOOKUP_FALSE,\n TYPE,\n LOCI,\n MEETINGINFO,\n ALTERNATE_REDIRECT_TRUE,\n DIALER_REGEX,\n WEBEX_DOT_COM,\n CONVERSATION_SERVICE,\n WWW_DOT,\n JOIN,\n MEET,\n MEET_M,\n HTTPS_PROTOCOL,\n UUID_REG,\n} from '../constants';\n\nconst MeetingInfoUtil: any = {};\n\nMeetingInfoUtil.extractDestination = (destination, type) => {\n let dest = destination;\n\n if (type === _LOCUS_ID_) {\n if (!(destination && destination.url)) {\n throw new ParameterError('You cannot create a meeting by locus without a locus.url defined');\n }\n dest = destination.url;\n }\n\n return dest;\n};\n\nMeetingInfoUtil.getParsedUrl = (link) => {\n try {\n let parsedUrl = url.parse(link);\n\n if (!parsedUrl) {\n return false;\n }\n // hack for links such as <company>.webex.com/meet/<user> without a protocol\n if (!parsedUrl.protocol) {\n parsedUrl = url.parse(`${HTTPS_PROTOCOL}${link}`);\n }\n\n return parsedUrl;\n } catch (error) {\n LoggerProxy.logger.warn(\n `Meeting-info:util#getParsedUrl --> unable to parse the URL, error: ${error}`\n );\n\n return null;\n }\n};\n\n/**\n * Helper function to check if a string matches a known meeting link pattern\n * @param {String} value string to parse and see if it matches a meeting link\n * @returns {Boolean}\n */\nMeetingInfoUtil.isMeetingLink = (value: string) => {\n const parsedUrl = MeetingInfoUtil.getParsedUrl(value);\n const hostNameBool = parsedUrl.hostname && parsedUrl.hostname.includes(WEBEX_DOT_COM);\n const pathNameBool =\n parsedUrl.pathname &&\n (parsedUrl.pathname.includes(`/${MEET}`) ||\n parsedUrl.pathname.includes(`/${MEET_M}`) ||\n parsedUrl.pathname.includes(`/${JOIN}`));\n\n return hostNameBool && pathNameBool;\n};\n\nMeetingInfoUtil.isConversationUrl = (value, webex) => {\n const clusterId = webex.internal.services.getClusterId(value);\n\n if (clusterId) {\n return clusterId.endsWith(CONVERSATION_SERVICE);\n }\n\n return false;\n};\n\nMeetingInfoUtil.convertLinkToSip = (value) => {\n const parsedUrl = MeetingInfoUtil.getParsedUrl(value);\n\n if (!parsedUrl) {\n return null;\n }\n let user;\n\n if (parsedUrl.pathname) {\n const userIndex = parsedUrl.pathname.lastIndexOf('/');\n\n user = parsedUrl.pathname.substring(userIndex + 1);\n }\n if (!user) {\n return null;\n }\n let company;\n\n if (parsedUrl.hostname) {\n const companyIndex = parsedUrl.hostname.lastIndexOf(`.${WEBEX_DOT_COM}`);\n\n company = parsedUrl.hostname.substring(0, companyIndex).replace(WWW_DOT, '');\n }\n if (!company) {\n return null;\n }\n\n return `${user}@${company}.${WEBEX_DOT_COM}`;\n};\n\nMeetingInfoUtil.isSipUri = (sipString) => {\n // TODO: lets remove regex from this equation and user URI matchers and such\n // have not found a great sip uri parser library as of now\n const sipUri = DIALER_REGEX.SIP_ADDRESS.exec(sipString);\n\n return sipUri;\n};\n\nMeetingInfoUtil.isPhoneNumber = (phoneNumber) => {\n const isValidNumber = DIALER_REGEX.PHONE_NUMBER.test(phoneNumber);\n\n return isValidNumber;\n};\n\nMeetingInfoUtil.getHydraId = (destination) => {\n const {type, id, cluster} = deconstructHydraId(destination);\n\n if (id && UUID_REG.test(id)) {\n if (type === _ROOM_) {\n return {room: true, destination: id, cluster};\n }\n if (type === _PEOPLE_) {\n return {people: true, destination: id, cluster};\n }\n\n return {};\n }\n\n return {};\n};\n\nMeetingInfoUtil.getSipUriFromHydraPersonId = (destination, webex) =>\n webex.people\n .get(destination)\n .then((res) => {\n if (res.emails && res.emails.length) {\n return res.emails[0];\n }\n throw new ParameterError('Hydra Id Lookup was an invalid hydra person id.');\n })\n .catch((err) => {\n LoggerProxy.logger.error(\n `Meeting-info:util#MeetingInfoUtil.getSipUriFromHydraPersonId --> getSipUriFromHydraPersonId ${err} `\n );\n throw err;\n });\n\nMeetingInfoUtil.generateOptions = async (from) => {\n const {destination, type, webex} = from;\n\n if (type) {\n return {\n destination,\n type,\n };\n }\n const options: any = {};\n const hydraId = MeetingInfoUtil.getHydraId(destination);\n\n if (MeetingInfoUtil.isMeetingLink(destination)) {\n LoggerProxy.logger.warn(\n 'Meeting-info:util#generateOptions --> WARN, use of Meeting Link is deprecated, please use a SIP URI instead'\n );\n\n options.type = _MEETING_LINK_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isSipUri(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isPhoneNumber(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isConversationUrl(destination, webex)) {\n options.type = _CONVERSATION_URL_;\n options.destination = destination;\n } else if (hydraId.people) {\n options.type = _SIP_URI_;\n\n return MeetingInfoUtil.getSipUriFromHydraPersonId(hydraId.destination, webex).then((res) => {\n options.destination = res;\n\n // Since hydra person ids require a unique case in which they are\n // entirely converted to a SIP URI, we need to set a flag for detecting\n // this type of destination.\n options.wasHydraPerson = true;\n\n return Promise.resolve(options);\n });\n } else if (hydraId.room) {\n options.type = _CONVERSATION_URL_;\n try {\n await webex.internal.services.waitForCatalog('postauth');\n\n const conversationUrl = webex.internal.conversation.getUrlFromClusterId({\n cluster: hydraId.cluster,\n id: hydraId.destination,\n });\n\n options.destination = conversationUrl;\n } catch (e) {\n LoggerProxy.logger.error(`Meeting-info:util#generateOptions --> ${e}`);\n throw e;\n }\n } else {\n throw new ParameterError(\n 'MeetingInfo is fetched with the meeting link, SIP URI, phone number, Hydra people ID, or a conversation URL.'\n );\n }\n\n return Promise.resolve(options);\n};\n\n/**\n * Helper function to build up a correct locus url depending on the value passed\n * @param {String} type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]\n * @param {Object} value ?? value.value\n * @returns {Object} returns an object with {resource, method}\n */\nMeetingInfoUtil.getResourceUrl = (type: string, value: any) => {\n let resource = `/${LOCI}/${MEETINGINFO}`;\n let method = HTTP_VERBS.GET;\n let uri = null;\n\n switch (type) {\n case _SIP_URI_:\n case _PERSONAL_ROOM_:\n case _MEETING_ID_:\n resource = `/${LOCI}/${MEETINGINFO}/${encodeURIComponent(\n value\n )}?${TYPE}=${type}&${USE_URI_LOOKUP_FALSE}`;\n break;\n case _CONVERSATION_URL_:\n method = HTTP_VERBS.PUT;\n break;\n case _LOCUS_ID_:\n uri = `${value}/${MEETINGINFO}`;\n method = HTTP_VERBS.PUT;\n break;\n case _MEETING_LINK_:\n resource = `$/${LOCI}/${MEETINGINFO}/${btoa(\n value\n )}?${TYPE}=${_MEETING_LINK_}&${USE_URI_LOOKUP_FALSE}`;\n break;\n default:\n }\n\n return {\n uri,\n resource,\n method,\n };\n};\n\nMeetingInfoUtil.getRequestParams = (resourceOptions, type, value, api) => {\n let requestParams: any = {\n method: resourceOptions.method,\n api,\n resource: resourceOptions.resource,\n };\n\n if (resourceOptions.method === HTTP_VERBS.GET) {\n // for handling URL redirections\n requestParams.resource = requestParams.resource.concat(`&${ALTERNATE_REDIRECT_TRUE}`);\n } else if (type !== _LOCUS_ID_) {\n // locus id check is a PUT not sure why\n requestParams.resource = requestParams.resource.concat(`?${ALTERNATE_REDIRECT_TRUE}`);\n requestParams.body = {\n value,\n lookupType: type,\n };\n } else if (type === _LOCUS_ID_) {\n requestParams = {\n method: resourceOptions.method,\n uri: resourceOptions.uri,\n };\n }\n\n return requestParams;\n};\n\nexport default MeetingInfoUtil;\n"],"mappings":";;;;;;;;;;;AAAA;AAEA;AACA;AAKA;AACA;AACA;AA0BA,IAAMA,eAAoB,GAAG,CAAC,CAAC;AAE/BA,eAAe,CAACC,kBAAkB,GAAG,UAACC,WAAW,EAAEC,IAAI,EAAK;EAC1D,IAAIC,IAAI,GAAGF,WAAW;EAEtB,IAAIC,IAAI,KAAKE,qBAAU,EAAE;IACvB,IAAI,EAAEH,WAAW,IAAIA,WAAW,CAACI,GAAG,CAAC,EAAE;MACrC,MAAM,IAAIC,kBAAc,CAAC,kEAAkE,CAAC;IAC9F;IACAH,IAAI,GAAGF,WAAW,CAACI,GAAG;EACxB;EAEA,OAAOF,IAAI;AACb,CAAC;AAEDJ,eAAe,CAACQ,YAAY,GAAG,UAACC,IAAI,EAAK;EACvC,IAAI;IACF,IAAIC,SAAS,GAAGJ,YAAG,CAACK,KAAK,CAACF,IAAI,CAAC;IAE/B,IAAI,CAACC,SAAS,EAAE;MACd,OAAO,KAAK;IACd;IACA;IACA,IAAI,CAACA,SAAS,CAACE,QAAQ,EAAE;MACvBF,SAAS,GAAGJ,YAAG,CAACK,KAAK,WAAIE,yBAAc,SAAGJ,IAAI,EAAG;IACnD;IAEA,OAAOC,SAAS;EAClB,CAAC,CAAC,OAAOI,KAAK,EAAE;IACdC,oBAAW,CAACC,MAAM,CAACC,IAAI,8EACiDH,KAAK,EAC5E;IAED,OAAO,IAAI;EACb;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACAd,eAAe,CAACkB,aAAa,GAAG,UAACC,KAAa,EAAK;EACjD,IAAMT,SAAS,GAAGV,eAAe,CAACQ,YAAY,CAACW,KAAK,CAAC;EACrD,IAAMC,YAAY,GAAGV,SAAS,CAACW,QAAQ,IAAI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