@webex/plugin-meetings 1.157.1 → 1.159.1

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/config.js CHANGED
@@ -100,7 +100,8 @@ var _default = {
100
100
  enableExtmap: false,
101
101
  experimental: {
102
102
  enableMediaNegotiatedEvent: false,
103
- enableUnifiedMeetings: false
103
+ enableUnifiedMeetings: false,
104
+ enableAdhocMeetings: false
104
105
  }
105
106
  }
106
107
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["config.js"],"names":["meetings","deviceType","WEB","mediaSettings","sendAudio","sendVideo","receiveAudio","receiveVideo","pstn","sendShare","receiveShare","reconnection","enabled","autoRejoin","detection","iceReconnectionTimeout","maxRejoinAttempts","stats","enableStatsAnalyzer","autoDowngradeEnabled","interval","analyzerInterval","historyMax","videoPacketLossRatioThreshold","rttThreshold","jitterThreshold","metrics","clientName","clientType","subClientType","mqaMetricsInterval","autoSendMQA","logging","enable","verboseEvents","resolution","maxWidth","maxHeight","idealWidth","idealHeight","screenResolution","bandwidth","audio","video","startBitrate","screenFrameRate","videoShareFrameRate","aspectRatio","autoUploadLogs","enableRtx","receiveTranscription","enableExtmap","experimental","enableMediaNegotiatedEvent","enableUnifiedMeetings"],"mappings":";;;;;;;;;;AAAA;;eAIe;AACb;AACA;AACA;AACAA,EAAAA,QAAQ,EAAE;AACRC,IAAAA,UAAU,EAAEA,mBAAWC,GADf;AAERC,IAAAA,aAAa,EAAE;AACbC,MAAAA,SAAS,EAAE,IADE;AAEbC,MAAAA,SAAS,EAAE,IAFE;AAGbC,MAAAA,YAAY,EAAE,IAHD;AAIbC,MAAAA,YAAY,EAAE,IAJD;AAKbC,MAAAA,IAAI,EAAE,KALO;AAMbC,MAAAA,SAAS,EAAE,KANE;AAObC,MAAAA,YAAY,EAAE;AAPD,KAFP;AAWRC,IAAAA,YAAY,EAAE;AACZC,MAAAA,OAAO,EAAE,KADG;AAEZC,MAAAA,UAAU,EAAE,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KAAK,EAAE,OAJE;AAKTC,MAAAA,YAAY,EAAE;AALL,KAlEH;AAyERC,IAAAA,eAAe,EAAE,EAzET;AA0ERC,IAAAA,mBAAmB,EAAE,EA1Eb;AA2ERC,IAAAA,WAAW,EAAE,kBA3EL;AA4ER;AACAC,IAAAA,cAAc,EAAE,IA7ER;AA8ERC,IAAAA,SAAS,EAAE,IA9EH;AA+ERC,IAAAA,oBAAoB,EAAE,KA/Ed;AAgFRC,IAAAA,YAAY,EAAE,KAhFN;AAiFRC,IAAAA,YAAY,EAAE;AACZC,MAAAA,0BAA0B,EAAE,KADhB;AAEZC,MAAAA,qBAAqB,EAAE;AAFX;AAjFN;AAJG,C","sourcesContent":["import {\n deviceType\n} from '@webex/common';\n\nexport default {\n // TODO: this needs to be defaulted\n // to JS_SDK and clients set it to WEB or others\n // see https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-73167\n meetings: {\n deviceType: deviceType.WEB,\n mediaSettings: {\n sendAudio: true,\n sendVideo: true,\n receiveAudio: true,\n receiveVideo: true,\n pstn: false,\n sendShare: false,\n receiveShare: false\n },\n reconnection: {\n enabled: false,\n autoRejoin: true,\n detection: true,\n // Timeout duration to wait for ICE to reconnect if a disconnect is received.\n iceReconnectionTimeout: 10000,\n // Amount of times attempting to rejoin a meeting during reconnect\n maxRejoinAttempts: 3\n },\n stats: {\n // Enable the webrtc stats analyzer that emits quality degradation events\n enableStatsAnalyzer: true,\n // Enable the auto downgrade video quality feature\n autoDowngradeEnabled: false,\n // 1 second intervals to collect stats data\n interval: 1000,\n // we just want to analyze data every 5 sec interval\n analyzerInterval: 5000,\n // hold the last 2 minute of a calls data\n historyMax: 120,\n // Once packet loss hits this ratio, the video will downgrade\n videoPacketLossRatioThreshold: 9, // comparison of packets lost / packets received\n rttThreshold: 500, // 500 ms noticeable quality lag begins based on bandwidth of user\n jitterThreshold: 500 // 500 ms noticeable quality lag begins based on bandwidth of user\n },\n metrics: {\n // change to your client name else data will be muddled\n // you do not need a specific format, and you do not need to register it\n clientName: 'WEBEX_JS_SDK',\n // TODO: for now this line has to be whitelisted, which is problematic for third party\n clientType: 'WEBEX_SDK',\n // Stores the sub client type used when sending metrics\n subClientType: 'WEB_APP',\n // send average values MQA in 60 second intervals\n mqaMetricsInterval: 60000,\n // send to cisco internal MQA data automatically\n // we already send CA\n autoSendMQA: true\n },\n logging: {\n enable: true,\n verboseEvents: true\n },\n resolution: {\n maxWidth: 1280,\n maxHeight: 720,\n idealWidth: 1280,\n idealHeight: 720\n },\n screenResolution: {\n maxWidth: 1920,\n maxHeight: 1080,\n idealWidth: 1920,\n idealHeight: 1080\n },\n bandwidth: {\n // please note, these are the maximum bandwidth values\n // the server supports, minimums have to be tested\n audio: 64000,\n video: 4000000,\n startBitrate: 2000\n },\n screenFrameRate: 10,\n videoShareFrameRate: 30,\n aspectRatio: 1.7695852534562213,\n // When enabled, as calls are ended, it will upload the SDK logs and correlate them\n autoUploadLogs: true,\n enableRtx: true,\n receiveTranscription: false,\n enableExtmap: false,\n experimental: {\n enableMediaNegotiatedEvent: false,\n enableUnifiedMeetings: false\n }\n }\n};\n"]}
1
+ {"version":3,"sources":["config.js"],"names":["meetings","deviceType","WEB","mediaSettings","sendAudio","sendVideo","receiveAudio","receiveVideo","pstn","sendShare","receiveShare","reconnection","enabled","autoRejoin","detection","iceReconnectionTimeout","maxRejoinAttempts","stats","enableStatsAnalyzer","autoDowngradeEnabled","interval","analyzerInterval","historyMax","videoPacketLossRatioThreshold","rttThreshold","jitterThreshold","metrics","clientName","clientType","subClientType","mqaMetricsInterval","autoSendMQA","logging","enable","verboseEvents","resolution","maxWidth","maxHeight","idealWidth","idealHeight","screenResolution","bandwidth","audio","video","startBitrate","screenFrameRate","videoShareFrameRate","aspectRatio","autoUploadLogs","enableRtx","receiveTranscription","enableExtmap","experimental","enableMediaNegotiatedEvent","enableUnifiedMeetings","enableAdhocMeetings"],"mappings":";;;;;;;;;;AAAA;;eAIe;AACb;AACA;AACA;AACAA,EAAAA,Q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VC,MAAAA,QAAQ,EAAE,IADA;AAEVC,MAAAA,SAAS,EAAE,GAFD;AAGVC,MAAAA,UAAU,EAAE,IAHF;AAIVC,MAAAA,WAAW,EAAE;AAJH,KAtDJ;AA4DRC,IAAAA,gBAAgB,EAAE;AAChBJ,MAAAA,QAAQ,EAAE,IADM;AAEhBC,MAAAA,SAAS,EAAE,IAFK;AAGhBC,MAAAA,UAAU,EAAE,IAHI;AAIhBC,MAAAA,WAAW,EAAE;AAJG,KA5DV;AAkERE,IAAAA,SAAS,EAAE;AACT;AACA;AACAC,MAAAA,KAAK,EAAE,KAHE;AAITC,MAAAA,KAAK,EAAE,OAJE;AAKTC,MAAAA,YAAY,EAAE;AALL,KAlEH;AAyERC,IAAAA,eAAe,EAAE,EAzET;AA0ERC,IAAAA,mBAAmB,EAAE,EA1Eb;AA2ERC,IAAAA,WAAW,EAAE,kBA3EL;AA4ER;AACAC,IAAAA,cAAc,EAAE,IA7ER;AA8ERC,IAAAA,SAAS,EAAE,IA9EH;AA+ERC,IAAAA,oBAAoB,EAAE,KA/Ed;AAgFRC,IAAAA,YAAY,EAAE,KAhFN;AAiFRC,IAAAA,YAAY,EAAE;AACZC,MAAAA,0BAA0B,EAAE,KADhB;AAEZC,MAAAA,qBAAqB,EAAE,KAFX;AAGZC,MAAAA,mBAAmB,EAAE;AAHT;AAjFN;AAJG,C","sourcesContent":["import {\n deviceType\n} from '@webex/common';\n\nexport default {\n // TODO: this needs to be defaulted\n // to JS_SDK and clients set it to WEB or others\n // see https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-73167\n meetings: {\n deviceType: deviceType.WEB,\n mediaSettings: {\n sendAudio: true,\n sendVideo: true,\n receiveAudio: true,\n receiveVideo: true,\n pstn: false,\n sendShare: false,\n receiveShare: false\n },\n reconnection: {\n enabled: false,\n autoRejoin: true,\n detection: true,\n // Timeout duration to wait for ICE to reconnect if a disconnect is received.\n iceReconnectionTimeout: 10000,\n // Amount of times attempting to rejoin a meeting during reconnect\n maxRejoinAttempts: 3\n },\n stats: {\n // Enable the webrtc stats analyzer that emits quality degradation events\n enableStatsAnalyzer: true,\n // Enable the auto downgrade video quality feature\n autoDowngradeEnabled: false,\n // 1 second intervals to collect stats data\n interval: 1000,\n // we just want to analyze data every 5 sec interval\n analyzerInterval: 5000,\n // hold the last 2 minute of a calls data\n historyMax: 120,\n // Once packet loss hits this ratio, the video will downgrade\n videoPacketLossRatioThreshold: 9, // comparison of packets lost / packets received\n rttThreshold: 500, // 500 ms noticeable quality lag begins based on bandwidth of user\n jitterThreshold: 500 // 500 ms noticeable quality lag begins based on bandwidth of user\n },\n metrics: {\n // change to your client name else data will be muddled\n // you do not need a specific format, and you do not need to register it\n clientName: 'WEBEX_JS_SDK',\n // TODO: for now this line has to be whitelisted, which is problematic for third party\n clientType: 'WEBEX_SDK',\n // Stores the sub client type used when sending metrics\n subClientType: 'WEB_APP',\n // send average values MQA in 60 second intervals\n mqaMetricsInterval: 60000,\n // send to cisco internal MQA data automatically\n // we already send CA\n autoSendMQA: true\n },\n logging: {\n enable: true,\n verboseEvents: true\n },\n resolution: {\n maxWidth: 1280,\n maxHeight: 720,\n idealWidth: 1280,\n idealHeight: 720\n },\n screenResolution: {\n maxWidth: 1920,\n maxHeight: 1080,\n idealWidth: 1920,\n idealHeight: 1080\n },\n bandwidth: {\n // please note, these are the maximum bandwidth values\n // the server supports, minimums have to be tested\n audio: 64000,\n video: 4000000,\n startBitrate: 2000\n },\n screenFrameRate: 10,\n videoShareFrameRate: 30,\n aspectRatio: 1.7695852534562213,\n // When enabled, as calls are ended, it will upload the SDK logs and correlate them\n autoUploadLogs: true,\n enableRtx: true,\n receiveTranscription: false,\n enableExtmap: false,\n experimental: {\n enableMediaNegotiatedEvent: false,\n enableUnifiedMeetings: false,\n enableAdhocMeetings: false\n }\n }\n};\n"]}
package/dist/index.js CHANGED
@@ -34,7 +34,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
34
34
  (0, _webexCore.registerPlugin)('meetings', _meetings.default, {
35
35
  config: _config.default
36
36
  });
37
- var _default = _meetings.default; // eslint-disable-next-line object-curly-spacing
38
-
37
+ var _default = _meetings.default;
39
38
  exports.default = _default;
40
39
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"names":["Meetings","config"],"mappings":";;;;;;;;;;;;;;;;;;AACA;;AAEA;;AACA;;;;;;;;;;AAJA;AAMA,+BAAe,UAAf,EAA2BA,iBAA3B,EAAqC;AACnCC,EAAAA,MAAM,EAANA;AADmC,CAArC;eAIeD,iB,EAEf","sourcesContent":["/* eslint-env browser */\nimport {registerPlugin} from '@webex/webex-core';\n\nimport Meetings from './meetings';\nimport config from './config';\n\nregisterPlugin('meetings', Meetings, {\n config\n});\n\nexport default Meetings;\n\n// eslint-disable-next-line object-curly-spacing\nexport * as CONSTANTS from './constants';\n"]}
1
+ {"version":3,"sources":["index.js"],"names":["Meetings","config"],"mappings":";;;;;;;;;;;;;;;;;;AACA;;AAEA;;AACA;;;;;;;;;;AAJA;AAMA,+BAAe,UAAf,EAA2BA,iBAA3B,EAAqC;AACnCC,EAAAA,MAAM,EAANA;AADmC,CAArC;eAIeD,iB","sourcesContent":["/* eslint-env browser */\nimport {registerPlugin} from '@webex/webex-core';\n\nimport Meetings from './meetings';\nimport config from './config';\n\nregisterPlugin('meetings', Meetings, {\n config\n});\n\nexport default Meetings;\n\nexport * as CONSTANTS from './constants';\n"]}
@@ -20,7 +20,7 @@ _Object$defineProperty(exports, "__esModule", {
20
20
  value: true
21
21
  });
22
22
 
23
- exports.default = exports.MeetingInfoV2CaptchaError = exports.MeetingInfoV2PasswordError = void 0;
23
+ exports.default = exports.MeetingInfoV2CaptchaError = exports.MeetingInfoV2AdhocMeetingError = exports.MeetingInfoV2PasswordError = void 0;
24
24
 
25
25
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
26
26
 
@@ -54,6 +54,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_R
54
54
 
55
55
  var PASSWORD_ERROR_DEFAULT_MESSAGE = 'Password required. Call fetchMeetingInfo() with password argument';
56
56
  var CAPTCHA_ERROR_DEFAULT_MESSAGE = 'Captcha required. Call fetchMeetingInfo() with captchaInfo argument';
57
+ var ADHOC_MEETING_DEFAULT_ERROR = 'Failed starting the adhoc meeting, Please contact support team ';
57
58
  /**
58
59
  * Error to indicate that wbxappapi requires a password
59
60
  */
@@ -87,39 +88,72 @@ var MeetingInfoV2PasswordError = /*#__PURE__*/function (_Error) {
87
88
  return MeetingInfoV2PasswordError;
88
89
  }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
89
90
  /**
90
- * Error to indicate that wbxappapi requires a captcha
91
- */
91
+ * Error generating a adhoc space meeting
92
+ */
92
93
 
93
94
 
94
95
  exports.MeetingInfoV2PasswordError = MeetingInfoV2PasswordError;
95
96
 
96
- var MeetingInfoV2CaptchaError = /*#__PURE__*/function (_Error2) {
97
- (0, _inherits2.default)(MeetingInfoV2CaptchaError, _Error2);
97
+ var MeetingInfoV2AdhocMeetingError = /*#__PURE__*/function (_Error2) {
98
+ (0, _inherits2.default)(MeetingInfoV2AdhocMeetingError, _Error2);
98
99
 
99
- var _super2 = _createSuper(MeetingInfoV2CaptchaError);
100
+ var _super2 = _createSuper(MeetingInfoV2AdhocMeetingError);
100
101
 
101
102
  /**
102
103
  *
103
104
  * @constructor
104
105
  * @param {Number} [wbxAppApiErrorCode]
105
- * @param {Object} [captchaInfo]
106
106
  * @param {String} [message]
107
107
  */
108
- function MeetingInfoV2CaptchaError(wbxAppApiErrorCode, captchaInfo) {
108
+ function MeetingInfoV2AdhocMeetingError(wbxAppApiErrorCode) {
109
109
  var _this2;
110
110
 
111
- var message = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : CAPTCHA_ERROR_DEFAULT_MESSAGE;
112
- (0, _classCallCheck2.default)(this, MeetingInfoV2CaptchaError);
111
+ var message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ADHOC_MEETING_DEFAULT_ERROR;
112
+ (0, _classCallCheck2.default)(this, MeetingInfoV2AdhocMeetingError);
113
113
  _this2 = _super2.call(this, "".concat(message, ", code=").concat(wbxAppApiErrorCode));
114
- _this2.name = 'MeetingInfoV2PasswordError';
114
+ _this2.name = 'MeetingInfoV2AdhocMeetingError';
115
115
  _this2.sdkMessage = message;
116
116
  _this2.stack = new Error().stack;
117
117
  _this2.wbxAppApiCode = wbxAppApiErrorCode;
118
- _this2.isPasswordRequired = wbxAppApiErrorCode === 423005;
119
- _this2.captchaInfo = captchaInfo;
120
118
  return _this2;
121
119
  }
122
120
 
121
+ return MeetingInfoV2AdhocMeetingError;
122
+ }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
123
+ /**
124
+ * Error to indicate that preferred webex site not present to start adhoc meeting
125
+ */
126
+
127
+
128
+ exports.MeetingInfoV2AdhocMeetingError = MeetingInfoV2AdhocMeetingError;
129
+
130
+ var MeetingInfoV2CaptchaError = /*#__PURE__*/function (_Error3) {
131
+ (0, _inherits2.default)(MeetingInfoV2CaptchaError, _Error3);
132
+
133
+ var _super3 = _createSuper(MeetingInfoV2CaptchaError);
134
+
135
+ /**
136
+ *
137
+ * @constructor
138
+ * @param {Number} [wbxAppApiErrorCode]
139
+ * @param {Object} [captchaInfo]
140
+ * @param {String} [message]
141
+ */
142
+ function MeetingInfoV2CaptchaError(wbxAppApiErrorCode, captchaInfo) {
143
+ var _this3;
144
+
145
+ var message = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : CAPTCHA_ERROR_DEFAULT_MESSAGE;
146
+ (0, _classCallCheck2.default)(this, MeetingInfoV2CaptchaError);
147
+ _this3 = _super3.call(this, "".concat(message, ", code=").concat(wbxAppApiErrorCode));
148
+ _this3.name = 'MeetingInfoV2PasswordError';
149
+ _this3.sdkMessage = message;
150
+ _this3.stack = new Error().stack;
151
+ _this3.wbxAppApiCode = wbxAppApiErrorCode;
152
+ _this3.isPasswordRequired = wbxAppApiErrorCode === 423005;
153
+ _this3.captchaInfo = captchaInfo;
154
+ return _this3;
155
+ }
156
+
123
157
  return MeetingInfoV2CaptchaError;
124
158
  }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
125
159
  /**
@@ -142,7 +176,7 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
142
176
  * converts hydra id into conversation url and persons Id
143
177
  * @param {String} destination one of many different types of destinations to look up info for
144
178
  * @param {String} [type] to match up with the destination value
145
- * @returns {Promise} returns destination and type
179
+ * @returns {Promise} destination and type
146
180
  * @public
147
181
  * @memberof MeetingInfo
148
182
  */
@@ -158,6 +192,90 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
158
192
  webex: this.webex
159
193
  });
160
194
  }
195
+ /**
196
+ * Creates adhoc space meetings for a space by fetching the conversation infomation
197
+ * @param {String} conversationUrl conversationUrl to start adhoc meeting on
198
+ * @returns {Promise} returns a meeting info object
199
+ * @public
200
+ * @memberof MeetingInfo
201
+ */
202
+
203
+ }, {
204
+ key: "createAdhocSpaceMeeting",
205
+ value: function () {
206
+ var _createAdhocSpaceMeeting = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(conversationUrl) {
207
+ var _this4 = this;
208
+
209
+ var getInvitees;
210
+ return _regenerator.default.wrap(function _callee$(_context) {
211
+ while (1) {
212
+ switch (_context.prev = _context.next) {
213
+ case 0:
214
+ if (this.webex.meetings.preferredWebexSite) {
215
+ _context.next = 2;
216
+ break;
217
+ }
218
+
219
+ throw Error('No preferred webex site found');
220
+
221
+ case 2:
222
+ getInvitees = function getInvitees() {
223
+ var particpants = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
224
+ var invitees = [];
225
+
226
+ if (particpants) {
227
+ particpants.forEach(function (participant) {
228
+ invitees.push({
229
+ email: participant.emailAddress,
230
+ ciUserUuid: participant.entryUUID
231
+ });
232
+ });
233
+ }
234
+
235
+ return invitees;
236
+ };
237
+
238
+ return _context.abrupt("return", this.webex.internal.conversation.get({
239
+ url: conversationUrl
240
+ }, {
241
+ includeParticipants: true,
242
+ disableTransform: true
243
+ }).then(function (conversation) {
244
+ var _conversation$partici;
245
+
246
+ var body = {
247
+ title: conversation.displayName,
248
+ spaceUrl: conversation.url,
249
+ keyUrl: conversation.encryptionKeyUrl,
250
+ kroUrl: conversation.kmsResourceObjectUrl,
251
+ invitees: getInvitees((_conversation$partici = conversation.participants) === null || _conversation$partici === void 0 ? void 0 : _conversation$partici.items)
252
+ };
253
+ var uri = _this4.webex.meetings.preferredWebexSite ? "https://".concat(_this4.webex.meetings.preferredWebexSite, "/wbxappapi/v2/meetings/spaceInstant") : '';
254
+ return _this4.webex.request({
255
+ method: _constants.HTTP_VERBS.POST,
256
+ uri: uri,
257
+ body: body
258
+ }).catch(function (err) {
259
+ var _err$body, _err$body2;
260
+
261
+ throw new MeetingInfoV2AdhocMeetingError((_err$body = err.body) === null || _err$body === void 0 ? void 0 : _err$body.code, (_err$body2 = err.body) === null || _err$body2 === void 0 ? void 0 : _err$body2.message);
262
+ });
263
+ }));
264
+
265
+ case 4:
266
+ case "end":
267
+ return _context.stop();
268
+ }
269
+ }
270
+ }, _callee, this);
271
+ }));
272
+
273
+ function createAdhocSpaceMeeting(_x) {
274
+ return _createAdhocSpaceMeeting.apply(this, arguments);
275
+ }
276
+
277
+ return createAdhocSpaceMeeting;
278
+ }()
161
279
  /**
162
280
  * Fetches meeting info from the server
163
281
  * @param {String} destination one of many different types of destinations to look up info for
@@ -174,21 +292,23 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
174
292
  }, {
175
293
  key: "fetchMeetingInfo",
176
294
  value: function () {
177
- var _fetchMeetingInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(destination) {
295
+ var _fetchMeetingInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(destination) {
178
296
  var type,
179
297
  password,
180
298
  captchaInfo,
181
299
  destinationType,
182
300
  body,
183
- _args = arguments;
184
- return _regenerator.default.wrap(function _callee$(_context) {
301
+ options,
302
+ directURI,
303
+ _args2 = arguments;
304
+ return _regenerator.default.wrap(function _callee2$(_context2) {
185
305
  while (1) {
186
- switch (_context.prev = _context.next) {
306
+ switch (_context2.prev = _context2.next) {
187
307
  case 0:
188
- type = _args.length > 1 && _args[1] !== undefined ? _args[1] : null;
189
- password = _args.length > 2 && _args[2] !== undefined ? _args[2] : null;
190
- captchaInfo = _args.length > 3 && _args[3] !== undefined ? _args[3] : null;
191
- _context.next = 5;
308
+ type = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : null;
309
+ password = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : null;
310
+ captchaInfo = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : null;
311
+ _context2.next = 5;
192
312
  return _utilv.default.getDestinationType({
193
313
  destination: destination,
194
314
  type: type,
@@ -196,31 +316,47 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
196
316
  });
197
317
 
198
318
  case 5:
199
- destinationType = _context.sent;
200
- _context.next = 8;
319
+ destinationType = _context2.sent;
320
+
321
+ if (!(destinationType.type === _constants._CONVERSATION_URL_ && this.webex.config.meetings.experimental.enableAdhocMeetings)) {
322
+ _context2.next = 8;
323
+ break;
324
+ }
325
+
326
+ return _context2.abrupt("return", this.createAdhocSpaceMeeting(destinationType.destination));
327
+
328
+ case 8:
329
+ _context2.next = 10;
201
330
  return _utilv.default.getRequestBody(_objectSpread(_objectSpread({}, destinationType), {}, {
202
331
  password: password,
203
332
  captchaInfo: captchaInfo
204
333
  }));
205
334
 
206
- case 8:
207
- body = _context.sent;
208
- return _context.abrupt("return", this.webex.request({
335
+ case 10:
336
+ body = _context2.sent;
337
+ options = {
209
338
  method: _constants.HTTP_VERBS.POST,
210
339
  service: 'webex-appapi-service',
211
340
  resource: 'meetingInfo',
212
341
  body: body
213
- }).catch(function (err) {
342
+ };
343
+ _context2.next = 14;
344
+ return _utilv.default.getDirectMeetingInfoURI(destinationType);
345
+
346
+ case 14:
347
+ directURI = _context2.sent;
348
+ if (directURI) options.directURI = directURI;
349
+ return _context2.abrupt("return", this.webex.request(options).catch(function (err) {
214
350
  if ((err === null || err === void 0 ? void 0 : err.statusCode) === 403) {
215
- var _err$body, _err$body2, _err$body2$data;
351
+ var _err$body3, _err$body4, _err$body4$data;
216
352
 
217
- throw new MeetingInfoV2PasswordError((_err$body = err.body) === null || _err$body === void 0 ? void 0 : _err$body.code, (_err$body2 = err.body) === null || _err$body2 === void 0 ? void 0 : (_err$body2$data = _err$body2.data) === null || _err$body2$data === void 0 ? void 0 : _err$body2$data.meetingInfo);
353
+ throw new MeetingInfoV2PasswordError((_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);
218
354
  }
219
355
 
220
356
  if ((err === null || err === void 0 ? void 0 : err.statusCode) === 423) {
221
- var _err$body3;
357
+ var _err$body5;
222
358
 
223
- throw new MeetingInfoV2CaptchaError((_err$body3 = err.body) === null || _err$body3 === void 0 ? void 0 : _err$body3.code, {
359
+ throw new MeetingInfoV2CaptchaError((_err$body5 = err.body) === null || _err$body5 === void 0 ? void 0 : _err$body5.code, {
224
360
  captchaId: err.body.captchaID,
225
361
  verificationImageURL: err.body.verificationImageURL,
226
362
  verificationAudioURL: err.body.verificationAudioURL,
@@ -231,15 +367,15 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
231
367
  throw err;
232
368
  }));
233
369
 
234
- case 10:
370
+ case 17:
235
371
  case "end":
236
- return _context.stop();
372
+ return _context2.stop();
237
373
  }
238
374
  }
239
- }, _callee, this);
375
+ }, _callee2, this);
240
376
  }));
241
377
 
242
- function fetchMeetingInfo(_x) {
378
+ function fetchMeetingInfo(_x2) {
243
379
  return _fetchMeetingInfo.apply(this, arguments);
244
380
  }
245
381
 
@@ -1 +1 @@
1
- {"version":3,"sources":["meeting-info-v2.js"],"names":["PASSWORD_ERROR_DEFAULT_MESSAGE","CAPTCHA_ERROR_DEFAULT_MESSAGE","MeetingInfoV2PasswordError","wbxAppApiErrorCode","meetingInfo","message","name","sdkMessage","stack","Error","wbxAppApiCode","MeetingInfoV2CaptchaError","captchaInfo","isPasswordRequired","MeetingInfoV2","webex","destination","type","MeetingInfoUtil","getDestinationType","password","destinationType","getRequestBody","body","request","method","HTTP_VERBS","POST","service","resource","catch","err","statusCode","code","data","captchaId","captchaID","verificationImageURL","verificationAudioURL","refreshURL"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAEA;;;;;;;;;;AAEA,IAAMA,8BAA8B,GAAG,mEAAvC;AACA,IAAMC,6BAA6B,GAAG,qEAAtC;AAEA;AACA;AACA;;IACaC,0B;;;;;AACX;AACF;AACA;AACA;AACA;AACA;AACA;AACE,sCAAYC,kBAAZ,EAAgCC,WAAhC,EAAuF;AAAA;;AAAA,QAA1CC,OAA0C,uEAAhCL,8BAAgC;AAAA;AACrF,wCAASK,OAAT,oBAA0BF,kBAA1B;AACA,UAAKG,IAAL,GAAY,4BAAZ;AACA,UAAKC,UAAL,GAAkBF,OAAlB;AACA,UAAKG,KAAL,GAAc,IAAIC,KAAJ,EAAD,CAAcD,KAA3B;AACA,UAAKE,aAAL,GAAqBP,kBAArB;AACA,UAAKC,WAAL,GAAmBA,WAAnB;AANqF;AAOtF;;;+CAf6CK,K;AAkBhD;AACA;AACA;;;;;IACaE,yB;;;;;AACX;AACF;AACA;AACA;AACA;AACA;AACA;AACE,qCAAYR,kBAAZ,EAAgCS,WAAhC,EAAsF;AAAA;;AAAA,QAAzCP,OAAyC,uEAA/BJ,6BAA+B;AAAA;AACpF,0CAASI,OAAT,oBAA0BF,kBAA1B;AACA,WAAKG,IAAL,GAAY,4BAAZ;AACA,WAAKC,UAAL,GAAkB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A,IANR;AAAA,iDAQS,KAAKR,KAAL,CAAWS,OAAX,CAAmB;AACxBC,kBAAAA,MAAM,EAAEC,sBAAWC,IADK;AAExBC,kBAAAA,OAAO,EAAE,sBAFe;AAGxBC,kBAAAA,QAAQ,EAAE,aAHc;AAIxBN,kBAAAA,IAAI,EAAJA;AAJwB,iBAAnB,EAMJO,KANI,CAME,UAACC,GAAD,EAAS;AACd,sBAAI,CAAAA,GAAG,SAAH,IAAAA,GAAG,WAAH,YAAAA,GAAG,CAAEC,UAAL,MAAoB,GAAxB,EAA6B;AAAA;;AAC3B,0BAAM,IAAI9B,0BAAJ,cAA+B6B,GAAG,CAACR,IAAnC,8CAA+B,UAAUU,IAAzC,gBAA+CF,GAAG,CAACR,IAAnD,kEAA+C,WAAUW,IAAzD,oDAA+C,gBAAgB9B,WAA/D,CAAN;AACD;;AACD,sBAAI,CAAA2B,GAAG,SAAH,IAAAA,GAAG,WAAH,YAAAA,GAAG,CAAEC,UAAL,MAAoB,GAAxB,EAA6B;AAAA;;AAC3B,0BAAM,IAAIrB,yBAAJ,eAA8BoB,GAAG,CAACR,IAAlC,+CAA8B,WAAUU,IAAxC,EAA8C;AAClDE,sBAAAA,SAAS,EAAEJ,GAAG,CAACR,IAAJ,CAASa,SAD8B;AAElDC,sBAAAA,oBAAoB,EAAEN,GAAG,CAACR,IAAJ,CAASc,oBAFmB;AAGlDC,sBAAAA,oBAAoB,EAAEP,GAAG,CAACR,IAAJ,CAASe,oBAHmB;AAIlDC,sBAAAA,UAAU,EAAER,GAAG,CAACR,IAAJ,CAASgB;AAJ6B,qBAA9C,CAAN;AAMD;;AACD,wBAAMR,GAAN;AACD,iBAnBI,CART;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O","sourcesContent":["\nimport {HTTP_VERBS} from '../constants';\n\nimport MeetingInfoUtil from './utilv2';\n\nconst PASSWORD_ERROR_DEFAULT_MESSAGE = 'Password required. Call fetchMeetingInfo() with password argument';\nconst CAPTCHA_ERROR_DEFAULT_MESSAGE = 'Captcha required. Call fetchMeetingInfo() with captchaInfo argument';\n\n/**\n * Error to indicate that wbxappapi requires a password\n */\nexport class MeetingInfoV2PasswordError extends Error {\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [meetingInfo]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode, meetingInfo, message = PASSWORD_ERROR_DEFAULT_MESSAGE) {\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 to indicate that wbxappapi requires a captcha\n */\nexport class MeetingInfoV2CaptchaError extends Error {\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [captchaInfo]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode, captchaInfo, message = CAPTCHA_ERROR_DEFAULT_MESSAGE) {\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 = wbxAppApiErrorCode === 423005;\n this.captchaInfo = captchaInfo;\n }\n}\n\n/**\n * @class MeetingInfo\n */\nexport default class MeetingInfoV2 {\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} returns destination and type\n * @public\n * @memberof MeetingInfo\n */\n fetchInfoOptions(destination, type = null) {\n return MeetingInfoUtil.getDestinationType({\n destination,\n type,\n webex: this.webex\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(destination, type = null, password = null, captchaInfo = null) {\n const destinationType = await MeetingInfoUtil.getDestinationType({\n destination,\n type,\n webex: this.webex\n });\n const body = await MeetingInfoUtil.getRequestBody({...destinationType, password, captchaInfo});\n\n return this.webex.request({\n method: HTTP_VERBS.POST,\n service: 'webex-appapi-service',\n resource: 'meetingInfo',\n body\n })\n .catch((err) => {\n if (err?.statusCode === 403) {\n throw new MeetingInfoV2PasswordError(err.body?.code, err.body?.data?.meetingInfo);\n }\n if (err?.statusCode === 423) {\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 throw err;\n });\n }\n}\n\n"]}
1
+ {"version":3,"sources":["meeting-info-v2.js"],"names":["PASSWORD_ERROR_DEFAULT_MESSAGE","CAPTCHA_ERROR_DEFAULT_MESSAGE","ADHOC_MEETING_DEFAULT_ERROR","MeetingInfoV2PasswordError","wbxAppApiErrorCode","meetingInfo","message","name","sdkMessage","stack","Error","wbxAppApiCode","MeetingInfoV2AdhocMeetingError","MeetingInfoV2CaptchaError","captchaInfo","isPasswordRequired","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","request","method","HTTP_VERBS","POST","catch","err","code","password","destinationType","_CONVERSATION_URL_","config","experimental","enableAdhocMeetings","createAdhocSpaceMeeting","getRequestBody","options","service","resource","getDirectMeetingInfoURI","directURI","statusCode","data","captchaId","capt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vD,KAAL,CAAWoC,OAAX,CAAmBe,OAAnB,EACJX,KADI,CACE,UAACC,GAAD,EAAS;AACd,sBAAI,CAAAA,GAAG,SAAH,IAAAA,GAAG,WAAH,YAAAA,GAAG,CAAEe,UAAL,MAAoB,GAAxB,EAA6B;AAAA;;AAC3B,0BAAM,IAAItE,0BAAJ,eAA+BuD,GAAG,CAAChB,IAAnC,+CAA+B,WAAUiB,IAAzC,gBAA+CD,GAAG,CAAChB,IAAnD,kEAA+C,WAAUgC,IAAzD,oDAA+C,gBAAgBrE,WAA/D,CAAN;AACD;;AACD,sBAAI,CAAAqD,GAAG,SAAH,IAAAA,GAAG,WAAH,YAAAA,GAAG,CAAEe,UAAL,MAAoB,GAAxB,EAA6B;AAAA;;AAC3B,0BAAM,IAAI5D,yBAAJ,eAA8B6C,GAAG,CAAChB,IAAlC,+CAA8B,WAAUiB,IAAxC,EAA8C;AAClDgB,sBAAAA,SAAS,EAAEjB,GAAG,CAAChB,IAAJ,CAASkC,SAD8B;AAElDC,sBAAAA,oBAAoB,EAAEnB,GAAG,CAAChB,IAAJ,CAASmC,oBAFmB;AAGlDC,sBAAAA,oBAAoB,EAAEpB,GAAG,CAAChB,IAAJ,CAASoC,oBAHmB;AAIlDC,sBAAAA,UAAU,EAAErB,GAAG,CAAChB,IAAJ,CAASqC;AAJ6B,qBAA9C,CAAN;AAMD;;AACD,wBAAMrB,GAAN;AACD,iBAdI,CAxBT;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O","sourcesContent":["\nimport {HTTP_VERBS, _CONVERSATION_URL_} from '../constants';\n\nimport MeetingInfoUtil from './utilv2';\n\nconst PASSWORD_ERROR_DEFAULT_MESSAGE = 'Password required. Call fetchMeetingInfo() with password argument';\nconst CAPTCHA_ERROR_DEFAULT_MESSAGE = 'Captcha required. Call fetchMeetingInfo() with captchaInfo argument';\nconst ADHOC_MEETING_DEFAULT_ERROR = 'Failed starting the adhoc meeting, Please contact support team ';\n\n/**\n * Error to indicate that wbxappapi requires a password\n */\nexport class MeetingInfoV2PasswordError extends Error {\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [meetingInfo]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode, meetingInfo, message = PASSWORD_ERROR_DEFAULT_MESSAGE) {\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 /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode, message = 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/**\n * Error to indicate that preferred webex site not present to start adhoc meeting\n */\nexport class MeetingInfoV2CaptchaError extends Error {\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [captchaInfo]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode, captchaInfo, message = CAPTCHA_ERROR_DEFAULT_MESSAGE) {\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 = wbxAppApiErrorCode === 423005;\n this.captchaInfo = captchaInfo;\n }\n}\n\n/**\n * @class MeetingInfo\n */\nexport default class MeetingInfoV2 {\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, type = 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) {\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.get(\n {url: conversationUrl},\n {includeParticipants: true, disableTransform: true}\n )\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 return this.webex.request({\n method: HTTP_VERBS.POST,\n uri,\n body\n })\n .catch((err) => {\n throw new MeetingInfoV2AdhocMeetingError(err.body?.code, err.body?.message);\n });\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(destination, type = null, password = null, captchaInfo = null) {\n const destinationType = await MeetingInfoUtil.getDestinationType({\n destination,\n type,\n webex: this.webex\n });\n\n if (destinationType.type === _CONVERSATION_URL_ && this.webex.config.meetings.experimental.enableAdhocMeetings) {\n return this.createAdhocSpaceMeeting(destinationType.destination);\n }\n\n const body = await MeetingInfoUtil.getRequestBody({...destinationType, password, captchaInfo});\n\n const options = {\n method: HTTP_VERBS.POST,\n service: 'webex-appapi-service',\n resource: 'meetingInfo',\n body\n };\n\n const directURI = await MeetingInfoUtil.getDirectMeetingInfoURI(destinationType);\n\n if (directURI) options.directURI = directURI;\n\n return this.webex.request(options)\n .catch((err) => {\n if (err?.statusCode === 403) {\n throw new MeetingInfoV2PasswordError(err.body?.code, err.body?.data?.meetingInfo);\n }\n if (err?.statusCode === 423) {\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 throw err;\n });\n }\n}\n\n"]}
@@ -381,6 +381,50 @@ MeetingInfoUtil.getRequestBody = function (options) {
381
381
 
382
382
  return body;
383
383
  };
384
+ /**
385
+ * Helper function to parse the webex site/host from a URI string.
386
+ * @param {String} uri string (e.g. '10019857020@convergedats.webex.com')
387
+ * @returns {String} the site/host part of the URI string (e.g. 'convergedats.webex.com')
388
+ */
389
+
390
+
391
+ MeetingInfoUtil.getWebexSite = function (uri) {
392
+ var _uri$match;
393
+
394
+ var exceptedDomains = ['meet.webex.com', 'meetup.webex.com', 'ciscospark.com'];
395
+ var site = uri === null || uri === void 0 ? void 0 : (_uri$match = uri.match(/.+@(.+\..+\.*.)$/)) === null || _uri$match === void 0 ? void 0 : _uri$match[1];
396
+ return exceptedDomains.includes(site) ? null : site;
397
+ };
398
+ /**
399
+ * Helper function to return the direct URI for fetching meeting info (to avoid a redirect).
400
+ * @param {Object} options type and value to fetch meeting info
401
+ * @param {String} options.type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]
402
+ * @param {Object} options.destination ?? value.value
403
+ * @returns {String} returns a URI string or null of there is no direct URI
404
+ */
405
+
406
+
407
+ MeetingInfoUtil.getDirectMeetingInfoURI = function (options) {
408
+ var _destination$info3;
409
+
410
+ var type = options.type,
411
+ destination = options.destination;
412
+ var preferredWebexSite = null;
413
+
414
+ switch (type) {
415
+ case _constants._SIP_URI_:
416
+ preferredWebexSite = MeetingInfoUtil.getWebexSite(destination);
417
+ break;
418
+
419
+ case _constants._LOCUS_ID_:
420
+ preferredWebexSite = (_destination$info3 = destination.info) === null || _destination$info3 === void 0 ? void 0 : _destination$info3.webExSite;
421
+ break;
422
+
423
+ default:
424
+ }
425
+
426
+ return preferredWebexSite ? "https://".concat(preferredWebexSite, "/wbxappapi/v1/meetingInfo") : null;
427
+ };
384
428
 
385
429
  var _default = MeetingInfoUtil;
386
430
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["utilv2.js"],"names":["MeetingInfoUtil","getParsedUrl","link","parsedUrl","url","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","isSipUri","sipString","sipUri","DIALER_REGEX","SIP_ADDRESS","exec","isPhoneNumber","phoneNumber","isValidNumber","PHONE_NUMBER","test","getHydraId","destination","type","id","cluster","UUID_REG","_ROOM_","room","_PEOPLE_","people","getSipUriFromHydraPersonId","get","then","res","emails","length","ParameterError","catch","err","getDestinationType","from","_PERSONAL_ROOM_","userId","device","orgId","options","VALID_EMAIL_ADDRESS","email","list","items","hydraId","_MEETING_LINK_","_SIP_URI_","_CONVERSATION_URL_","wasHydraPerson","resolve","waitForCatalog","conversationUrl","conversation","getUrlFromClusterId","getRequestBody","password","captchaInfo","body","supportHostKey","sipUrl","_MEETING_ID_","meetingKey","_LOCUS_ID_","info","webExMeetingId","meetingUrl","_MEETING_UUID_","meetingUUID","captch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pCP,QAAAA,IAAI,CAACI,UAAL,GAAkB9C,WAAW,CAACgD,IAAZ,CAAiBC,cAAnC;AACD,OAFD,MAGK,0BAAIjD,WAAW,CAACgD,IAAhB,+CAAI,mBAAkB1D,MAAtB,EAA8B;AACjCoD,QAAAA,IAAI,CAACE,MAAL,GAAc5C,WAAW,CAACgD,IAAZ,CAAiB1D,MAA/B;AACD;;AACD;;AACF,SAAKwC,yBAAL;AACEY,MAAAA,IAAI,CAACQ,UAAL,GAAkBlD,WAAlB;AACA;;AACF,SAAKmD,yBAAL;AAAqB;AACnBT,QAAAA,IAAI,CAACU,WAAL,GAAmBpD,WAAnB;AACA;AACD;;AACD;AA9BF;;AAiCA,MAAIwC,QAAJ,EAAc;AACZE,IAAAA,IAAI,CAACF,QAAL,GAAgBA,QAAhB;AACD;;AAED,MAAIC,WAAJ,EAAiB;AACfC,IAAAA,IAAI,CAACW,SAAL,GAAiBZ,WAAW,CAACvC,EAA7B;AACAwC,IAAAA,IAAI,CAACY,iBAAL,GAAyBb,WAAW,CAACc,IAArC;AACD;;AAED,SAAOb,IAAP;AACD,CAnDD;;eAqDerF,e","sourcesContent":["import url from 'url';\n\nimport {\n deconstructHydraId\n} from '@webex/common';\n\nimport {\n _SIP_URI_,\n _PERSONAL_ROOM_,\n _MEETING_ID_,\n _CONVERSATION_URL_,\n _LOCUS_ID_,\n _MEETING_LINK_,\n _PEOPLE_,\n _ROOM_,\n _MEETING_UUID_,\n DIALER_REGEX,\n WEBEX_DOT_COM,\n CONVERSATION_SERVICE,\n JOIN,\n MEET,\n MEET_M,\n HTTPS_PROTOCOL,\n UUID_REG,\n VALID_EMAIL_ADDRESS\n} from '../constants';\nimport ParameterError from '../common/errors/parameter';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nconst MeetingInfoUtil = {};\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 }\n catch (error) {\n LoggerProxy.logger.warn(`Meeting-info:util#getParsedUrl --> unable to parse the URL, error: ${error}`);\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) => {\n const parsedUrl = MeetingInfoUtil.getParsedUrl(value);\n const hostNameBool = parsedUrl.hostname && parsedUrl.hostname.includes(WEBEX_DOT_COM);\n const pathNameBool = parsedUrl.pathname && (parsedUrl.pathname.includes(`/${MEET}`) || parsedUrl.pathname.includes(`/${MEET_M}`) || 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\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) => webex.people.get(destination).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}).catch((err) => {\n LoggerProxy.logger.error(`Meeting-info:util#MeetingInfoUtil.getSipUriFromHydraPersonId --> getSipUriFromHydraPersonId ${err} `);\n throw err;\n});\n\n\nMeetingInfoUtil.getDestinationType = async (from) => {\n const {type, webex} = from;\n let {destination} = from;\n\n if (type === _PERSONAL_ROOM_) { // this case checks if your type is personal room\n if (!destination) { // if we are not getting anything in desination we fetch org and user ids from webex instance\n destination = {\n userId: webex.internal.device.userId,\n orgId: webex.internal.device.orgId\n };\n }\n else {\n const options = VALID_EMAIL_ADDRESS.test(destination) ? {email: destination} : {id: destination};// we are assuming userId as default\n const res = await webex.people.list(options);\n\n let {orgId, id: userId} = res.items[0];\n\n userId = deconstructHydraId(userId).id;\n orgId = deconstructHydraId(orgId).id;\n destination = {userId, orgId};\n }\n }\n if (type) {\n return {\n destination,\n type\n };\n }\n const options = {};\n const hydraId = MeetingInfoUtil.getHydraId(destination);\n\n if (MeetingInfoUtil.isMeetingLink(destination)) {\n LoggerProxy.logger.warn('Meeting-info:util#generateOptions --> WARN, use of Meeting Link is deprecated, please use a SIP URI instead');\n\n options.type = _MEETING_LINK_;\n options.destination = destination;\n }\n else if (MeetingInfoUtil.isSipUri(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n }\n else if (MeetingInfoUtil.isPhoneNumber(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n }\n else if (MeetingInfoUtil.isConversationUrl(destination, webex)) {\n options.type = _CONVERSATION_URL_;\n options.destination = destination;\n }\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 }\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 }\n catch (e) {\n LoggerProxy.logger.error(`Meeting-info:util#getDestinationType --> ${e}`);\n throw (e);\n }\n }\n else {\n LoggerProxy.logger.warn('Meeting-info:util#getDestinationType --> (\\'MeetingInfo is fetched with meeting link, sip uri, phone number, hydra room id, hydra people id, or a conversation url.');\n throw new ParameterError('MeetingInfo is fetched with meeting link, sip uri, phone number, hydra room id, hydra people id, or a conversation url.');\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 {Object} options type and value to fetch meeting info\n * @param {String} options.type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]\n * @param {Object} options.destination ?? value.value\n * @returns {Object} returns an object with {resource, method}\n */\nMeetingInfoUtil.getRequestBody = (options) => {\n const {\n type, destination, password, captchaInfo\n } = options;\n const body = {\n supportHostKey: true\n };\n\n switch (type) {\n case _SIP_URI_:\n body.sipUrl = destination;\n break;\n case _PERSONAL_ROOM_:\n body.userId = destination.userId;\n body.orgId = destination.orgId;\n break;\n case _MEETING_ID_:\n body.meetingKey = destination;\n break;\n case _CONVERSATION_URL_:\n body.conversationUrl = destination;\n break;\n case _LOCUS_ID_:\n // use meetingID for the completer meeting info for the already started meeting\n if (destination.info?.webExMeetingId) {\n body.meetingKey = destination.info.webExMeetingId;\n }\n else if (destination.info?.sipUri) {\n body.sipUrl = destination.info.sipUri;\n }\n break;\n case _MEETING_LINK_:\n body.meetingUrl = destination;\n break;\n case _MEETING_UUID_: {\n body.meetingUUID = destination;\n break;\n }\n default:\n }\n\n if (password) {\n body.password = password;\n }\n\n if (captchaInfo) {\n body.captchaID = captchaInfo.id;\n body.captchaVerifyCode = captchaInfo.code;\n }\n\n return body;\n};\n\nexport default MeetingInfoUtil;\n"]}
1
+ {"version":3,"sources":["utilv2.js"],"names":["MeetingInfoUtil","getParsedUrl","link","parsedUrl","url","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","isSipUri","sipString","sipUri","DIALER_REGEX","SIP_ADDRESS","exec","isPhoneNumber","phoneNumber","isValidNumber","PHONE_NUMBER","test","getHydraId","destination","type","id","cluster","UUID_REG","_ROOM_","room","_PEOPLE_","people","getSipUriFromHydraPersonId","get","then","res","emails","length","ParameterError","catch","err","getDestinationType","from","_PERSONAL_ROOM_","userId","device","orgId","options","VALID_EMAIL_ADDRESS","email","list","items","hydraId","_MEETING_LINK_","_SIP_URI_","_CONVERSATION_URL_","wasHydraPerson","resolve","waitForCatalog","conversationUrl","conversation","getUrlFromClusterId","getRequestBody","password","captchaInfo","body","supportHostKey","sipUrl","_MEETING_ID_","meetingKey","_LOCUS_ID_","info","webExMeetingId","meetingUrl","_MEETING_UUID_","meetingUUID","captchaID","captchaVerifyCode","code","getWebexSite","uri","exceptedDomains","site","match","getDirectMeetingInfoURI","preferredWebexSite","webExSite"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AAIA;;AAoBA;;AACA;;AAEA,IAAMA,eAAe,GAAG,EAAxB;;AAEAA,eAAe,CAACC,YAAhB,GAA+B,UAACC,IAAD,EAAU;AACvC,MAAI;AACF,QAAIC,SAAS,GAAGC,aAAIC,KAAJ,CAAUH,IAAV,CAAhB;;AAEA,QAAI,CAACC,SAAL,EAAgB;AACd,aAAO,KAAP;AACD,KALC,CAMF;;;AACA,QAAI,CAACA,SAAS,CAACG,QAAf,EAAyB;AACvBH,MAAAA,SAAS,GAAGC,aAAIC,KAAJ,WAAaE,yBAAb,SAA8BL,IAA9B,EAAZ;AACD;;AAED,WAAOC,SAAP;AACD,GAZD,CAaA,OAAOK,KAAP,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GAAgBA,QAAhB;AACD;;AAED,MAAIC,WAAJ,EAAiB;AACfC,IAAAA,IAAI,CAACW,SAAL,GAAiBZ,WAAW,CAACvC,EAA7B;AACAwC,IAAAA,IAAI,CAACY,iBAAL,GAAyBb,WAAW,CAACc,IAArC;AACD;;AAED,SAAOb,IAAP;AACD,CAnDD;AAqDA;AACA;AACA;AACA;AACA;;;AACArF,eAAe,CAACmG,YAAhB,GAA+B,UAACC,GAAD,EAAS;AAAA;;AACtC,MAAMC,eAAe,GAAG,CAAC,gBAAD,EAAmB,kBAAnB,EAAuC,gBAAvC,CAAxB;AACA,MAAMC,IAAI,GAAGF,GAAH,aAAGA,GAAH,qCAAGA,GAAG,CAAEG,KAAL,CAAW,kBAAX,CAAH,+CAAG,WAAiC,CAAjC,CAAb;AAEA,SAAOF,eAAe,CAACrF,QAAhB,CAAyBsF,IAAzB,IAAiC,IAAjC,GAAwCA,IAA/C;AACD,CALD;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACAtG,eAAe,CAACwG,uBAAhB,GAA0C,UAACrC,OAAD,EAAa;AAAA;;AACrD,MACEvB,IADF,GAEIuB,OAFJ,CACEvB,IADF;AAAA,MACQD,WADR,GAEIwB,OAFJ,CACQxB,WADR;AAIA,MAAI8D,kBAAkB,GAAG,IAAzB;;AAEA,UAAQ7D,IAAR;AACE,SAAK8B,oBAAL;AACE+B,MAAAA,kBAAkB,GAAGzG,eAAe,CAACmG,YAAhB,CAA6BxD,WAA7B,CAArB;AACA;;AACF,SAAK+C,qBAAL;AACEe,MAAAA,kBAAkB,yBAAG9D,WAAW,CAACgD,IAAf,uDAAG,mBAAkBe,SAAvC;AACA;;AACF;AAPF;;AAUA,SAAOD,kBAAkB,qBAAcA,kBAAd,iCAA8D,IAAvF;AACD,CAlBD;;eAoBezG,e","sourcesContent":["import url from 'url';\n\nimport {\n deconstructHydraId\n} from '@webex/common';\n\nimport {\n _SIP_URI_,\n _PERSONAL_ROOM_,\n _MEETING_ID_,\n _CONVERSATION_URL_,\n _LOCUS_ID_,\n _MEETING_LINK_,\n _PEOPLE_,\n _ROOM_,\n _MEETING_UUID_,\n DIALER_REGEX,\n WEBEX_DOT_COM,\n CONVERSATION_SERVICE,\n JOIN,\n MEET,\n MEET_M,\n HTTPS_PROTOCOL,\n UUID_REG,\n VALID_EMAIL_ADDRESS\n} from '../constants';\nimport ParameterError from '../common/errors/parameter';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nconst MeetingInfoUtil = {};\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 }\n catch (error) {\n LoggerProxy.logger.warn(`Meeting-info:util#getParsedUrl --> unable to parse the URL, error: ${error}`);\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) => {\n const parsedUrl = MeetingInfoUtil.getParsedUrl(value);\n const hostNameBool = parsedUrl.hostname && parsedUrl.hostname.includes(WEBEX_DOT_COM);\n const pathNameBool = parsedUrl.pathname && (parsedUrl.pathname.includes(`/${MEET}`) || parsedUrl.pathname.includes(`/${MEET_M}`) || 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\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) => webex.people.get(destination).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}).catch((err) => {\n LoggerProxy.logger.error(`Meeting-info:util#MeetingInfoUtil.getSipUriFromHydraPersonId --> getSipUriFromHydraPersonId ${err} `);\n throw err;\n});\n\n\nMeetingInfoUtil.getDestinationType = async (from) => {\n const {type, webex} = from;\n let {destination} = from;\n\n if (type === _PERSONAL_ROOM_) { // this case checks if your type is personal room\n if (!destination) { // if we are not getting anything in desination we fetch org and user ids from webex instance\n destination = {\n userId: webex.internal.device.userId,\n orgId: webex.internal.device.orgId\n };\n }\n else {\n const options = VALID_EMAIL_ADDRESS.test(destination) ? {email: destination} : {id: destination};// we are assuming userId as default\n const res = await webex.people.list(options);\n\n let {orgId, id: userId} = res.items[0];\n\n userId = deconstructHydraId(userId).id;\n orgId = deconstructHydraId(orgId).id;\n destination = {userId, orgId};\n }\n }\n if (type) {\n return {\n destination,\n type\n };\n }\n const options = {};\n const hydraId = MeetingInfoUtil.getHydraId(destination);\n\n if (MeetingInfoUtil.isMeetingLink(destination)) {\n LoggerProxy.logger.warn('Meeting-info:util#generateOptions --> WARN, use of Meeting Link is deprecated, please use a SIP URI instead');\n\n options.type = _MEETING_LINK_;\n options.destination = destination;\n }\n else if (MeetingInfoUtil.isSipUri(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n }\n else if (MeetingInfoUtil.isPhoneNumber(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n }\n else if (MeetingInfoUtil.isConversationUrl(destination, webex)) {\n options.type = _CONVERSATION_URL_;\n options.destination = destination;\n }\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 }\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 }\n catch (e) {\n LoggerProxy.logger.error(`Meeting-info:util#getDestinationType --> ${e}`);\n throw (e);\n }\n }\n else {\n LoggerProxy.logger.warn('Meeting-info:util#getDestinationType --> (\\'MeetingInfo is fetched with meeting link, sip uri, phone number, hydra room id, hydra people id, or a conversation url.');\n throw new ParameterError('MeetingInfo is fetched with meeting link, sip uri, phone number, hydra room id, hydra people id, or a conversation url.');\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 {Object} options type and value to fetch meeting info\n * @param {String} options.type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]\n * @param {Object} options.destination ?? value.value\n * @returns {Object} returns an object with {resource, method}\n */\nMeetingInfoUtil.getRequestBody = (options) => {\n const {\n type, destination, password, captchaInfo\n } = options;\n const body = {\n supportHostKey: true\n };\n\n switch (type) {\n case _SIP_URI_:\n body.sipUrl = destination;\n break;\n case _PERSONAL_ROOM_:\n body.userId = destination.userId;\n body.orgId = destination.orgId;\n break;\n case _MEETING_ID_:\n body.meetingKey = destination;\n break;\n case _CONVERSATION_URL_:\n body.conversationUrl = destination;\n break;\n case _LOCUS_ID_:\n // use meetingID for the completer meeting info for the already started meeting\n if (destination.info?.webExMeetingId) {\n body.meetingKey = destination.info.webExMeetingId;\n }\n else if (destination.info?.sipUri) {\n body.sipUrl = destination.info.sipUri;\n }\n break;\n case _MEETING_LINK_:\n body.meetingUrl = destination;\n break;\n case _MEETING_UUID_: {\n body.meetingUUID = destination;\n break;\n }\n default:\n }\n\n if (password) {\n body.password = password;\n }\n\n if (captchaInfo) {\n body.captchaID = captchaInfo.id;\n body.captchaVerifyCode = captchaInfo.code;\n }\n\n return body;\n};\n\n/**\n * Helper function to parse the webex site/host from a URI string.\n * @param {String} uri string (e.g. '10019857020@convergedats.webex.com')\n * @returns {String} the site/host part of the URI string (e.g. 'convergedats.webex.com')\n */\nMeetingInfoUtil.getWebexSite = (uri) => {\n const exceptedDomains = ['meet.webex.com', 'meetup.webex.com', 'ciscospark.com'];\n const site = uri?.match(/.+@(.+\\..+\\.*.)$/)?.[1];\n\n return exceptedDomains.includes(site) ? null : site;\n};\n\n/**\n * Helper function to return the direct URI for fetching meeting info (to avoid a redirect).\n * @param {Object} options type and value to fetch meeting info\n * @param {String} options.type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]\n * @param {Object} options.destination ?? value.value\n * @returns {String} returns a URI string or null of there is no direct URI\n */\nMeetingInfoUtil.getDirectMeetingInfoURI = (options) => {\n const {\n type, destination\n } = options;\n\n let preferredWebexSite = null;\n\n switch (type) {\n case _SIP_URI_:\n preferredWebexSite = MeetingInfoUtil.getWebexSite(destination);\n break;\n case _LOCUS_ID_:\n preferredWebexSite = destination.info?.webExSite;\n break;\n default:\n }\n\n return preferredWebexSite ? `https://${preferredWebexSite}/wbxappapi/v1/meetingInfo` : null;\n};\n\nexport default MeetingInfoUtil;\n"]}