@webex/plugin-meetings 1.159.1 → 1.159.4

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.
@@ -392,7 +392,7 @@ MeetingInfoUtil.getWebexSite = function (uri) {
392
392
  var _uri$match;
393
393
 
394
394
  var exceptedDomains = ['meet.webex.com', 'meetup.webex.com', 'ciscospark.com'];
395
- var site = uri === null || uri === void 0 ? void 0 : (_uri$match = uri.match(/.+@(.+\..+\.*.)$/)) === null || _uri$match === void 0 ? void 0 : _uri$match[1];
395
+ var site = uri === null || uri === void 0 ? void 0 : (_uri$match = uri.match(/.+@([^.]+\.[^.]+\.[^.]+)$/)) === null || _uri$match === void 0 ? void 0 : _uri$match[1];
396
396
  return exceptedDomains.includes(site) ? null : site;
397
397
  };
398
398
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["utilv2.js"],"names":["MeetingInfoUtil","getParsedUrl","link","parsedUrl","url","parse","protocol","HTTPS_PROTOCOL","error","LoggerProxy","logger","warn","isMeetingLink","value","hostNameBool","hostname","includes","WEBEX_DOT_COM","pathNameBool","pathname","MEET","MEET_M","JOIN","isConversationUrl","webex","clusterId","internal","services","getClusterId","endsWith","CONVERSATION_SERVICE","isSipUri","sipString","sipUri","DIALER_REGEX","SIP_ADDRESS","exec","isPhoneNumber","phoneNumber","isValidNumber","PHONE_NUMBER","test","getHydraId","destination","type","id","cluster","UUID_REG","_ROOM_","room","_PEOPLE_","people","getSipUriFromHydraPersonId","get","then","res","emails","length","ParameterError","catch","err","getDestinationType","from","_PERSONAL_ROOM_","userId","device","orgId","options","VALID_EMAIL_ADDRESS","email","list","items","hydraId","_MEETING_LINK_","_SIP_URI_","_CONVERSATION_URL_","wasHydraPerson","resolve","waitForCatalog","conversationUrl","conversation","getUrlFromClusterId","getRequestBody","password","captchaInfo","body","supportHostKey","sipUrl","_MEETING_ID_","meetingKey","_LOCUS_ID_","info","webExMeetingId","meetingUrl","_MEETING_UUID_","meetingUUID","captchaID","captchaVerifyCode","code","getWebexSite","uri","exceptedDomains","site","match","getDirectMeetingInfoURI","preferredWebexSite","webExSite"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AAIA;;AAoBA;;AACA;;AAEA,IAAMA,eAAe,GAAG,EAAxB;;AAEAA,eAAe,CAACC,YAAhB,GAA+B,UAACC,IAAD,EAAU;AACvC,MAAI;AACF,QAAIC,SAAS,GAAGC,aAAIC,KAAJ,CAAUH,IAAV,CAAhB;;AAEA,QAAI,CAACC,SAAL,EAAgB;AACd,aAAO,KAAP;AACD,KALC,CAMF;;;AACA,QAAI,CAACA,SAAS,CAACG,QAAf,EAAyB;AACvBH,MAAAA,SAAS,GAAGC,aAAIC,KAAJ,WAAaE,yBAAb,SAA8BL,IAA9B,EAAZ;AACD;;AAED,WAAOC,SAAP;AACD,GAZD,CAaA,OAAOK,KAAP,EAAc;AACZC,yBAAYC,MAAZ,CAAmBC,IAAnB,8EAA8FH,KAA9F;;AAEA,WAAO,IAAP;AACD;AACF,CAnBD;AAqBA;AACA;AACA;AACA;AACA;;;AACAR,eAAe,CAACY,aAAhB,GAAgC,UAACC,KAAD,EAAW;AACzC,MAAMV,SAAS,GAAGH,eAAe,CAACC,YAAhB,CAA6BY,KAA7B,CAAlB;AACA,MAAMC,YAAY,GAAGX,SAAS,CAACY,QAAV,IAAsBZ,SAAS,CAACY,QAAV,CAAmBC,QAAnB,CAA4BC,wBAA5B,CAA3C;AACA,MAAMC,YAAY,GAAGf,SAAS,CAACgB,QAAV,KAAuBhB,SAAS,CAACgB,QAAV,CAAmBH,QAAnB,YAAgCI,eAAhC,MAA2CjB,SAAS,CAACgB,QAAV,CAAmBH,QAAnB,YAAgCK,iBAAhC,EAA3C,IAAwFlB,SAAS,CAACgB,QAAV,CAAmBH,QAAnB,YAAgCM,eAAhC,EAA/G,CAArB;AAEA,SAAOR,YAAY,IAAII,YAAvB;AACD,CAND;;AAQAlB,eAAe,CAACuB,iBAAhB,GAAoC,UAAC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MACEvB,IADF,GAEIuB,OAFJ,CACEvB,IADF;AAAA,MACQD,WADR,GAEIwB,OAFJ,CACQxB,WADR;AAIA,MAAI8D,kBAAkB,GAAG,IAAzB;;AAEA,UAAQ7D,IAAR;AACE,SAAK8B,oBAAL;AACE+B,MAAAA,kBAAkB,GAAGzG,eAAe,CAACmG,YAAhB,CAA6BxD,WAA7B,CAArB;AACA;;AACF,SAAK+C,qBAAL;AACEe,MAAAA,kBAAkB,yBAAG9D,WAAW,CAACgD,IAAf,uDAAG,mBAAkBe,SAAvC;AACA;;AACF;AAPF;;AAUA,SAAOD,kBAAkB,qBAAcA,kBAAd,iCAA8D,IAAvF;AACD,CAlBD;;eAoBezG,e","sourcesContent":["import url from 'url';\n\nimport {\n deconstructHydraId\n} from '@webex/common';\n\nimport {\n _SIP_URI_,\n _PERSONAL_ROOM_,\n _MEETING_ID_,\n _CONVERSATION_URL_,\n _LOCUS_ID_,\n _MEETING_LINK_,\n _PEOPLE_,\n _ROOM_,\n _MEETING_UUID_,\n DIALER_REGEX,\n WEBEX_DOT_COM,\n CONVERSATION_SERVICE,\n JOIN,\n MEET,\n MEET_M,\n HTTPS_PROTOCOL,\n UUID_REG,\n VALID_EMAIL_ADDRESS\n} from '../constants';\nimport ParameterError from '../common/errors/parameter';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nconst MeetingInfoUtil = {};\n\nMeetingInfoUtil.getParsedUrl = (link) => {\n try {\n let parsedUrl = url.parse(link);\n\n if (!parsedUrl) {\n return false;\n }\n // hack for links such as <company>.webex.com/meet/<user> without a protocol\n if (!parsedUrl.protocol) {\n parsedUrl = url.parse(`${HTTPS_PROTOCOL}${link}`);\n }\n\n return parsedUrl;\n }\n catch (error) {\n LoggerProxy.logger.warn(`Meeting-info:util#getParsedUrl --> unable to parse the URL, error: ${error}`);\n\n return null;\n }\n};\n\n/**\n * Helper function to check if a string matches a known meeting link pattern\n * @param {String} value string to parse and see if it matches a meeting link\n * @returns {Boolean}\n */\nMeetingInfoUtil.isMeetingLink = (value) => {\n const parsedUrl = MeetingInfoUtil.getParsedUrl(value);\n const hostNameBool = parsedUrl.hostname && parsedUrl.hostname.includes(WEBEX_DOT_COM);\n const pathNameBool = parsedUrl.pathname && (parsedUrl.pathname.includes(`/${MEET}`) || parsedUrl.pathname.includes(`/${MEET_M}`) || parsedUrl.pathname.includes(`/${JOIN}`));\n\n return hostNameBool && pathNameBool;\n};\n\nMeetingInfoUtil.isConversationUrl = (value, webex) => {\n const clusterId = webex.internal.services.getClusterId(value);\n\n if (clusterId) {\n return clusterId.endsWith(CONVERSATION_SERVICE);\n }\n\n return false;\n};\n\n\nMeetingInfoUtil.isSipUri = (sipString) => {\n // TODO: lets remove regex from this equation and user URI matchers and such\n // have not found a great sip uri parser library as of now\n const sipUri = DIALER_REGEX.SIP_ADDRESS.exec(sipString);\n\n return sipUri;\n};\n\nMeetingInfoUtil.isPhoneNumber = (phoneNumber) => {\n const isValidNumber = DIALER_REGEX.PHONE_NUMBER.test(phoneNumber);\n\n return isValidNumber;\n};\n\nMeetingInfoUtil.getHydraId = (destination) => {\n const {type, id, cluster} = deconstructHydraId(destination);\n\n if (id && UUID_REG.test(id)) {\n if (type === _ROOM_) {\n return {room: true, destination: id, cluster};\n }\n if (type === _PEOPLE_) {\n return {people: true, destination: id, cluster};\n }\n\n return {};\n }\n\n return {};\n};\n\nMeetingInfoUtil.getSipUriFromHydraPersonId = (destination, webex) => webex.people.get(destination).then((res) => {\n if (res.emails && res.emails.length) {\n return res.emails[0];\n }\n throw new ParameterError('Hydra Id Lookup was an invalid hydra person id.');\n}).catch((err) => {\n LoggerProxy.logger.error(`Meeting-info:util#MeetingInfoUtil.getSipUriFromHydraPersonId --> getSipUriFromHydraPersonId ${err} `);\n throw err;\n});\n\n\nMeetingInfoUtil.getDestinationType = async (from) => {\n const {type, webex} = from;\n let {destination} = from;\n\n if (type === _PERSONAL_ROOM_) { // this case checks if your type is personal room\n if (!destination) { // if we are not getting anything in desination we fetch org and user ids from webex instance\n destination = {\n userId: webex.internal.device.userId,\n orgId: webex.internal.device.orgId\n };\n }\n else {\n const options = VALID_EMAIL_ADDRESS.test(destination) ? {email: destination} : {id: destination};// we are assuming userId as default\n const res = await webex.people.list(options);\n\n let {orgId, id: userId} = res.items[0];\n\n userId = deconstructHydraId(userId).id;\n orgId = deconstructHydraId(orgId).id;\n destination = {userId, orgId};\n }\n }\n if (type) {\n return {\n destination,\n type\n };\n }\n const options = {};\n const hydraId = MeetingInfoUtil.getHydraId(destination);\n\n if (MeetingInfoUtil.isMeetingLink(destination)) {\n LoggerProxy.logger.warn('Meeting-info:util#generateOptions --> WARN, use of Meeting Link is deprecated, please use a SIP URI instead');\n\n options.type = _MEETING_LINK_;\n options.destination = destination;\n }\n else if (MeetingInfoUtil.isSipUri(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n }\n else if (MeetingInfoUtil.isPhoneNumber(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n }\n else if (MeetingInfoUtil.isConversationUrl(destination, webex)) {\n options.type = _CONVERSATION_URL_;\n options.destination = destination;\n }\n else if (hydraId.people) {\n options.type = _SIP_URI_;\n\n return MeetingInfoUtil.getSipUriFromHydraPersonId(hydraId.destination, webex).then((res) => {\n options.destination = res;\n\n // Since hydra person ids require a unique case in which they are\n // entirely converted to a SIP URI, we need to set a flag for detecting\n // this type of destination.\n options.wasHydraPerson = true;\n\n return Promise.resolve(options);\n });\n }\n else if (hydraId.room) {\n options.type = _CONVERSATION_URL_;\n try {\n await webex.internal.services.waitForCatalog('postauth');\n\n const conversationUrl = webex.internal.conversation.getUrlFromClusterId({\n cluster: hydraId.cluster,\n id: hydraId.destination\n });\n\n options.destination = conversationUrl;\n }\n catch (e) {\n LoggerProxy.logger.error(`Meeting-info:util#getDestinationType --> ${e}`);\n throw (e);\n }\n }\n else {\n LoggerProxy.logger.warn('Meeting-info:util#getDestinationType --> (\\'MeetingInfo is fetched with meeting link, sip uri, phone number, hydra room id, hydra people id, or a conversation url.');\n throw new ParameterError('MeetingInfo is fetched with meeting link, sip uri, phone number, hydra room id, hydra people id, or a conversation url.');\n }\n\n return Promise.resolve(options);\n};\n\n/**\n * Helper function to build up a correct locus url depending on the value passed\n * @param {Object} options type and value to fetch meeting info\n * @param {String} options.type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]\n * @param {Object} options.destination ?? value.value\n * @returns {Object} returns an object with {resource, method}\n */\nMeetingInfoUtil.getRequestBody = (options) => {\n const {\n type, destination, password, captchaInfo\n } = options;\n const body = {\n supportHostKey: true\n };\n\n switch (type) {\n case _SIP_URI_:\n body.sipUrl = destination;\n break;\n case _PERSONAL_ROOM_:\n body.userId = destination.userId;\n body.orgId = destination.orgId;\n break;\n case _MEETING_ID_:\n body.meetingKey = destination;\n break;\n case _CONVERSATION_URL_:\n body.conversationUrl = destination;\n break;\n case _LOCUS_ID_:\n // use meetingID for the completer meeting info for the already started meeting\n if (destination.info?.webExMeetingId) {\n body.meetingKey = destination.info.webExMeetingId;\n }\n else if (destination.info?.sipUri) {\n body.sipUrl = destination.info.sipUri;\n }\n break;\n case _MEETING_LINK_:\n body.meetingUrl = destination;\n break;\n case _MEETING_UUID_: {\n body.meetingUUID = destination;\n break;\n }\n default:\n }\n\n if (password) {\n body.password = password;\n }\n\n if (captchaInfo) {\n body.captchaID = captchaInfo.id;\n body.captchaVerifyCode = captchaInfo.code;\n }\n\n return body;\n};\n\n/**\n * Helper function to parse the webex site/host from a URI string.\n * @param {String} uri string (e.g. '10019857020@convergedats.webex.com')\n * @returns {String} the site/host part of the URI string (e.g. 'convergedats.webex.com')\n */\nMeetingInfoUtil.getWebexSite = (uri) => {\n const exceptedDomains = ['meet.webex.com', 'meetup.webex.com', 'ciscospark.com'];\n const site = uri?.match(/.+@(.+\\..+\\.*.)$/)?.[1];\n\n return exceptedDomains.includes(site) ? null : site;\n};\n\n/**\n * Helper function to return the direct URI for fetching meeting info (to avoid a redirect).\n * @param {Object} options type and value to fetch meeting info\n * @param {String} options.type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]\n * @param {Object} options.destination ?? value.value\n * @returns {String} returns a URI string or null of there is no direct URI\n */\nMeetingInfoUtil.getDirectMeetingInfoURI = (options) => {\n const {\n type, destination\n } = options;\n\n let preferredWebexSite = null;\n\n switch (type) {\n case _SIP_URI_:\n preferredWebexSite = MeetingInfoUtil.getWebexSite(destination);\n break;\n case _LOCUS_ID_:\n preferredWebexSite = destination.info?.webExSite;\n break;\n default:\n }\n\n return preferredWebexSite ? `https://${preferredWebexSite}/wbxappapi/v1/meetingInfo` : null;\n};\n\nexport default MeetingInfoUtil;\n"]}
1
+ {"version":3,"sources":["utilv2.js"],"names":["MeetingInfoUtil","getParsedUrl","link","parsedUrl","url","parse","protocol","HTTPS_PROTOCOL","error","LoggerProxy","logger","warn","isMeetingLink","value","hostNameBool","hostname","includes","WEBEX_DOT_COM","pathNameBool","pathname","MEET","MEET_M","JOIN","isConversationUrl","webex","clusterId","internal","services","getClusterId","endsWith","CONVERSATION_SERVICE","isSipUri","sipString","sipUri","DIALER_REGEX","SIP_ADDRESS","exec","isPhoneNumber","phoneNumber","isValidNumber","PHONE_NUMBER","test","getHydraId","destination","type","id","cluster","UUID_REG","_ROOM_","room","_PEOPLE_","people","getSipUriFromHydraPersonId","get","then","res","emails","length","ParameterError","catch","err","getDestinationType","from","_PERSONAL_ROOM_","userId","device","orgId","options","VALID_EMAIL_ADDRESS","email","list","items","hydraId","_MEETING_LINK_","_SIP_URI_","_CONVERSATION_URL_","wasHydraPerson","resolve","waitForCatalog","conversationUrl","conversation","getUrlFromClusterId","getRequestBody","password","captchaInfo","body","supportHostKey","sipUrl","_MEETING_ID_","meetingKey","_LOCUS_ID_","info","webExMeetingId","meetingUrl","_MEETING_UUID_","meetingUUID","captchaID","captchaVerifyCode","code","getWebexSite","uri","exceptedDomains","site","match","getDirectMeetingIn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AEIwB,OAFJ,CACQxB,WADR;AAIA,MAAI8D,kBAAkB,GAAG,IAAzB;;AAEA,UAAQ7D,IAAR;AACE,SAAK8B,oBAAL;AACE+B,MAAAA,kBAAkB,GAAGzG,eAAe,CAACmG,YAAhB,CAA6BxD,WAA7B,CAArB;AACA;;AACF,SAAK+C,qBAAL;AACEe,MAAAA,kBAAkB,yBAAG9D,WAAW,CAACgD,IAAf,uDAAG,mBAAkBe,SAAvC;AACA;;AACF;AAPF;;AAUA,SAAOD,kBAAkB,qBAAcA,kBAAd,iCAA8D,IAAvF;AACD,CAlBD;;eAoBezG,e","sourcesContent":["import url from 'url';\n\nimport {\n deconstructHydraId\n} from '@webex/common';\n\nimport {\n _SIP_URI_,\n _PERSONAL_ROOM_,\n _MEETING_ID_,\n _CONVERSATION_URL_,\n _LOCUS_ID_,\n _MEETING_LINK_,\n _PEOPLE_,\n _ROOM_,\n _MEETING_UUID_,\n DIALER_REGEX,\n WEBEX_DOT_COM,\n CONVERSATION_SERVICE,\n JOIN,\n MEET,\n MEET_M,\n HTTPS_PROTOCOL,\n UUID_REG,\n VALID_EMAIL_ADDRESS\n} from '../constants';\nimport ParameterError from '../common/errors/parameter';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nconst MeetingInfoUtil = {};\n\nMeetingInfoUtil.getParsedUrl = (link) => {\n try {\n let parsedUrl = url.parse(link);\n\n if (!parsedUrl) {\n return false;\n }\n // hack for links such as <company>.webex.com/meet/<user> without a protocol\n if (!parsedUrl.protocol) {\n parsedUrl = url.parse(`${HTTPS_PROTOCOL}${link}`);\n }\n\n return parsedUrl;\n }\n catch (error) {\n LoggerProxy.logger.warn(`Meeting-info:util#getParsedUrl --> unable to parse the URL, error: ${error}`);\n\n return null;\n }\n};\n\n/**\n * Helper function to check if a string matches a known meeting link pattern\n * @param {String} value string to parse and see if it matches a meeting link\n * @returns {Boolean}\n */\nMeetingInfoUtil.isMeetingLink = (value) => {\n const parsedUrl = MeetingInfoUtil.getParsedUrl(value);\n const hostNameBool = parsedUrl.hostname && parsedUrl.hostname.includes(WEBEX_DOT_COM);\n const pathNameBool = parsedUrl.pathname && (parsedUrl.pathname.includes(`/${MEET}`) || parsedUrl.pathname.includes(`/${MEET_M}`) || parsedUrl.pathname.includes(`/${JOIN}`));\n\n return hostNameBool && pathNameBool;\n};\n\nMeetingInfoUtil.isConversationUrl = (value, webex) => {\n const clusterId = webex.internal.services.getClusterId(value);\n\n if (clusterId) {\n return clusterId.endsWith(CONVERSATION_SERVICE);\n }\n\n return false;\n};\n\n\nMeetingInfoUtil.isSipUri = (sipString) => {\n // TODO: lets remove regex from this equation and user URI matchers and such\n // have not found a great sip uri parser library as of now\n const sipUri = DIALER_REGEX.SIP_ADDRESS.exec(sipString);\n\n return sipUri;\n};\n\nMeetingInfoUtil.isPhoneNumber = (phoneNumber) => {\n const isValidNumber = DIALER_REGEX.PHONE_NUMBER.test(phoneNumber);\n\n return isValidNumber;\n};\n\nMeetingInfoUtil.getHydraId = (destination) => {\n const {type, id, cluster} = deconstructHydraId(destination);\n\n if (id && UUID_REG.test(id)) {\n if (type === _ROOM_) {\n return {room: true, destination: id, cluster};\n }\n if (type === _PEOPLE_) {\n return {people: true, destination: id, cluster};\n }\n\n return {};\n }\n\n return {};\n};\n\nMeetingInfoUtil.getSipUriFromHydraPersonId = (destination, webex) => webex.people.get(destination).then((res) => {\n if (res.emails && res.emails.length) {\n return res.emails[0];\n }\n throw new ParameterError('Hydra Id Lookup was an invalid hydra person id.');\n}).catch((err) => {\n LoggerProxy.logger.error(`Meeting-info:util#MeetingInfoUtil.getSipUriFromHydraPersonId --> getSipUriFromHydraPersonId ${err} `);\n throw err;\n});\n\n\nMeetingInfoUtil.getDestinationType = async (from) => {\n const {type, webex} = from;\n let {destination} = from;\n\n if (type === _PERSONAL_ROOM_) { // this case checks if your type is personal room\n if (!destination) { // if we are not getting anything in desination we fetch org and user ids from webex instance\n destination = {\n userId: webex.internal.device.userId,\n orgId: webex.internal.device.orgId\n };\n }\n else {\n const options = VALID_EMAIL_ADDRESS.test(destination) ? {email: destination} : {id: destination};// we are assuming userId as default\n const res = await webex.people.list(options);\n\n let {orgId, id: userId} = res.items[0];\n\n userId = deconstructHydraId(userId).id;\n orgId = deconstructHydraId(orgId).id;\n destination = {userId, orgId};\n }\n }\n if (type) {\n return {\n destination,\n type\n };\n }\n const options = {};\n const hydraId = MeetingInfoUtil.getHydraId(destination);\n\n if (MeetingInfoUtil.isMeetingLink(destination)) {\n LoggerProxy.logger.warn('Meeting-info:util#generateOptions --> WARN, use of Meeting Link is deprecated, please use a SIP URI instead');\n\n options.type = _MEETING_LINK_;\n options.destination = destination;\n }\n else if (MeetingInfoUtil.isSipUri(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n }\n else if (MeetingInfoUtil.isPhoneNumber(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n }\n else if (MeetingInfoUtil.isConversationUrl(destination, webex)) {\n options.type = _CONVERSATION_URL_;\n options.destination = destination;\n }\n else if (hydraId.people) {\n options.type = _SIP_URI_;\n\n return MeetingInfoUtil.getSipUriFromHydraPersonId(hydraId.destination, webex).then((res) => {\n options.destination = res;\n\n // Since hydra person ids require a unique case in which they are\n // entirely converted to a SIP URI, we need to set a flag for detecting\n // this type of destination.\n options.wasHydraPerson = true;\n\n return Promise.resolve(options);\n });\n }\n else if (hydraId.room) {\n options.type = _CONVERSATION_URL_;\n try {\n await webex.internal.services.waitForCatalog('postauth');\n\n const conversationUrl = webex.internal.conversation.getUrlFromClusterId({\n cluster: hydraId.cluster,\n id: hydraId.destination\n });\n\n options.destination = conversationUrl;\n }\n catch (e) {\n LoggerProxy.logger.error(`Meeting-info:util#getDestinationType --> ${e}`);\n throw (e);\n }\n }\n else {\n LoggerProxy.logger.warn('Meeting-info:util#getDestinationType --> (\\'MeetingInfo is fetched with meeting link, sip uri, phone number, hydra room id, hydra people id, or a conversation url.');\n throw new ParameterError('MeetingInfo is fetched with meeting link, sip uri, phone number, hydra room id, hydra people id, or a conversation url.');\n }\n\n return Promise.resolve(options);\n};\n\n/**\n * Helper function to build up a correct locus url depending on the value passed\n * @param {Object} options type and value to fetch meeting info\n * @param {String} options.type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]\n * @param {Object} options.destination ?? value.value\n * @returns {Object} returns an object with {resource, method}\n */\nMeetingInfoUtil.getRequestBody = (options) => {\n const {\n type, destination, password, captchaInfo\n } = options;\n const body = {\n supportHostKey: true\n };\n\n switch (type) {\n case _SIP_URI_:\n body.sipUrl = destination;\n break;\n case _PERSONAL_ROOM_:\n body.userId = destination.userId;\n body.orgId = destination.orgId;\n break;\n case _MEETING_ID_:\n body.meetingKey = destination;\n break;\n case _CONVERSATION_URL_:\n body.conversationUrl = destination;\n break;\n case _LOCUS_ID_:\n // use meetingID for the completer meeting info for the already started meeting\n if (destination.info?.webExMeetingId) {\n body.meetingKey = destination.info.webExMeetingId;\n }\n else if (destination.info?.sipUri) {\n body.sipUrl = destination.info.sipUri;\n }\n break;\n case _MEETING_LINK_:\n body.meetingUrl = destination;\n break;\n case _MEETING_UUID_: {\n body.meetingUUID = destination;\n break;\n }\n default:\n }\n\n if (password) {\n body.password = password;\n }\n\n if (captchaInfo) {\n body.captchaID = captchaInfo.id;\n body.captchaVerifyCode = captchaInfo.code;\n }\n\n return body;\n};\n\n/**\n * Helper function to parse the webex site/host from a URI string.\n * @param {String} uri string (e.g. '10019857020@convergedats.webex.com')\n * @returns {String} the site/host part of the URI string (e.g. 'convergedats.webex.com')\n */\nMeetingInfoUtil.getWebexSite = (uri) => {\n const exceptedDomains = ['meet.webex.com', 'meetup.webex.com', 'ciscospark.com'];\n const site = uri?.match(/.+@([^.]+\\.[^.]+\\.[^.]+)$/)?.[1];\n\n return exceptedDomains.includes(site) ? null : site;\n};\n\n/**\n * Helper function to return the direct URI for fetching meeting info (to avoid a redirect).\n * @param {Object} options type and value to fetch meeting info\n * @param {String} options.type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]\n * @param {Object} options.destination ?? value.value\n * @returns {String} returns a URI string or null of there is no direct URI\n */\nMeetingInfoUtil.getDirectMeetingInfoURI = (options) => {\n const {\n type, destination\n } = options;\n\n let preferredWebexSite = null;\n\n switch (type) {\n case _SIP_URI_:\n preferredWebexSite = MeetingInfoUtil.getWebexSite(destination);\n break;\n case _LOCUS_ID_:\n preferredWebexSite = destination.info?.webExSite;\n break;\n default:\n }\n\n return preferredWebexSite ? `https://${preferredWebexSite}/wbxappapi/v1/meetingInfo` : null;\n};\n\nexport default MeetingInfoUtil;\n"]}
@@ -275,7 +275,7 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
275
275
  // Either the locus
276
276
  // TODO : Add check for the callBack Address
277
277
 
278
- meeting = this.meetingCollection.getByKey(_constants.LOCUS_URL, data.locusUrl) || this.meetingCollection.getByKey(_constants.CORRELATION_ID, _util2.default.checkForCorrelationId(this.webex.internal.device.url, data.locus)) || this.meetingCollection.getByKey(_constants.SIP_URI, data.locus.self && data.locus.self.callbackInfo && data.locus.self.callbackInfo.callbackAddress) || this.meetingCollection.getByKey(_constants.CONVERSATION_URL, data.locus.conversationUrl); // Special case when locus has got replaced, This only happend once if a replace locus exists
278
+ meeting = this.meetingCollection.getByKey(_constants.LOCUS_URL, data.locusUrl) || this.meetingCollection.getByKey(_constants.CORRELATION_ID, _util2.default.checkForCorrelationId(this.webex.internal.device.url, data.locus)) || this.meetingCollection.getByKey(_constants.SIP_URI, data.locus.self && data.locus.self.callbackInfo && data.locus.self.callbackInfo.callbackAddress) || (this.config.experimental.enableUnifiedMeetings ? undefined : this.meetingCollection.getByKey(_constants.CONVERSATION_URL, data.locus.conversationUrl)); // Special case when locus has got replaced, This only happend once if a replace locus exists
279
279
  // https://sqbu-github.cisco.com/WebExSquared/locus/wiki/Locus-changing-mid-call
280
280
 
281
281
  if (!meeting && ((_data$locus = data.locus) === null || _data$locus === void 0 ? void 0 : (_data$locus$replaces = _data$locus.replaces) === null || _data$locus$replaces === void 0 ? void 0 : _data$locus$replaces.length) > 0) {
@@ -784,7 +784,16 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
784
784
  var meeting = null;
785
785
 
786
786
  if (type === _constants._CONVERSATION_URL_ || options.type === _constants._CONVERSATION_URL_) {
787
- meeting = _this10.meetingCollection.getByKey(_constants.CONVERSATION_URL, targetDest);
787
+ var foundMeeting = _this10.meetingCollection.getByKey(_constants.CONVERSATION_URL, targetDest);
788
+
789
+ if (foundMeeting) {
790
+ var foundMeetingIsNotCalendarMeeting = !foundMeeting.locusInfo.scheduledMeeting; // If the found meeting is not a calendar meeting, return that meeting.
791
+ // This allows for the creation of instant-meetings when calendar meetings are present.
792
+
793
+ if (foundMeetingIsNotCalendarMeeting) {
794
+ meeting = foundMeeting;
795
+ }
796
+ }
788
797
  } // Attempt to collect the meeting if it exists.
789
798
 
790
799
 
@@ -870,20 +879,19 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
870
879
  roapSeq: 0,
871
880
  locus: type === _constants._LOCUS_ID_ ? destination : null,
872
881
  // pass the locus object if present
873
- meetingInfoProvider: this.meetingInfo
882
+ meetingInfoProvider: this.meetingInfo,
883
+ destination: destination,
884
+ destinationType: type
874
885
  }, {
875
886
  parent: this.webex
876
887
  });
877
888
  this.meetingCollection.set(meeting);
878
889
  _context.prev = 3;
879
890
  _context.next = 6;
880
- return meeting.fetchMeetingInfo({
881
- destination: destination,
882
- type: type
883
- });
891
+ return meeting.fetchMeetingInfo({});
884
892
 
885
893
  case 6:
886
- _context.next = 13;
894
+ _context.next = 12;
887
895
  break;
888
896
 
889
897
  case 8:
@@ -897,13 +905,10 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
897
905
  _loggerProxy.default.logger.info('Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share');
898
906
  }
899
907
 
900
- _loggerProxy.default.logger.debug("Meetings:index#createMeeting --> Debug ".concat(_context.t0, " fetching /meetingInfo for creation.")); // We need to save this info for future reference
901
-
902
-
903
- meeting.destination = destination;
908
+ _loggerProxy.default.logger.debug("Meetings:index#createMeeting --> Debug ".concat(_context.t0, " fetching /meetingInfo for creation."));
904
909
 
905
- case 13:
906
- _context.prev = 13;
910
+ case 12:
911
+ _context.prev = 12;
907
912
 
908
913
  // For type LOCUS_ID we need to parse the locus object to get the information
909
914
  // about the caller and callee
@@ -926,17 +931,17 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
926
931
  });
927
932
  }
928
933
 
929
- return _context.finish(13);
934
+ return _context.finish(12);
930
935
 
931
- case 16:
936
+ case 15:
932
937
  return _context.abrupt("return", meeting);
933
938
 
934
- case 17:
939
+ case 16:
935
940
  case "end":
936
941
  return _context.stop();
937
942
  }
938
943
  }
939
- }, _callee, this, [[3, 8, 13, 16]]);
944
+ }, _callee, this, [[3, 8, 12, 15]]);
940
945
  }));
941
946
 
942
947
  function createMeeting(_x) {
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"names":["Meetings","args","MEETINGS","request","Request","parent","webex","loggerRequest","LoggerRequest","meetingCollection","MeetingCollection","personalMeetingRoom","reachability","registered","preferredWebexSite","media","getUserMedia","Media","getSupportedDevice","onReady","MeetingsUtil","checkH264Support","disableNotifications","Metrics","initialSetup","data","meeting","getByKey","LOCUS_URL","locusUrl","CORRELATION_ID","checkForCorrelationId","internal","device","url","locus","SIP_URI","self","callbackInfo","callbackAddress","CONVERSATION_URL","conversationUrl","replaces","length","fullState","state","LOCUS","STATE","INACTIVE","LoggerProxy","logger","warn","_LEFT_","removed","create","_LOCUS_ID_","then","newMeeting","locusInfo","catch","e","console","log","finally","getMeetingByType","_ID_","id","postEvent","event","eventType","REMOTE_STARTED","trigger","MERCURY_EVENT","Trigger","file","function","EVENT_TRIGGERS","MEETING_ADDED","type","_MEETING_","_JOIN_","_INCOMING_","parse","envelope","LOCUSEVENT","MESSAGE_ROAP","handleLocusEvent","MEETINGS_NETWORK_DISCONNECTED","mercury","on","LOCUS_MERCURY","handleLocusMercury","ROAP","ROAP_MERCURY","handleRoapMercury","ONLINE","syncMeetings","OFFLINE","handleMercuryOffline","off","once","READY","StaticConfig","set","config","LoggerConfig","logging","meetingInfo","experimental","enableUnifiedMeetings","MeetingInfoV2","MeetingInfo","PersonalMeetingRoom","MEETINGS_READY","changeState","enableAdhocMeetings","canAuthorize","error","reject","Error","info","resolve","all","fetchUserPreferredWebexSite","getGeoHint","startReachability","message","register","connect","call","listenForEvents","MEETINGS_REGISTERED","sendBehavioralMetric","BEHAVIORAL_METRICS","MEETINGS_REGISTRATION_SUCCESS","MEETINGS_REGISTRATION_FAILED","reason","stack","stopListeningForEvents","disconnect","unregister","MEETINGS_UNREGISTERED","options","uploadLogs","uploadResult","MEETING_LOG_UPLOAD_SUCCESS","meetingId","details","uploadError","MEETING_LOG_UPLOAD_FAILURE","UPLOAD_LOGS_FAILURE","meetingsId","code","Reachability","setReachability","getReachability","gatherReachability","fetchGeoHint","res","geoHintInfo","fetchLoginUserInformation","userPreferences","parseUserPreferences","MeetingUtil","cleanUp","delete","MEETING_REMOVED","destination","fetchInfoOptions","targetDest","_CONVERSATION_URL_","createMeeting","createdMeeting","EVENTS","DESTROY_MEETING","payload","autoUploadLogs","callStart","lastActive","correlationId","feedbackId","locusId","webExMeetingId","destroy","REQUEST_UPLOAD_LOGS","meetingInstance","Meeting","userId","deviceUrl","orgId","roapSeq","meetingInfoProvider","fetchMeetingInfo","CaptchaError","PasswordError","debug","sipUri","setSipUri","meetingAddedType","getMeetingAddedType","value","getAll","getActiveMeetings","locusArray","activeLocusUrl","loci","forEach","push","meetingsCollection","includes","MEETING_REMOVED_REASON","NO_MEETINGS_TO_SYNC","scheduled","get","StatsAnalyzer","StatsCalculator","WebexPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAuBA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;IACqBA,Q;;;;;AAGjB;AACJ;AACA;AACA;AACA;AACA;AACI,sBAAqB;AAAA;;AAAA;;AAAA,sCAANC,IAAM;AAANA,MAAAA,IAAM;AAAA;;AACnB,oDAASA,IAAT;AAEA;AACN;AACA;AACA;AACA;AACA;AACA;;AATyB,4FARTC,mBAQS;AAUnB,UAAKC,OAAL,GAAe,IAAIC,iBAAJ,CAAY,EAAZ,EAAgB;AAACC,MAAAA,MAAM,EAAE,MAAKC;AAAd,KAAhB,CAAf;AACA;AACN;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,aAAL,GAAqB,IAAIC,gBAAJ,CAAkB;AAACF,MAAAA,KAAK,EAAE,MAAKA;AAAb,KAAlB,CAArB;AACA,UAAKG,iBAAL,GAAyB,IAAIC,mBAAJ,EAAzB;AACA;AACN;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,mBAAL,GAA2B,IAA3B;AACA;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,YAAL,GAAoB,IAApB;AAEA;AACN;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,UAAL,GAAkB,KAAlB;AAEA;AACN;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,kBAAL,GAA0B,EAA1B;AAEA;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,KAAL,GAAa;AACXC,MAAAA,YAAY,EAAEC,eAA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BgM,MAAvB,CAA8B;AAACW,QAAAA,SAAS,EAAE;AAAZ,OAA9B,CAAP;AACD;AAED;AACJ;AACA;AACA;;;;WACI,qBAAY;AACV,aAAOnK,qBAAYoK,GAAZ,EAAP;AACD;AAED;AACJ;AACA;AACA;AACA;AACA;;;;WACI,uBAAc;AACZ,aAAOC,iBAAP;AACD;AAED;AACJ;AACA;AACA;AACA;AACA;;;;WACI,yBAAgB;AACd,aAAOC,mBAAP;AACD;;;EA/0BiCC,sB","sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n*/\n\nimport '@webex/internal-plugin-mercury';\nimport '@webex/internal-plugin-conversation';\nimport {WebexPlugin} from '@webex/webex-core';\n\nimport 'webrtc-adapter';\n\nimport Metrics from '../metrics';\nimport {trigger, eventType} from '../metrics/config';\nimport LoggerConfig from '../common/logs/logger-config';\nimport StaticConfig from '../common/config';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport LoggerRequest from '../common/logs/request';\nimport Trigger from '../common/events/trigger-proxy';\nimport Media from '../media';\nimport MeetingUtil from '../meeting/util';\nimport {\n MEETINGS,\n EVENTS,\n EVENT_TRIGGERS,\n READY,\n LOCUSEVENT,\n LOCUS_URL,\n ROAP,\n ONLINE,\n OFFLINE,\n _MEETING_,\n _JOIN_,\n _LOCUS_ID_,\n _INCOMING_,\n LOCUS,\n CORRELATION_ID,\n SIP_URI,\n _LEFT_,\n _ID_,\n MEETING_REMOVED_REASON,\n _CONVERSATION_URL_,\n CONVERSATION_URL\n} from '../constants';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\nimport MeetingInfo from '../meeting-info';\nimport MeetingInfoV2 from '../meeting-info/meeting-info-v2';\nimport Meeting from '../meeting';\nimport PersonalMeetingRoom from '../personal-meeting-room';\nimport Reachability from '../reachability';\nimport Request from '../meetings/request';\nimport StatsAnalyzer from '../analyzer/analyzer';\nimport StatsCalculator from '../analyzer/calculator';\nimport PasswordError from '../common/errors/password-error';\nimport CaptchaError from '../common/errors/captcha-error';\n\nimport MeetingCollection from './collection';\nimport MeetingsUtil from './util';\n\n\n/**\n * Meetings Ready Event\n * Emitted when the meetings instance on webex is ready\n * @event meetings:ready\n * @instance\n * @memberof Meetings\n */\n\n/**\n * Meetings Network Disconnected Event\n * Emitted when the meetings instance is disconnected from\n * the internal mercury server\n * @event network:disconnected\n * @instance\n * @memberof Meetings\n */\n\n/**\n * Meetings Registered Event\n * Emitted when the meetings instance has been registered and listening\n * @event meetings:registered\n * @instance\n * @memberof Meetings\n */\n\n/**\n * Meeting Removed Event\n * Emitted when a meeting was removed from the cache of meetings\n * @event meeting:removed\n * @instance\n * @type {Object}\n * @property {String} meetingId the removed meeting\n * @property {Object} response the server response\n * @property {String} type what type of meeting it was\n * @memberof Meetings\n */\n\n/**\n * Meeting Added Event\n * Emitted when a meeting was added to the cache of meetings\n * @event meeting:added\n * @instance\n * @type {Object}\n * @property {String} meetingId the added meeting\n * @property {String} type what type of meeting it was\n * @memberof Meetings\n */\n\n/**\n * Maintain a cache of meetings and sync with services.\n * @class\n */\nexport default class Meetings extends WebexPlugin {\n namespace = MEETINGS;\n\n /**\n * Initializes the Meetings Plugin\n * @constructor\n * @public\n * @memberof Meetings\n */\n constructor(...args) {\n super(...args);\n\n /**\n * The Meetings request to interact with server\n * @instance\n * @type {Object}\n * @private\n * @memberof Meetings\n */\n this.request = new Request({}, {parent: this.webex});\n /**\n * Log upload request helper\n * @instance\n * @type {Object}\n * @private\n * @memberof Meetings\n */\n this.loggerRequest = new LoggerRequest({webex: this.webex});\n this.meetingCollection = new MeetingCollection();\n /**\n * The PersonalMeetingRoom object to interact with server\n * @instance\n * @type {Object}\n * @public\n * @memberof Meetings\n */\n this.personalMeetingRoom = null;\n /**\n * The Reachability object to interact with server, starts as null until {@link Meeting#setReachability} is called\n * starts as null\n * @instance\n * @type {Object}\n * @private\n * @memberof Meetings\n */\n this.reachability = null;\n\n /**\n * If the meetings plugin has been registered and listening via {@link Meetings#register}\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Meetings\n */\n this.registered = false;\n\n /**\n * This values indicates the preferred webex site the user will start there meeting, getsits value from {@link Meetings#register}\n * @instance\n * @type {String}\n * @private\n * @memberof Meetings\n */\n this.preferredWebexSite = '';\n\n /**\n * The public interface for the internal Media util files. These are helpful to expose outside the context\n * of a meeting so that a user can access media without creating a meeting instance.\n * @instance\n * @type {Object}\n * @private\n * @memberof Meetings\n */\n this.media = {\n getUserMedia: Media.getUserMedia,\n getSupportedDevice: Media.getSupportedDevice\n };\n\n this.onReady();\n MeetingsUtil.checkH264Support({disableNotifications: true});\n Metrics.initialSetup(this.meetingCollection, this.webex);\n }\n\n /**\n * handle locus events and takes meeting actions with them as they come in\n * @param {Object} data a locus event\n * @param {String} data.locusUrl\n * @param {Object} data.locus\n * @param {String} data.eventType\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n handleLocusEvent(data) {\n let meeting = null;\n\n // getting meeting by correlationId. This will happen for the new event\n // Either the locus\n // TODO : Add check for the callBack Address\n meeting = this.meetingCollection.getByKey(LOCUS_URL, data.locusUrl) ||\n this.meetingCollection.getByKey(CORRELATION_ID, MeetingsUtil.checkForCorrelationId(this.webex.internal.device.url, data.locus)) ||\n this.meetingCollection.getByKey(SIP_URI, data.locus.self && data.locus.self.callbackInfo && data.locus.self.callbackInfo.callbackAddress) ||\n this.meetingCollection.getByKey(CONVERSATION_URL, data.locus.conversationUrl);\n\n // Special case when locus has got replaced, This only happend once if a replace locus exists\n // https://sqbu-github.cisco.com/WebExSquared/locus/wiki/Locus-changing-mid-call\n\n if (!meeting && data.locus?.replaces?.length > 0) {\n // Always the last element in the replace is the active one\n meeting = this.meetingCollection.getByKey(LOCUS_URL, data.locus.replaces[data.locus.replaces.length - 1].locusUrl);\n }\n\n if (!meeting) {\n // TODO: create meeting when we get a meeting object\n // const checkForEnded = (locus) => {\n // TODO: you already ended the meeting but you got an event later\n // Mainly for 1:1 Callsor meeting\n // Happens mainly after refresh\n\n // 1:1 Meeting\n // 1) You ended a call before but you got a mercury event\n // Make sure end the call and cleanup the meeting only if the mercury\n // event says so\n // 2) Maintain lastSync time in the meetings object which helps to compare\n // If the meeting came befor or after the sync . ANy meeting start time before the sync time is invalid\n\n // For space Meeting\n // Check the locus object and see who has joined\n\n // };\n // rather then locus object change to locus url\n\n if (data.locus && data.locus.fullState && data.locus.fullState.state === LOCUS.STATE.INACTIVE) {\n // just ignore the event as its already ended and not active\n LoggerProxy.logger.warn('Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.');\n\n return;\n }\n\n\n // When its wireless share or guest and user leaves the meeting we dont have to keep the meeting object\n // Any future events will be neglected\n\n if (data.locus && data.locus.self && (data.locus.self.state === _LEFT_ && data.locus.self.removed === true)) {\n // just ignore the event as its already ended and not active\n LoggerProxy.logger.warn('Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.');\n\n return;\n }\n\n this.create(data.locus, _LOCUS_ID_).then((newMeeting) => {\n meeting = newMeeting;\n\n // It's a new meeting so initialize the locus data\n meeting.locusInfo.initialSetup(data.locus);\n }).catch((e) => {\n console.log(e);\n })\n .finally(() => {\n // There will be cases where locus event comes in gets created and deleted because its a 1:1 and meeting gets deleted\n // because the other user left so before sending 'added' event make sure it exists in the collection\n\n if (this.getMeetingByType(_ID_, meeting.id)) {\n Metrics.postEvent({event: eventType.REMOTE_STARTED, meeting, data: {trigger: trigger.MERCURY_EVENT}});\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'handleLocusEvent'\n },\n EVENT_TRIGGERS.MEETING_ADDED,\n {\n meeting,\n type: meeting.type === _MEETING_ ? _JOIN_ : _INCOMING_\n }\n );\n }\n else {\n // Meeting got added but was not found in the collection. It might have got destroyed\n LoggerProxy.logger.warn('Meetings:index#handleLocusEvent --> Created and destroyed meeting object before sending an event');\n }\n });\n }\n else {\n meeting.locusInfo.parse(meeting, data);\n }\n }\n\n /**\n * handles locus events through mercury that are not roap\n * @param {Object} envelope\n * @param {Object} envelope.data\n * @param {String} envelope.data.eventType\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n handleLocusMercury(envelope) {\n const {data} = envelope;\n const {eventType} = data;\n\n if (eventType && eventType !== LOCUSEVENT.MESSAGE_ROAP) {\n this.handleLocusEvent(data);\n }\n }\n\n\n /**\n * handles mecury offline event\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n handleMercuryOffline() {\n Trigger.trigger(\n this,\n {\n file: 'meetings/index',\n function: 'handleMercuryOffline'\n },\n EVENT_TRIGGERS.MEETINGS_NETWORK_DISCONNECTED,\n );\n }\n\n\n /**\n * registers for locus and roap mercury events\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n listenForEvents() {\n this.webex.internal.mercury.on(LOCUSEVENT.LOCUS_MERCURY, (envelope) => {\n this.handleLocusMercury(envelope);\n });\n this.webex.internal.mercury.on(ROAP.ROAP_MERCURY, (envelope) => {\n MeetingsUtil.handleRoapMercury(envelope, this.meetingCollection);\n });\n\n this.webex.internal.mercury.on(ONLINE, () => {\n this.syncMeetings();\n });\n\n this.webex.internal.mercury.on(OFFLINE, () => {\n this.handleMercuryOffline();\n });\n }\n\n /**\n * stops listening for locus and roap mercury events\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n stopListeningForEvents() {\n this.webex.internal.mercury.off(LOCUSEVENT.LOCUS_MERCURY);\n this.webex.internal.mercury.off(ROAP.ROAP_MERCURY);\n this.webex.internal.mercury.off(ONLINE);\n }\n\n /**\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n onReady() {\n this.webex.once(READY, () => {\n StaticConfig.set(this.config);\n LoggerProxy.set(this.webex.logger);\n LoggerConfig.set(this.config.logging);\n\n /**\n * The MeetingInfo object to interact with server\n * @instance\n * @type {Object}\n * @private\n * @memberof Meetings\n */\n this.meetingInfo = this.config.experimental.enableUnifiedMeetings ? new MeetingInfoV2(this.webex) : new MeetingInfo(this.webex);\n this.personalMeetingRoom = new PersonalMeetingRoom({meetingInfo: this.meetingInfo}, {parent: this.webex});\n\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'onReady'\n },\n EVENT_TRIGGERS.MEETINGS_READY\n );\n });\n }\n\n /**\n * API to toggle unified meetings\n * @param {Boolean} changeState\n * @private\n * @memberof Meetings\n * @returns {undefined}\n */\n _toggleUnifiedMeetings(changeState) {\n if (typeof changeState !== 'boolean') {\n return;\n }\n if (this.config?.experimental?.enableUnifiedMeetings !== changeState) {\n this.config.experimental.enableUnifiedMeetings = changeState;\n this.meetingInfo = changeState ? new MeetingInfoV2(this.webex) : new MeetingInfo(this.webex);\n }\n }\n\n /**\n * API to toggle starting adhoc meeting\n * @param {Boolean} changeState\n * @private\n * @memberof Meetings\n * @returns {undefined}\n */\n _toggleAdhocMeetings(changeState) {\n if (typeof changeState !== 'boolean') {\n return;\n }\n if (this.config?.experimental?.enableAdhocMeetings !== changeState) {\n this.config.experimental.enableAdhocMeetings = changeState;\n }\n }\n\n /**\n * Explicitly sets up the meetings plugin by registering\n * the device, connecting to mercury, and listening for locus events.\n *\n * @returns {Promise}\n * @public\n * @memberof Meetings\n */\n register() {\n if (!this.webex.canAuthorize) {\n LoggerProxy.logger.error('Meetings:index#register --> ERROR, Unable to register, SDK cannot authorize');\n\n return Promise.reject(new Error('SDK cannot authorize'));\n }\n\n\n if (this.registered) {\n LoggerProxy.logger.info('Meetings:index#register --> INFO, Meetings plugin already registered');\n\n return Promise.resolve();\n }\n\n return Promise.all([\n this.fetchUserPreferredWebexSite(),\n this.getGeoHint(),\n this.startReachability().catch((error) => {\n LoggerProxy.logger.error(`Meetings:index#register --> GDM error, ${error.message}`);\n }),\n this.webex.internal.device.register()\n .then(() => LoggerProxy.logger.info(`Meetings:index#register --> INFO, Device registered ${this.webex.internal.device.url}`))\n .then(() => this.webex.internal.mercury.connect()),\n MeetingsUtil.checkH264Support.call(this)\n ]).then(() => {\n this.listenForEvents();\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'register'\n },\n EVENT_TRIGGERS.MEETINGS_REGISTERED\n );\n this.registered = true;\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.MEETINGS_REGISTRATION_SUCCESS,\n );\n })\n .catch((error) => {\n LoggerProxy.logger.error(`Meetings:index#register --> ERROR, Unable to register, ${error.message}`);\n\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.MEETINGS_REGISTRATION_FAILED,\n {\n reason: error.message,\n stack: error.stack\n }\n );\n\n return Promise.reject(error);\n });\n }\n\n /**\n * Explicitly tears down the meetings plugin by deregistering\n * the device, disconnecting from mercury, and stops listening to locus events\n *\n * @returns {Promise}\n * @public\n * @memberof Meetings\n */\n unregister() {\n if (!this.registered) {\n LoggerProxy.logger.info('Meetings:index#unregister --> INFO, Meetings plugin already unregistered');\n\n return Promise.resolve();\n }\n\n this.stopListeningForEvents();\n\n return this.webex.internal.mercury.disconnect()\n .then(() => this.webex.internal.device.unregister())\n .then(() => {\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'unregister'\n },\n EVENT_TRIGGERS.MEETINGS_UNREGISTERED\n );\n this.registered = false;\n });\n }\n\n /**\n * Uploads logs to the webex services for tracking\n * @param {Object} [options={}]\n * @param {String} [options.callStart] Call Start Time\n * @param {String} [options.feedbackId] ID used for tracking\n * @param {String} [options.locusId]\n * @param {String} [options.correlationId]\n * @param {String} [options.meetingId] webex meeting ID\n * @param {String} [options.userId] userId\n * @param {String} [options.orgId] org id\n * @returns {String} feedback ID logs were submitted under\n */\n uploadLogs(options = {}) {\n LoggerProxy.logger.info('Meetings:index#uploadLogs --> uploading logs');\n\n return this.loggerRequest.uploadLogs(options)\n .then((uploadResult) => {\n LoggerProxy.logger.info('Meetings:index#uploadLogs --> Upload logs for meeting completed.', uploadResult);\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'uploadLogs'\n },\n EVENT_TRIGGERS.MEETING_LOG_UPLOAD_SUCCESS,\n {\n meetingId: options.meetingId,\n details: uploadResult\n }\n );\n })\n .catch((uploadError) => {\n LoggerProxy.logger.error('Meetings:index#uploadLogs --> Unable to upload logs for meeting', uploadError);\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'uploadLogs'\n },\n EVENT_TRIGGERS.MEETING_LOG_UPLOAD_FAILURE,\n {\n meetingId: options.meetingId,\n reason: uploadError\n }\n );\n\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.UPLOAD_LOGS_FAILURE,\n {\n meetingId: options.meetingsId,\n reason: uploadError.message,\n stack: uploadError.stack,\n code: uploadError.code\n }\n );\n });\n }\n\n /**\n * initializes the reachability instance for Meetings\n * @returns {undefined}\n * @public\n * @memberof Meetings\n */\n setReachability() {\n this.reachability = new Reachability(this.webex);\n }\n\n /**\n * gets the reachability instance for Meetings\n * @returns {Reachability}\n * @public\n * @memberof Meetings\n */\n getReachability() {\n return this.reachability;\n }\n\n /**\n * initializes and starts gathering reachability for Meetings\n * @returns {Promise}\n * @public\n * @memberof Meetings\n */\n startReachability() {\n if (!this.reachability) {\n this.setReachability();\n }\n\n return this.getReachability().gatherReachability();\n }\n\n /**\n * Get geoHint for info for meetings\n * @returns {Promise}\n * @private\n * @memberof Meetings\n */\n getGeoHint() {\n return this.request.fetchGeoHint().then((res) => {\n this.geoHintInfo = res;\n });\n }\n\n /**\n * Fetch user preferred webex site information\n * This also has other infomation about the user\n * @returns {Promise}\n * @private\n * @memberof Meetings\n */\n fetchUserPreferredWebexSite() {\n return this.request.fetchLoginUserInformation().then((res) => {\n if (res && res.userPreferences) {\n this.preferredWebexSite = MeetingsUtil.parseUserPreferences(res?.userPreferences);\n }\n });\n }\n\n\n /**\n * gets the personal meeting room instance, for saved PMR values for this user\n * @returns {PersonalMeetingRoom}\n * @public\n * @memberof Meetings\n */\n\n getPersonalMeetingRoom() {\n return this.personalMeetingRoom;\n }\n\n /**\n * @param {Meeting} meeting\n * @param {Object} reason\n * @param {String} type\n * @returns {Undefined}\n * @private\n * @memberof Meetings\n */\n destroy(meeting, reason) {\n MeetingUtil.cleanUp(meeting);\n this.meetingCollection.delete(meeting.id);\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'destroy'\n },\n EVENT_TRIGGERS.MEETING_REMOVED,\n {\n meetingId: meeting.id,\n reason\n }\n );\n }\n\n /**\n * Create a meeting.\n * @param {string} destination - sipURL, spaceId, phonenumber, or locus object}\n * @param {string} [type] - the optional specified type, such as locusId\n * @returns {Promise<Meeting>} A new Meeting.\n * @public\n * @memberof Meetings\n */\n create(destination, type = null) {\n // TODO: type should be from a dictionary\n\n // Validate meeting information based on the provided destination and\n // type. This must be performed prior to determining if the meeting is\n // found in the collection, as we mutate the destination for hydra person\n // id values.\n return this.meetingInfo.fetchInfoOptions(destination, type)\n // Catch a failure to fetch info options.\n .catch((error) => {\n LoggerProxy.logger.info(`Meetings:index#create --> INFO, unable to determine info options: ${error.message}`);\n })\n .then((options = {}) => {\n // Normalize the destination.\n const targetDest = options.destination || destination;\n\n // check for the conversation URL then sip Url\n let meeting = null;\n\n if (type === _CONVERSATION_URL_ || options.type === _CONVERSATION_URL_) {\n meeting = this.meetingCollection.getByKey(CONVERSATION_URL, targetDest);\n }\n\n // Attempt to collect the meeting if it exists.\n if (!meeting) {\n meeting = this.meetingCollection.getByKey(SIP_URI, targetDest);\n }\n\n\n // Validate if a meeting was found.\n if (!meeting) {\n // Create a meeting based on the normalized destination and type.\n return this.createMeeting(targetDest, type)\n .then((createdMeeting) => {\n // If the meeting was successfully created.\n if (createdMeeting && createdMeeting.on) {\n // Create a destruction event for the meeting.\n createdMeeting.on(EVENTS.DESTROY_MEETING, (payload) => {\n if (this.config.autoUploadLogs) {\n this.uploadLogs({\n callStart: createdMeeting.locusInfo?.fullState?.lastActive,\n correlationId: createdMeeting.correlationId,\n feedbackId: createdMeeting.correlationId,\n locusId: createdMeeting.locusId,\n meetingId: createdMeeting.locusInfo?.info?.webExMeetingId\n }).then(() => this.destroy(createdMeeting, payload.reason));\n }\n else {\n this.destroy(createdMeeting, payload.reason);\n }\n });\n\n createdMeeting.on(EVENTS.REQUEST_UPLOAD_LOGS, (meetingInstance) => {\n if (this.config.autoUploadLogs) {\n this.uploadLogs({\n callStart: meetingInstance?.locusInfo?.fullState?.lastActive,\n correlationId: meetingInstance.correlationId,\n feedbackId: meetingInstance.correlationId,\n locusId: meetingInstance.locusId,\n meetingId: meetingInstance.locusInfo?.info?.webExMeetingId\n });\n }\n });\n }\n else {\n LoggerProxy.logger.error(`Meetings:index#create --> ERROR, meeting does not have on method, will not be destroyed, meeting cleanup impossible for meeting: ${meeting}`);\n }\n\n // Return the newly created meeting.\n return Promise.resolve(createdMeeting);\n });\n }\n\n // Return the existing meeting.\n return Promise.resolve(meeting);\n });\n }\n\n /**\n * @param {String} destination see create()\n * @param {String} type see create()\n * @returns {Promise} a new meeting instance complete with meeting info and destination\n * @private\n * @memberof Meetings\n */\n async createMeeting(destination, type = null) {\n const meeting = new Meeting(\n {\n userId: this.webex.internal.device.userId,\n deviceUrl: this.webex.internal.device.url,\n orgId: this.webex.internal.device.orgId,\n roapSeq: 0,\n locus: type === _LOCUS_ID_ ? destination : null, // pass the locus object if present\n meetingInfoProvider: this.meetingInfo\n },\n {\n parent: this.webex\n }\n );\n\n this.meetingCollection.set(meeting);\n\n try {\n await meeting.fetchMeetingInfo({destination, type});\n }\n catch (err) {\n if (!(err instanceof CaptchaError) && !(err instanceof PasswordError)) {\n // if there is no meeting info we assume its a 1:1 call or wireless share\n LoggerProxy.logger.info(`Meetings:index#createMeeting --> Info Unable to fetch meeting info for ${destination}.`);\n LoggerProxy.logger.info('Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share');\n }\n LoggerProxy.logger.debug(`Meetings:index#createMeeting --> Debug ${err} fetching /meetingInfo for creation.`);\n // We need to save this info for future reference\n meeting.destination = destination;\n }\n finally {\n // For type LOCUS_ID we need to parse the locus object to get the information\n // about the caller and callee\n // Meeting Added event will be created in `handleLocusEvent`\n if (type !== _LOCUS_ID_) {\n if (!meeting.sipUri) {\n meeting.setSipUri(destination);\n }\n\n // TODO: check if we have to move this to parser\n const meetingAddedType = MeetingsUtil.getMeetingAddedType(type);\n\n // We typically shouldn't need to trigger both and event and return a promise.\n // Is this a special case? We want to make the public API usage as simple as possible.\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'createMeeting'\n },\n EVENT_TRIGGERS.MEETING_ADDED,\n {\n meeting,\n type: meetingAddedType\n }\n );\n }\n }\n\n return meeting;\n\n // Create the meeting calling the necessary service endpoints.\n\n // Internally, there are many more destinations:\n //\n // - locusID\n // - meetingURL\n // - globalMeetingID, e.g, *00*meetingID\n // - meetingID\n // - meetingURL\n // - PSTN\n // - phone number\n //\n // Our job is to determine the appropriate one\n // and its corresponding service so that developers\n // need only sipURL or spaceID to get a meeting\n // and its ID, but have the option to use createWithType()\n // and specify those types to get meetingInfo\n }\n\n /**\n * get a specifc meeting given it's type matched to the value, i.e., locus url\n * @param {String} type\n * @param {Object} value\n * @returns {Meeting}\n * @public\n * @memberof Meetings\n */\n getMeetingByType(type, value) {\n return this.meetingCollection.getByKey(type, value);\n }\n\n /**\n * Get all meetings.\n * @param {object} options\n * @param {object} options.startDate - get meetings after this start date\n * @param {object} options.endDate - get meetings before this end date\n * @returns {Object} All currently active meetings.\n * @public\n * @memberof Meetings\n */\n getAllMeetings(options = {}) {\n // Options may include other parameters to filter this collection\n // of meetings.\n return this.meetingCollection.getAll(options);\n }\n\n /**\n * syncs all the meeting from server\n * @returns {undefined}\n * @public\n * @memberof Meetings\n */\n syncMeetings() {\n return this.request.getActiveMeetings().then((locusArray) => {\n const activeLocusUrl = [];\n\n if (locusArray?.loci && locusArray.loci.length > 0) {\n locusArray.loci.forEach((locus) => {\n activeLocusUrl.push(locus.url);\n this.handleLocusEvent({\n locus,\n locusUrl: locus.url\n });\n });\n }\n const meetingsCollection = this.meetingCollection.getAll();\n\n if (Object.keys(meetingsCollection).length > 0) {\n // Some time the mercury event is missed after mercury reconnect\n // if sync returns no locus then clear all the meetings\n for (const meeting of Object.values(meetingsCollection)) {\n if (!activeLocusUrl.includes(meeting.locusUrl)) {\n // destroy function also uploads logs\n this.destroy(meeting, MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);\n }\n }\n }\n });\n }\n\n /**\n * Get all scheduled meetings.\n * @param {object} options\n * @param {object} options.startDate - get meetings after this start date\n * @param {object} options.endDate - get meetings before this end date\n * @returns {Object} All scheduled meetings.\n * @memberof Meetings\n */\n getScheduledMeetings() {\n return this.meetingCollection.getAll({scheduled: true});\n }\n\n /**\n * Get the logger instance for plugin-meetings\n * @returns {Logger}\n */\n getLogger() {\n return LoggerProxy.get();\n }\n\n /**\n * Get the Stats Analyzer singleton\n * @returns {StatsAnalyzer}\n * @public\n * @memberof Meetings\n */\n getAnalyzer() {\n return StatsAnalyzer;\n }\n\n /**\n * Get the Stats Calculator singleton\n * @returns {StatsCalculator}\n * @public\n * @memberof Meetings\n */\n getCalculator() {\n return StatsCalculator;\n }\n}\n"]}
1
+ {"version":3,"sources":["index.js"],"names":["Meetings","args","MEETINGS","request","Request","parent","webex","loggerRequest","LoggerRequest","meetingCollection","MeetingCollection","personalMeetingRoom","reachability","registered","preferredWebexSite","media","getUserMedia","Media","getSupportedDevice","onReady","MeetingsUtil","checkH264Support","disableNotifications","Metrics","initialSetup","data","meeting","getByKey","LOCUS_URL","locusUrl","CORRELATION_ID","checkForCorrelationId","internal","device","url","locus","SIP_URI","self","callbackInfo","callbackAddress","config","experimental","enableUnifiedMeetings","undefined","CONVERSATION_URL","conversationUrl","replaces","length","fullState","state","LOCUS","STATE","INACTIVE","LoggerProxy","logger","warn","_LEFT_","removed","create","_LOCUS_ID_","then","newMeeting","locusInfo","catch","e","console","log","finally","getMeetingByType","_ID_","id","postEvent","event","eventType","REMOTE_STARTED","trigger","MERCURY_EVENT","Trigger","file","function","EVENT_TRIGGERS","MEETING_ADDED","type","_MEETING_","_JOIN_","_INCOMING_","parse","envelope","LOCUSEVENT","MESSAGE_ROAP","handleLocusEvent","MEETINGS_NETWORK_DISCONNECTED","mercury","on","LOCUS_MERCURY","handleLocusMercury","ROAP","ROAP_MERCURY","handleRoapMercury","ONLINE","syncMeetings","OFFLINE","handleMercuryOffline","off","once","READY","StaticConfig","set","LoggerConfig","logging","meetingInfo","MeetingInfoV2","MeetingInfo","PersonalMeetingRoom","MEETINGS_READY","changeState","enableAdhocMeetings","canAuthorize","error","reject","Error","info","resolve","all","fetchUserPreferredWebexSite","getGeoHint","startReachability","message","register","connect","call","listenForEvents","MEETINGS_REGISTERED","sendBehavioralMetric","BEHAVIORAL_METRICS","MEETINGS_REGISTRATION_SUCCESS","MEETINGS_REGISTRATION_FAILED","reason","stack","stopListeningForEvents","disconnect","unregister","MEETINGS_UNREGISTERED","options","uploadLogs","uploadResult","MEETING_LOG_UPLOAD_SUCCESS","meetingId","details","uploadError","MEETING_LOG_UPLOAD_FAILURE","UPLOAD_LOGS_FAILURE","meetingsId","code","Reachability","setReachability","getReachability","gatherReachability","fetchGeoHint","res","geoHintInfo","fetchLoginUserInformation","userPreferences","parseUserPreferences","MeetingUtil","cleanUp","delete","MEETING_REMOVED","destination","fetchInfoOptions","targetDest","_CONVERSATION_URL_","foundMeeting","foundMeetingIsNotCalendarMeeting","scheduledMeeting","createMeeting","createdMeeting","EVENTS","DESTROY_MEETING","payload","autoUploadLogs","callStart","lastActive","correlationId","feedbackId","locusId","webExMeetingId","destroy","REQUEST_UPLOAD_LOGS","meetingInstance","Meeting","userId","deviceUrl","orgId","roapSeq","meetingInfoProvider","destinationType","fetchMeetingInfo","CaptchaError","PasswordError","debug","sipUri","setSipUri","meetingAddedType","getMeetingAddedType","value","getAll","getActiveMeetings","locusArray","activeLocusUrl","loci","forEach","push","meetingsCollection","includes","MEETING_REMOVED_REASON","NO_MEETINGS_TO_SYNC","scheduled","get","StatsAnalyzer","StatsCalculator","WebexPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAuBA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;IACqBA,Q;;;;;AAGjB;AACJ;AACA;AACA;AACA;AACA;AACI,sBAAqB;AAAA;;AAAA;;AAAA,sCAANC,IAAM;AAANA,MAAAA,IAAM;AAAA;;AACnB,oDAASA,IAAT;AAEA;AACN;AACA;AACA;AACA;AACA;AACA;;AATyB,4FARTC,mBAQS;AAUnB,UAAKC,OAAL,GAAe,IAAIC,iBAAJ,CAAY,EAAZ,EAAgB;AAACC,MAAAA,MAAM,EAAE,MAAKC;AAAd,KAAhB,CAAf;AACA;AACN;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,aAAL,GAAqB,IAAIC,gBAAJ,CAAkB;AAACF,MAAAA,KAAK,EAAE,MAAKA;AAAb,KAAlB,CAArB;AACA,UAAKG,iBAAL,GAAyB,IAAIC,mBAAJ,EAAzB;AACA;AACN;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,mBAAL,GAA2B,IAA3B;AACA;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,YAAL,GAAoB,IAApB;AAEA;AACN;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,UAAL,GAAkB,KAAlB;AAEA;AACN;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,kBAAL,GAA0B,EAA1B;AAEA;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AACM,UAAKC,KAAL,GA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CAAwB5L,OAAO,CAACG,QAAhC,CAAL,EAAgD;AAC9C;AACA,cAAA,OAAI,CAAC8J,OAAL,CAAajK,OAAb,EAAsB6L,kCAAuBC,mBAA7C;AACD;AACF;AACF;AACF,OAxBM,CAAP;AAyBD;AAED;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;;;WACI,gCAAuB;AACrB,aAAO,KAAK/M,iBAAL,CAAuBqM,MAAvB,CAA8B;AAACW,QAAAA,SAAS,EAAE;AAAZ,OAA9B,CAAP;AACD;AAED;AACJ;AACA;AACA;;;;WACI,qBAAY;AACV,aAAOpK,qBAAYqK,GAAZ,EAAP;AACD;AAED;AACJ;AACA;AACA;AACA;AACA;;;;WACI,uBAAc;AACZ,aAAOC,iBAAP;AACD;AAED;AACJ;AACA;AACA;AACA;AACA;;;;WACI,yBAAgB;AACd,aAAOC,mBAAP;AACD;;;EAz1BiCC,sB","sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n*/\n\nimport '@webex/internal-plugin-mercury';\nimport '@webex/internal-plugin-conversation';\nimport {WebexPlugin} from '@webex/webex-core';\n\nimport 'webrtc-adapter';\n\nimport Metrics from '../metrics';\nimport {trigger, eventType} from '../metrics/config';\nimport LoggerConfig from '../common/logs/logger-config';\nimport StaticConfig from '../common/config';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport LoggerRequest from '../common/logs/request';\nimport Trigger from '../common/events/trigger-proxy';\nimport Media from '../media';\nimport MeetingUtil from '../meeting/util';\nimport {\n MEETINGS,\n EVENTS,\n EVENT_TRIGGERS,\n READY,\n LOCUSEVENT,\n LOCUS_URL,\n ROAP,\n ONLINE,\n OFFLINE,\n _MEETING_,\n _JOIN_,\n _LOCUS_ID_,\n _INCOMING_,\n LOCUS,\n CORRELATION_ID,\n SIP_URI,\n _LEFT_,\n _ID_,\n MEETING_REMOVED_REASON,\n _CONVERSATION_URL_,\n CONVERSATION_URL\n} from '../constants';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\nimport MeetingInfo from '../meeting-info';\nimport MeetingInfoV2 from '../meeting-info/meeting-info-v2';\nimport Meeting from '../meeting';\nimport PersonalMeetingRoom from '../personal-meeting-room';\nimport Reachability from '../reachability';\nimport Request from '../meetings/request';\nimport StatsAnalyzer from '../analyzer/analyzer';\nimport StatsCalculator from '../analyzer/calculator';\nimport PasswordError from '../common/errors/password-error';\nimport CaptchaError from '../common/errors/captcha-error';\n\nimport MeetingCollection from './collection';\nimport MeetingsUtil from './util';\n\n\n/**\n * Meetings Ready Event\n * Emitted when the meetings instance on webex is ready\n * @event meetings:ready\n * @instance\n * @memberof Meetings\n */\n\n/**\n * Meetings Network Disconnected Event\n * Emitted when the meetings instance is disconnected from\n * the internal mercury server\n * @event network:disconnected\n * @instance\n * @memberof Meetings\n */\n\n/**\n * Meetings Registered Event\n * Emitted when the meetings instance has been registered and listening\n * @event meetings:registered\n * @instance\n * @memberof Meetings\n */\n\n/**\n * Meeting Removed Event\n * Emitted when a meeting was removed from the cache of meetings\n * @event meeting:removed\n * @instance\n * @type {Object}\n * @property {String} meetingId the removed meeting\n * @property {Object} response the server response\n * @property {String} type what type of meeting it was\n * @memberof Meetings\n */\n\n/**\n * Meeting Added Event\n * Emitted when a meeting was added to the cache of meetings\n * @event meeting:added\n * @instance\n * @type {Object}\n * @property {String} meetingId the added meeting\n * @property {String} type what type of meeting it was\n * @memberof Meetings\n */\n\n/**\n * Maintain a cache of meetings and sync with services.\n * @class\n */\nexport default class Meetings extends WebexPlugin {\n namespace = MEETINGS;\n\n /**\n * Initializes the Meetings Plugin\n * @constructor\n * @public\n * @memberof Meetings\n */\n constructor(...args) {\n super(...args);\n\n /**\n * The Meetings request to interact with server\n * @instance\n * @type {Object}\n * @private\n * @memberof Meetings\n */\n this.request = new Request({}, {parent: this.webex});\n /**\n * Log upload request helper\n * @instance\n * @type {Object}\n * @private\n * @memberof Meetings\n */\n this.loggerRequest = new LoggerRequest({webex: this.webex});\n this.meetingCollection = new MeetingCollection();\n /**\n * The PersonalMeetingRoom object to interact with server\n * @instance\n * @type {Object}\n * @public\n * @memberof Meetings\n */\n this.personalMeetingRoom = null;\n /**\n * The Reachability object to interact with server, starts as null until {@link Meeting#setReachability} is called\n * starts as null\n * @instance\n * @type {Object}\n * @private\n * @memberof Meetings\n */\n this.reachability = null;\n\n /**\n * If the meetings plugin has been registered and listening via {@link Meetings#register}\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Meetings\n */\n this.registered = false;\n\n /**\n * This values indicates the preferred webex site the user will start there meeting, getsits value from {@link Meetings#register}\n * @instance\n * @type {String}\n * @private\n * @memberof Meetings\n */\n this.preferredWebexSite = '';\n\n /**\n * The public interface for the internal Media util files. These are helpful to expose outside the context\n * of a meeting so that a user can access media without creating a meeting instance.\n * @instance\n * @type {Object}\n * @private\n * @memberof Meetings\n */\n this.media = {\n getUserMedia: Media.getUserMedia,\n getSupportedDevice: Media.getSupportedDevice\n };\n\n this.onReady();\n MeetingsUtil.checkH264Support({disableNotifications: true});\n Metrics.initialSetup(this.meetingCollection, this.webex);\n }\n\n /**\n * handle locus events and takes meeting actions with them as they come in\n * @param {Object} data a locus event\n * @param {String} data.locusUrl\n * @param {Object} data.locus\n * @param {String} data.eventType\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n handleLocusEvent(data) {\n let meeting = null;\n\n // getting meeting by correlationId. This will happen for the new event\n // Either the locus\n // TODO : Add check for the callBack Address\n meeting = this.meetingCollection.getByKey(LOCUS_URL, data.locusUrl) ||\n this.meetingCollection.getByKey(CORRELATION_ID, MeetingsUtil.checkForCorrelationId(this.webex.internal.device.url, data.locus)) ||\n this.meetingCollection.getByKey(SIP_URI, data.locus.self && data.locus.self.callbackInfo && data.locus.self.callbackInfo.callbackAddress) ||\n (this.config.experimental.enableUnifiedMeetings ? undefined : this.meetingCollection.getByKey(CONVERSATION_URL, data.locus.conversationUrl));\n\n // Special case when locus has got replaced, This only happend once if a replace locus exists\n // https://sqbu-github.cisco.com/WebExSquared/locus/wiki/Locus-changing-mid-call\n\n if (!meeting && data.locus?.replaces?.length > 0) {\n // Always the last element in the replace is the active one\n meeting = this.meetingCollection.getByKey(LOCUS_URL, data.locus.replaces[data.locus.replaces.length - 1].locusUrl);\n }\n\n if (!meeting) {\n // TODO: create meeting when we get a meeting object\n // const checkForEnded = (locus) => {\n // TODO: you already ended the meeting but you got an event later\n // Mainly for 1:1 Callsor meeting\n // Happens mainly after refresh\n\n // 1:1 Meeting\n // 1) You ended a call before but you got a mercury event\n // Make sure end the call and cleanup the meeting only if the mercury\n // event says so\n // 2) Maintain lastSync time in the meetings object which helps to compare\n // If the meeting came befor or after the sync . ANy meeting start time before the sync time is invalid\n\n // For space Meeting\n // Check the locus object and see who has joined\n\n // };\n // rather then locus object change to locus url\n\n if (data.locus && data.locus.fullState && data.locus.fullState.state === LOCUS.STATE.INACTIVE) {\n // just ignore the event as its already ended and not active\n LoggerProxy.logger.warn('Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.');\n\n return;\n }\n\n\n // When its wireless share or guest and user leaves the meeting we dont have to keep the meeting object\n // Any future events will be neglected\n\n if (data.locus && data.locus.self && (data.locus.self.state === _LEFT_ && data.locus.self.removed === true)) {\n // just ignore the event as its already ended and not active\n LoggerProxy.logger.warn('Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.');\n\n return;\n }\n\n this.create(data.locus, _LOCUS_ID_).then((newMeeting) => {\n meeting = newMeeting;\n\n // It's a new meeting so initialize the locus data\n meeting.locusInfo.initialSetup(data.locus);\n }).catch((e) => {\n console.log(e);\n })\n .finally(() => {\n // There will be cases where locus event comes in gets created and deleted because its a 1:1 and meeting gets deleted\n // because the other user left so before sending 'added' event make sure it exists in the collection\n\n if (this.getMeetingByType(_ID_, meeting.id)) {\n Metrics.postEvent({event: eventType.REMOTE_STARTED, meeting, data: {trigger: trigger.MERCURY_EVENT}});\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'handleLocusEvent'\n },\n EVENT_TRIGGERS.MEETING_ADDED,\n {\n meeting,\n type: meeting.type === _MEETING_ ? _JOIN_ : _INCOMING_\n }\n );\n }\n else {\n // Meeting got added but was not found in the collection. It might have got destroyed\n LoggerProxy.logger.warn('Meetings:index#handleLocusEvent --> Created and destroyed meeting object before sending an event');\n }\n });\n }\n else {\n meeting.locusInfo.parse(meeting, data);\n }\n }\n\n /**\n * handles locus events through mercury that are not roap\n * @param {Object} envelope\n * @param {Object} envelope.data\n * @param {String} envelope.data.eventType\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n handleLocusMercury(envelope) {\n const {data} = envelope;\n const {eventType} = data;\n\n if (eventType && eventType !== LOCUSEVENT.MESSAGE_ROAP) {\n this.handleLocusEvent(data);\n }\n }\n\n\n /**\n * handles mecury offline event\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n handleMercuryOffline() {\n Trigger.trigger(\n this,\n {\n file: 'meetings/index',\n function: 'handleMercuryOffline'\n },\n EVENT_TRIGGERS.MEETINGS_NETWORK_DISCONNECTED,\n );\n }\n\n\n /**\n * registers for locus and roap mercury events\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n listenForEvents() {\n this.webex.internal.mercury.on(LOCUSEVENT.LOCUS_MERCURY, (envelope) => {\n this.handleLocusMercury(envelope);\n });\n this.webex.internal.mercury.on(ROAP.ROAP_MERCURY, (envelope) => {\n MeetingsUtil.handleRoapMercury(envelope, this.meetingCollection);\n });\n\n this.webex.internal.mercury.on(ONLINE, () => {\n this.syncMeetings();\n });\n\n this.webex.internal.mercury.on(OFFLINE, () => {\n this.handleMercuryOffline();\n });\n }\n\n /**\n * stops listening for locus and roap mercury events\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n stopListeningForEvents() {\n this.webex.internal.mercury.off(LOCUSEVENT.LOCUS_MERCURY);\n this.webex.internal.mercury.off(ROAP.ROAP_MERCURY);\n this.webex.internal.mercury.off(ONLINE);\n }\n\n /**\n * @returns {undefined}\n * @private\n * @memberof Meetings\n */\n onReady() {\n this.webex.once(READY, () => {\n StaticConfig.set(this.config);\n LoggerProxy.set(this.webex.logger);\n LoggerConfig.set(this.config.logging);\n\n /**\n * The MeetingInfo object to interact with server\n * @instance\n * @type {Object}\n * @private\n * @memberof Meetings\n */\n this.meetingInfo = this.config.experimental.enableUnifiedMeetings ? new MeetingInfoV2(this.webex) : new MeetingInfo(this.webex);\n this.personalMeetingRoom = new PersonalMeetingRoom({meetingInfo: this.meetingInfo}, {parent: this.webex});\n\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'onReady'\n },\n EVENT_TRIGGERS.MEETINGS_READY\n );\n });\n }\n\n /**\n * API to toggle unified meetings\n * @param {Boolean} changeState\n * @private\n * @memberof Meetings\n * @returns {undefined}\n */\n _toggleUnifiedMeetings(changeState) {\n if (typeof changeState !== 'boolean') {\n return;\n }\n if (this.config?.experimental?.enableUnifiedMeetings !== changeState) {\n this.config.experimental.enableUnifiedMeetings = changeState;\n this.meetingInfo = changeState ? new MeetingInfoV2(this.webex) : new MeetingInfo(this.webex);\n }\n }\n\n /**\n * API to toggle starting adhoc meeting\n * @param {Boolean} changeState\n * @private\n * @memberof Meetings\n * @returns {undefined}\n */\n _toggleAdhocMeetings(changeState) {\n if (typeof changeState !== 'boolean') {\n return;\n }\n if (this.config?.experimental?.enableAdhocMeetings !== changeState) {\n this.config.experimental.enableAdhocMeetings = changeState;\n }\n }\n\n /**\n * Explicitly sets up the meetings plugin by registering\n * the device, connecting to mercury, and listening for locus events.\n *\n * @returns {Promise}\n * @public\n * @memberof Meetings\n */\n register() {\n if (!this.webex.canAuthorize) {\n LoggerProxy.logger.error('Meetings:index#register --> ERROR, Unable to register, SDK cannot authorize');\n\n return Promise.reject(new Error('SDK cannot authorize'));\n }\n\n\n if (this.registered) {\n LoggerProxy.logger.info('Meetings:index#register --> INFO, Meetings plugin already registered');\n\n return Promise.resolve();\n }\n\n return Promise.all([\n this.fetchUserPreferredWebexSite(),\n this.getGeoHint(),\n this.startReachability().catch((error) => {\n LoggerProxy.logger.error(`Meetings:index#register --> GDM error, ${error.message}`);\n }),\n this.webex.internal.device.register()\n .then(() => LoggerProxy.logger.info(`Meetings:index#register --> INFO, Device registered ${this.webex.internal.device.url}`))\n .then(() => this.webex.internal.mercury.connect()),\n MeetingsUtil.checkH264Support.call(this)\n ]).then(() => {\n this.listenForEvents();\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'register'\n },\n EVENT_TRIGGERS.MEETINGS_REGISTERED\n );\n this.registered = true;\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.MEETINGS_REGISTRATION_SUCCESS,\n );\n })\n .catch((error) => {\n LoggerProxy.logger.error(`Meetings:index#register --> ERROR, Unable to register, ${error.message}`);\n\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.MEETINGS_REGISTRATION_FAILED,\n {\n reason: error.message,\n stack: error.stack\n }\n );\n\n return Promise.reject(error);\n });\n }\n\n /**\n * Explicitly tears down the meetings plugin by deregistering\n * the device, disconnecting from mercury, and stops listening to locus events\n *\n * @returns {Promise}\n * @public\n * @memberof Meetings\n */\n unregister() {\n if (!this.registered) {\n LoggerProxy.logger.info('Meetings:index#unregister --> INFO, Meetings plugin already unregistered');\n\n return Promise.resolve();\n }\n\n this.stopListeningForEvents();\n\n return this.webex.internal.mercury.disconnect()\n .then(() => this.webex.internal.device.unregister())\n .then(() => {\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'unregister'\n },\n EVENT_TRIGGERS.MEETINGS_UNREGISTERED\n );\n this.registered = false;\n });\n }\n\n /**\n * Uploads logs to the webex services for tracking\n * @param {Object} [options={}]\n * @param {String} [options.callStart] Call Start Time\n * @param {String} [options.feedbackId] ID used for tracking\n * @param {String} [options.locusId]\n * @param {String} [options.correlationId]\n * @param {String} [options.meetingId] webex meeting ID\n * @param {String} [options.userId] userId\n * @param {String} [options.orgId] org id\n * @returns {String} feedback ID logs were submitted under\n */\n uploadLogs(options = {}) {\n LoggerProxy.logger.info('Meetings:index#uploadLogs --> uploading logs');\n\n return this.loggerRequest.uploadLogs(options)\n .then((uploadResult) => {\n LoggerProxy.logger.info('Meetings:index#uploadLogs --> Upload logs for meeting completed.', uploadResult);\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'uploadLogs'\n },\n EVENT_TRIGGERS.MEETING_LOG_UPLOAD_SUCCESS,\n {\n meetingId: options.meetingId,\n details: uploadResult\n }\n );\n })\n .catch((uploadError) => {\n LoggerProxy.logger.error('Meetings:index#uploadLogs --> Unable to upload logs for meeting', uploadError);\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'uploadLogs'\n },\n EVENT_TRIGGERS.MEETING_LOG_UPLOAD_FAILURE,\n {\n meetingId: options.meetingId,\n reason: uploadError\n }\n );\n\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.UPLOAD_LOGS_FAILURE,\n {\n meetingId: options.meetingsId,\n reason: uploadError.message,\n stack: uploadError.stack,\n code: uploadError.code\n }\n );\n });\n }\n\n /**\n * initializes the reachability instance for Meetings\n * @returns {undefined}\n * @public\n * @memberof Meetings\n */\n setReachability() {\n this.reachability = new Reachability(this.webex);\n }\n\n /**\n * gets the reachability instance for Meetings\n * @returns {Reachability}\n * @public\n * @memberof Meetings\n */\n getReachability() {\n return this.reachability;\n }\n\n /**\n * initializes and starts gathering reachability for Meetings\n * @returns {Promise}\n * @public\n * @memberof Meetings\n */\n startReachability() {\n if (!this.reachability) {\n this.setReachability();\n }\n\n return this.getReachability().gatherReachability();\n }\n\n /**\n * Get geoHint for info for meetings\n * @returns {Promise}\n * @private\n * @memberof Meetings\n */\n getGeoHint() {\n return this.request.fetchGeoHint().then((res) => {\n this.geoHintInfo = res;\n });\n }\n\n /**\n * Fetch user preferred webex site information\n * This also has other infomation about the user\n * @returns {Promise}\n * @private\n * @memberof Meetings\n */\n fetchUserPreferredWebexSite() {\n return this.request.fetchLoginUserInformation().then((res) => {\n if (res && res.userPreferences) {\n this.preferredWebexSite = MeetingsUtil.parseUserPreferences(res?.userPreferences);\n }\n });\n }\n\n\n /**\n * gets the personal meeting room instance, for saved PMR values for this user\n * @returns {PersonalMeetingRoom}\n * @public\n * @memberof Meetings\n */\n\n getPersonalMeetingRoom() {\n return this.personalMeetingRoom;\n }\n\n /**\n * @param {Meeting} meeting\n * @param {Object} reason\n * @param {String} type\n * @returns {Undefined}\n * @private\n * @memberof Meetings\n */\n destroy(meeting, reason) {\n MeetingUtil.cleanUp(meeting);\n this.meetingCollection.delete(meeting.id);\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'destroy'\n },\n EVENT_TRIGGERS.MEETING_REMOVED,\n {\n meetingId: meeting.id,\n reason\n }\n );\n }\n\n /**\n * Create a meeting.\n * @param {string} destination - sipURL, spaceId, phonenumber, or locus object}\n * @param {string} [type] - the optional specified type, such as locusId\n * @returns {Promise<Meeting>} A new Meeting.\n * @public\n * @memberof Meetings\n */\n create(destination, type = null) {\n // TODO: type should be from a dictionary\n\n // Validate meeting information based on the provided destination and\n // type. This must be performed prior to determining if the meeting is\n // found in the collection, as we mutate the destination for hydra person\n // id values.\n return this.meetingInfo.fetchInfoOptions(destination, type)\n // Catch a failure to fetch info options.\n .catch((error) => {\n LoggerProxy.logger.info(`Meetings:index#create --> INFO, unable to determine info options: ${error.message}`);\n })\n .then((options = {}) => {\n // Normalize the destination.\n const targetDest = options.destination || destination;\n\n // check for the conversation URL then sip Url\n let meeting = null;\n\n if (type === _CONVERSATION_URL_ || options.type === _CONVERSATION_URL_) {\n const foundMeeting = this.meetingCollection.getByKey(CONVERSATION_URL, targetDest);\n\n if (foundMeeting) {\n const foundMeetingIsNotCalendarMeeting = !foundMeeting.locusInfo.scheduledMeeting;\n\n // If the found meeting is not a calendar meeting, return that meeting.\n // This allows for the creation of instant-meetings when calendar meetings are present.\n if (foundMeetingIsNotCalendarMeeting) {\n meeting = foundMeeting;\n }\n }\n }\n\n // Attempt to collect the meeting if it exists.\n if (!meeting) {\n meeting = this.meetingCollection.getByKey(SIP_URI, targetDest);\n }\n\n\n // Validate if a meeting was found.\n if (!meeting) {\n // Create a meeting based on the normalized destination and type.\n return this.createMeeting(targetDest, type)\n .then((createdMeeting) => {\n // If the meeting was successfully created.\n if (createdMeeting && createdMeeting.on) {\n // Create a destruction event for the meeting.\n createdMeeting.on(EVENTS.DESTROY_MEETING, (payload) => {\n if (this.config.autoUploadLogs) {\n this.uploadLogs({\n callStart: createdMeeting.locusInfo?.fullState?.lastActive,\n correlationId: createdMeeting.correlationId,\n feedbackId: createdMeeting.correlationId,\n locusId: createdMeeting.locusId,\n meetingId: createdMeeting.locusInfo?.info?.webExMeetingId\n }).then(() => this.destroy(createdMeeting, payload.reason));\n }\n else {\n this.destroy(createdMeeting, payload.reason);\n }\n });\n\n createdMeeting.on(EVENTS.REQUEST_UPLOAD_LOGS, (meetingInstance) => {\n if (this.config.autoUploadLogs) {\n this.uploadLogs({\n callStart: meetingInstance?.locusInfo?.fullState?.lastActive,\n correlationId: meetingInstance.correlationId,\n feedbackId: meetingInstance.correlationId,\n locusId: meetingInstance.locusId,\n meetingId: meetingInstance.locusInfo?.info?.webExMeetingId\n });\n }\n });\n }\n else {\n LoggerProxy.logger.error(`Meetings:index#create --> ERROR, meeting does not have on method, will not be destroyed, meeting cleanup impossible for meeting: ${meeting}`);\n }\n\n // Return the newly created meeting.\n return Promise.resolve(createdMeeting);\n });\n }\n\n // Return the existing meeting.\n return Promise.resolve(meeting);\n });\n }\n\n /**\n * @param {String} destination see create()\n * @param {String} type see create()\n * @returns {Promise} a new meeting instance complete with meeting info and destination\n * @private\n * @memberof Meetings\n */\n async createMeeting(destination, type = null) {\n const meeting = new Meeting(\n {\n userId: this.webex.internal.device.userId,\n deviceUrl: this.webex.internal.device.url,\n orgId: this.webex.internal.device.orgId,\n roapSeq: 0,\n locus: type === _LOCUS_ID_ ? destination : null, // pass the locus object if present\n meetingInfoProvider: this.meetingInfo,\n destination,\n destinationType: type,\n },\n {\n parent: this.webex\n }\n );\n\n this.meetingCollection.set(meeting);\n\n try {\n await meeting.fetchMeetingInfo({});\n }\n catch (err) {\n if (!(err instanceof CaptchaError) && !(err instanceof PasswordError)) {\n // if there is no meeting info we assume its a 1:1 call or wireless share\n LoggerProxy.logger.info(`Meetings:index#createMeeting --> Info Unable to fetch meeting info for ${destination}.`);\n LoggerProxy.logger.info('Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share');\n }\n LoggerProxy.logger.debug(`Meetings:index#createMeeting --> Debug ${err} fetching /meetingInfo for creation.`);\n }\n finally {\n // For type LOCUS_ID we need to parse the locus object to get the information\n // about the caller and callee\n // Meeting Added event will be created in `handleLocusEvent`\n if (type !== _LOCUS_ID_) {\n if (!meeting.sipUri) {\n meeting.setSipUri(destination);\n }\n\n // TODO: check if we have to move this to parser\n const meetingAddedType = MeetingsUtil.getMeetingAddedType(type);\n\n // We typically shouldn't need to trigger both and event and return a promise.\n // Is this a special case? We want to make the public API usage as simple as possible.\n Trigger.trigger(\n this,\n {\n file: 'meetings',\n function: 'createMeeting'\n },\n EVENT_TRIGGERS.MEETING_ADDED,\n {\n meeting,\n type: meetingAddedType\n }\n );\n }\n }\n\n return meeting;\n\n // Create the meeting calling the necessary service endpoints.\n\n // Internally, there are many more destinations:\n //\n // - locusID\n // - meetingURL\n // - globalMeetingID, e.g, *00*meetingID\n // - meetingID\n // - meetingURL\n // - PSTN\n // - phone number\n //\n // Our job is to determine the appropriate one\n // and its corresponding service so that developers\n // need only sipURL or spaceID to get a meeting\n // and its ID, but have the option to use createWithType()\n // and specify those types to get meetingInfo\n }\n\n /**\n * get a specifc meeting given it's type matched to the value, i.e., locus url\n * @param {String} type\n * @param {Object} value\n * @returns {Meeting}\n * @public\n * @memberof Meetings\n */\n getMeetingByType(type, value) {\n return this.meetingCollection.getByKey(type, value);\n }\n\n /**\n * Get all meetings.\n * @param {object} options\n * @param {object} options.startDate - get meetings after this start date\n * @param {object} options.endDate - get meetings before this end date\n * @returns {Object} All currently active meetings.\n * @public\n * @memberof Meetings\n */\n getAllMeetings(options = {}) {\n // Options may include other parameters to filter this collection\n // of meetings.\n return this.meetingCollection.getAll(options);\n }\n\n /**\n * syncs all the meeting from server\n * @returns {undefined}\n * @public\n * @memberof Meetings\n */\n syncMeetings() {\n return this.request.getActiveMeetings().then((locusArray) => {\n const activeLocusUrl = [];\n\n if (locusArray?.loci && locusArray.loci.length > 0) {\n locusArray.loci.forEach((locus) => {\n activeLocusUrl.push(locus.url);\n this.handleLocusEvent({\n locus,\n locusUrl: locus.url\n });\n });\n }\n const meetingsCollection = this.meetingCollection.getAll();\n\n if (Object.keys(meetingsCollection).length > 0) {\n // Some time the mercury event is missed after mercury reconnect\n // if sync returns no locus then clear all the meetings\n for (const meeting of Object.values(meetingsCollection)) {\n if (!activeLocusUrl.includes(meeting.locusUrl)) {\n // destroy function also uploads logs\n this.destroy(meeting, MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);\n }\n }\n }\n });\n }\n\n /**\n * Get all scheduled meetings.\n * @param {object} options\n * @param {object} options.startDate - get meetings after this start date\n * @param {object} options.endDate - get meetings before this end date\n * @returns {Object} All scheduled meetings.\n * @memberof Meetings\n */\n getScheduledMeetings() {\n return this.meetingCollection.getAll({scheduled: true});\n }\n\n /**\n * Get the logger instance for plugin-meetings\n * @returns {Logger}\n */\n getLogger() {\n return LoggerProxy.get();\n }\n\n /**\n * Get the Stats Analyzer singleton\n * @returns {StatsAnalyzer}\n * @public\n * @memberof Meetings\n */\n getAnalyzer() {\n return StatsAnalyzer;\n }\n\n /**\n * Get the Stats Calculator singleton\n * @returns {StatsCalculator}\n * @public\n * @memberof Meetings\n */\n getCalculator() {\n return StatsCalculator;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/plugin-meetings",
3
- "version": "1.159.1",
3
+ "version": "1.159.4",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -24,19 +24,19 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@babel/runtime-corejs2": "^7.14.8",
27
- "@webex/webex-core": "1.159.1",
28
- "@webex/internal-plugin-mercury": "1.159.1",
29
- "@webex/internal-plugin-conversation": "1.159.1",
27
+ "@webex/webex-core": "1.159.4",
28
+ "@webex/internal-plugin-mercury": "1.159.4",
29
+ "@webex/internal-plugin-conversation": "1.159.4",
30
30
  "webrtc-adapter": "^7.7.0",
31
31
  "lodash": "^4.17.21",
32
32
  "uuid": "^3.3.2",
33
33
  "global": "^4.4.0",
34
34
  "ip-anonymize": "^0.1.0",
35
- "@webex/common": "1.159.1",
35
+ "@webex/common": "1.159.4",
36
36
  "bowser": "^2.11.0",
37
37
  "sdp-transform": "^2.12.0",
38
38
  "readable-stream": "^3.6.0",
39
- "@webex/common-timers": "1.159.1",
39
+ "@webex/common-timers": "1.159.4",
40
40
  "btoa": "^1.2.1",
41
41
  "javascript-state-machine": "^3.1.0",
42
42
  "envify": "^4.1.0"
@@ -37,7 +37,6 @@ import {
37
37
  _CALL_,
38
38
  _INCOMING_,
39
39
  _JOIN_,
40
- _SIP_URI_,
41
40
  AUDIO,
42
41
  CONNECTION_STATE,
43
42
  CONTENT,
@@ -577,6 +576,22 @@ export default class Meeting extends StatelessWebexPlugin {
577
576
  * @memberof Meeting
578
577
  */
579
578
  this.sipUri = null;
579
+ /**
580
+ * @instance
581
+ * @type {String}
582
+ * @readonly
583
+ * @public
584
+ * @memberof Meeting
585
+ */
586
+ this.destination = attrs.destination;
587
+ /**
588
+ * @instance
589
+ * @type {String}
590
+ * @readonly
591
+ * @public
592
+ * @memberof Meeting
593
+ */
594
+ this.destinationType = attrs.destinationType;
580
595
  /**
581
596
  * @instance
582
597
  * @type {String}
@@ -901,7 +916,7 @@ export default class Meeting extends StatelessWebexPlugin {
901
916
  * @returns {Promise}
902
917
  */
903
918
  async fetchMeetingInfo({
904
- destination, type, password = null, captchaCode = null
919
+ password = null, captchaCode = null
905
920
  }) {
906
921
  if (captchaCode && !this.requiredCaptcha) {
907
922
  return Promise.reject(new Error('fetchMeetingInfo() called with captchaCode when captcha was not required'));
@@ -913,7 +928,7 @@ export default class Meeting extends StatelessWebexPlugin {
913
928
  try {
914
929
  const captchaInfo = captchaCode ? {code: captchaCode, id: this.requiredCaptcha.captchaId} : null;
915
930
 
916
- const info = await this.attrs.meetingInfoProvider.fetchMeetingInfo(destination, type, password, captchaInfo);
931
+ const info = await this.attrs.meetingInfoProvider.fetchMeetingInfo(this.destination, this.destinationType, password, captchaInfo);
917
932
 
918
933
  this.parseMeetingInfo(info);
919
934
  this.meetingInfo = info ? info.body : null;
@@ -930,7 +945,7 @@ export default class Meeting extends StatelessWebexPlugin {
930
945
  }
931
946
  catch (err) {
932
947
  if (err instanceof MeetingInfoV2PasswordError) {
933
- LoggerProxy.logger.info(`Meeting:index#fetchMeetingInfo --> Info Unable to fetch meeting info for ${destination} - password required (code=${err?.body?.code}).`);
948
+ LoggerProxy.logger.info(`Meeting:index#fetchMeetingInfo --> Info Unable to fetch meeting info for ${this.destination} - password required (code=${err?.body?.code}).`);
934
949
 
935
950
  // when wbxappapi requires password it still populates partial meeting info in the response
936
951
  if (err.meetingInfo) {
@@ -948,7 +963,7 @@ export default class Meeting extends StatelessWebexPlugin {
948
963
  throw (new PasswordError());
949
964
  }
950
965
  else if (err instanceof MeetingInfoV2CaptchaError) {
951
- LoggerProxy.logger.info(`Meeting:index#fetchMeetingInfo --> Info Unable to fetch meeting info for ${destination} - captcha required (code=${err?.body?.code}).`);
966
+ LoggerProxy.logger.info(`Meeting:index#fetchMeetingInfo --> Info Unable to fetch meeting info for ${this.destination} - captcha required (code=${err?.body?.code}).`);
952
967
 
953
968
  this.meetingInfoFailureReason = (this.requiredCaptcha) ?
954
969
  MEETING_INFO_FAILURE_REASON.WRONG_CAPTCHA :
@@ -979,7 +994,7 @@ export default class Meeting extends StatelessWebexPlugin {
979
994
  */
980
995
  verifyPassword(password, captchaCode) {
981
996
  return this.fetchMeetingInfo({
982
- destination: this.sipUri, type: _SIP_URI_, password, captchaCode
997
+ password, captchaCode
983
998
  })
984
999
  .then(() => ({isPasswordValid: true, requiredCaptcha: null, failureReason: MEETING_INFO_FAILURE_REASON.NONE}))
985
1000
  .catch((error) => {
@@ -271,7 +271,7 @@ MeetingInfoUtil.getRequestBody = (options) => {
271
271
  */
272
272
  MeetingInfoUtil.getWebexSite = (uri) => {
273
273
  const exceptedDomains = ['meet.webex.com', 'meetup.webex.com', 'ciscospark.com'];
274
- const site = uri?.match(/.+@(.+\..+\.*.)$/)?.[1];
274
+ const site = uri?.match(/.+@([^.]+\.[^.]+\.[^.]+)$/)?.[1];
275
275
 
276
276
  return exceptedDomains.includes(site) ? null : site;
277
277
  };