@webex/plugin-meetings 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/common/errors/reconnection-not-started.js +46 -0
- package/dist/common/errors/reconnection-not-started.js.map +1 -0
- package/dist/constants.js +16 -5
- package/dist/constants.js.map +1 -1
- package/dist/index.js +80 -0
- package/dist/index.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/controlsUtils.js +7 -1
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +10 -0
- package/dist/locus-info/index.js.map +1 -1
- package/dist/media/properties.js +102 -57
- package/dist/media/properties.js.map +1 -1
- package/dist/mediaQualityMetrics/config.js +10 -10
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +6 -0
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +564 -475
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +27 -0
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/util.js +9 -16
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting/voicea-meeting.js +37 -49
- package/dist/meeting/voicea-meeting.js.map +1 -1
- package/dist/meeting-info/util.js +304 -267
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js +334 -298
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/index.js +12 -28
- package/dist/meetings/index.js.map +1 -1
- package/dist/reachability/index.js +88 -9
- package/dist/reachability/index.js.map +1 -1
- package/dist/reconnection-manager/index.js +138 -109
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/roap/request.js +3 -27
- package/dist/roap/request.js.map +1 -1
- package/dist/statsAnalyzer/index.js +8 -2
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +17 -0
- 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/breakout.d.ts +8 -0
- package/dist/types/breakouts/collection.d.ts +5 -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/index.d.ts +5 -0
- package/dist/types/breakouts/request.d.ts +22 -0
- package/dist/types/breakouts/utils.d.ts +15 -0
- package/dist/types/common/browser-detection.d.ts +9 -0
- package/dist/types/common/collection.d.ts +48 -0
- package/dist/types/common/config.d.ts +2 -0
- package/dist/types/common/errors/captcha-error.d.ts +15 -0
- package/dist/types/common/errors/intent-to-join.d.ts +16 -0
- package/dist/types/common/errors/join-meeting.d.ts +17 -0
- package/dist/types/common/errors/media.d.ts +15 -0
- package/dist/types/common/errors/no-meeting-info.d.ts +14 -0
- package/dist/types/common/errors/parameter.d.ts +15 -0
- package/dist/types/common/errors/password-error.d.ts +15 -0
- package/dist/types/common/errors/permission.d.ts +14 -0
- package/dist/types/common/errors/reclaim-host-role-errors.d.ts +60 -0
- package/dist/types/common/errors/reconnection-not-started.d.ts +13 -0
- package/dist/types/common/errors/reconnection.d.ts +15 -0
- package/dist/types/common/errors/stats.d.ts +15 -0
- package/dist/types/common/errors/webex-errors.d.ts +93 -0
- package/dist/types/common/errors/webex-meetings-error.d.ts +20 -0
- package/dist/types/common/events/events-scope.d.ts +17 -0
- package/dist/types/common/events/events.d.ts +12 -0
- package/dist/types/common/events/trigger-proxy.d.ts +2 -0
- package/dist/types/common/events/util.d.ts +2 -0
- package/dist/types/common/logs/logger-config.d.ts +2 -0
- package/dist/types/common/logs/logger-proxy.d.ts +2 -0
- package/dist/types/common/logs/request.d.ts +36 -0
- package/dist/types/common/queue.d.ts +34 -0
- package/dist/types/config.d.ts +73 -0
- package/dist/types/constants.d.ts +1098 -0
- package/dist/types/controls-options-manager/constants.d.ts +4 -0
- package/dist/types/controls-options-manager/enums.d.ts +15 -0
- package/dist/types/controls-options-manager/index.d.ts +136 -0
- package/dist/types/controls-options-manager/types.d.ts +43 -0
- package/dist/types/controls-options-manager/util.d.ts +1 -0
- package/dist/types/index.d.ts +19 -0
- package/dist/types/interceptors/index.d.ts +2 -0
- package/dist/types/interceptors/locusRetry.d.ts +27 -0
- 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/controlsUtils.d.ts +2 -0
- package/dist/types/locus-info/embeddedAppsUtils.d.ts +2 -0
- package/dist/types/locus-info/fullState.d.ts +2 -0
- package/dist/types/locus-info/hostUtils.d.ts +2 -0
- package/dist/types/locus-info/index.d.ts +322 -0
- package/dist/types/locus-info/infoUtils.d.ts +2 -0
- package/dist/types/locus-info/mediaSharesUtils.d.ts +2 -0
- package/dist/types/locus-info/parser.d.ts +272 -0
- package/dist/types/locus-info/selfUtils.d.ts +2 -0
- package/dist/types/media/MediaConnectionAwaiter.d.ts +61 -0
- package/dist/types/media/index.d.ts +34 -0
- package/dist/types/media/properties.d.ts +117 -0
- package/dist/types/media/util.d.ts +2 -0
- package/dist/types/mediaQualityMetrics/config.d.ts +247 -0
- package/dist/types/meeting/in-meeting-actions.d.ts +173 -0
- package/dist/types/meeting/index.d.ts +1832 -0
- package/dist/types/meeting/locusMediaRequest.d.ts +75 -0
- package/dist/types/meeting/muteState.d.ts +178 -0
- package/dist/types/meeting/request.d.ts +295 -0
- package/dist/types/meeting/request.type.d.ts +11 -0
- package/dist/types/meeting/state.d.ts +9 -0
- package/dist/types/meeting/util.d.ts +122 -0
- package/dist/types/meeting/voicea-meeting.d.ts +17 -0
- package/dist/types/meeting-info/collection.d.ts +20 -0
- package/dist/types/meeting-info/index.d.ts +69 -0
- package/dist/types/meeting-info/meeting-info-v2.d.ts +123 -0
- package/dist/types/meeting-info/request.d.ts +22 -0
- package/dist/types/meeting-info/util.d.ts +49 -0
- package/dist/types/meeting-info/utilv2.d.ts +65 -0
- package/dist/types/meetings/collection.d.ts +40 -0
- package/dist/types/meetings/index.d.ts +383 -0
- package/dist/types/meetings/meetings.types.d.ts +4 -0
- package/dist/types/meetings/request.d.ts +27 -0
- package/dist/types/meetings/util.d.ts +18 -0
- package/dist/types/member/index.d.ts +160 -0
- package/dist/types/member/types.d.ts +32 -0
- package/dist/types/member/util.d.ts +2 -0
- package/dist/types/members/collection.d.ts +29 -0
- package/dist/types/members/index.d.ts +353 -0
- package/dist/types/members/request.d.ts +114 -0
- package/dist/types/members/types.d.ts +25 -0
- package/dist/types/members/util.d.ts +215 -0
- package/dist/types/metrics/constants.d.ts +70 -0
- package/dist/types/metrics/index.d.ts +45 -0
- package/dist/types/multistream/mediaRequestManager.d.ts +119 -0
- package/dist/types/multistream/receiveSlot.d.ts +68 -0
- package/dist/types/multistream/receiveSlotManager.d.ts +56 -0
- package/dist/types/multistream/remoteMedia.d.ts +72 -0
- package/dist/types/multistream/remoteMediaGroup.d.ts +49 -0
- package/dist/types/multistream/remoteMediaManager.d.ts +300 -0
- package/dist/types/multistream/sendSlotManager.d.ts +69 -0
- package/dist/types/networkQualityMonitor/index.d.ts +70 -0
- package/dist/types/personal-meeting-room/index.d.ts +47 -0
- package/dist/types/personal-meeting-room/request.d.ts +14 -0
- package/dist/types/personal-meeting-room/util.d.ts +2 -0
- package/dist/types/reachability/clusterReachability.d.ts +110 -0
- package/dist/types/reachability/index.d.ts +120 -0
- package/dist/types/reachability/request.d.ts +39 -0
- package/dist/types/reachability/util.d.ts +15 -0
- package/dist/types/reactions/constants.d.ts +3 -0
- package/dist/types/reactions/reactions.d.ts +4 -0
- package/dist/types/reactions/reactions.type.d.ts +52 -0
- package/dist/types/reconnection-manager/index.d.ts +126 -0
- package/dist/types/recording-controller/enums.d.ts +7 -0
- package/dist/types/recording-controller/index.d.ts +207 -0
- package/dist/types/recording-controller/util.d.ts +14 -0
- package/dist/types/roap/index.d.ts +86 -0
- package/dist/types/roap/request.d.ts +39 -0
- package/dist/types/roap/turnDiscovery.d.ts +155 -0
- package/dist/types/rtcMetrics/constants.d.ts +4 -0
- package/dist/types/rtcMetrics/index.d.ts +61 -0
- package/dist/types/statsAnalyzer/global.d.ts +36 -0
- package/dist/types/statsAnalyzer/index.d.ts +217 -0
- package/dist/types/statsAnalyzer/mqaUtil.d.ts +48 -0
- package/dist/types/transcription/index.d.ts +64 -0
- package/dist/types/webinar/collection.d.ts +16 -0
- package/dist/types/webinar/index.d.ts +5 -0
- package/dist/webinar/index.js +1 -1
- package/package.json +22 -22
- package/src/common/errors/reconnection-not-started.ts +25 -0
- package/src/constants.ts +14 -5
- package/src/index.ts +30 -0
- package/src/locus-info/controlsUtils.ts +11 -0
- package/src/locus-info/index.ts +16 -0
- package/src/media/properties.ts +67 -15
- package/src/mediaQualityMetrics/config.ts +13 -7
- package/src/meeting/in-meeting-actions.ts +12 -0
- package/src/meeting/index.ts +144 -107
- package/src/meeting/locusMediaRequest.ts +31 -0
- package/src/meeting/util.ts +9 -16
- package/src/meeting/voicea-meeting.ts +44 -46
- package/src/meeting-info/util.ts +241 -233
- package/src/meeting-info/utilv2.ts +250 -244
- package/src/meetings/index.ts +15 -27
- package/src/reachability/index.ts +60 -0
- package/src/reconnection-manager/index.ts +128 -105
- package/src/roap/request.ts +1 -24
- package/src/statsAnalyzer/index.ts +10 -3
- package/src/statsAnalyzer/mqaUtil.ts +23 -0
- package/test/unit/spec/locus-info/controlsUtils.js +20 -0
- package/test/unit/spec/locus-info/index.js +21 -0
- package/test/unit/spec/media/properties.ts +145 -140
- package/test/unit/spec/meeting/in-meeting-actions.ts +6 -0
- package/test/unit/spec/meeting/index.js +271 -105
- package/test/unit/spec/meeting/locusMediaRequest.ts +49 -0
- package/test/unit/spec/meeting/utils.js +3 -10
- package/test/unit/spec/meeting/voicea-meeting.ts +5 -14
- package/test/unit/spec/meetings/index.js +59 -17
- package/test/unit/spec/reachability/index.ts +266 -0
- package/test/unit/spec/reconnection-manager/index.js +127 -39
- package/test/unit/spec/roap/request.ts +0 -37
- package/test/unit/spec/stats-analyzer/index.js +100 -8
- package/src/common/errors/reconnection-in-progress.ts +0 -8
|
@@ -9,6 +9,8 @@ exports.default = void 0;
|
|
|
9
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
10
10
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
11
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
13
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
12
14
|
var _url = _interopRequireDefault(require("url"));
|
|
13
15
|
var _btoa = _interopRequireDefault(require("btoa"));
|
|
14
16
|
var _common = require("@webex/common");
|
|
@@ -16,286 +18,321 @@ var _parameter = _interopRequireDefault(require("../common/errors/parameter"));
|
|
|
16
18
|
var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
|
|
17
19
|
var _constants = require("../constants");
|
|
18
20
|
// @ts-ignore
|
|
21
|
+
/**
|
|
22
|
+
* @class MeetingInfoUtil
|
|
23
|
+
*/
|
|
24
|
+
var MeetingInfoUtil = exports.default = /*#__PURE__*/function () {
|
|
25
|
+
function MeetingInfoUtil() {
|
|
26
|
+
(0, _classCallCheck2.default)(this, MeetingInfoUtil);
|
|
27
|
+
}
|
|
28
|
+
(0, _createClass2.default)(MeetingInfoUtil, null, [{
|
|
29
|
+
key: "extractDestination",
|
|
30
|
+
value: function extractDestination(destination, type) {
|
|
31
|
+
var dest = destination;
|
|
32
|
+
if (type === _constants._LOCUS_ID_) {
|
|
33
|
+
if (!(destination && destination.url)) {
|
|
34
|
+
throw new _parameter.default('You cannot create a meeting by locus without a locus.url defined');
|
|
35
|
+
}
|
|
36
|
+
dest = destination.url;
|
|
37
|
+
}
|
|
38
|
+
return dest;
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
key: "getParsedUrl",
|
|
42
|
+
value: function getParsedUrl(link) {
|
|
43
|
+
try {
|
|
44
|
+
var parsedUrl = _url.default.parse(link);
|
|
45
|
+
if (!parsedUrl) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
// hack for links such as <company>.webex.com/meet/<user> without a protocol
|
|
49
|
+
if (!parsedUrl.protocol) {
|
|
50
|
+
parsedUrl = _url.default.parse("".concat(_constants.HTTPS_PROTOCOL).concat(link));
|
|
51
|
+
}
|
|
52
|
+
return parsedUrl;
|
|
53
|
+
} catch (error) {
|
|
54
|
+
_loggerProxy.default.logger.warn("Meeting-info:util#getParsedUrl --> unable to parse the URL, error: ".concat(error));
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
19
58
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Helper function to check if a string matches a known meeting link pattern
|
|
61
|
+
* @param {String} value string to parse and see if it matches a meeting link
|
|
62
|
+
* @returns {Boolean}
|
|
63
|
+
*/
|
|
64
|
+
}, {
|
|
65
|
+
key: "isMeetingLink",
|
|
66
|
+
value: function isMeetingLink(value) {
|
|
67
|
+
var parsedUrl = this.getParsedUrl(value);
|
|
68
|
+
var hostNameBool;
|
|
69
|
+
var pathNameBool;
|
|
70
|
+
if (parsedUrl) {
|
|
71
|
+
hostNameBool = parsedUrl.hostname && parsedUrl.hostname.includes(_constants.WEBEX_DOT_COM);
|
|
72
|
+
pathNameBool = parsedUrl.pathname && (parsedUrl.pathname.includes("/".concat(_constants.MEET)) || parsedUrl.pathname.includes("/".concat(_constants.MEET_M)) || parsedUrl.pathname.includes("/".concat(_constants.JOIN)));
|
|
73
|
+
}
|
|
74
|
+
return hostNameBool && pathNameBool;
|
|
26
75
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (!parsedUrl) {
|
|
76
|
+
}, {
|
|
77
|
+
key: "isConversationUrl",
|
|
78
|
+
value: function isConversationUrl(value, webex) {
|
|
79
|
+
var clusterId = webex.internal.services.getClusterId(value);
|
|
80
|
+
if (clusterId) {
|
|
81
|
+
return clusterId.endsWith(_constants.CONVERSATION_SERVICE);
|
|
82
|
+
}
|
|
35
83
|
return false;
|
|
36
84
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
85
|
+
}, {
|
|
86
|
+
key: "convertLinkToSip",
|
|
87
|
+
value: function convertLinkToSip(value) {
|
|
88
|
+
var parsedUrl = this.getParsedUrl(value);
|
|
89
|
+
if (!parsedUrl) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
var user;
|
|
93
|
+
if (parsedUrl.pathname) {
|
|
94
|
+
var userIndex = parsedUrl.pathname.lastIndexOf('/');
|
|
95
|
+
user = parsedUrl.pathname.substring(userIndex + 1);
|
|
96
|
+
}
|
|
97
|
+
if (!user) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
var company;
|
|
101
|
+
if (parsedUrl.hostname) {
|
|
102
|
+
var companyIndex = parsedUrl.hostname.lastIndexOf(".".concat(_constants.WEBEX_DOT_COM));
|
|
103
|
+
company = parsedUrl.hostname.substring(0, companyIndex).replace(_constants.WWW_DOT, '');
|
|
104
|
+
}
|
|
105
|
+
if (!company) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
return "".concat(user, "@").concat(company, ".").concat(_constants.WEBEX_DOT_COM);
|
|
40
109
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Helper function to check if a string matches a known meeting link pattern
|
|
50
|
-
* @param {String} value string to parse and see if it matches a meeting link
|
|
51
|
-
* @returns {Boolean}
|
|
52
|
-
*/
|
|
53
|
-
MeetingInfoUtil.isMeetingLink = function (value) {
|
|
54
|
-
var parsedUrl = MeetingInfoUtil.getParsedUrl(value);
|
|
55
|
-
var hostNameBool = parsedUrl.hostname && parsedUrl.hostname.includes(_constants.WEBEX_DOT_COM);
|
|
56
|
-
var pathNameBool = parsedUrl.pathname && (parsedUrl.pathname.includes("/".concat(_constants.MEET)) || parsedUrl.pathname.includes("/".concat(_constants.MEET_M)) || parsedUrl.pathname.includes("/".concat(_constants.JOIN)));
|
|
57
|
-
return hostNameBool && pathNameBool;
|
|
58
|
-
};
|
|
59
|
-
MeetingInfoUtil.isConversationUrl = function (value, webex) {
|
|
60
|
-
var clusterId = webex.internal.services.getClusterId(value);
|
|
61
|
-
if (clusterId) {
|
|
62
|
-
return clusterId.endsWith(_constants.CONVERSATION_SERVICE);
|
|
63
|
-
}
|
|
64
|
-
return false;
|
|
65
|
-
};
|
|
66
|
-
MeetingInfoUtil.convertLinkToSip = function (value) {
|
|
67
|
-
var parsedUrl = MeetingInfoUtil.getParsedUrl(value);
|
|
68
|
-
if (!parsedUrl) {
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
71
|
-
var user;
|
|
72
|
-
if (parsedUrl.pathname) {
|
|
73
|
-
var userIndex = parsedUrl.pathname.lastIndexOf('/');
|
|
74
|
-
user = parsedUrl.pathname.substring(userIndex + 1);
|
|
75
|
-
}
|
|
76
|
-
if (!user) {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
var company;
|
|
80
|
-
if (parsedUrl.hostname) {
|
|
81
|
-
var companyIndex = parsedUrl.hostname.lastIndexOf(".".concat(_constants.WEBEX_DOT_COM));
|
|
82
|
-
company = parsedUrl.hostname.substring(0, companyIndex).replace(_constants.WWW_DOT, '');
|
|
83
|
-
}
|
|
84
|
-
if (!company) {
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
return "".concat(user, "@").concat(company, ".").concat(_constants.WEBEX_DOT_COM);
|
|
88
|
-
};
|
|
89
|
-
MeetingInfoUtil.isSipUri = function (sipString) {
|
|
90
|
-
// TODO: lets remove regex from this equation and user URI matchers and such
|
|
91
|
-
// have not found a great sip uri parser library as of now
|
|
92
|
-
var sipUri = _constants.DIALER_REGEX.SIP_ADDRESS.exec(sipString);
|
|
93
|
-
return sipUri;
|
|
94
|
-
};
|
|
95
|
-
MeetingInfoUtil.isPhoneNumber = function (phoneNumber) {
|
|
96
|
-
var isValidNumber = _constants.DIALER_REGEX.PHONE_NUMBER.test(phoneNumber);
|
|
97
|
-
return isValidNumber;
|
|
98
|
-
};
|
|
99
|
-
MeetingInfoUtil.getHydraId = function (destination) {
|
|
100
|
-
var _deconstructHydraId = (0, _common.deconstructHydraId)(destination),
|
|
101
|
-
type = _deconstructHydraId.type,
|
|
102
|
-
id = _deconstructHydraId.id,
|
|
103
|
-
cluster = _deconstructHydraId.cluster;
|
|
104
|
-
if (id && _constants.UUID_REG.test(id)) {
|
|
105
|
-
if (type === _constants._ROOM_) {
|
|
106
|
-
return {
|
|
107
|
-
room: true,
|
|
108
|
-
destination: id,
|
|
109
|
-
cluster: cluster
|
|
110
|
-
};
|
|
110
|
+
}, {
|
|
111
|
+
key: "isSipUri",
|
|
112
|
+
value: function isSipUri(sipString) {
|
|
113
|
+
// TODO: lets remove regex from this equation and user URI matchers and such
|
|
114
|
+
// have not found a great sip uri parser library as of now
|
|
115
|
+
var sipUri = _constants.DIALER_REGEX.SIP_ADDRESS.exec(sipString);
|
|
116
|
+
return sipUri;
|
|
111
117
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
};
|
|
118
|
+
}, {
|
|
119
|
+
key: "isPhoneNumber",
|
|
120
|
+
value: function isPhoneNumber(phoneNumber) {
|
|
121
|
+
var isValidNumber = _constants.DIALER_REGEX.PHONE_NUMBER.test(phoneNumber);
|
|
122
|
+
return isValidNumber;
|
|
118
123
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
}, {
|
|
125
|
+
key: "getHydraId",
|
|
126
|
+
value: function getHydraId(destination) {
|
|
127
|
+
var _deconstructHydraId = (0, _common.deconstructHydraId)(destination),
|
|
128
|
+
type = _deconstructHydraId.type,
|
|
129
|
+
id = _deconstructHydraId.id,
|
|
130
|
+
cluster = _deconstructHydraId.cluster;
|
|
131
|
+
if (id && _constants.UUID_REG.test(id)) {
|
|
132
|
+
if (type === _constants._ROOM_) {
|
|
133
|
+
return {
|
|
134
|
+
room: true,
|
|
135
|
+
destination: id,
|
|
136
|
+
cluster: cluster
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
if (type === _constants._PEOPLE_) {
|
|
140
|
+
return {
|
|
141
|
+
people: true,
|
|
142
|
+
destination: id,
|
|
143
|
+
cluster: cluster
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
return {};
|
|
147
|
+
}
|
|
148
|
+
return {};
|
|
127
149
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
}, {
|
|
151
|
+
key: "getSipUriFromHydraPersonId",
|
|
152
|
+
value: function getSipUriFromHydraPersonId(destination, webex) {
|
|
153
|
+
return webex.people.get(destination).then(function (res) {
|
|
154
|
+
if (res.emails && res.emails.length) {
|
|
155
|
+
return res.emails[0];
|
|
156
|
+
}
|
|
157
|
+
throw new _parameter.default('Hydra Id Lookup was an invalid hydra person id.');
|
|
158
|
+
}).catch(function (err) {
|
|
159
|
+
_loggerProxy.default.logger.error("Meeting-info:util#MeetingInfoUtil.getSipUriFromHydraPersonId --> getSipUriFromHydraPersonId ".concat(err, " "));
|
|
160
|
+
throw err;
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}, {
|
|
164
|
+
key: "generateOptions",
|
|
165
|
+
value: function () {
|
|
166
|
+
var _generateOptions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(from) {
|
|
167
|
+
var destination, type, webex, options, hydraId, serviceUrl;
|
|
168
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
169
|
+
while (1) switch (_context.prev = _context.next) {
|
|
170
|
+
case 0:
|
|
171
|
+
destination = from.destination, type = from.type, webex = from.webex;
|
|
172
|
+
if (!type) {
|
|
173
|
+
_context.next = 3;
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
return _context.abrupt("return", {
|
|
177
|
+
destination: destination,
|
|
178
|
+
type: type
|
|
179
|
+
});
|
|
180
|
+
case 3:
|
|
181
|
+
options = {};
|
|
182
|
+
hydraId = this.getHydraId(destination);
|
|
183
|
+
if (!this.isMeetingLink(destination)) {
|
|
184
|
+
_context.next = 11;
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
_loggerProxy.default.logger.warn('Meeting-info:util#generateOptions --> WARN, use of Meeting Link is deprecated, please use a SIP URI instead');
|
|
188
|
+
options.type = _constants._MEETING_LINK_;
|
|
189
|
+
options.destination = destination;
|
|
190
|
+
_context.next = 47;
|
|
191
|
+
break;
|
|
192
|
+
case 11:
|
|
193
|
+
if (!this.isSipUri(destination)) {
|
|
194
|
+
_context.next = 16;
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
options.type = _constants._SIP_URI_;
|
|
198
|
+
options.destination = destination;
|
|
199
|
+
_context.next = 47;
|
|
200
|
+
break;
|
|
201
|
+
case 16:
|
|
202
|
+
if (!this.isPhoneNumber(destination)) {
|
|
203
|
+
_context.next = 21;
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
options.type = _constants._SIP_URI_;
|
|
207
|
+
options.destination = destination;
|
|
208
|
+
_context.next = 47;
|
|
209
|
+
break;
|
|
210
|
+
case 21:
|
|
211
|
+
if (!this.isConversationUrl(destination, webex)) {
|
|
212
|
+
_context.next = 26;
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
215
|
+
options.type = _constants._CONVERSATION_URL_;
|
|
216
|
+
options.destination = destination;
|
|
217
|
+
_context.next = 47;
|
|
218
|
+
break;
|
|
219
|
+
case 26:
|
|
220
|
+
if (!hydraId.people) {
|
|
221
|
+
_context.next = 31;
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
options.type = _constants._SIP_URI_;
|
|
225
|
+
return _context.abrupt("return", this.getSipUriFromHydraPersonId(hydraId.destination, webex).then(function (res) {
|
|
226
|
+
options.destination = res;
|
|
227
|
+
|
|
228
|
+
// Since hydra person ids require a unique case in which they are
|
|
229
|
+
// entirely converted to a SIP URI, we need to set a flag for detecting
|
|
230
|
+
// this type of destination.
|
|
231
|
+
options.wasHydraPerson = true;
|
|
232
|
+
return _promise.default.resolve(options);
|
|
233
|
+
}));
|
|
234
|
+
case 31:
|
|
235
|
+
if (!hydraId.room) {
|
|
236
|
+
_context.next = 46;
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
options.type = _constants._CONVERSATION_URL_;
|
|
240
|
+
_context.prev = 33;
|
|
241
|
+
_context.next = 36;
|
|
242
|
+
return webex.internal.services.waitForCatalog('postauth');
|
|
243
|
+
case 36:
|
|
244
|
+
serviceUrl = webex.internal.services.getServiceUrlFromClusterId({
|
|
245
|
+
cluster: hydraId.cluster
|
|
246
|
+
}, webex);
|
|
247
|
+
options.destination = hydraId.destination ? "".concat(serviceUrl, "/conversations/").concat(hydraId.destination) : serviceUrl;
|
|
248
|
+
_context.next = 44;
|
|
249
|
+
break;
|
|
250
|
+
case 40:
|
|
251
|
+
_context.prev = 40;
|
|
252
|
+
_context.t0 = _context["catch"](33);
|
|
253
|
+
_loggerProxy.default.logger.error("Meeting-info:util#generateOptions --> ".concat(_context.t0));
|
|
254
|
+
throw _context.t0;
|
|
255
|
+
case 44:
|
|
256
|
+
_context.next = 47;
|
|
257
|
+
break;
|
|
258
|
+
case 46:
|
|
259
|
+
throw new _parameter.default('MeetingInfo is fetched with the meeting link, SIP URI, phone number, Hydra people ID, or a conversation URL.');
|
|
260
|
+
case 47:
|
|
261
|
+
return _context.abrupt("return", _promise.default.resolve(options));
|
|
262
|
+
case 48:
|
|
263
|
+
case "end":
|
|
264
|
+
return _context.stop();
|
|
155
265
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
266
|
+
}, _callee, this, [[33, 40]]);
|
|
267
|
+
}));
|
|
268
|
+
function generateOptions(_x) {
|
|
269
|
+
return _generateOptions.apply(this, arguments);
|
|
270
|
+
}
|
|
271
|
+
return generateOptions;
|
|
272
|
+
}()
|
|
273
|
+
/**
|
|
274
|
+
* Helper function to build up a correct locus url depending on the value passed
|
|
275
|
+
* @param {String} type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]
|
|
276
|
+
* @param {Object} value ?? value.value
|
|
277
|
+
* @returns {Object} returns an object with {resource, method}
|
|
278
|
+
*/
|
|
279
|
+
}, {
|
|
280
|
+
key: "getResourceUrl",
|
|
281
|
+
value: function getResourceUrl(type, value) {
|
|
282
|
+
var resource = "/".concat(_constants.LOCI, "/").concat(_constants.MEETINGINFO);
|
|
283
|
+
var method = _constants.HTTP_VERBS.GET;
|
|
284
|
+
var uri = null;
|
|
285
|
+
switch (type) {
|
|
286
|
+
case _constants._SIP_URI_:
|
|
287
|
+
case _constants._PERSONAL_ROOM_:
|
|
288
|
+
case _constants._MEETING_ID_:
|
|
289
|
+
resource = "/".concat(_constants.LOCI, "/").concat(_constants.MEETINGINFO, "/").concat(encodeURIComponent(value), "?").concat(_constants.TYPE, "=").concat(type, "&").concat(_constants.USE_URI_LOOKUP_FALSE);
|
|
160
290
|
break;
|
|
161
|
-
case
|
|
162
|
-
|
|
163
|
-
_context.next = 16;
|
|
164
|
-
break;
|
|
165
|
-
}
|
|
166
|
-
options.type = _constants._SIP_URI_;
|
|
167
|
-
options.destination = destination;
|
|
168
|
-
_context.next = 47;
|
|
291
|
+
case _constants._CONVERSATION_URL_:
|
|
292
|
+
method = _constants.HTTP_VERBS.PUT;
|
|
169
293
|
break;
|
|
170
|
-
case
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
break;
|
|
174
|
-
}
|
|
175
|
-
options.type = _constants._SIP_URI_;
|
|
176
|
-
options.destination = destination;
|
|
177
|
-
_context.next = 47;
|
|
294
|
+
case _constants._LOCUS_ID_:
|
|
295
|
+
uri = "".concat(value, "/").concat(_constants.MEETINGINFO);
|
|
296
|
+
method = _constants.HTTP_VERBS.PUT;
|
|
178
297
|
break;
|
|
179
|
-
case
|
|
180
|
-
|
|
181
|
-
_context.next = 26;
|
|
182
|
-
break;
|
|
183
|
-
}
|
|
184
|
-
options.type = _constants._CONVERSATION_URL_;
|
|
185
|
-
options.destination = destination;
|
|
186
|
-
_context.next = 47;
|
|
298
|
+
case _constants._MEETING_LINK_:
|
|
299
|
+
resource = "$/".concat(_constants.LOCI, "/").concat(_constants.MEETINGINFO, "/").concat((0, _btoa.default)(value), "?").concat(_constants.TYPE, "=").concat(_constants._MEETING_LINK_, "&").concat(_constants.USE_URI_LOOKUP_FALSE);
|
|
187
300
|
break;
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
case 40:
|
|
220
|
-
_context.prev = 40;
|
|
221
|
-
_context.t0 = _context["catch"](33);
|
|
222
|
-
_loggerProxy.default.logger.error("Meeting-info:util#generateOptions --> ".concat(_context.t0));
|
|
223
|
-
throw _context.t0;
|
|
224
|
-
case 44:
|
|
225
|
-
_context.next = 47;
|
|
226
|
-
break;
|
|
227
|
-
case 46:
|
|
228
|
-
throw new _parameter.default('MeetingInfo is fetched with the meeting link, SIP URI, phone number, Hydra people ID, or a conversation URL.');
|
|
229
|
-
case 47:
|
|
230
|
-
return _context.abrupt("return", _promise.default.resolve(options));
|
|
231
|
-
case 48:
|
|
232
|
-
case "end":
|
|
233
|
-
return _context.stop();
|
|
301
|
+
default:
|
|
302
|
+
}
|
|
303
|
+
return {
|
|
304
|
+
uri: uri,
|
|
305
|
+
resource: resource,
|
|
306
|
+
method: method
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
}, {
|
|
310
|
+
key: "getRequestParams",
|
|
311
|
+
value: function getRequestParams(resourceOptions, type, value, api) {
|
|
312
|
+
var requestParams = {
|
|
313
|
+
method: resourceOptions.method,
|
|
314
|
+
api: api,
|
|
315
|
+
resource: resourceOptions.resource
|
|
316
|
+
};
|
|
317
|
+
if (resourceOptions.method === _constants.HTTP_VERBS.GET) {
|
|
318
|
+
// for handling URL redirections
|
|
319
|
+
requestParams.resource = requestParams.resource.concat("&".concat(_constants.ALTERNATE_REDIRECT_TRUE));
|
|
320
|
+
} else if (type !== _constants._LOCUS_ID_) {
|
|
321
|
+
// locus id check is a PUT not sure why
|
|
322
|
+
requestParams.resource = requestParams.resource.concat("?".concat(_constants.ALTERNATE_REDIRECT_TRUE));
|
|
323
|
+
requestParams.body = {
|
|
324
|
+
value: value,
|
|
325
|
+
lookupType: type
|
|
326
|
+
};
|
|
327
|
+
} else if (type === _constants._LOCUS_ID_) {
|
|
328
|
+
requestParams = {
|
|
329
|
+
method: resourceOptions.method,
|
|
330
|
+
uri: resourceOptions.uri
|
|
331
|
+
};
|
|
234
332
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
};
|
|
333
|
+
return requestParams;
|
|
334
|
+
}
|
|
335
|
+
}]);
|
|
336
|
+
return MeetingInfoUtil;
|
|
240
337
|
}();
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* Helper function to build up a correct locus url depending on the value passed
|
|
244
|
-
* @param {String} type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]
|
|
245
|
-
* @param {Object} value ?? value.value
|
|
246
|
-
* @returns {Object} returns an object with {resource, method}
|
|
247
|
-
*/
|
|
248
|
-
MeetingInfoUtil.getResourceUrl = function (type, value) {
|
|
249
|
-
var resource = "/".concat(_constants.LOCI, "/").concat(_constants.MEETINGINFO);
|
|
250
|
-
var method = _constants.HTTP_VERBS.GET;
|
|
251
|
-
var uri = null;
|
|
252
|
-
switch (type) {
|
|
253
|
-
case _constants._SIP_URI_:
|
|
254
|
-
case _constants._PERSONAL_ROOM_:
|
|
255
|
-
case _constants._MEETING_ID_:
|
|
256
|
-
resource = "/".concat(_constants.LOCI, "/").concat(_constants.MEETINGINFO, "/").concat(encodeURIComponent(value), "?").concat(_constants.TYPE, "=").concat(type, "&").concat(_constants.USE_URI_LOOKUP_FALSE);
|
|
257
|
-
break;
|
|
258
|
-
case _constants._CONVERSATION_URL_:
|
|
259
|
-
method = _constants.HTTP_VERBS.PUT;
|
|
260
|
-
break;
|
|
261
|
-
case _constants._LOCUS_ID_:
|
|
262
|
-
uri = "".concat(value, "/").concat(_constants.MEETINGINFO);
|
|
263
|
-
method = _constants.HTTP_VERBS.PUT;
|
|
264
|
-
break;
|
|
265
|
-
case _constants._MEETING_LINK_:
|
|
266
|
-
resource = "$/".concat(_constants.LOCI, "/").concat(_constants.MEETINGINFO, "/").concat((0, _btoa.default)(value), "?").concat(_constants.TYPE, "=").concat(_constants._MEETING_LINK_, "&").concat(_constants.USE_URI_LOOKUP_FALSE);
|
|
267
|
-
break;
|
|
268
|
-
default:
|
|
269
|
-
}
|
|
270
|
-
return {
|
|
271
|
-
uri: uri,
|
|
272
|
-
resource: resource,
|
|
273
|
-
method: method
|
|
274
|
-
};
|
|
275
|
-
};
|
|
276
|
-
MeetingInfoUtil.getRequestParams = function (resourceOptions, type, value, api) {
|
|
277
|
-
var requestParams = {
|
|
278
|
-
method: resourceOptions.method,
|
|
279
|
-
api: api,
|
|
280
|
-
resource: resourceOptions.resource
|
|
281
|
-
};
|
|
282
|
-
if (resourceOptions.method === _constants.HTTP_VERBS.GET) {
|
|
283
|
-
// for handling URL redirections
|
|
284
|
-
requestParams.resource = requestParams.resource.concat("&".concat(_constants.ALTERNATE_REDIRECT_TRUE));
|
|
285
|
-
} else if (type !== _constants._LOCUS_ID_) {
|
|
286
|
-
// locus id check is a PUT not sure why
|
|
287
|
-
requestParams.resource = requestParams.resource.concat("?".concat(_constants.ALTERNATE_REDIRECT_TRUE));
|
|
288
|
-
requestParams.body = {
|
|
289
|
-
value: value,
|
|
290
|
-
lookupType: type
|
|
291
|
-
};
|
|
292
|
-
} else if (type === _constants._LOCUS_ID_) {
|
|
293
|
-
requestParams = {
|
|
294
|
-
method: resourceOptions.method,
|
|
295
|
-
uri: resourceOptions.uri
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
return requestParams;
|
|
299
|
-
};
|
|
300
|
-
var _default = exports.default = MeetingInfoUtil;
|
|
301
338
|
//# sourceMappingURL=util.js.map
|