@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.
Files changed (205) hide show
  1. package/dist/breakouts/breakout.js +1 -1
  2. package/dist/breakouts/index.js +1 -1
  3. package/dist/common/errors/reconnection-not-started.js +46 -0
  4. package/dist/common/errors/reconnection-not-started.js.map +1 -0
  5. package/dist/constants.js +16 -5
  6. package/dist/constants.js.map +1 -1
  7. package/dist/index.js +80 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/interpretation/index.js +1 -1
  10. package/dist/interpretation/siLanguage.js +1 -1
  11. package/dist/locus-info/controlsUtils.js +7 -1
  12. package/dist/locus-info/controlsUtils.js.map +1 -1
  13. package/dist/locus-info/index.js +10 -0
  14. package/dist/locus-info/index.js.map +1 -1
  15. package/dist/media/properties.js +102 -57
  16. package/dist/media/properties.js.map +1 -1
  17. package/dist/mediaQualityMetrics/config.js +10 -10
  18. package/dist/mediaQualityMetrics/config.js.map +1 -1
  19. package/dist/meeting/in-meeting-actions.js +6 -0
  20. package/dist/meeting/in-meeting-actions.js.map +1 -1
  21. package/dist/meeting/index.js +564 -475
  22. package/dist/meeting/index.js.map +1 -1
  23. package/dist/meeting/locusMediaRequest.js +27 -0
  24. package/dist/meeting/locusMediaRequest.js.map +1 -1
  25. package/dist/meeting/util.js +9 -16
  26. package/dist/meeting/util.js.map +1 -1
  27. package/dist/meeting/voicea-meeting.js +37 -49
  28. package/dist/meeting/voicea-meeting.js.map +1 -1
  29. package/dist/meeting-info/util.js +304 -267
  30. package/dist/meeting-info/util.js.map +1 -1
  31. package/dist/meeting-info/utilv2.js +334 -298
  32. package/dist/meeting-info/utilv2.js.map +1 -1
  33. package/dist/meetings/index.js +12 -28
  34. package/dist/meetings/index.js.map +1 -1
  35. package/dist/reachability/index.js +88 -9
  36. package/dist/reachability/index.js.map +1 -1
  37. package/dist/reconnection-manager/index.js +138 -109
  38. package/dist/reconnection-manager/index.js.map +1 -1
  39. package/dist/roap/request.js +3 -27
  40. package/dist/roap/request.js.map +1 -1
  41. package/dist/statsAnalyzer/index.js +8 -2
  42. package/dist/statsAnalyzer/index.js.map +1 -1
  43. package/dist/statsAnalyzer/mqaUtil.js +17 -0
  44. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  45. package/dist/types/annotation/annotation.types.d.ts +42 -0
  46. package/dist/types/annotation/constants.d.ts +31 -0
  47. package/dist/types/annotation/index.d.ts +117 -0
  48. package/dist/types/breakouts/breakout.d.ts +8 -0
  49. package/dist/types/breakouts/collection.d.ts +5 -0
  50. package/dist/types/breakouts/edit-lock-error.d.ts +15 -0
  51. package/dist/types/breakouts/events.d.ts +8 -0
  52. package/dist/types/breakouts/index.d.ts +5 -0
  53. package/dist/types/breakouts/request.d.ts +22 -0
  54. package/dist/types/breakouts/utils.d.ts +15 -0
  55. package/dist/types/common/browser-detection.d.ts +9 -0
  56. package/dist/types/common/collection.d.ts +48 -0
  57. package/dist/types/common/config.d.ts +2 -0
  58. package/dist/types/common/errors/captcha-error.d.ts +15 -0
  59. package/dist/types/common/errors/intent-to-join.d.ts +16 -0
  60. package/dist/types/common/errors/join-meeting.d.ts +17 -0
  61. package/dist/types/common/errors/media.d.ts +15 -0
  62. package/dist/types/common/errors/no-meeting-info.d.ts +14 -0
  63. package/dist/types/common/errors/parameter.d.ts +15 -0
  64. package/dist/types/common/errors/password-error.d.ts +15 -0
  65. package/dist/types/common/errors/permission.d.ts +14 -0
  66. package/dist/types/common/errors/reclaim-host-role-errors.d.ts +60 -0
  67. package/dist/types/common/errors/reconnection-not-started.d.ts +13 -0
  68. package/dist/types/common/errors/reconnection.d.ts +15 -0
  69. package/dist/types/common/errors/stats.d.ts +15 -0
  70. package/dist/types/common/errors/webex-errors.d.ts +93 -0
  71. package/dist/types/common/errors/webex-meetings-error.d.ts +20 -0
  72. package/dist/types/common/events/events-scope.d.ts +17 -0
  73. package/dist/types/common/events/events.d.ts +12 -0
  74. package/dist/types/common/events/trigger-proxy.d.ts +2 -0
  75. package/dist/types/common/events/util.d.ts +2 -0
  76. package/dist/types/common/logs/logger-config.d.ts +2 -0
  77. package/dist/types/common/logs/logger-proxy.d.ts +2 -0
  78. package/dist/types/common/logs/request.d.ts +36 -0
  79. package/dist/types/common/queue.d.ts +34 -0
  80. package/dist/types/config.d.ts +73 -0
  81. package/dist/types/constants.d.ts +1098 -0
  82. package/dist/types/controls-options-manager/constants.d.ts +4 -0
  83. package/dist/types/controls-options-manager/enums.d.ts +15 -0
  84. package/dist/types/controls-options-manager/index.d.ts +136 -0
  85. package/dist/types/controls-options-manager/types.d.ts +43 -0
  86. package/dist/types/controls-options-manager/util.d.ts +1 -0
  87. package/dist/types/index.d.ts +19 -0
  88. package/dist/types/interceptors/index.d.ts +2 -0
  89. package/dist/types/interceptors/locusRetry.d.ts +27 -0
  90. package/dist/types/interpretation/collection.d.ts +5 -0
  91. package/dist/types/interpretation/index.d.ts +5 -0
  92. package/dist/types/interpretation/siLanguage.d.ts +5 -0
  93. package/dist/types/locus-info/controlsUtils.d.ts +2 -0
  94. package/dist/types/locus-info/embeddedAppsUtils.d.ts +2 -0
  95. package/dist/types/locus-info/fullState.d.ts +2 -0
  96. package/dist/types/locus-info/hostUtils.d.ts +2 -0
  97. package/dist/types/locus-info/index.d.ts +322 -0
  98. package/dist/types/locus-info/infoUtils.d.ts +2 -0
  99. package/dist/types/locus-info/mediaSharesUtils.d.ts +2 -0
  100. package/dist/types/locus-info/parser.d.ts +272 -0
  101. package/dist/types/locus-info/selfUtils.d.ts +2 -0
  102. package/dist/types/media/MediaConnectionAwaiter.d.ts +61 -0
  103. package/dist/types/media/index.d.ts +34 -0
  104. package/dist/types/media/properties.d.ts +117 -0
  105. package/dist/types/media/util.d.ts +2 -0
  106. package/dist/types/mediaQualityMetrics/config.d.ts +247 -0
  107. package/dist/types/meeting/in-meeting-actions.d.ts +173 -0
  108. package/dist/types/meeting/index.d.ts +1832 -0
  109. package/dist/types/meeting/locusMediaRequest.d.ts +75 -0
  110. package/dist/types/meeting/muteState.d.ts +178 -0
  111. package/dist/types/meeting/request.d.ts +295 -0
  112. package/dist/types/meeting/request.type.d.ts +11 -0
  113. package/dist/types/meeting/state.d.ts +9 -0
  114. package/dist/types/meeting/util.d.ts +122 -0
  115. package/dist/types/meeting/voicea-meeting.d.ts +17 -0
  116. package/dist/types/meeting-info/collection.d.ts +20 -0
  117. package/dist/types/meeting-info/index.d.ts +69 -0
  118. package/dist/types/meeting-info/meeting-info-v2.d.ts +123 -0
  119. package/dist/types/meeting-info/request.d.ts +22 -0
  120. package/dist/types/meeting-info/util.d.ts +49 -0
  121. package/dist/types/meeting-info/utilv2.d.ts +65 -0
  122. package/dist/types/meetings/collection.d.ts +40 -0
  123. package/dist/types/meetings/index.d.ts +383 -0
  124. package/dist/types/meetings/meetings.types.d.ts +4 -0
  125. package/dist/types/meetings/request.d.ts +27 -0
  126. package/dist/types/meetings/util.d.ts +18 -0
  127. package/dist/types/member/index.d.ts +160 -0
  128. package/dist/types/member/types.d.ts +32 -0
  129. package/dist/types/member/util.d.ts +2 -0
  130. package/dist/types/members/collection.d.ts +29 -0
  131. package/dist/types/members/index.d.ts +353 -0
  132. package/dist/types/members/request.d.ts +114 -0
  133. package/dist/types/members/types.d.ts +25 -0
  134. package/dist/types/members/util.d.ts +215 -0
  135. package/dist/types/metrics/constants.d.ts +70 -0
  136. package/dist/types/metrics/index.d.ts +45 -0
  137. package/dist/types/multistream/mediaRequestManager.d.ts +119 -0
  138. package/dist/types/multistream/receiveSlot.d.ts +68 -0
  139. package/dist/types/multistream/receiveSlotManager.d.ts +56 -0
  140. package/dist/types/multistream/remoteMedia.d.ts +72 -0
  141. package/dist/types/multistream/remoteMediaGroup.d.ts +49 -0
  142. package/dist/types/multistream/remoteMediaManager.d.ts +300 -0
  143. package/dist/types/multistream/sendSlotManager.d.ts +69 -0
  144. package/dist/types/networkQualityMonitor/index.d.ts +70 -0
  145. package/dist/types/personal-meeting-room/index.d.ts +47 -0
  146. package/dist/types/personal-meeting-room/request.d.ts +14 -0
  147. package/dist/types/personal-meeting-room/util.d.ts +2 -0
  148. package/dist/types/reachability/clusterReachability.d.ts +110 -0
  149. package/dist/types/reachability/index.d.ts +120 -0
  150. package/dist/types/reachability/request.d.ts +39 -0
  151. package/dist/types/reachability/util.d.ts +15 -0
  152. package/dist/types/reactions/constants.d.ts +3 -0
  153. package/dist/types/reactions/reactions.d.ts +4 -0
  154. package/dist/types/reactions/reactions.type.d.ts +52 -0
  155. package/dist/types/reconnection-manager/index.d.ts +126 -0
  156. package/dist/types/recording-controller/enums.d.ts +7 -0
  157. package/dist/types/recording-controller/index.d.ts +207 -0
  158. package/dist/types/recording-controller/util.d.ts +14 -0
  159. package/dist/types/roap/index.d.ts +86 -0
  160. package/dist/types/roap/request.d.ts +39 -0
  161. package/dist/types/roap/turnDiscovery.d.ts +155 -0
  162. package/dist/types/rtcMetrics/constants.d.ts +4 -0
  163. package/dist/types/rtcMetrics/index.d.ts +61 -0
  164. package/dist/types/statsAnalyzer/global.d.ts +36 -0
  165. package/dist/types/statsAnalyzer/index.d.ts +217 -0
  166. package/dist/types/statsAnalyzer/mqaUtil.d.ts +48 -0
  167. package/dist/types/transcription/index.d.ts +64 -0
  168. package/dist/types/webinar/collection.d.ts +16 -0
  169. package/dist/types/webinar/index.d.ts +5 -0
  170. package/dist/webinar/index.js +1 -1
  171. package/package.json +22 -22
  172. package/src/common/errors/reconnection-not-started.ts +25 -0
  173. package/src/constants.ts +14 -5
  174. package/src/index.ts +30 -0
  175. package/src/locus-info/controlsUtils.ts +11 -0
  176. package/src/locus-info/index.ts +16 -0
  177. package/src/media/properties.ts +67 -15
  178. package/src/mediaQualityMetrics/config.ts +13 -7
  179. package/src/meeting/in-meeting-actions.ts +12 -0
  180. package/src/meeting/index.ts +144 -107
  181. package/src/meeting/locusMediaRequest.ts +31 -0
  182. package/src/meeting/util.ts +9 -16
  183. package/src/meeting/voicea-meeting.ts +44 -46
  184. package/src/meeting-info/util.ts +241 -233
  185. package/src/meeting-info/utilv2.ts +250 -244
  186. package/src/meetings/index.ts +15 -27
  187. package/src/reachability/index.ts +60 -0
  188. package/src/reconnection-manager/index.ts +128 -105
  189. package/src/roap/request.ts +1 -24
  190. package/src/statsAnalyzer/index.ts +10 -3
  191. package/src/statsAnalyzer/mqaUtil.ts +23 -0
  192. package/test/unit/spec/locus-info/controlsUtils.js +20 -0
  193. package/test/unit/spec/locus-info/index.js +21 -0
  194. package/test/unit/spec/media/properties.ts +145 -140
  195. package/test/unit/spec/meeting/in-meeting-actions.ts +6 -0
  196. package/test/unit/spec/meeting/index.js +271 -105
  197. package/test/unit/spec/meeting/locusMediaRequest.ts +49 -0
  198. package/test/unit/spec/meeting/utils.js +3 -10
  199. package/test/unit/spec/meeting/voicea-meeting.ts +5 -14
  200. package/test/unit/spec/meetings/index.js +59 -17
  201. package/test/unit/spec/reachability/index.ts +266 -0
  202. package/test/unit/spec/reconnection-manager/index.js +127 -39
  203. package/test/unit/spec/roap/request.ts +0 -37
  204. package/test/unit/spec/stats-analyzer/index.js +100 -8
  205. package/src/common/errors/reconnection-in-progress.ts +0 -8
@@ -13,8 +13,10 @@ _Object$defineProperty(exports, "__esModule", {
13
13
  exports.default = void 0;
14
14
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
15
15
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
16
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
17
16
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
17
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
18
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
19
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
18
20
  var _url = _interopRequireDefault(require("url"));
19
21
  var _common = require("@webex/common");
20
22
  var _constants = require("../constants");
@@ -23,322 +25,356 @@ var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy")
23
25
  var _webexErrors = require("../common/errors/webex-errors");
24
26
  function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
25
27
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; } // @ts-ignore
26
- var MeetingInfoUtil = {};
27
- var meetingInfoError = 'MeetingInfo is fetched with the meeting link, SIP URI, phone number, Hydra people ID, or a conversation URL.';
28
- MeetingInfoUtil.getParsedUrl = function (link) {
29
- try {
30
- var parsedUrl = _url.default.parse(link);
31
- if (!parsedUrl) {
32
- return false;
33
- }
34
- // hack for links such as <company>.webex.com/meet/<user> without a protocol
35
- if (!parsedUrl.protocol) {
36
- parsedUrl = _url.default.parse("".concat(_constants.HTTPS_PROTOCOL).concat(link));
37
- }
38
- return parsedUrl;
39
- } catch (error) {
40
- _loggerProxy.default.logger.warn("Meeting-info:util#getParsedUrl --> unable to parse the URL, error: ".concat(error));
41
- return null;
42
- }
43
- };
44
-
45
28
  /**
46
- * Helper function to check if a string matches a known meeting link pattern
47
- * @param {String} value string to parse and see if it matches a meeting link
48
- * @returns {Boolean}
29
+ * @class MeetingInfoUtil
49
30
  */
50
- MeetingInfoUtil.isMeetingLink = function (value) {
51
- var parsedUrl = MeetingInfoUtil.getParsedUrl(value);
52
- var hostNameBool = parsedUrl.hostname && parsedUrl.hostname.includes(_constants.WEBEX_DOT_COM);
53
- var pathNameBool = parsedUrl.pathname && (parsedUrl.pathname.includes("/".concat(_constants.MEET)) || parsedUrl.pathname.includes("/".concat(_constants.MEET_M)) || parsedUrl.pathname.includes("/".concat(_constants.MEET_CISCO)) || parsedUrl.pathname.includes("/".concat(_constants.MEET_CO)) || parsedUrl.pathname.includes("/".concat(_constants.JOIN)));
54
- return hostNameBool && pathNameBool;
55
- };
56
- MeetingInfoUtil.isConversationUrl = function (value, webex) {
57
- var clusterId = webex.internal.services.getClusterId(value);
58
- if (clusterId) {
59
- return clusterId.endsWith(_constants.CONVERSATION_SERVICE);
31
+ var MeetingInfoUtil = exports.default = /*#__PURE__*/function () {
32
+ function MeetingInfoUtil() {
33
+ (0, _classCallCheck2.default)(this, MeetingInfoUtil);
60
34
  }
61
- return false;
62
- };
63
- MeetingInfoUtil.isSipUri = function (sipString) {
64
- // TODO: lets remove regex from this equation and user URI matchers and such
65
- // have not found a great sip uri parser library as of now
66
- var sipUri = _constants.DIALER_REGEX.SIP_ADDRESS.exec(sipString);
67
- return sipUri;
68
- };
69
- MeetingInfoUtil.isPhoneNumber = function (phoneNumber) {
70
- var isValidNumber = _constants.DIALER_REGEX.PHONE_NUMBER.test(phoneNumber);
71
- return isValidNumber;
72
- };
73
- MeetingInfoUtil.getHydraId = function (destination) {
74
- var _deconstructHydraId = (0, _common.deconstructHydraId)(destination),
75
- type = _deconstructHydraId.type,
76
- id = _deconstructHydraId.id,
77
- cluster = _deconstructHydraId.cluster;
78
- if (id && _constants.UUID_REG.test(id)) {
79
- if (type === _constants._ROOM_) {
80
- return {
81
- room: true,
82
- destination: id,
83
- cluster: cluster
84
- };
35
+ (0, _createClass2.default)(MeetingInfoUtil, null, [{
36
+ key: "getParsedUrl",
37
+ value: function getParsedUrl(link) {
38
+ try {
39
+ var parsedUrl = _url.default.parse(link);
40
+ if (!parsedUrl) {
41
+ return false;
42
+ }
43
+ // hack for links such as <company>.webex.com/meet/<user> without a protocol
44
+ if (!parsedUrl.protocol) {
45
+ parsedUrl = _url.default.parse("".concat(_constants.HTTPS_PROTOCOL).concat(link));
46
+ }
47
+ return parsedUrl;
48
+ } catch (error) {
49
+ _loggerProxy.default.logger.warn("Meeting-info:util#getParsedUrl --> unable to parse the URL, error: ".concat(error));
50
+ return null;
51
+ }
85
52
  }
86
- if (type === _constants._PEOPLE_) {
87
- return {
88
- people: true,
89
- destination: id,
90
- cluster: cluster
91
- };
53
+
54
+ /**
55
+ * Helper function to check if a string matches a known meeting link pattern
56
+ * @param {String} value string to parse and see if it matches a meeting link
57
+ * @returns {Boolean}
58
+ */
59
+ }, {
60
+ key: "isMeetingLink",
61
+ value: function isMeetingLink(value) {
62
+ var hostNameBool;
63
+ var pathNameBool;
64
+ var parsedUrl = this.getParsedUrl(value);
65
+ if (parsedUrl) {
66
+ hostNameBool = parsedUrl.hostname && parsedUrl.hostname.includes(_constants.WEBEX_DOT_COM);
67
+ pathNameBool = parsedUrl.pathname && (parsedUrl.pathname.includes("/".concat(_constants.MEET)) || parsedUrl.pathname.includes("/".concat(_constants.MEET_M)) || parsedUrl.pathname.includes("/".concat(_constants.MEET_CISCO)) || parsedUrl.pathname.includes("/".concat(_constants.MEET_CO)) || parsedUrl.pathname.includes("/".concat(_constants.JOIN)));
68
+ }
69
+ return hostNameBool && pathNameBool;
92
70
  }
93
- return {};
94
- }
95
- return {};
96
- };
97
- MeetingInfoUtil.getSipUriFromHydraPersonId = function (destination, webex) {
98
- return webex.people.get(destination).then(function (res) {
99
- if (res.emails && res.emails.length) {
100
- return res.emails[0];
71
+ }, {
72
+ key: "isConversationUrl",
73
+ value: function isConversationUrl(value, webex) {
74
+ var clusterId = webex.internal.services.getClusterId(value);
75
+ if (clusterId) {
76
+ return clusterId.endsWith(_constants.CONVERSATION_SERVICE);
77
+ }
78
+ return false;
101
79
  }
102
- throw new _parameter.default('Hydra Id Lookup was an invalid hydra person id.');
103
- }).catch(function (err) {
104
- _loggerProxy.default.logger.error("Meeting-info:util#MeetingInfoUtil.getSipUriFromHydraPersonId --> getSipUriFromHydraPersonId ".concat(err, " "));
105
- throw err;
106
- });
107
- };
108
- MeetingInfoUtil.getDestinationType = /*#__PURE__*/function () {
109
- var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(from) {
110
- var type, webex, destination, _options, res, _res$items$, orgId, userId, options, hydraId;
111
- return _regenerator.default.wrap(function _callee$(_context) {
112
- while (1) switch (_context.prev = _context.next) {
113
- case 0:
114
- type = from.type, webex = from.webex;
115
- destination = from.destination;
116
- if (!(type === _constants._PERSONAL_ROOM_)) {
117
- _context.next = 15;
118
- break;
119
- }
120
- if (destination) {
121
- _context.next = 7;
122
- break;
123
- }
124
- // if we are not getting anything in desination we fetch org and user ids from webex instance
125
- destination = {
126
- userId: webex.internal.device.userId,
127
- orgId: webex.internal.device.orgId
80
+ }, {
81
+ key: "isSipUri",
82
+ value: function isSipUri(sipString) {
83
+ // TODO: lets remove regex from this equation and user URI matchers and such
84
+ // have not found a great sip uri parser library as of now
85
+ var sipUri = _constants.DIALER_REGEX.SIP_ADDRESS.exec(sipString);
86
+ return sipUri;
87
+ }
88
+ }, {
89
+ key: "isPhoneNumber",
90
+ value: function isPhoneNumber(phoneNumber) {
91
+ var isValidNumber = _constants.DIALER_REGEX.PHONE_NUMBER.test(phoneNumber);
92
+ return isValidNumber;
93
+ }
94
+ }, {
95
+ key: "getHydraId",
96
+ value: function getHydraId(destination) {
97
+ var _deconstructHydraId = (0, _common.deconstructHydraId)(destination),
98
+ type = _deconstructHydraId.type,
99
+ id = _deconstructHydraId.id,
100
+ cluster = _deconstructHydraId.cluster;
101
+ if (id && _constants.UUID_REG.test(id)) {
102
+ if (type === _constants._ROOM_) {
103
+ return {
104
+ room: true,
105
+ destination: id,
106
+ cluster: cluster
128
107
  };
129
- _context.next = 15;
130
- break;
131
- case 7:
132
- _options = _constants.VALID_EMAIL_ADDRESS.test(destination) ? {
133
- email: destination
134
- } : {
135
- id: destination
136
- }; // we are assuming userId as default
137
- _context.next = 10;
138
- return webex.people.list(_options);
139
- case 10:
140
- res = _context.sent;
141
- _res$items$ = res.items[0], orgId = _res$items$.orgId, userId = _res$items$.id;
142
- userId = (0, _common.deconstructHydraId)(userId).id;
143
- orgId = (0, _common.deconstructHydraId)(orgId).id;
144
- destination = {
145
- userId: userId,
146
- orgId: orgId
108
+ }
109
+ if (type === _constants._PEOPLE_) {
110
+ return {
111
+ people: true,
112
+ destination: id,
113
+ cluster: cluster
147
114
  };
148
- case 15:
149
- if (!type) {
150
- _context.next = 17;
151
- break;
152
- }
153
- return _context.abrupt("return", {
154
- destination: destination,
155
- type: type
156
- });
157
- case 17:
158
- options = {};
159
- if (webex && webex.config && webex.config.meetings && webex.config.meetings.disableHydraId) {
160
- hydraId = null;
161
- } else {
162
- hydraId = MeetingInfoUtil.getHydraId(destination);
163
- }
164
- if (!MeetingInfoUtil.isMeetingLink(destination)) {
165
- _context.next = 25;
166
- break;
115
+ }
116
+ return {};
117
+ }
118
+ return {};
119
+ }
120
+ }, {
121
+ key: "getSipUriFromHydraPersonId",
122
+ value: function getSipUriFromHydraPersonId(destination, webex) {
123
+ return webex.people.get(destination).then(function (res) {
124
+ if (res.emails && res.emails.length) {
125
+ return res.emails[0];
126
+ }
127
+ throw new _parameter.default('Hydra Id Lookup was an invalid hydra person id.');
128
+ }).catch(function (err) {
129
+ _loggerProxy.default.logger.error("Meeting-info:util#MeetingInfoUtil.getSipUriFromHydraPersonId --> getSipUriFromHydraPersonId ".concat(err, " "));
130
+ throw err;
131
+ });
132
+ }
133
+ }, {
134
+ key: "getDestinationType",
135
+ value: function () {
136
+ var _getDestinationType = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(from) {
137
+ var type, webex, destination, _options, res, _res$items$, orgId, userId, options, hydraId;
138
+ return _regenerator.default.wrap(function _callee$(_context) {
139
+ while (1) switch (_context.prev = _context.next) {
140
+ case 0:
141
+ type = from.type, webex = from.webex;
142
+ destination = from.destination;
143
+ if (!(type === _constants._PERSONAL_ROOM_)) {
144
+ _context.next = 15;
145
+ break;
146
+ }
147
+ if (destination) {
148
+ _context.next = 7;
149
+ break;
150
+ }
151
+ // if we are not getting anything in desination we fetch org and user ids from webex instance
152
+ destination = {
153
+ userId: webex.internal.device.userId,
154
+ orgId: webex.internal.device.orgId
155
+ };
156
+ _context.next = 15;
157
+ break;
158
+ case 7:
159
+ _options = _constants.VALID_EMAIL_ADDRESS.test(destination) ? {
160
+ email: destination
161
+ } : {
162
+ id: destination
163
+ }; // we are assuming userId as default
164
+ _context.next = 10;
165
+ return webex.people.list(_options);
166
+ case 10:
167
+ res = _context.sent;
168
+ _res$items$ = res.items[0], orgId = _res$items$.orgId, userId = _res$items$.id;
169
+ userId = (0, _common.deconstructHydraId)(userId).id;
170
+ orgId = (0, _common.deconstructHydraId)(orgId).id;
171
+ destination = {
172
+ userId: userId,
173
+ orgId: orgId
174
+ };
175
+ case 15:
176
+ if (!type) {
177
+ _context.next = 17;
178
+ break;
179
+ }
180
+ return _context.abrupt("return", {
181
+ destination: destination,
182
+ type: type
183
+ });
184
+ case 17:
185
+ options = {};
186
+ if (webex && webex.config && webex.config.meetings && webex.config.meetings.disableHydraId) {
187
+ hydraId = null;
188
+ } else {
189
+ hydraId = this.getHydraId(destination);
190
+ }
191
+ if (!this.isMeetingLink(destination)) {
192
+ _context.next = 25;
193
+ break;
194
+ }
195
+ _loggerProxy.default.logger.warn('Meeting-info:util#generateOptions --> WARN, use of Meeting Link is deprecated, please use a SIP URI instead');
196
+ options.type = _constants._MEETING_LINK_;
197
+ options.destination = destination;
198
+ _context.next = 52;
199
+ break;
200
+ case 25:
201
+ if (!this.isSipUri(destination)) {
202
+ _context.next = 30;
203
+ break;
204
+ }
205
+ options.type = _constants._SIP_URI_;
206
+ options.destination = destination;
207
+ _context.next = 52;
208
+ break;
209
+ case 30:
210
+ if (!this.isPhoneNumber(destination)) {
211
+ _context.next = 35;
212
+ break;
213
+ }
214
+ options.type = _constants._SIP_URI_;
215
+ options.destination = destination;
216
+ _context.next = 52;
217
+ break;
218
+ case 35:
219
+ if (!this.isConversationUrl(destination, webex)) {
220
+ _context.next = 40;
221
+ break;
222
+ }
223
+ options.type = _constants._CONVERSATION_URL_;
224
+ options.destination = destination;
225
+ _context.next = 52;
226
+ break;
227
+ case 40:
228
+ if (!(hydraId && hydraId.people)) {
229
+ _context.next = 45;
230
+ break;
231
+ }
232
+ options.type = _constants._SIP_URI_;
233
+ return _context.abrupt("return", this.getSipUriFromHydraPersonId(hydraId && hydraId.destination, webex).then(function (res) {
234
+ options.destination = res;
235
+
236
+ // Since hydra person ids require a unique case in which they are
237
+ // entirely converted to a SIP URI, we need to set a flag for detecting
238
+ // this type of destination.
239
+ options.wasHydraPerson = true;
240
+ return _promise.default.resolve(options);
241
+ }));
242
+ case 45:
243
+ if (!hydraId.room) {
244
+ _context.next = 50;
245
+ break;
246
+ }
247
+ _loggerProxy.default.logger.error("Meeting-info:util#getDestinationType --> Using the space ID as a destination is no longer supported. Please refer to the [migration guide](https://github.com/webex/webex-js-sdk/wiki/Migration-to-Unified-Space-Meetings) to migrate to use the meeting ID or SIP address.");
248
+ // Error code 30105 added as Space ID deprecated as of beta, Please refer migration guide.
249
+ throw new _webexErrors.SpaceIDDeprecatedError();
250
+ case 50:
251
+ _loggerProxy.default.logger.warn("Meeting-info:util#getDestinationType --> ".concat(this.meetingInfoError));
252
+ throw new _parameter.default("".concat(this.meetingInfoError));
253
+ case 52:
254
+ return _context.abrupt("return", _promise.default.resolve(options));
255
+ case 53:
256
+ case "end":
257
+ return _context.stop();
167
258
  }
168
- _loggerProxy.default.logger.warn('Meeting-info:util#generateOptions --> WARN, use of Meeting Link is deprecated, please use a SIP URI instead');
169
- options.type = _constants._MEETING_LINK_;
170
- options.destination = destination;
171
- _context.next = 52;
259
+ }, _callee, this);
260
+ }));
261
+ function getDestinationType(_x) {
262
+ return _getDestinationType.apply(this, arguments);
263
+ }
264
+ return getDestinationType;
265
+ }()
266
+ /**
267
+ * Helper function to build up a correct locus url depending on the value passed
268
+ * @param {Object} options type and value to fetch meeting info
269
+ * @param {String} options.type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]
270
+ * @param {String} options.installedOrgID org ID of user's machine
271
+ * @param {Object} options.destination ?? value.value
272
+ * @returns {Object} returns an object with {resource, method}
273
+ */
274
+ }, {
275
+ key: "getRequestBody",
276
+ value: function getRequestBody(options) {
277
+ var _destination$info, _destination$info2;
278
+ var type = options.type,
279
+ destination = options.destination,
280
+ password = options.password,
281
+ captchaInfo = options.captchaInfo,
282
+ installedOrgID = options.installedOrgID,
283
+ locusId = options.locusId,
284
+ extraParams = options.extraParams;
285
+ var body = _objectSpread(_objectSpread({}, _constants.DEFAULT_MEETING_INFO_REQUEST_BODY), extraParams);
286
+ switch (type) {
287
+ case _constants._SIP_URI_:
288
+ body.sipUrl = destination;
172
289
  break;
173
- case 25:
174
- if (!MeetingInfoUtil.isSipUri(destination)) {
175
- _context.next = 30;
176
- break;
177
- }
178
- options.type = _constants._SIP_URI_;
179
- options.destination = destination;
180
- _context.next = 52;
290
+ case _constants._PERSONAL_ROOM_:
291
+ body.userId = destination.userId;
292
+ body.orgId = destination.orgId;
181
293
  break;
182
- case 30:
183
- if (!MeetingInfoUtil.isPhoneNumber(destination)) {
184
- _context.next = 35;
185
- break;
186
- }
187
- options.type = _constants._SIP_URI_;
188
- options.destination = destination;
189
- _context.next = 52;
294
+ case _constants._MEETING_ID_:
295
+ body.meetingKey = destination;
190
296
  break;
191
- case 35:
192
- if (!MeetingInfoUtil.isConversationUrl(destination, webex)) {
193
- _context.next = 40;
194
- break;
195
- }
196
- options.type = _constants._CONVERSATION_URL_;
197
- options.destination = destination;
198
- _context.next = 52;
297
+ case _constants._CONVERSATION_URL_:
298
+ body.conversationUrl = destination;
199
299
  break;
200
- case 40:
201
- if (!(hydraId && hydraId.people)) {
202
- _context.next = 45;
203
- break;
300
+ case _constants._LOCUS_ID_:
301
+ // use meetingID for the completer meeting info for the already started meeting
302
+ if ((_destination$info = destination.info) !== null && _destination$info !== void 0 && _destination$info.webExMeetingId) {
303
+ body.meetingKey = destination.info.webExMeetingId;
304
+ } else if ((_destination$info2 = destination.info) !== null && _destination$info2 !== void 0 && _destination$info2.sipUri) {
305
+ body.sipUrl = destination.info.sipUri;
204
306
  }
205
- options.type = _constants._SIP_URI_;
206
- return _context.abrupt("return", MeetingInfoUtil.getSipUriFromHydraPersonId(hydraId && hydraId.destination, webex).then(function (res) {
207
- options.destination = res;
208
-
209
- // Since hydra person ids require a unique case in which they are
210
- // entirely converted to a SIP URI, we need to set a flag for detecting
211
- // this type of destination.
212
- options.wasHydraPerson = true;
213
- return _promise.default.resolve(options);
214
- }));
215
- case 45:
216
- if (!hydraId.room) {
217
- _context.next = 50;
307
+ break;
308
+ case _constants._MEETING_LINK_:
309
+ body.meetingUrl = destination;
310
+ break;
311
+ case _constants._MEETING_UUID_:
312
+ {
313
+ body.meetingUUID = destination;
218
314
  break;
219
315
  }
220
- _loggerProxy.default.logger.error("Meeting-info:util#getDestinationType --> Using the space ID as a destination is no longer supported. Please refer to the [migration guide](https://github.com/webex/webex-js-sdk/wiki/Migration-to-Unified-Space-Meetings) to migrate to use the meeting ID or SIP address.");
221
- // Error code 30105 added as Space ID deprecated as of beta, Please refer migration guide.
222
- throw new _webexErrors.SpaceIDDeprecatedError();
223
- case 50:
224
- _loggerProxy.default.logger.warn("Meeting-info:util#getDestinationType --> ".concat(meetingInfoError));
225
- throw new _parameter.default("".concat(meetingInfoError));
226
- case 52:
227
- return _context.abrupt("return", _promise.default.resolve(options));
228
- case 53:
229
- case "end":
230
- return _context.stop();
316
+ default:
231
317
  }
232
- }, _callee);
233
- }));
234
- return function (_x) {
235
- return _ref.apply(this, arguments);
236
- };
237
- }();
238
-
239
- /**
240
- * Helper function to build up a correct locus url depending on the value passed
241
- * @param {Object} options type and value to fetch meeting info
242
- * @param {String} options.type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]
243
- * @param {String} options.installedOrgID org ID of user's machine
244
- * @param {Object} options.destination ?? value.value
245
- * @returns {Object} returns an object with {resource, method}
246
- */
247
- MeetingInfoUtil.getRequestBody = function (options) {
248
- var _destination$info, _destination$info2;
249
- var type = options.type,
250
- destination = options.destination,
251
- password = options.password,
252
- captchaInfo = options.captchaInfo,
253
- installedOrgID = options.installedOrgID,
254
- locusId = options.locusId,
255
- extraParams = options.extraParams;
256
- var body = _objectSpread(_objectSpread({}, _constants.DEFAULT_MEETING_INFO_REQUEST_BODY), extraParams);
257
- switch (type) {
258
- case _constants._SIP_URI_:
259
- body.sipUrl = destination;
260
- break;
261
- case _constants._PERSONAL_ROOM_:
262
- body.userId = destination.userId;
263
- body.orgId = destination.orgId;
264
- break;
265
- case _constants._MEETING_ID_:
266
- body.meetingKey = destination;
267
- break;
268
- case _constants._CONVERSATION_URL_:
269
- body.conversationUrl = destination;
270
- break;
271
- case _constants._LOCUS_ID_:
272
- // use meetingID for the completer meeting info for the already started meeting
273
- if ((_destination$info = destination.info) !== null && _destination$info !== void 0 && _destination$info.webExMeetingId) {
274
- body.meetingKey = destination.info.webExMeetingId;
275
- } else if ((_destination$info2 = destination.info) !== null && _destination$info2 !== void 0 && _destination$info2.sipUri) {
276
- body.sipUrl = destination.info.sipUri;
318
+ if (password) {
319
+ body.password = password;
277
320
  }
278
- break;
279
- case _constants._MEETING_LINK_:
280
- body.meetingUrl = destination;
281
- break;
282
- case _constants._MEETING_UUID_:
283
- {
284
- body.meetingUUID = destination;
285
- break;
321
+ if (captchaInfo) {
322
+ body.captchaID = captchaInfo.id;
323
+ body.captchaVerifyCode = captchaInfo.code;
286
324
  }
287
- default:
288
- }
289
- if (password) {
290
- body.password = password;
291
- }
292
- if (captchaInfo) {
293
- body.captchaID = captchaInfo.id;
294
- body.captchaVerifyCode = captchaInfo.code;
295
- }
296
- if (installedOrgID) {
297
- body.installedOrgID = installedOrgID;
298
- }
299
- if (locusId) {
300
- body.locusId = locusId;
301
- }
302
- return body;
303
- };
325
+ if (installedOrgID) {
326
+ body.installedOrgID = installedOrgID;
327
+ }
328
+ if (locusId) {
329
+ body.locusId = locusId;
330
+ }
331
+ return body;
332
+ }
304
333
 
305
- /**
306
- * Helper function to parse the webex site/host from a URI string.
307
- * @param {String} uri string (e.g. '10019857020@convergedats.webex.com')
308
- * @returns {String} the site/host part of the URI string (e.g. 'convergedats.webex.com')
309
- */
310
- MeetingInfoUtil.getWebexSite = function (uri) {
311
- var _uri$match;
312
- var exceptedDomains = ['meet.webex.com', 'meetup.webex.com', 'ciscospark.com'];
313
- var site = uri === null || uri === void 0 ? void 0 : (_uri$match = uri.match(/.+@([^.]+\.[^.]+\.[^.]+)$/)) === null || _uri$match === void 0 ? void 0 : _uri$match[1];
314
- var isExceptedDomain = !!site && exceptedDomains.some(function (domain) {
315
- return site.includes(domain);
316
- });
317
- return isExceptedDomain ? null : site;
318
- };
334
+ /**
335
+ * Helper function to parse the webex site/host from a URI string.
336
+ * @param {String} uri string (e.g. '10019857020@convergedats.webex.com')
337
+ * @returns {String} the site/host part of the URI string (e.g. 'convergedats.webex.com')
338
+ */
339
+ }, {
340
+ key: "getWebexSite",
341
+ value: function getWebexSite(uri) {
342
+ var _uri$match;
343
+ var exceptedDomains = ['meet.webex.com', 'meetup.webex.com', 'ciscospark.com'];
344
+ var site = uri === null || uri === void 0 ? void 0 : (_uri$match = uri.match(/.+@([^.]+\.[^.]+\.[^.]+)$/)) === null || _uri$match === void 0 ? void 0 : _uri$match[1];
345
+ var isExceptedDomain = !!site && exceptedDomains.some(function (domain) {
346
+ return site.includes(domain);
347
+ });
348
+ return isExceptedDomain ? null : site;
349
+ }
319
350
 
320
- /**
321
- * Helper function to return the direct URI for fetching meeting info (to avoid a redirect).
322
- * @param {Object} options type and value to fetch meeting info
323
- * @param {String} options.type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]
324
- * @param {Object} options.destination ?? value.value
325
- * @returns {String} returns a URI string or null of there is no direct URI
326
- */
327
- MeetingInfoUtil.getDirectMeetingInfoURI = function (options) {
328
- var _destination$info3;
329
- var type = options.type,
330
- destination = options.destination;
331
- var preferredWebexSite = null;
332
- switch (type) {
333
- case _constants._SIP_URI_:
334
- preferredWebexSite = MeetingInfoUtil.getWebexSite(destination);
335
- break;
336
- case _constants._LOCUS_ID_:
337
- preferredWebexSite = (_destination$info3 = destination.info) === null || _destination$info3 === void 0 ? void 0 : _destination$info3.webExSite;
338
- break;
339
- default:
340
- }
341
- return preferredWebexSite ? "https://".concat(preferredWebexSite, "/wbxappapi/v1/meetingInfo") : null;
342
- };
343
- var _default = exports.default = MeetingInfoUtil;
351
+ /**
352
+ * Helper function to return the direct URI for fetching meeting info (to avoid a redirect).
353
+ * @param {Object} options type and value to fetch meeting info
354
+ * @param {String} options.type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]
355
+ * @param {Object} options.destination ?? value.value
356
+ * @returns {String} returns a URI string or null of there is no direct URI
357
+ */
358
+ }, {
359
+ key: "getDirectMeetingInfoURI",
360
+ value: function getDirectMeetingInfoURI(options) {
361
+ var _destination$info3;
362
+ var type = options.type,
363
+ destination = options.destination;
364
+ var preferredWebexSite = null;
365
+ switch (type) {
366
+ case _constants._SIP_URI_:
367
+ preferredWebexSite = this.getWebexSite(destination);
368
+ break;
369
+ case _constants._LOCUS_ID_:
370
+ preferredWebexSite = (_destination$info3 = destination.info) === null || _destination$info3 === void 0 ? void 0 : _destination$info3.webExSite;
371
+ break;
372
+ default:
373
+ }
374
+ return preferredWebexSite ? "https://".concat(preferredWebexSite, "/wbxappapi/v1/meetingInfo") : null;
375
+ }
376
+ }]);
377
+ return MeetingInfoUtil;
378
+ }();
379
+ (0, _defineProperty2.default)(MeetingInfoUtil, "meetingInfoError", 'MeetingInfo is fetched with the meeting link, SIP URI, phone number, Hydra people ID, or a conversation URL.');
344
380
  //# sourceMappingURL=utilv2.js.map