@webex/plugin-meetings 3.0.0-beta.390 → 3.0.0-beta.392

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 (51) hide show
  1. package/dist/breakouts/breakout.js +1 -1
  2. package/dist/breakouts/index.js +1 -1
  3. package/dist/config.js +1 -0
  4. package/dist/config.js.map +1 -1
  5. package/dist/constants.js +16 -7
  6. package/dist/constants.js.map +1 -1
  7. package/dist/interpretation/index.js +1 -1
  8. package/dist/interpretation/siLanguage.js +1 -1
  9. package/dist/meeting/index.js +738 -616
  10. package/dist/meeting/index.js.map +1 -1
  11. package/dist/meeting/util.js +4 -1
  12. package/dist/meeting/util.js.map +1 -1
  13. package/dist/meeting/voicea-meeting.js +172 -0
  14. package/dist/meeting/voicea-meeting.js.map +1 -0
  15. package/dist/meeting-info/meeting-info-v2.js +9 -6
  16. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  17. package/dist/meeting-info/util.js +7 -6
  18. package/dist/meeting-info/util.js.map +1 -1
  19. package/dist/meeting-info/utilv2.js +8 -4
  20. package/dist/meeting-info/utilv2.js.map +1 -1
  21. package/dist/member/index.js +0 -1
  22. package/dist/member/index.js.map +1 -1
  23. package/dist/types/constants.d.ts +8 -2
  24. package/dist/types/meeting/index.d.ts +56 -12
  25. package/dist/types/meeting/voicea-meeting.d.ts +16 -0
  26. package/dist/webinar/index.js +1 -1
  27. package/package.json +20 -20
  28. package/src/config.ts +2 -4
  29. package/src/constants.ts +11 -2
  30. package/src/meeting/index.ts +320 -157
  31. package/src/meeting/util.ts +5 -1
  32. package/src/meeting/voicea-meeting.ts +122 -0
  33. package/src/meeting-info/meeting-info-v2.ts +5 -11
  34. package/src/meeting-info/util.ts +12 -9
  35. package/src/meeting-info/utilv2.ts +24 -14
  36. package/src/member/index.ts +0 -1
  37. package/test/integration/spec/journey.js +2 -2
  38. package/test/unit/spec/breakouts/breakout.ts +2 -1
  39. package/test/unit/spec/breakouts/index.ts +7 -4
  40. package/test/unit/spec/locus-info/index.js +27 -18
  41. package/test/unit/spec/locus-info/selfUtils.js +6 -11
  42. package/test/unit/spec/media/index.ts +5 -0
  43. package/test/unit/spec/meeting/index.js +315 -87
  44. package/test/unit/spec/meeting/utils.js +52 -10
  45. package/test/unit/spec/meeting/voicea-meeting.ts +266 -0
  46. package/test/unit/spec/meeting-info/meetinginfov2.js +20 -15
  47. package/test/unit/spec/meetings/index.js +78 -10
  48. package/test/unit/spec/metrics/index.js +1 -2
  49. package/test/unit/spec/multistream/mediaRequestManager.ts +1 -0
  50. package/test/unit/spec/recording-controller/index.js +0 -1
  51. package/test/unit/spec/roap/turnDiscovery.ts +1 -1
@@ -15,6 +15,8 @@ var _common = require("@webex/common");
15
15
  var _parameter = _interopRequireDefault(require("../common/errors/parameter"));
16
16
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
17
17
  var _constants = require("../constants");
18
+ // @ts-ignore
19
+
18
20
  var MeetingInfoUtil = {};
19
21
  MeetingInfoUtil.extractDestination = function (destination, type) {
20
22
  var dest = destination;
@@ -131,7 +133,7 @@ MeetingInfoUtil.getSipUriFromHydraPersonId = function (destination, webex) {
131
133
  };
132
134
  MeetingInfoUtil.generateOptions = /*#__PURE__*/function () {
133
135
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(from) {
134
- var destination, type, webex, options, hydraId, conversationUrl;
136
+ var destination, type, webex, options, hydraId, serviceUrl;
135
137
  return _regenerator.default.wrap(function _callee$(_context) {
136
138
  while (1) switch (_context.prev = _context.next) {
137
139
  case 0:
@@ -208,11 +210,10 @@ MeetingInfoUtil.generateOptions = /*#__PURE__*/function () {
208
210
  _context.next = 36;
209
211
  return webex.internal.services.waitForCatalog('postauth');
210
212
  case 36:
211
- conversationUrl = webex.internal.conversation.getUrlFromClusterId({
212
- cluster: hydraId.cluster,
213
- id: hydraId.destination
214
- });
215
- options.destination = conversationUrl;
213
+ serviceUrl = webex.internal.services.getServiceUrlFromClusterId({
214
+ cluster: hydraId.cluster
215
+ }, webex);
216
+ options.destination = hydraId.destination ? "".concat(serviceUrl, "/conversations/").concat(hydraId.destination) : serviceUrl;
216
217
  _context.next = 44;
217
218
  break;
218
219
  case 40:
@@ -1 +1 @@
1
- {"version":3,"names":["MeetingInfoUtil","extractDestination","destination","type","dest","_LOCUS_ID_","url","ParameterError","getParsedUrl","link","parsedUrl","parse","protocol","HTTPS_PROTOCOL","error","LoggerProxy","logger","warn","isMeetingLink","value","hostNameBool","hostname","includes","WEBEX_DOT_COM","pathNameBool","pathname","MEET","MEET_M","JOIN","isConversationUrl","webex","clusterId","internal","services","getClusterId","endsWith","CONVERSATION_SERVICE","convertLinkToSip","user","userIndex","lastIndexOf","substring","company","companyIndex","replace","WWW_DOT","isSipUri","sipString","sipUri","DIALER_REGEX","SIP_ADDRESS","exec","isPhoneNumber","phoneNumber","isValidNumber","PHONE_NUMBER","test","getHydraId","deconstructHydraId","id","cluster","UUID_REG","_ROOM_","room","_PEOPLE_","people","getSipUriFromHydraPersonId","get","then","res","emails","length","catch","err","generateOptions","from","options","hydraId","_MEETING_LINK_","_SIP_URI_","_CONVERSATION_URL_","wasHydraPerson","resolve","waitForCatalog","conversationUrl","conversation","getUrlFromClusterId","getResourceUrl","resource","LOCI","MEETINGINFO","method","HTTP_VERBS","GET","uri","_PERSONAL_ROOM_","_MEETING_ID_","encodeURIComponent","TYPE","USE_URI_LOOKUP_FALSE","PUT","btoa","getRequestParams","resourceOptions","api","requestParams","concat","ALTERNATE_REDIRECT_TRUE","body","lookupType"],"sources":["util.ts"],"sourcesContent":["import url from 'url';\n\nimport btoa from 'btoa';\nimport {\n // @ts-ignore\n deconstructHydraId,\n} from '@webex/common';\n\nimport ParameterError from '../common/errors/parameter';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {\n _SIP_URI_,\n _PERSONAL_ROOM_,\n _MEETING_ID_,\n _CONVERSATION_URL_,\n _LOCUS_ID_,\n _MEETING_LINK_,\n _PEOPLE_,\n _ROOM_,\n HTTP_VERBS,\n USE_URI_LOOKUP_FALSE,\n TYPE,\n LOCI,\n MEETINGINFO,\n ALTERNATE_REDIRECT_TRUE,\n DIALER_REGEX,\n WEBEX_DOT_COM,\n CONVERSATION_SERVICE,\n WWW_DOT,\n JOIN,\n MEET,\n MEET_M,\n HTTPS_PROTOCOL,\n UUID_REG,\n} from '../constants';\n\nconst MeetingInfoUtil: any = {};\n\nMeetingInfoUtil.extractDestination = (destination, type) => {\n let dest = destination;\n\n if (type === _LOCUS_ID_) {\n if (!(destination && destination.url)) {\n throw new ParameterError('You cannot create a meeting by locus without a locus.url defined');\n }\n dest = destination.url;\n }\n\n return dest;\n};\n\nMeetingInfoUtil.getParsedUrl = (link) => {\n try {\n let parsedUrl = url.parse(link);\n\n if (!parsedUrl) {\n return false;\n }\n // hack for links such as <company>.webex.com/meet/<user> without a protocol\n if (!parsedUrl.protocol) {\n parsedUrl = url.parse(`${HTTPS_PROTOCOL}${link}`);\n }\n\n return parsedUrl;\n } catch (error) {\n LoggerProxy.logger.warn(\n `Meeting-info:util#getParsedUrl --> unable to parse the URL, error: ${error}`\n );\n\n return null;\n }\n};\n\n/**\n * Helper function to check if a string matches a known meeting link pattern\n * @param {String} value string to parse and see if it matches a meeting link\n * @returns {Boolean}\n */\nMeetingInfoUtil.isMeetingLink = (value: string) => {\n const parsedUrl = MeetingInfoUtil.getParsedUrl(value);\n const hostNameBool = parsedUrl.hostname && parsedUrl.hostname.includes(WEBEX_DOT_COM);\n const pathNameBool =\n parsedUrl.pathname &&\n (parsedUrl.pathname.includes(`/${MEET}`) ||\n parsedUrl.pathname.includes(`/${MEET_M}`) ||\n parsedUrl.pathname.includes(`/${JOIN}`));\n\n return hostNameBool && pathNameBool;\n};\n\nMeetingInfoUtil.isConversationUrl = (value, webex) => {\n const clusterId = webex.internal.services.getClusterId(value);\n\n if (clusterId) {\n return clusterId.endsWith(CONVERSATION_SERVICE);\n }\n\n return false;\n};\n\nMeetingInfoUtil.convertLinkToSip = (value) => {\n const parsedUrl = MeetingInfoUtil.getParsedUrl(value);\n\n if (!parsedUrl) {\n return null;\n }\n let user;\n\n if (parsedUrl.pathname) {\n const userIndex = parsedUrl.pathname.lastIndexOf('/');\n\n user = parsedUrl.pathname.substring(userIndex + 1);\n }\n if (!user) {\n return null;\n }\n let company;\n\n if (parsedUrl.hostname) {\n const companyIndex = parsedUrl.hostname.lastIndexOf(`.${WEBEX_DOT_COM}`);\n\n company = parsedUrl.hostname.substring(0, companyIndex).replace(WWW_DOT, '');\n }\n if (!company) {\n return null;\n }\n\n return `${user}@${company}.${WEBEX_DOT_COM}`;\n};\n\nMeetingInfoUtil.isSipUri = (sipString) => {\n // TODO: lets remove regex from this equation and user URI matchers and such\n // have not found a great sip uri parser library as of now\n const sipUri = DIALER_REGEX.SIP_ADDRESS.exec(sipString);\n\n return sipUri;\n};\n\nMeetingInfoUtil.isPhoneNumber = (phoneNumber) => {\n const isValidNumber = DIALER_REGEX.PHONE_NUMBER.test(phoneNumber);\n\n return isValidNumber;\n};\n\nMeetingInfoUtil.getHydraId = (destination) => {\n const {type, id, cluster} = deconstructHydraId(destination);\n\n if (id && UUID_REG.test(id)) {\n if (type === _ROOM_) {\n return {room: true, destination: id, cluster};\n }\n if (type === _PEOPLE_) {\n return {people: true, destination: id, cluster};\n }\n\n return {};\n }\n\n return {};\n};\n\nMeetingInfoUtil.getSipUriFromHydraPersonId = (destination, webex) =>\n webex.people\n .get(destination)\n .then((res) => {\n if (res.emails && res.emails.length) {\n return res.emails[0];\n }\n throw new ParameterError('Hydra Id Lookup was an invalid hydra person id.');\n })\n .catch((err) => {\n LoggerProxy.logger.error(\n `Meeting-info:util#MeetingInfoUtil.getSipUriFromHydraPersonId --> getSipUriFromHydraPersonId ${err} `\n );\n throw err;\n });\n\nMeetingInfoUtil.generateOptions = async (from) => {\n const {destination, type, webex} = from;\n\n if (type) {\n return {\n destination,\n type,\n };\n }\n const options: any = {};\n const hydraId = MeetingInfoUtil.getHydraId(destination);\n\n if (MeetingInfoUtil.isMeetingLink(destination)) {\n LoggerProxy.logger.warn(\n 'Meeting-info:util#generateOptions --> WARN, use of Meeting Link is deprecated, please use a SIP URI instead'\n );\n\n options.type = _MEETING_LINK_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isSipUri(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isPhoneNumber(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isConversationUrl(destination, webex)) {\n options.type = _CONVERSATION_URL_;\n options.destination = destination;\n } else if (hydraId.people) {\n options.type = _SIP_URI_;\n\n return MeetingInfoUtil.getSipUriFromHydraPersonId(hydraId.destination, webex).then((res) => {\n options.destination = res;\n\n // Since hydra person ids require a unique case in which they are\n // entirely converted to a SIP URI, we need to set a flag for detecting\n // this type of destination.\n options.wasHydraPerson = true;\n\n return Promise.resolve(options);\n });\n } else if (hydraId.room) {\n options.type = _CONVERSATION_URL_;\n try {\n await webex.internal.services.waitForCatalog('postauth');\n\n const conversationUrl = webex.internal.conversation.getUrlFromClusterId({\n cluster: hydraId.cluster,\n id: hydraId.destination,\n });\n\n options.destination = conversationUrl;\n } catch (e) {\n LoggerProxy.logger.error(`Meeting-info:util#generateOptions --> ${e}`);\n throw e;\n }\n } else {\n throw new ParameterError(\n 'MeetingInfo is fetched with the meeting link, SIP URI, phone number, Hydra people ID, or a conversation URL.'\n );\n }\n\n return Promise.resolve(options);\n};\n\n/**\n * Helper function to build up a correct locus url depending on the value passed\n * @param {String} type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]\n * @param {Object} value ?? value.value\n * @returns {Object} returns an object with {resource, method}\n */\nMeetingInfoUtil.getResourceUrl = (type: string, value: any) => {\n let resource = `/${LOCI}/${MEETINGINFO}`;\n let method = HTTP_VERBS.GET;\n let uri = null;\n\n switch (type) {\n case _SIP_URI_:\n case _PERSONAL_ROOM_:\n case _MEETING_ID_:\n resource = `/${LOCI}/${MEETINGINFO}/${encodeURIComponent(\n value\n )}?${TYPE}=${type}&${USE_URI_LOOKUP_FALSE}`;\n break;\n case _CONVERSATION_URL_:\n method = HTTP_VERBS.PUT;\n break;\n case _LOCUS_ID_:\n uri = `${value}/${MEETINGINFO}`;\n method = HTTP_VERBS.PUT;\n break;\n case _MEETING_LINK_:\n resource = `$/${LOCI}/${MEETINGINFO}/${btoa(\n value\n )}?${TYPE}=${_MEETING_LINK_}&${USE_URI_LOOKUP_FALSE}`;\n break;\n default:\n }\n\n return {\n uri,\n resource,\n method,\n };\n};\n\nMeetingInfoUtil.getRequestParams = (resourceOptions, type, value, api) => {\n let requestParams: any = {\n method: resourceOptions.method,\n api,\n resource: resourceOptions.resource,\n };\n\n if (resourceOptions.method === HTTP_VERBS.GET) {\n // for handling URL redirections\n requestParams.resource = requestParams.resource.concat(`&${ALTERNATE_REDIRECT_TRUE}`);\n } else if (type !== _LOCUS_ID_) {\n // locus id check is a PUT not sure why\n requestParams.resource = requestParams.resource.concat(`?${ALTERNATE_REDIRECT_TRUE}`);\n requestParams.body = {\n value,\n lookupType: type,\n };\n } else if (type === _LOCUS_ID_) {\n requestParams = {\n method: resourceOptions.method,\n uri: resourceOptions.uri,\n };\n }\n\n return requestParams;\n};\n\nexport default MeetingInfoUtil;\n"],"mappings":";;;;;;;;;;;AAAA;AAEA;AACA;AAKA;AACA;AACA;AA0BA,IAAMA,eAAoB,GAAG,CAAC,CAAC;AAE/BA,eAAe,CAACC,kBAAkB,GAAG,UAACC,WAAW,EAAEC,IAAI,EAAK;EAC1D,IAAIC,IAAI,GAAGF,WAAW;EAEtB,IAAIC,IAAI,KAAKE,qBAAU,EAAE;IACvB,IAAI,EAAEH,WAAW,IAAIA,WAAW,CAACI,GAAG,CAAC,EAAE;MACrC,MAAM,IAAIC,kBAAc,CAAC,kEAAkE,CAAC;IAC9F;IACAH,IAAI,GAAGF,W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ACH,CAAC,MAAM,IAAIA,IAAI,KAAKE,qBAAU,EAAE;IAC9BoG,aAAa,GAAG;MACdd,MAAM,EAAEY,eAAe,CAACZ,MAAM;MAC9BG,GAAG,EAAES,eAAe,CAACT;IACvB,CAAC;EACH;EAEA,OAAOW,aAAa;AACtB,CAAC;AAAC,eAEazG,eAAe;AAAA"}
1
+ {"version":3,"names":["MeetingInfoUtil","extractDestination","destination","type","dest","_LOCUS_ID_","url","ParameterError","getParsedUrl","link","parsedUrl","parse","protocol","HTTPS_PROTOCOL","error","LoggerProxy","logger","warn","isMeetingLink","value","hostNameBool","hostname","includes","WEBEX_DOT_COM","pathNameBool","pathname","MEET","MEET_M","JOIN","isConversationUrl","webex","clusterId","internal","services","getClusterId","endsWith","CONVERSATION_SERVICE","convertLinkToSip","user","userIndex","lastIndexOf","substring","company","companyIndex","replace","WWW_DOT","isSipUri","sipString","sipUri","DIALER_REGEX","SIP_ADDRESS","exec","isPhoneNumber","phoneNumber","isValidNumber","PHONE_NUMBER","test","getHydraId","deconstructHydraId","id","cluster","UUID_REG","_ROOM_","room","_PEOPLE_","people","getSipUriFromHydraPersonId","get","then","res","emails","length","catch","err","generateOptions","from","options","hydraId","_MEETING_LINK_","_SIP_URI_","_CONVERSATION_URL_","wasHydraPerson","resolve","waitForCatalog","serviceUrl","getServiceUrlFromClusterId","getResourceUrl","resource","LOCI","MEETINGINFO","method","HTTP_VERBS","GET","uri","_PERSONAL_ROOM_","_MEETING_ID_","encodeURIComponent","TYPE","USE_URI_LOOKUP_FALSE","PUT","btoa","getRequestParams","resourceOptions","api","requestParams","concat","ALTERNATE_REDIRECT_TRUE","body","lookupType"],"sources":["util.ts"],"sourcesContent":["import url from 'url';\n\nimport btoa from 'btoa';\n// @ts-ignore\nimport {deconstructHydraId} from '@webex/common';\n\nimport ParameterError from '../common/errors/parameter';\nimport LoggerProxy from '../common/logs/logger-proxy';\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 HTTP_VERBS,\n USE_URI_LOOKUP_FALSE,\n TYPE,\n LOCI,\n MEETINGINFO,\n ALTERNATE_REDIRECT_TRUE,\n DIALER_REGEX,\n WEBEX_DOT_COM,\n CONVERSATION_SERVICE,\n WWW_DOT,\n JOIN,\n MEET,\n MEET_M,\n HTTPS_PROTOCOL,\n UUID_REG,\n} from '../constants';\n\nconst MeetingInfoUtil: any = {};\n\nMeetingInfoUtil.extractDestination = (destination, type) => {\n let dest = destination;\n\n if (type === _LOCUS_ID_) {\n if (!(destination && destination.url)) {\n throw new ParameterError('You cannot create a meeting by locus without a locus.url defined');\n }\n dest = destination.url;\n }\n\n return dest;\n};\n\nMeetingInfoUtil.getParsedUrl = (link) => {\n try {\n let parsedUrl = url.parse(link);\n\n if (!parsedUrl) {\n return false;\n }\n // hack for links such as <company>.webex.com/meet/<user> without a protocol\n if (!parsedUrl.protocol) {\n parsedUrl = url.parse(`${HTTPS_PROTOCOL}${link}`);\n }\n\n return parsedUrl;\n } catch (error) {\n LoggerProxy.logger.warn(\n `Meeting-info:util#getParsedUrl --> unable to parse the URL, error: ${error}`\n );\n\n return null;\n }\n};\n\n/**\n * Helper function to check if a string matches a known meeting link pattern\n * @param {String} value string to parse and see if it matches a meeting link\n * @returns {Boolean}\n */\nMeetingInfoUtil.isMeetingLink = (value: string) => {\n const parsedUrl = MeetingInfoUtil.getParsedUrl(value);\n const hostNameBool = parsedUrl.hostname && parsedUrl.hostname.includes(WEBEX_DOT_COM);\n const pathNameBool =\n parsedUrl.pathname &&\n (parsedUrl.pathname.includes(`/${MEET}`) ||\n parsedUrl.pathname.includes(`/${MEET_M}`) ||\n parsedUrl.pathname.includes(`/${JOIN}`));\n\n return hostNameBool && pathNameBool;\n};\n\nMeetingInfoUtil.isConversationUrl = (value, webex) => {\n const clusterId = webex.internal.services.getClusterId(value);\n\n if (clusterId) {\n return clusterId.endsWith(CONVERSATION_SERVICE);\n }\n\n return false;\n};\n\nMeetingInfoUtil.convertLinkToSip = (value) => {\n const parsedUrl = MeetingInfoUtil.getParsedUrl(value);\n\n if (!parsedUrl) {\n return null;\n }\n let user;\n\n if (parsedUrl.pathname) {\n const userIndex = parsedUrl.pathname.lastIndexOf('/');\n\n user = parsedUrl.pathname.substring(userIndex + 1);\n }\n if (!user) {\n return null;\n }\n let company;\n\n if (parsedUrl.hostname) {\n const companyIndex = parsedUrl.hostname.lastIndexOf(`.${WEBEX_DOT_COM}`);\n\n company = parsedUrl.hostname.substring(0, companyIndex).replace(WWW_DOT, '');\n }\n if (!company) {\n return null;\n }\n\n return `${user}@${company}.${WEBEX_DOT_COM}`;\n};\n\nMeetingInfoUtil.isSipUri = (sipString) => {\n // TODO: lets remove regex from this equation and user URI matchers and such\n // have not found a great sip uri parser library as of now\n const sipUri = DIALER_REGEX.SIP_ADDRESS.exec(sipString);\n\n return sipUri;\n};\n\nMeetingInfoUtil.isPhoneNumber = (phoneNumber) => {\n const isValidNumber = DIALER_REGEX.PHONE_NUMBER.test(phoneNumber);\n\n return isValidNumber;\n};\n\nMeetingInfoUtil.getHydraId = (destination) => {\n const {type, id, cluster} = deconstructHydraId(destination);\n\n if (id && UUID_REG.test(id)) {\n if (type === _ROOM_) {\n return {room: true, destination: id, cluster};\n }\n if (type === _PEOPLE_) {\n return {people: true, destination: id, cluster};\n }\n\n return {};\n }\n\n return {};\n};\n\nMeetingInfoUtil.getSipUriFromHydraPersonId = (destination, webex) =>\n webex.people\n .get(destination)\n .then((res) => {\n if (res.emails && res.emails.length) {\n return res.emails[0];\n }\n throw new ParameterError('Hydra Id Lookup was an invalid hydra person id.');\n })\n .catch((err) => {\n LoggerProxy.logger.error(\n `Meeting-info:util#MeetingInfoUtil.getSipUriFromHydraPersonId --> getSipUriFromHydraPersonId ${err} `\n );\n throw err;\n });\n\nMeetingInfoUtil.generateOptions = async (from) => {\n const {destination, type, webex} = from;\n\n if (type) {\n return {\n destination,\n type,\n };\n }\n const options: any = {};\n const hydraId = MeetingInfoUtil.getHydraId(destination);\n\n if (MeetingInfoUtil.isMeetingLink(destination)) {\n LoggerProxy.logger.warn(\n 'Meeting-info:util#generateOptions --> WARN, use of Meeting Link is deprecated, please use a SIP URI instead'\n );\n\n options.type = _MEETING_LINK_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isSipUri(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isPhoneNumber(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isConversationUrl(destination, webex)) {\n options.type = _CONVERSATION_URL_;\n options.destination = destination;\n } else if (hydraId.people) {\n options.type = _SIP_URI_;\n\n return MeetingInfoUtil.getSipUriFromHydraPersonId(hydraId.destination, webex).then((res) => {\n options.destination = res;\n\n // Since hydra person ids require a unique case in which they are\n // entirely converted to a SIP URI, we need to set a flag for detecting\n // this type of destination.\n options.wasHydraPerson = true;\n\n return Promise.resolve(options);\n });\n } else if (hydraId.room) {\n options.type = _CONVERSATION_URL_;\n try {\n await webex.internal.services.waitForCatalog('postauth');\n\n const serviceUrl = webex.internal.services.getServiceUrlFromClusterId(\n {\n cluster: hydraId.cluster,\n },\n webex\n );\n\n options.destination = hydraId.destination\n ? `${serviceUrl}/conversations/${hydraId.destination}`\n : serviceUrl;\n } catch (e) {\n LoggerProxy.logger.error(`Meeting-info:util#generateOptions --> ${e}`);\n throw e;\n }\n } else {\n throw new ParameterError(\n 'MeetingInfo is fetched with the meeting link, SIP URI, phone number, Hydra people ID, or a conversation URL.'\n );\n }\n\n return Promise.resolve(options);\n};\n\n/**\n * Helper function to build up a correct locus url depending on the value passed\n * @param {String} type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]\n * @param {Object} value ?? value.value\n * @returns {Object} returns an object with {resource, method}\n */\nMeetingInfoUtil.getResourceUrl = (type: string, value: any) => {\n let resource = `/${LOCI}/${MEETINGINFO}`;\n let method = HTTP_VERBS.GET;\n let uri = null;\n\n switch (type) {\n case _SIP_URI_:\n case _PERSONAL_ROOM_:\n case _MEETING_ID_:\n resource = `/${LOCI}/${MEETINGINFO}/${encodeURIComponent(\n value\n )}?${TYPE}=${type}&${USE_URI_LOOKUP_FALSE}`;\n break;\n case _CONVERSATION_URL_:\n method = HTTP_VERBS.PUT;\n break;\n case _LOCUS_ID_:\n uri = `${value}/${MEETINGINFO}`;\n method = HTTP_VERBS.PUT;\n break;\n case _MEETING_LINK_:\n resource = `$/${LOCI}/${MEETINGINFO}/${btoa(\n value\n )}?${TYPE}=${_MEETING_LINK_}&${USE_URI_LOOKUP_FALSE}`;\n break;\n default:\n }\n\n return {\n uri,\n resource,\n method,\n };\n};\n\nMeetingInfoUtil.getRequestParams = (resourceOptions, type, value, api) => {\n let requestParams: any = {\n method: resourceOptions.method,\n api,\n resource: resourceOptions.resource,\n };\n\n if (resourceOptions.method === HTTP_VERBS.GET) {\n // for handling URL redirections\n requestParams.resource = requestParams.resource.concat(`&${ALTERNATE_REDIRECT_TRUE}`);\n } else if (type !== _LOCUS_ID_) {\n // locus id check is a PUT not sure why\n requestParams.resource = requestParams.resource.concat(`?${ALTERNATE_REDIRECT_TRUE}`);\n requestParams.body = {\n value,\n lookupType: type,\n };\n } else if (type === _LOCUS_ID_) {\n requestParams = {\n method: resourceOptions.method,\n uri: resourceOptions.uri,\n };\n }\n\n return requestParams;\n};\n\nexport default MeetingInfoUtil;\n"],"mappings":";;;;;;;;;;;AAAA;AAEA;AAEA;AAEA;AACA;AAEA;AANA;;AAgCA,IAAMA,eAAoB,GAAG,CAAC,CAAC;AAE/BA,eAAe,CAACC,kBAAkB,GAAG,UAACC,WAAW,EAAEC,IAAI,EAAK;EAC1D,IAAIC,IAAI,GAAGF,WAAW;EAEtB,IAAIC,IAAI,KAAKE,qBAAU,EAAE;IACvB,IAAI,EAAEH,WAAW,IAAIA,WAAW,CAACI,GAAG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,CAACkB,MAAM,YAAKC,kCAAuB,EAAG;IACrFF,aAAa,CAACG,IAAI,GAAG;MACnBxF,KAAK,EAALA,KAAK;MACLyF,UAAU,EAAEzG;IACd,CAAC;EACH,CAAC,MAAM,IAAIA,IAAI,KAAKE,qBAAU,EAAE;IAC9BmG,aAAa,GAAG;MACdd,MAAM,EAAEY,eAAe,CAACZ,MAAM;MAC9BG,GAAG,EAAES,eAAe,CAACT;IACvB,CAAC;EACH;EAEA,OAAOW,aAAa;AACtB,CAAC;AAAC,eAEaxG,eAAe;AAAA"}
@@ -50,7 +50,7 @@ MeetingInfoUtil.getParsedUrl = function (link) {
50
50
  MeetingInfoUtil.isMeetingLink = function (value) {
51
51
  var parsedUrl = MeetingInfoUtil.getParsedUrl(value);
52
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.JOIN)));
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
54
  return hostNameBool && pathNameBool;
55
55
  };
56
56
  MeetingInfoUtil.isConversationUrl = function (value, webex) {
@@ -156,7 +156,11 @@ MeetingInfoUtil.getDestinationType = /*#__PURE__*/function () {
156
156
  });
157
157
  case 17:
158
158
  options = {};
159
- hydraId = MeetingInfoUtil.getHydraId(destination);
159
+ if (webex && webex.config && webex.config.meetings && webex.config.meetings.disableHydraId) {
160
+ hydraId = null;
161
+ } else {
162
+ hydraId = MeetingInfoUtil.getHydraId(destination);
163
+ }
160
164
  if (!MeetingInfoUtil.isMeetingLink(destination)) {
161
165
  _context.next = 25;
162
166
  break;
@@ -194,12 +198,12 @@ MeetingInfoUtil.getDestinationType = /*#__PURE__*/function () {
194
198
  _context.next = 52;
195
199
  break;
196
200
  case 40:
197
- if (!hydraId.people) {
201
+ if (!(hydraId && hydraId.people)) {
198
202
  _context.next = 45;
199
203
  break;
200
204
  }
201
205
  options.type = _constants._SIP_URI_;
202
- return _context.abrupt("return", MeetingInfoUtil.getSipUriFromHydraPersonId(hydraId.destination, webex).then(function (res) {
206
+ return _context.abrupt("return", MeetingInfoUtil.getSipUriFromHydraPersonId(hydraId && hydraId.destination, webex).then(function (res) {
203
207
  options.destination = res;
204
208
 
205
209
  // Since hydra person ids require a unique case in which they are
@@ -1 +1 @@
1
- {"version":3,"names":["MeetingInfoUtil","meetingInfoError","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","deconstructHydraId","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","SpaceIDDeprecatedError","getRequestBody","password","captchaInfo","installedOrgID","locusId","extraParams","body","DEFAULT_MEETING_INFO_REQUEST_BODY","sipUrl","_MEETING_ID_","meetingKey","conversationUrl","_LOCUS_ID_","info","webExMeetingId","meetingUrl","_MEETING_UUID_","meetingUUID","captchaID","captchaVerifyCode","code","getWebexSite","uri","exceptedDomains","site","match","getDirectMeetingInfoURI","preferredWebexSite","webExSite"],"sources":["utilv2.ts"],"sourcesContent":["import url from 'url';\n\nimport {\n // @ts-ignore\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 DEFAULT_MEETING_INFO_REQUEST_BODY,\n} from '../constants';\nimport ParameterError from '../common/errors/parameter';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {SpaceIDDeprecatedError} from '../common/errors/webex-errors';\n\nconst MeetingInfoUtil: any = {};\nconst meetingInfoError =\n 'MeetingInfo is fetched with the meeting link, SIP URI, phone number, Hydra people ID, or a conversation URL.';\n\nMeetingInfoUtil.getParsedUrl = (link) => {\n try {\n let parsedUrl = url.parse(link);\n\n if (!parsedUrl) {\n return false;\n }\n // hack for links such as <company>.webex.com/meet/<user> without a protocol\n if (!parsedUrl.protocol) {\n parsedUrl = url.parse(`${HTTPS_PROTOCOL}${link}`);\n }\n\n return parsedUrl;\n } catch (error) {\n LoggerProxy.logger.warn(\n `Meeting-info:util#getParsedUrl --> unable to parse the URL, error: ${error}`\n );\n\n return null;\n }\n};\n\n/**\n * Helper function to check if a string matches a known meeting link pattern\n * @param {String} value string to parse and see if it matches a meeting link\n * @returns {Boolean}\n */\nMeetingInfoUtil.isMeetingLink = (value: string) => {\n const parsedUrl = MeetingInfoUtil.getParsedUrl(value);\n const hostNameBool = parsedUrl.hostname && parsedUrl.hostname.includes(WEBEX_DOT_COM);\n const pathNameBool =\n parsedUrl.pathname &&\n (parsedUrl.pathname.includes(`/${MEET}`) ||\n parsedUrl.pathname.includes(`/${MEET_M}`) ||\n parsedUrl.pathname.includes(`/${JOIN}`));\n\n return hostNameBool && pathNameBool;\n};\n\nMeetingInfoUtil.isConversationUrl = (value, webex) => {\n const clusterId = webex.internal.services.getClusterId(value);\n\n if (clusterId) {\n return clusterId.endsWith(CONVERSATION_SERVICE);\n }\n\n return false;\n};\n\nMeetingInfoUtil.isSipUri = (sipString) => {\n // TODO: lets remove regex from this equation and user URI matchers and such\n // have not found a great sip uri parser library as of now\n const sipUri = DIALER_REGEX.SIP_ADDRESS.exec(sipString);\n\n return sipUri;\n};\n\nMeetingInfoUtil.isPhoneNumber = (phoneNumber) => {\n const isValidNumber = DIALER_REGEX.PHONE_NUMBER.test(phoneNumber);\n\n return isValidNumber;\n};\n\nMeetingInfoUtil.getHydraId = (destination) => {\n const {type, id, cluster} = deconstructHydraId(destination);\n\n if (id && UUID_REG.test(id)) {\n if (type === _ROOM_) {\n return {room: true, destination: id, cluster};\n }\n if (type === _PEOPLE_) {\n return {people: true, destination: id, cluster};\n }\n\n return {};\n }\n\n return {};\n};\n\nMeetingInfoUtil.getSipUriFromHydraPersonId = (destination, webex) =>\n webex.people\n .get(destination)\n .then((res) => {\n if (res.emails && res.emails.length) {\n return res.emails[0];\n }\n throw new ParameterError('Hydra Id Lookup was an invalid hydra person id.');\n })\n .catch((err) => {\n LoggerProxy.logger.error(\n `Meeting-info:util#MeetingInfoUtil.getSipUriFromHydraPersonId --> getSipUriFromHydraPersonId ${err} `\n );\n throw err;\n });\n\nMeetingInfoUtil.getDestinationType = async (from) => {\n const {type, webex} = from;\n let {destination} = from;\n\n if (type === _PERSONAL_ROOM_) {\n // this case checks if your type is personal room\n if (!destination) {\n // 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 } else {\n const options = VALID_EMAIL_ADDRESS.test(destination)\n ? {email: destination}\n : {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: any = {};\n const hydraId = MeetingInfoUtil.getHydraId(destination);\n\n if (MeetingInfoUtil.isMeetingLink(destination)) {\n LoggerProxy.logger.warn(\n 'Meeting-info:util#generateOptions --> WARN, use of Meeting Link is deprecated, please use a SIP URI instead'\n );\n\n options.type = _MEETING_LINK_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isSipUri(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isPhoneNumber(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isConversationUrl(destination, webex)) {\n options.type = _CONVERSATION_URL_;\n options.destination = destination;\n } else if (hydraId.people) {\n options.type = _SIP_URI_;\n\n return MeetingInfoUtil.getSipUriFromHydraPersonId(hydraId.destination, webex).then((res) => {\n options.destination = res;\n\n // Since hydra person ids require a unique case in which they are\n // entirely converted to a SIP URI, we need to set a flag for detecting\n // this type of destination.\n options.wasHydraPerson = true;\n\n return Promise.resolve(options);\n });\n } else if (hydraId.room) {\n LoggerProxy.logger.error(\n `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.`\n );\n // Error code 30105 added as Space ID deprecated as of beta, Please refer migration guide.\n throw new SpaceIDDeprecatedError();\n } else {\n LoggerProxy.logger.warn(`Meeting-info:util#getDestinationType --> ${meetingInfoError}`);\n throw new ParameterError(`${meetingInfoError}`);\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 {String} options.installedOrgID org ID of user's machine\n * @param {Object} options.destination ?? value.value\n * @returns {Object} returns an object with {resource, method}\n */\nMeetingInfoUtil.getRequestBody = (options: {type: string; destination: object} | any) => {\n const {type, destination, password, captchaInfo, installedOrgID, locusId, extraParams} = options;\n const body: any = {\n ...DEFAULT_MEETING_INFO_REQUEST_BODY,\n ...extraParams,\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 } 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 if (installedOrgID) {\n body.installedOrgID = installedOrgID;\n }\n\n if (locusId) {\n body.locusId = locusId;\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: string) => {\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: {type: string; destination: any}) => {\n const {type, destination} = 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"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAEA;AAKA;AAqBA;AACA;AACA;AAAqE;AAAA;AAErE,IAAMA,eAAoB,GAAG,CAAC,CAAC;AAC/B,IAAMC,gBAAgB,GACpB,8GAA8G;AAEhHD,eAAe,CAACE,YAAY,GAAG,UAACC,IAAI,EAAK;EACvC,IAAI;IACF,IAAIC,SAAS,GAAGC,YAAG,CAACC,KAAK,CAACH,IAAI,CAAC;IAE/B,IAAI,CAACC,SAAS,EAAE;MACd,OAAO,KAAK;IACd;IACA;IACA,IAAI,CAACA,SAAS,CAACG,QAAQ,EAAE;MACvBH,SAAS,GAAGC,YAAG,CAACC,KAAK,WAAIE,yBAAc,SAAGL,IAAI,EAAG;IACnD;IAEA,OAAOC,SAAS;EAClB,CAAC,CAAC,OAAOK,KAAK,EAAE;IACdC,oBAAW,CAACC,MAAM,CAACC,IAAI,8EACiDH,KAAK,EAC5E;IAED,OAAO,IAAI;EACb;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACAT,eAAe,CAACa,aAAa,GAAG,UAACC,KAAa,EAAK;EACjD,IAAMV,SAAS,GAAGJ,eAAe,CAACE,YAAY,CAACY,KAAK,CAAC;EACrD,IAAMC,YAAY,GAAGX,SAAS,CAACY,QAAQ,IAAIZ,SAAS,CAACY,QAAQ,CAACC,QAAQ,CAACC,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InfoUtil","meetingInfoError","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","MEET_CISCO","MEET_CO","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","deconstructHydraId","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","config","meetings","disableHydraId","hydraId","_MEETING_LINK_","_SIP_URI_","_CONVERSATION_URL_","wasHydraPerson","resolve","SpaceIDDeprecatedError","getRequestBody","password","captchaInfo","installedOrgID","locusId","extraParams","body","DEFAULT_MEETING_INFO_REQUEST_BODY","sipUrl","_MEETING_ID_","meetingKey","conversationUrl","_LOCUS_ID_","info","webExMeetingId","meetingUrl","_MEETING_UUID_","meetingUUID","captchaID","captchaVerifyCode","code","getWebexSite","uri","exceptedDomains","site","match","getDirectMeetingInfoURI","preferredWebexSite","webExSite"],"sources":["utilv2.ts"],"sourcesContent":["import url from 'url';\n\n// @ts-ignore\nimport {deconstructHydraId} 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 MEET_CISCO,\n MEET_CO,\n HTTPS_PROTOCOL,\n UUID_REG,\n VALID_EMAIL_ADDRESS,\n DEFAULT_MEETING_INFO_REQUEST_BODY,\n} from '../constants';\nimport ParameterError from '../common/errors/parameter';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {SpaceIDDeprecatedError} from '../common/errors/webex-errors';\n\nconst MeetingInfoUtil: any = {};\nconst meetingInfoError =\n 'MeetingInfo is fetched with the meeting link, SIP URI, phone number, Hydra people ID, or a conversation URL.';\n\nMeetingInfoUtil.getParsedUrl = (link) => {\n try {\n let parsedUrl = url.parse(link);\n\n if (!parsedUrl) {\n return false;\n }\n // hack for links such as <company>.webex.com/meet/<user> without a protocol\n if (!parsedUrl.protocol) {\n parsedUrl = url.parse(`${HTTPS_PROTOCOL}${link}`);\n }\n\n return parsedUrl;\n } catch (error) {\n LoggerProxy.logger.warn(\n `Meeting-info:util#getParsedUrl --> unable to parse the URL, error: ${error}`\n );\n\n return null;\n }\n};\n\n/**\n * Helper function to check if a string matches a known meeting link pattern\n * @param {String} value string to parse and see if it matches a meeting link\n * @returns {Boolean}\n */\nMeetingInfoUtil.isMeetingLink = (value: string) => {\n const parsedUrl = MeetingInfoUtil.getParsedUrl(value);\n const hostNameBool = parsedUrl.hostname && parsedUrl.hostname.includes(WEBEX_DOT_COM);\n const pathNameBool =\n parsedUrl.pathname &&\n (parsedUrl.pathname.includes(`/${MEET}`) ||\n parsedUrl.pathname.includes(`/${MEET_M}`) ||\n parsedUrl.pathname.includes(`/${MEET_CISCO}`) ||\n parsedUrl.pathname.includes(`/${MEET_CO}`) ||\n parsedUrl.pathname.includes(`/${JOIN}`));\n\n return hostNameBool && pathNameBool;\n};\n\nMeetingInfoUtil.isConversationUrl = (value, webex) => {\n const clusterId = webex.internal.services.getClusterId(value);\n\n if (clusterId) {\n return clusterId.endsWith(CONVERSATION_SERVICE);\n }\n\n return false;\n};\n\nMeetingInfoUtil.isSipUri = (sipString) => {\n // TODO: lets remove regex from this equation and user URI matchers and such\n // have not found a great sip uri parser library as of now\n const sipUri = DIALER_REGEX.SIP_ADDRESS.exec(sipString);\n\n return sipUri;\n};\n\nMeetingInfoUtil.isPhoneNumber = (phoneNumber) => {\n const isValidNumber = DIALER_REGEX.PHONE_NUMBER.test(phoneNumber);\n\n return isValidNumber;\n};\n\nMeetingInfoUtil.getHydraId = (destination) => {\n const {type, id, cluster} = deconstructHydraId(destination);\n\n if (id && UUID_REG.test(id)) {\n if (type === _ROOM_) {\n return {room: true, destination: id, cluster};\n }\n if (type === _PEOPLE_) {\n return {people: true, destination: id, cluster};\n }\n\n return {};\n }\n\n return {};\n};\n\nMeetingInfoUtil.getSipUriFromHydraPersonId = (destination, webex) =>\n webex.people\n .get(destination)\n .then((res) => {\n if (res.emails && res.emails.length) {\n return res.emails[0];\n }\n throw new ParameterError('Hydra Id Lookup was an invalid hydra person id.');\n })\n .catch((err) => {\n LoggerProxy.logger.error(\n `Meeting-info:util#MeetingInfoUtil.getSipUriFromHydraPersonId --> getSipUriFromHydraPersonId ${err} `\n );\n throw err;\n });\n\nMeetingInfoUtil.getDestinationType = async (from) => {\n const {type, webex} = from;\n let {destination} = from;\n\n if (type === _PERSONAL_ROOM_) {\n // this case checks if your type is personal room\n if (!destination) {\n // 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 } else {\n const options = VALID_EMAIL_ADDRESS.test(destination)\n ? {email: destination}\n : {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: any = {};\n let hydraId;\n\n if (webex && webex.config && webex.config.meetings && webex.config.meetings.disableHydraId) {\n hydraId = null;\n } else {\n hydraId = MeetingInfoUtil.getHydraId(destination);\n }\n\n if (MeetingInfoUtil.isMeetingLink(destination)) {\n LoggerProxy.logger.warn(\n 'Meeting-info:util#generateOptions --> WARN, use of Meeting Link is deprecated, please use a SIP URI instead'\n );\n\n options.type = _MEETING_LINK_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isSipUri(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isPhoneNumber(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isConversationUrl(destination, webex)) {\n options.type = _CONVERSATION_URL_;\n options.destination = destination;\n } else if (hydraId && hydraId.people) {\n options.type = _SIP_URI_;\n\n return MeetingInfoUtil.getSipUriFromHydraPersonId(hydraId && hydraId.destination, webex).then(\n (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 LoggerProxy.logger.error(\n `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.`\n );\n // Error code 30105 added as Space ID deprecated as of beta, Please refer migration guide.\n throw new SpaceIDDeprecatedError();\n } else {\n LoggerProxy.logger.warn(`Meeting-info:util#getDestinationType --> ${meetingInfoError}`);\n throw new ParameterError(`${meetingInfoError}`);\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 {String} options.installedOrgID org ID of user's machine\n * @param {Object} options.destination ?? value.value\n * @returns {Object} returns an object with {resource, method}\n */\nMeetingInfoUtil.getRequestBody = (options: {type: string; destination: object} | any) => {\n const {type, destination, password, captchaInfo, installedOrgID, locusId, extraParams} = options;\n const body: any = {\n ...DEFAULT_MEETING_INFO_REQUEST_BODY,\n ...extraParams,\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 } 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 if (installedOrgID) {\n body.installedOrgID = installedOrgID;\n }\n\n if (locusId) {\n body.locusId = locusId;\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: string) => {\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: {type: string; destination: any}) => {\n const {type, destination} = 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"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAGA;AAEA;AAuBA;AACA;AACA;AAAqE;AAAA;AAErE,IAAMA,eAAoB,GAAG,CAAC,CAAC;AAC/B,IAAMC,gBAAgB,GACpB,8GAA8G;AAEhHD,eAAe,CAACE,YAAY,GAAG,UAACC,IAAI,EAAK;EACvC,IAAI;IACF,IAAIC,SAAS,GAAGC,YAAG,CAACC,KAAK,CAACH,IAAI,CAAC;IAE/B,IAAI,CAACC,SAAS,EAAE;MACd,OAAO,KAAK;IACd;IACA;IACA,IAAI,CAACA,SAAS,CAACG,QAAQ,EAAE;MACvBH,SAAS,GAAGC,YAAG,CAACC,KAAK,WAAIE,yBAAc,SAAGL,IAAI,EAAG;IACnD;IAEA,OAAOC,SAAS;EAClB,CAAC,CAAC,OAAOK,KAAK,EAAE;IACdC,oBAAW,CAACC,MAAM,CAACC,IAAI,8EACiDH,KAAK,EAC5E;IAED,OAAO,IAAI;EACb;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACAT,eAAe,CAACa,aAAa,GAAG,UAACC,KAAa,EAAK;EACjD,IAAMV,SAAS,GAAGJ,eAAe,CAACE,YAAY,CAACY,KAAK,CAAC;EACrD,IAAMC,YAAY,GAAGX,SAAS,CAACY,QAAQ,IAAIZ,SAAS,CAACY,QAAQ,CAACC,QAAQ,CAACC,wBAAa,CAAC;EACrF,IAAMC,YAAY,GAChBf,SAAS,CAACgB,QAAQ,KACjBhB,SAAS,CAACgB,QAAQ,CAACH,QAAQ,YAAKI,eAAI,EAAG,IACtCjB,SAAS,CAACgB,QAAQ,CAACH,QAAQ,YAAKK,iBAAM,EAAG,IACzClB,SAAS,CAACgB,QAAQ,CAACH,QAAQ,YAAKM,qBAAU,EAAG,IAC7CnB,SAAS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AAcA,kBAAkB,iCAA8B,IAAI;AAC7F,CAAC;AAAC,eAEajH,eAAe;AAAA"}
@@ -267,7 +267,6 @@ var Member = /*#__PURE__*/function () {
267
267
  audio: null,
268
268
  video: null
269
269
  };
270
-
271
270
  // TODO: more participant types
272
271
  // such as native client, web client, is a device, what type of phone, etc
273
272
  this.processParticipant(participant);
@@ -1 +1 @@
1
- {"version":3,"names":["Member","participant","options","MEETINGS","canReclaimHost","id","name","isAudioMuted","isVideoMuted","isHandRaised","supportsBreakouts","supportLiveAnnotation","isSelf","isHost","isGuest","isInLobby","isInMeeting","isNotAdmitted","isContentSharing","status","isDevice","isUser","associatedUser","isRecording","isMutable","isRemovable","type","isModerator","isModeratorAssignmentProhibited","roles","mediaStatus","audio","video","processParticipant","processParticipantOptions","processMember","MemberUtil","extractId","extractName","isBreakoutsSupported","supportsInterpretation","isInterpretationSupported","isLiveAnnotationSupported","processStatus","processRoles","processIsSelf","selfId","processIsHost","hostId","processIsContentSharing","contentSharingId","processType","processIsRecording","recordingId","extractMediaStatus","extractStatus","_IN_LOBBY_","_IN_MEETING_","_NOT_IN_MEETING_","flag","sharingId","isSame","isAssociatedSame","extractControlRoles"],"sources":["index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nimport {MEETINGS, _IN_LOBBY_, _NOT_IN_MEETING_, _IN_MEETING_} from '../constants';\nimport {IExternalRoles, IMediaStatus, ParticipantWithRoles} from './types';\n\nimport MemberUtil from './util';\n\n/**\n * @class Member\n */\nexport default class Member {\n associatedUser: any;\n canReclaimHost: boolean;\n id: any;\n isAudioMuted: any;\n isContentSharing: any;\n isDevice: any;\n isGuest: any;\n isHandRaised: any;\n isHost: any;\n isInLobby: any;\n isInMeeting: any;\n isModerator: any;\n isModeratorAssignmentProhibited: any;\n isMutable: any;\n isNotAdmitted: any;\n isRecording: any;\n isRemovable: any;\n isSelf: any;\n isUser: any;\n isVideoMuted: any;\n roles: IExternalRoles;\n mediaStatus: IMediaStatus;\n name: any;\n participant: any;\n status: any;\n supportsBreakouts: boolean;\n supportsInterpretation: boolean;\n supportLiveAnnotation: boolean;\n type: any;\n namespace = MEETINGS;\n\n /**\n * @param {Object} participant - the locus participant\n * @param {Object} [options] - constructor params\n * @param {String} options.selfId\n * @param {String} options.hostId\n * @param {String} options.contentSharingId\n * @param {String} options.type\n * @returns {Member}\n * @memberof Member\n */\n constructor(\n participant: object,\n options:\n | {\n selfId: string;\n hostId: string;\n contentSharingId: string;\n type: string;\n }\n | any = {}\n ) {\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.canReclaimHost = false;\n /**\n * The server participant object\n * @instance\n * @type {Object}\n * @private\n * @memberof Member\n */\n this.participant = null;\n /**\n * The member id\n * @instance\n * @type {String}\n * @public\n * @memberof Member\n */\n this.id = null;\n /**\n * The member name\n * @instance\n * @type {String}\n * @public\n * @memberof Member\n */\n this.name = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isAudioMuted = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isVideoMuted = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isHandRaised = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.supportsBreakouts = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.supportLiveAnnotation = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isSelf = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isHost = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isGuest = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isInLobby = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isInMeeting = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isNotAdmitted = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isContentSharing = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.status = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isDevice = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isUser = null;\n /**\n * Is this member associated to another user by way of pairing (typical of devices)\n * @instance\n * @type {String}\n * @public\n * @memberof Member\n */\n this.associatedUser = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isRecording = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isMutable = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isRemovable = null;\n /**\n * @instance\n * @type {String}\n * @private\n * @memberof Member\n */\n this.type = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isModerator = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isModeratorAssignmentProhibited = null;\n\n /**\n * @instance\n * @type {IExternalRoles}\n * @public\n * @memberof Member\n */\n this.roles = null;\n\n /**\n * @instance\n * @type {IMediaStatus}\n * @public\n * @memberof Member\n * @example {audio: MediaStatus.RECVONLY, video: MediaStatus.SENDRECV}\n */\n this.mediaStatus = {\n audio: null,\n video: null,\n };\n\n // TODO: more participant types\n // such as native client, web client, is a device, what type of phone, etc\n this.processParticipant(participant);\n this.processParticipantOptions(participant, options);\n this.processMember();\n }\n\n /**\n * set all the participant values extracted directly from locus participant\n * @param {Object} participant the locus participant object\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processParticipant(participant: object) {\n this.participant = participant;\n if (participant) {\n this.canReclaimHost = MemberUtil.canReclaimHost(participant);\n this.id = MemberUtil.extractId(participant);\n this.name = MemberUtil.extractName(participant);\n this.isAudioMuted = MemberUtil.isAudioMuted(participant);\n this.isVideoMuted = MemberUtil.isVideoMuted(participant);\n this.isHandRaised = MemberUtil.isHandRaised(participant);\n this.supportsBreakouts = MemberUtil.isBreakoutsSupported(participant);\n this.supportsInterpretation = MemberUtil.isInterpretationSupported(participant);\n this.supportLiveAnnotation = MemberUtil.isLiveAnnotationSupported(participant);\n this.isGuest = MemberUtil.isGuest(participant);\n this.isUser = MemberUtil.isUser(participant);\n this.isDevice = MemberUtil.isDevice(participant);\n this.isModerator = MemberUtil.isModerator(participant);\n this.isModeratorAssignmentProhibited =\n MemberUtil.isModeratorAssignmentProhibited(participant);\n this.processStatus(participant);\n this.processRoles(participant as ParticipantWithRoles);\n // must be done last\n this.isNotAdmitted = MemberUtil.isNotAdmitted(participant, this.isGuest, this.status);\n }\n }\n\n /**\n * Use the members options and participant values to set on the member\n * @param {Object} participant the locus participant object\n * @param {Object} options the passed in options, what was set on members\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processParticipantOptions(participant: object, options: any) {\n if (participant && options) {\n this.processIsSelf(participant, options.selfId);\n this.processIsHost(participant, options.hostId);\n this.processIsContentSharing(participant, options.contentSharingId);\n this.processType(options.type);\n this.processIsRecording(participant, options.recordingId);\n }\n }\n\n /**\n * processes what already exists on the member to determine other info about the member\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processMember() {\n // must occur after self, guest, meeting, and type properties are calculated\n this.isRemovable = MemberUtil.isRemovable(\n this.isSelf,\n this.isGuest,\n this.isInMeeting,\n this.type\n );\n // must occur after self, device, meeting, mute status, and type properties are calculated\n this.isMutable = MemberUtil.isMutable(\n this.isSelf,\n this.isDevice,\n this.isInMeeting,\n this.isAudioMuted,\n this.type\n );\n\n this.mediaStatus = MemberUtil.extractMediaStatus(this.participant);\n }\n\n /**\n * set the status on member object\n * @param {Object} participant the locus participant object\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processStatus(participant: object) {\n this.status = MemberUtil.extractStatus(participant);\n switch (this.status) {\n case _IN_LOBBY_:\n this.isInLobby = true;\n this.isInMeeting = false;\n break;\n case _IN_MEETING_:\n this.isInLobby = false;\n this.isInMeeting = true;\n break;\n case _NOT_IN_MEETING_:\n this.isInLobby = false;\n this.isInMeeting = false;\n break;\n default:\n this.isInLobby = false;\n this.isInMeeting = false;\n }\n }\n\n /**\n * set the isContentSharing on member\n * @param {Boolean} flag\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n public setIsContentSharing(flag: boolean) {\n this.isContentSharing = flag;\n }\n\n /**\n * set the isHost on member\n * @param {Boolean} flag\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n public setIsHost(flag: boolean) {\n this.isHost = flag;\n }\n\n /**\n * set the isSelf on member\n * @param {Boolean} flag\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n public setIsSelf(flag: boolean) {\n this.isSelf = flag;\n }\n\n /**\n * determine if this member is content sharing\n * @param {Object} participant\n * @param {String} sharingId\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n public processIsContentSharing(participant: object, sharingId: string) {\n if (MemberUtil.isUser(participant)) {\n this.isContentSharing = MemberUtil.isSame(participant, sharingId);\n } else if (MemberUtil.isDevice(participant)) {\n this.isContentSharing = MemberUtil.isAssociatedSame(participant, sharingId);\n }\n }\n\n /**\n * Determine if this member is recording\n * @param {Object} participant\n * @param {String} recordingId\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n public processIsRecording(participant: object, recordingId: string) {\n this.isRecording = MemberUtil.isSame(participant, recordingId);\n }\n\n /**\n * determine if this member is the self\n * @param {Object} participant\n * @param {String} selfId\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processIsSelf(participant: object, selfId: string) {\n if (MemberUtil.isUser(participant)) {\n this.isSelf = MemberUtil.isSame(participant, selfId);\n } else if (MemberUtil.isDevice(participant)) {\n this.isSelf = MemberUtil.isAssociatedSame(participant, selfId);\n this.associatedUser = selfId;\n }\n }\n\n /**\n * determine if this member is the host\n * @param {Object} participant\n * @param {String} hostId\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processIsHost(participant: object, hostId: string) {\n if (MemberUtil.isUser(participant)) {\n this.isHost = MemberUtil.isSame(participant, hostId);\n } else if (MemberUtil.isDevice(participant)) {\n this.isHost = MemberUtil.isAssociatedSame(participant, hostId);\n }\n }\n\n /**\n * process the roles that have been applied to this member\n * @param {Object} participant\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processRoles(participant: ParticipantWithRoles) {\n this.roles = MemberUtil.extractControlRoles(participant);\n }\n\n /**\n * set the type for the member, could be MEETING or CALL\n * @param {String} type\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processType(type: string) {\n this.type = type;\n }\n}\n"],"mappings":";;;;;;;;;;;AAGA;AAGA;AANA;AACA;AACA;AAMA;AACA;AACA;AAFA,IAGqBA,MAAM;EAgCzB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,gBACEC,WAAmB,EASnB;IAAA,IARAC,OAOO,uEAAG,CAAC,CAAC;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA,iDArBFC,mBAAQ;IAuBlB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,cAAc,GAAG,KAAK;IAC3B;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACH,WAAW,GAAG,IAAI;IACvB;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACI,EAAE,GAAG,IAAI;IACd;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,IAAI,GAAG,IAAI;IAChB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,YAAY,GAAG,IAAI;IACxB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,YAAY,GAAG,IAAI;IACxB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,YAAY,GAAG,IAAI;IACxB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,iBAAiB,GAAG,IAAI;IAC7B;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,qBAAqB,GAAG,IAAI;IACjC;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,MAAM,GAAG,IAAI;IAClB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,MAAM,GAAG,IAAI;IAClB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,OAAO,GAAG,IAAI;IACnB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,SAAS,GAAG,IAAI;IACrB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,WAAW,GAAG,IAAI;IACvB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,aAAa,GAAG,IAAI;IACzB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,gBAAgB,GAAG,IAAI;IAC5B;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,MAAM,GAAG,IAAI;IAClB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,QAAQ,GAAG,IAAI;IACpB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,MAAM,GAAG,IAAI;IAClB;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,cAAc,GAAG,IAAI;IAC1B;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,WAAW,GAAG,IAAI;IACvB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,SAAS,GAAG,IAAI;IACrB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,WAAW,GAAG,IAAI;IACvB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,IAAI,GAAG,IAAI;IAChB;AACJ;AACA;AACA;A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;AACA;AACA;AACA;AACA;AACA;EAPE;IAAA;IAAA,OAQA,uBAAsB7C,WAAmB,EAAE+C,MAAc,EAAE;MACzD,IAAIZ,aAAU,CAACf,MAAM,CAACpB,WAAW,CAAC,EAAE;QAClC,IAAI,CAACY,MAAM,GAAGuB,aAAU,CAACyB,MAAM,CAAC5D,WAAW,EAAE+C,MAAM,CAAC;MACtD,CAAC,MAAM,IAAIZ,aAAU,CAAChB,QAAQ,CAACnB,WAAW,CAAC,EAAE;QAC3C,IAAI,CAACY,MAAM,GAAGuB,aAAU,CAAC0B,gBAAgB,CAAC7D,WAAW,EAAE+C,MAAM,CAAC;MAChE;IACF;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAA;IAAA,OAOA,sBAAqB/C,WAAiC,EAAE;MACtD,IAAI,CAAC4B,KAAK,GAAGO,aAAU,CAAC2B,mBAAmB,CAAC9D,WAAW,CAAC;IAC1D;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAA;IAAA,OAOA,qBAAoByB,IAAY,EAAE;MAChC,IAAI,CAACA,IAAI,GAAGA,IAAI;IAClB;EAAC;EAAA;AAAA;AAAA"}
1
+ {"version":3,"names":["Member","participant","options","MEETINGS","canReclaimHost","id","name","isAudioMuted","isVideoMuted","isHandRaised","supportsBreakouts","supportLiveAnnotation","isSelf","isHost","isGuest","isInLobby","isInMeeting","isNotAdmitted","isContentSharing","status","isDevice","isUser","associatedUser","isRecording","isMutable","isRemovable","type","isModerator","isModeratorAssignmentProhibited","roles","mediaStatus","audio","video","processParticipant","processParticipantOptions","processMember","MemberUtil","extractId","extractName","isBreakoutsSupported","supportsInterpretation","isInterpretationSupported","isLiveAnnotationSupported","processStatus","processRoles","processIsSelf","selfId","processIsHost","hostId","processIsContentSharing","contentSharingId","processType","processIsRecording","recordingId","extractMediaStatus","extractStatus","_IN_LOBBY_","_IN_MEETING_","_NOT_IN_MEETING_","flag","sharingId","isSame","isAssociatedSame","extractControlRoles"],"sources":["index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nimport {MEETINGS, _IN_LOBBY_, _NOT_IN_MEETING_, _IN_MEETING_} from '../constants';\nimport {IExternalRoles, IMediaStatus, ParticipantWithRoles} from './types';\n\nimport MemberUtil from './util';\n\n/**\n * @class Member\n */\nexport default class Member {\n associatedUser: any;\n canReclaimHost: boolean;\n id: any;\n isAudioMuted: any;\n isContentSharing: any;\n isDevice: any;\n isGuest: any;\n isHandRaised: any;\n isHost: any;\n isInLobby: any;\n isInMeeting: any;\n isModerator: any;\n isModeratorAssignmentProhibited: any;\n isMutable: any;\n isNotAdmitted: any;\n isRecording: any;\n isRemovable: any;\n isSelf: any;\n isUser: any;\n isVideoMuted: any;\n roles: IExternalRoles;\n mediaStatus: IMediaStatus;\n name: any;\n participant: any;\n status: any;\n supportsBreakouts: boolean;\n supportsInterpretation: boolean;\n supportLiveAnnotation: boolean;\n type: any;\n namespace = MEETINGS;\n\n /**\n * @param {Object} participant - the locus participant\n * @param {Object} [options] - constructor params\n * @param {String} options.selfId\n * @param {String} options.hostId\n * @param {String} options.contentSharingId\n * @param {String} options.type\n * @returns {Member}\n * @memberof Member\n */\n constructor(\n participant: object,\n options:\n | {\n selfId: string;\n hostId: string;\n contentSharingId: string;\n type: string;\n }\n | any = {}\n ) {\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.canReclaimHost = false;\n /**\n * The server participant object\n * @instance\n * @type {Object}\n * @private\n * @memberof Member\n */\n this.participant = null;\n /**\n * The member id\n * @instance\n * @type {String}\n * @public\n * @memberof Member\n */\n this.id = null;\n /**\n * The member name\n * @instance\n * @type {String}\n * @public\n * @memberof Member\n */\n this.name = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isAudioMuted = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isVideoMuted = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isHandRaised = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.supportsBreakouts = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.supportLiveAnnotation = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isSelf = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isHost = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isGuest = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isInLobby = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isInMeeting = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isNotAdmitted = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isContentSharing = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.status = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isDevice = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isUser = null;\n /**\n * Is this member associated to another user by way of pairing (typical of devices)\n * @instance\n * @type {String}\n * @public\n * @memberof Member\n */\n this.associatedUser = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isRecording = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isMutable = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isRemovable = null;\n /**\n * @instance\n * @type {String}\n * @private\n * @memberof Member\n */\n this.type = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isModerator = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isModeratorAssignmentProhibited = null;\n\n /**\n * @instance\n * @type {IExternalRoles}\n * @public\n * @memberof Member\n */\n this.roles = null;\n\n /**\n * @instance\n * @type {IMediaStatus}\n * @public\n * @memberof Member\n * @example {audio: MediaStatus.RECVONLY, video: MediaStatus.SENDRECV}\n */\n this.mediaStatus = {\n audio: null,\n video: null,\n };\n // TODO: more participant types\n // such as native client, web client, is a device, what type of phone, etc\n this.processParticipant(participant);\n this.processParticipantOptions(participant, options);\n this.processMember();\n }\n\n /**\n * set all the participant values extracted directly from locus participant\n * @param {Object} participant the locus participant object\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processParticipant(participant: object) {\n this.participant = participant;\n if (participant) {\n this.canReclaimHost = MemberUtil.canReclaimHost(participant);\n this.id = MemberUtil.extractId(participant);\n this.name = MemberUtil.extractName(participant);\n this.isAudioMuted = MemberUtil.isAudioMuted(participant);\n this.isVideoMuted = MemberUtil.isVideoMuted(participant);\n this.isHandRaised = MemberUtil.isHandRaised(participant);\n this.supportsBreakouts = MemberUtil.isBreakoutsSupported(participant);\n this.supportsInterpretation = MemberUtil.isInterpretationSupported(participant);\n this.supportLiveAnnotation = MemberUtil.isLiveAnnotationSupported(participant);\n this.isGuest = MemberUtil.isGuest(participant);\n this.isUser = MemberUtil.isUser(participant);\n this.isDevice = MemberUtil.isDevice(participant);\n this.isModerator = MemberUtil.isModerator(participant);\n this.isModeratorAssignmentProhibited =\n MemberUtil.isModeratorAssignmentProhibited(participant);\n this.processStatus(participant);\n this.processRoles(participant as ParticipantWithRoles);\n // must be done last\n this.isNotAdmitted = MemberUtil.isNotAdmitted(participant, this.isGuest, this.status);\n }\n }\n\n /**\n * Use the members options and participant values to set on the member\n * @param {Object} participant the locus participant object\n * @param {Object} options the passed in options, what was set on members\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processParticipantOptions(participant: object, options: any) {\n if (participant && options) {\n this.processIsSelf(participant, options.selfId);\n this.processIsHost(participant, options.hostId);\n this.processIsContentSharing(participant, options.contentSharingId);\n this.processType(options.type);\n this.processIsRecording(participant, options.recordingId);\n }\n }\n\n /**\n * processes what already exists on the member to determine other info about the member\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processMember() {\n // must occur after self, guest, meeting, and type properties are calculated\n this.isRemovable = MemberUtil.isRemovable(\n this.isSelf,\n this.isGuest,\n this.isInMeeting,\n this.type\n );\n // must occur after self, device, meeting, mute status, and type properties are calculated\n this.isMutable = MemberUtil.isMutable(\n this.isSelf,\n this.isDevice,\n this.isInMeeting,\n this.isAudioMuted,\n this.type\n );\n\n this.mediaStatus = MemberUtil.extractMediaStatus(this.participant);\n }\n\n /**\n * set the status on member object\n * @param {Object} participant the locus participant object\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processStatus(participant: object) {\n this.status = MemberUtil.extractStatus(participant);\n switch (this.status) {\n case _IN_LOBBY_:\n this.isInLobby = true;\n this.isInMeeting = false;\n break;\n case _IN_MEETING_:\n this.isInLobby = false;\n this.isInMeeting = true;\n break;\n case _NOT_IN_MEETING_:\n this.isInLobby = false;\n this.isInMeeting = false;\n break;\n default:\n this.isInLobby = false;\n this.isInMeeting = false;\n }\n }\n\n /**\n * set the isContentSharing on member\n * @param {Boolean} flag\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n public setIsContentSharing(flag: boolean) {\n this.isContentSharing = flag;\n }\n\n /**\n * set the isHost on member\n * @param {Boolean} flag\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n public setIsHost(flag: boolean) {\n this.isHost = flag;\n }\n\n /**\n * set the isSelf on member\n * @param {Boolean} flag\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n public setIsSelf(flag: boolean) {\n this.isSelf = flag;\n }\n\n /**\n * determine if this member is content sharing\n * @param {Object} participant\n * @param {String} sharingId\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n public processIsContentSharing(participant: object, sharingId: string) {\n if (MemberUtil.isUser(participant)) {\n this.isContentSharing = MemberUtil.isSame(participant, sharingId);\n } else if (MemberUtil.isDevice(participant)) {\n this.isContentSharing = MemberUtil.isAssociatedSame(participant, sharingId);\n }\n }\n\n /**\n * Determine if this member is recording\n * @param {Object} participant\n * @param {String} recordingId\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n public processIsRecording(participant: object, recordingId: string) {\n this.isRecording = MemberUtil.isSame(participant, recordingId);\n }\n\n /**\n * determine if this member is the self\n * @param {Object} participant\n * @param {String} selfId\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processIsSelf(participant: object, selfId: string) {\n if (MemberUtil.isUser(participant)) {\n this.isSelf = MemberUtil.isSame(participant, selfId);\n } else if (MemberUtil.isDevice(participant)) {\n this.isSelf = MemberUtil.isAssociatedSame(participant, selfId);\n this.associatedUser = selfId;\n }\n }\n\n /**\n * determine if this member is the host\n * @param {Object} participant\n * @param {String} hostId\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processIsHost(participant: object, hostId: string) {\n if (MemberUtil.isUser(participant)) {\n this.isHost = MemberUtil.isSame(participant, hostId);\n } else if (MemberUtil.isDevice(participant)) {\n this.isHost = MemberUtil.isAssociatedSame(participant, hostId);\n }\n }\n\n /**\n * process the roles that have been applied to this member\n * @param {Object} participant\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processRoles(participant: ParticipantWithRoles) {\n this.roles = MemberUtil.extractControlRoles(participant);\n }\n\n /**\n * set the type for the member, could be MEETING or CALL\n * @param {String} type\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processType(type: string) {\n this.type = type;\n }\n}\n"],"mappings":";;;;;;;;;;;AAGA;AAGA;AANA;AACA;AACA;AAMA;AACA;AACA;AAFA,IAGqBA,MAAM;EAgCzB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,gBACEC,WAAmB,EASnB;IAAA,IARAC,OAOO,uEAAG,CAAC,CAAC;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA,iDArBFC,mBAAQ;IAuBlB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,cAAc,GAAG,KAAK;IAC3B;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACH,WAAW,GAAG,IAAI;IACvB;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACI,EAAE,GAAG,IAAI;IACd;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,IAAI,GAAG,IAAI;IAChB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,YAAY,GAAG,IAAI;IACxB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,YAAY,GAAG,IAAI;IACxB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,YAAY,GAAG,IAAI;IACxB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,iBAAiB,GAAG,IAAI;IAC7B;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,qBAAqB,GAAG,IAAI;IACjC;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,MAAM,GAAG,IAAI;IAClB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,MAAM,GAAG,IAAI;IAClB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,OAAO,GAAG,IAAI;IACnB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,SAAS,GAAG,IAAI;IACrB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,WAAW,GAAG,IAAI;IACvB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,aAAa,GAAG,IAAI;IACzB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,gBAAgB,GAAG,IAAI;IAC5B;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,MAAM,GAAG,IAAI;IAClB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,QAAQ,GAAG,IAAI;IACpB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,MAAM,GAAG,IAAI;IAClB;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,cAAc,GAAG,IAAI;IAC1B;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,WAAW,GAAG,IAAI;IACvB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,SAAS,GAAG,IAAI;IACrB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,WAAW,GAAG,IAAI;IACvB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,IAAI,GAAG,IAAI;IAChB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,WAAW,GAAG,IAAI;IACvB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,+BAA+B,GAAG,IAAI;;IAE3C;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,KAAK,GAAG,IAAI;;IAEjB;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,WAAW,GAAG;MACjBC,KAAK,EAAE,IAAI;MACXC,KAAK,EAAE;IACT,CAAC;IACD;IACA;IACA,IAAI,CAACC,kBAAkB,CAAChC,WAAW,CAAC;IACpC,IAAI,CAACiC,yBAAyB,CAACjC,WAAW,EAAEC,OAAO,CAAC;IACpD,IAAI,CAACiC,aAAa,EAAE;EACtB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAA;IAAA,OAOA,4BAA2BlC,WAAmB,EAAE;MAC9C,IAAI,CAACA,WAAW,GAAGA,WAAW;MAC9B,IAAIA,WAAW,EAAE;QACf,IAAI,CAACG,cAAc,GAAGgC,aAAU,CAAChC,cAAc,CAACH,WAAW,CAAC;QAC5D,IAAI,CAACI,EAAE,GAAG+B,aAAU,CAACC,SAAS,CAACpC,WAAW,CAAC;Q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export declare const MEETINGINFO = "meetingInfo";
35
35
  export declare const MEET = "meet";
36
36
  export declare const MEET_M = "m";
37
37
  export declare const MEDIA = "media";
38
+ export declare const MEET_CO = "co";
39
+ export declare const MEET_CISCO = "cisco";
38
40
  export declare const OFFLINE = "offline";
39
41
  export declare const ONLINE = "online";
40
42
  export declare const PARTICIPANT = "participant";
@@ -49,6 +51,7 @@ export declare const SHARE = "share";
49
51
  export declare const TYPE = "type";
50
52
  export declare const VIDEO = "video";
51
53
  export declare const VIDEO_STATUS = "videoStatus";
54
+ export declare const LANGUAGE_ENGLISH = "en";
52
55
  export declare const _ANSWER_ = "ANSWER";
53
56
  export declare const _ACTIVE_ = "ACTIVE";
54
57
  export declare const _CALL_ = "CALL";
@@ -195,8 +198,6 @@ export declare const EVENT_TRIGGERS: {
195
198
  MEETING_MEDIA_REMOTE_STARTED: string;
196
199
  MEETING_STARTED_RECORDING: string;
197
200
  MEETING_STOPPED_RECORDING: string;
198
- MEETING_STARTED_RECEIVING_TRANSCRIPTION: string;
199
- MEETING_STOPPED_RECEIVING_TRANSCRIPTION: string;
200
201
  MEETING_RECEIVE_REACTIONS: string;
201
202
  MEETING_PAUSED_RECORDING: string;
202
203
  MEETING_RESUMED_RECORDING: string;
@@ -267,6 +268,10 @@ export declare const EVENT_TRIGGERS: {
267
268
  MEETING_CONTROLS_VIDEO_UPDATED: string;
268
269
  MEETING_LOCUS_URL_UPDATE: string;
269
270
  MEETING_STREAM_PUBLISH_STATE_CHANGED: string;
271
+ MEETING_TRANSCRIPTION_CONNECTED: string;
272
+ MEETING_STARTED_RECEIVING_TRANSCRIPTION: string;
273
+ MEETING_STOPPED_RECEIVING_TRANSCRIPTION: string;
274
+ MEETING_CAPTION_RECEIVED: string;
270
275
  };
271
276
  export declare const EVENT_TYPES: {
272
277
  SELF: string;
@@ -773,6 +778,7 @@ export declare const SELF_ROLES: {
773
778
  COHOST: string;
774
779
  MODERATOR: string;
775
780
  ATTENDEE: string;
781
+ PRESENTER: string;
776
782
  };
777
783
  export declare const MEETING_STATE: {
778
784
  STATES: {
@@ -11,7 +11,6 @@ import MediaProperties from '../media/properties';
11
11
  import ReconnectionManager from '../reconnection-manager';
12
12
  import MeetingRequest from './request';
13
13
  import Members from '../members/index';
14
- import Transcription from '../transcription';
15
14
  import { NETWORK_STATUS } from '../constants';
16
15
  import { ReceiveSlotManager } from '../multistream/receiveSlotManager';
17
16
  import { MediaRequestManager } from '../multistream/mediaRequestManager';
@@ -21,6 +20,34 @@ import InMeetingActions from './in-meeting-actions';
21
20
  import RecordingController from '../recording-controller';
22
21
  import ControlsOptionsManager from '../controls-options-manager';
23
22
  import { LocusMediaRequest } from './locusMediaRequest';
23
+ export type CaptionData = {
24
+ id: string;
25
+ isFinal: boolean;
26
+ translations: Array<string>;
27
+ text: string;
28
+ currentCaptionLanguage: string;
29
+ timestamp: string;
30
+ speaker: string;
31
+ };
32
+ export type Transcription = {
33
+ languageOptions: {
34
+ captionLanguages?: string;
35
+ maxLanguages?: number;
36
+ spokenLanguages?: Array<string>;
37
+ currentCaptionLanguage?: string;
38
+ requestedCaptionLanguage?: string;
39
+ currentSpokenLanguage?: string;
40
+ };
41
+ status: string;
42
+ isListening: boolean;
43
+ commandText: string;
44
+ captions: Array<CaptionData>;
45
+ showCaptionBox: boolean;
46
+ transcribingRequestStatus: string;
47
+ isCaptioning: boolean;
48
+ speakerProxy: Map<string, any>;
49
+ interimCaptions: Map<string, CaptionData>;
50
+ };
24
51
  export type LocalStreams = {
25
52
  microphone?: LocalMicrophoneStream;
26
53
  camera?: LocalCameraStream;
@@ -419,6 +446,8 @@ export default class Meeting extends StatelessWebexPlugin {
419
446
  remoteShareInstanceId: string;
420
447
  turnDiscoverySkippedReason: string;
421
448
  turnServerUsed: boolean;
449
+ areVoiceaEventsSetup: boolean;
450
+ voiceaListenerCallbacks: object;
422
451
  private retriedWithTurnServer;
423
452
  private sendSlotManager;
424
453
  private deferSDPAnswer?;
@@ -561,6 +590,13 @@ export default class Meeting extends StatelessWebexPlugin {
561
590
  * @memberof Meeting
562
591
  */
563
592
  private setUpInterpretationListener;
593
+ /**
594
+ * Set up the listeners for captions
595
+ * @returns {undefined}
596
+ * @private
597
+ * @memberof Meeting
598
+ */
599
+ private setUpVoiceaListeners;
564
600
  /**
565
601
  * Set up the locus info listener for meetings disconnected due to inactivity
566
602
  * @returns {undefined}
@@ -1066,17 +1102,26 @@ export default class Meeting extends StatelessWebexPlugin {
1066
1102
  */
1067
1103
  isReactionsSupported(): boolean;
1068
1104
  /**
1069
- * Monitor the Low-Latency Mercury (LLM) web socket connection on `onError` and `onClose` states
1070
- * @private
1071
- * @returns {void}
1105
+ * sets Caption language for the meeting
1106
+ * @param {string} language
1107
+ * @returns {Promise}
1072
1108
  */
1073
- private monitorTranscriptionSocketConnection;
1109
+ setCaptionLanguage(language: string): Promise<unknown>;
1074
1110
  /**
1075
- * Request for a WebSocket Url, open and monitor the WebSocket connection
1076
- * @private
1111
+ * sets Spoken language for the meeting
1112
+ * @param {string} language
1113
+ * @returns {Promise}
1114
+ */
1115
+ setSpokenLanguage(language: string): Promise<unknown>;
1116
+ /**
1117
+ * This method will enable the transcription for the current meeting if the meeting has enabled/supports Webex Assistant
1118
+ * @param {Object} options object with spokenlanguage setting
1119
+ * @public
1077
1120
  * @returns {Promise<void>} a promise to open the WebSocket connection
1078
1121
  */
1079
- private receiveTranscription;
1122
+ startTranscription(options?: {
1123
+ spokenLanguage?: string;
1124
+ }): Promise<void>;
1080
1125
  /**
1081
1126
  * Callback called when a relay event is received from meeting LLM Connection
1082
1127
  * @param {RelayEvent} e Event object coming from LLM Connection
@@ -1085,11 +1130,10 @@ export default class Meeting extends StatelessWebexPlugin {
1085
1130
  */
1086
1131
  private processRelayEvent;
1087
1132
  /**
1088
- * stop recieving Transcription by closing
1089
- * the web socket connection properly
1133
+ * This method stops receiving transcription for the current meeting
1090
1134
  * @returns {void}
1091
1135
  */
1092
- stopReceivingTranscription(): void;
1136
+ stopTranscription(): void;
1093
1137
  /**
1094
1138
  * triggers an event to notify that the user
1095
1139
  * will not receive any more transcription
@@ -1640,7 +1684,7 @@ export default class Meeting extends StatelessWebexPlugin {
1640
1684
  *
1641
1685
  * @returns {string} one of 'attendee','host','cohost', returns the user type of the current user
1642
1686
  */
1643
- getCurUserType(): "host" | "cohost" | "attendee";
1687
+ getCurUserType(): "host" | "cohost" | "presenter" | "attendee";
1644
1688
  /**
1645
1689
  * End the current meeting for all
1646
1690
  * @returns {Promise}
@@ -0,0 +1,16 @@
1
+ export declare const getSpeaker: (members: any, csis?: any[]) => unknown;
2
+ export declare const getSpeakerFromProxyOrStore: ({ csisKey, meetingMembers, transcriptData }: {
3
+ csisKey: any;
4
+ meetingMembers: any;
5
+ transcriptData: any;
6
+ }) => {
7
+ speaker: {
8
+ speakerId: string;
9
+ name: string;
10
+ };
11
+ needsCaching: boolean;
12
+ };
13
+ export declare const processNewCaptions: ({ data, meeting }: {
14
+ data: any;
15
+ meeting: any;
16
+ }) => void;
@@ -62,7 +62,7 @@ var Webinar = _webexCore.WebexPlugin.extend({
62
62
  updateCanManageWebcast: function updateCanManageWebcast(canManageWebcast) {
63
63
  this.set('canManageWebcast', canManageWebcast);
64
64
  },
65
- version: "3.0.0-beta.390"
65
+ version: "3.0.0-beta.392"
66
66
  });
67
67
  var _default = Webinar;
68
68
  exports.default = _default;