@webex/plugin-meetings 1.158.0 → 1.159.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.js +2 -1
- package/dist/config.js.map +1 -1
- package/dist/meeting/index.js +23 -7
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +165 -38
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meetings/index.js +78 -31
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/request.js +16 -6
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +17 -0
- package/dist/meetings/util.js.map +1 -1
- package/package.json +6 -5
- package/src/config.js +2 -1
- package/src/meeting/index.js +21 -6
- package/src/meeting-info/meeting-info-v2.js +82 -3
- package/src/meetings/index.js +48 -4
- package/src/meetings/request.js +15 -6
- package/src/meetings/util.js +19 -0
- package/test/unit/spec/meeting/index.js +41 -13
- package/test/unit/spec/meeting-info/meetinginfov2.js +99 -2
- package/test/unit/spec/meetings/index.js +90 -29
- package/test/unit/spec/meetings/utils.js +18 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.js"],"names":["Meetings","args","MEETINGS","request","Request","parent","webex","loggerRequest","LoggerRequest","meetingCollection","MeetingCollection","personalMeetingRoom","reachability","registered","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","canAuthorize","error","reject","Error","info","resolve","all","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","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;;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;AACA;;AACM,UAAKC,KAAL,GAAa;AACXC,MAAAA,YAAY,EAAEC,eAAMD,YADT;AAEXE,MAAAA,kBAAkB,EAAED,eAAMC;AAFf,KAAb;;AAKA,UAAK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G,OAAI,CAACjM,iBAAL,CAAuB0L,MAAvB,EAA3B;;AAEA,YAAI,mBAAYO,kBAAZ,EAAgChK,MAAhC,GAAyC,CAA7C,EAAgD;AAC9C;AACA;AACA,4CAAsB,qBAAcgK,kBAAd,CAAtB,oCAAyD;AAApD,gBAAMjL,OAAO,qBAAb;;AACH,gBAAI,CAAC6K,cAAc,CAACK,QAAf,CAAwBlL,OAAO,CAACG,QAAhC,CAAL,EAAgD;AAC9C;AACA,cAAA,OAAI,CAACqJ,OAAL,CAAaxJ,OAAb,EAAsBmL,kCAAuBC,mBAA7C;AACD;AACF;AACF;AACF,OAxBM,CAAP;AAyBD;AAED;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;;;WACI,gCAAuB;AACrB,aAAO,KAAKpM,iBAAL,CAAuB0L,MAAvB,CAA8B;AAACW,QAAAA,SAAS,EAAE;AAAZ,OAA9B,CAAP;AACD;AAED;AACJ;AACA;AACA;;;;WACI,qBAAY;AACV,aAAO9J,qBAAY+J,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;;;EApyBiCC,sB","sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n*/\n\nimport '@webex/internal-plugin-mercury';\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 * 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 * 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.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 * gets the personal meeting room instance, for saved PMR values for this user\n * @returns {PersonalMeetingRoom}\n * @public\n * @memberof Meetings\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","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","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,GAAa;AACXC,MAAAA,YAAY,EAAEC,eAAMD,YADT;AAEXE,MAAAA,kBAAkB,EAAED,eAAMC;AAFf,KAAb;;AAKA,UAAKC,OAAL;;AACAC,mBAAaC,gB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A;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 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/dist/meetings/request.js
CHANGED
|
@@ -51,9 +51,9 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
51
51
|
key: "getActiveMeetings",
|
|
52
52
|
value:
|
|
53
53
|
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
* get all the active meetings for the user
|
|
55
|
+
* @returns {Array} return locus array
|
|
56
|
+
*/
|
|
57
57
|
function getActiveMeetings() {
|
|
58
58
|
var _this = this;
|
|
59
59
|
|
|
@@ -67,14 +67,24 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
* fetch geoHit for the user
|
|
71
|
+
* @returns {Promise<object>} geoHintInfo
|
|
72
|
+
*/
|
|
73
73
|
|
|
74
74
|
}, {
|
|
75
75
|
key: "fetchGeoHint",
|
|
76
76
|
value: function fetchGeoHint() {
|
|
77
77
|
return this.webex.internal.services.fetchClientRegionInfo();
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* fetch login user information
|
|
81
|
+
* @returns {Promise<object>} loginUserInformation
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
}, {
|
|
85
|
+
key: "fetchLoginUserInformation",
|
|
86
|
+
value: function fetchLoginUserInformation() {
|
|
87
|
+
return this.webex.internal.services.fetchLoginUserInformation();
|
|
78
88
|
} // locus federation, determines and populate locus if the responseBody has remote URLs to fetch locus details
|
|
79
89
|
|
|
80
90
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["request.js"],"names":["MeetingRequest","request","api","API","LOCUS","resource","RESOURCE","LOCI","then","res","determineRedirections","body","catch","error","LoggerProxy","logger","webex","internal","services","fetchClientRegionInfo","responseBody","remoteLocusClusterUrls","length","all","map","url","method","HTTP_VERBS","GET","runWhitelistedDomains","loci","concat","locusUrls","resolve","StatelessWebexPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;;;;;AAMA;AACA;AACA;IACqBA,c;;;;;;;;;;;;;AACnB;AACF;AACA;AACA;AACE,iCAAoB;AAAA;;AAClB,aAAO,KAAKC,OAAL,CAAa;AAClBC,QAAAA,GAAG,EAAEC,eAAIC,KADS;AAElBC,QAAAA,QAAQ,EAAEC,oBAASC;AAFD,OAAb,EAIJC,IAJI,CAIC,UAACC,GAAD;AAAA,eAAS,KAAI,CAACC,qBAAL,CAA2BD,GAAG,CAACE,IAA/B,CAAT;AAAA,OAJD,EAKJC,KALI,CAKE,UAACC,KAAD,EAAW;AAChBC,6BAAYC,MAAZ,CAAmBF,KAAnB,+EAAgGA,KAAhG;AACD,OAPI,CAAP;AAQD;AAED;AACF;AACA;AACA;;;;WACE,wBAAe;AACb,aAAO,KAAKG,KAAL,CAAWC,QAAX,CAAoBC,QAApB,CAA6BC,qBAA7B,EAAP;AACD,K,
|
|
1
|
+
{"version":3,"sources":["request.js"],"names":["MeetingRequest","request","api","API","LOCUS","resource","RESOURCE","LOCI","then","res","determineRedirections","body","catch","error","LoggerProxy","logger","webex","internal","services","fetchClientRegionInfo","fetchLoginUserInformation","responseBody","remoteLocusClusterUrls","length","all","map","url","method","HTTP_VERBS","GET","runWhitelistedDomains","loci","concat","locusUrls","resolve","StatelessWebexPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;;;;;AAMA;AACA;AACA;IACqBA,c;;;;;;;;;;;;;AACnB;AACF;AACA;AACA;AACE,iCAAoB;AAAA;;AAClB,aAAO,KAAKC,OAAL,CAAa;AAClBC,QAAAA,GAAG,EAAEC,eAAIC,KADS;AAElBC,QAAAA,QAAQ,EAAEC,oBAASC;AAFD,OAAb,EAIJC,IAJI,CAIC,UAACC,GAAD;AAAA,eAAS,KAAI,CAACC,qBAAL,CAA2BD,GAAG,CAACE,IAA/B,CAAT;AAAA,OAJD,EAKJC,KALI,CAKE,UAACC,KAAD,EAAW;AAChBC,6BAAYC,MAAZ,CAAmBF,KAAnB,+EAAgGA,KAAhG;AACD,OAPI,CAAP;AAQD;AAED;AACF;AACA;AACA;;;;WACE,wBAAe;AACb,aAAO,KAAKG,KAAL,CAAWC,QAAX,CAAoBC,QAApB,CAA6BC,qBAA7B,EAAP;AACD;AAED;AACF;AACA;AACA;;;;WACE,qCAA4B;AAC1B,aAAO,KAAKH,KAAL,CAAWC,QAAX,CAAoBC,QAApB,CAA6BE,yBAA7B,EAAP;AACD,K,CAGD;;AAEA;AACF;AACA;AACA;AACA;;;;WACE,+BAAsBC,YAAtB,EAAoC;AAAA;;AAClC,UAAIA,YAAY,CAACC,sBAAb,IAAuCD,YAAY,CAACC,sBAAb,CAAoCC,MAA/E,EAAuF;AACrF,eAAO,iBAAQC,GAAR,CAAYH,YAAY,CAACC,sBAAb,CAAoCG,GAApC,CAAwC,UAACC,GAAD;AAAA,iBAAS,MAAI,CAACzB,OAAL,CAAa;AAC/E0B,YAAAA,MAAM,EAAEC,sBAAWC,GAD4D;AAE/EH,YAAAA,GAAG,EAAHA,GAF+E;AAG/EI,YAAAA,qBAAqB,EAAE,IAHwD,CAGnD;;AAHmD,WAAb,EAKjEtB,IALiE,CAK5D,UAACC,GAAD,EAAS;AACbY,YAAAA,YAAY,CAACU,IAAb,GAAoBV,YAAY,CAACU,IAAb,CAAkBC,MAAlB,CAAyBvB,GAAG,CAACE,IAAJ,CAASoB,IAAlC,CAApB;AACAV,YAAAA,YAAY,CAACY,SAAb,GAAyBZ,YAAY,CAACY,SAAb,CAAuBD,MAAvB,CAA8BvB,GAAG,CAACE,IAAJ,CAASsB,SAAvC,CAAzB;AAEA,mBAAO,iBAAQC,OAAR,CAAgBb,YAAhB,CAAP;AACD,WAViE,EAWjET,KAXiE,CAW3D,UAACC,KAAD,EAAW;AAChBC,iCAAYC,MAAZ,CAAmBF,KAAnB,4FAA6Ga,GAA7G,uBAA6Hb,KAA7H;AACD,WAbiE,CAAT;AAAA,SAAxC,CAAZ,EAcJL,IAdI,CAcC;AAAA,iBAAM,iBAAQ0B,OAAR,CAAgBb,YAAhB,CAAN;AAAA,SAdD,CAAP;AAeD;;AAED,aAAO,iBAAQa,OAAR,CAAgBb,YAAhB,CAAP;AACD;;;EA5DyCc,+B","sourcesContent":["import {StatelessWebexPlugin} from '@webex/webex-core';\n\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {\n HTTP_VERBS,\n API,\n RESOURCE\n} from '../constants';\n\n/**\n * @class MeetingRequest\n */\nexport default class MeetingRequest extends StatelessWebexPlugin {\n /**\n * get all the active meetings for the user\n * @returns {Array} return locus array\n */\n getActiveMeetings() {\n return this.request({\n api: API.LOCUS,\n resource: RESOURCE.LOCI\n })\n .then((res) => this.determineRedirections(res.body))\n .catch((error) => {\n LoggerProxy.logger.error(`Meetings:request#getActiveMeetings --> failed to get locus details, ${error}`);\n });\n }\n\n /**\n * fetch geoHit for the user\n * @returns {Promise<object>} geoHintInfo\n */\n fetchGeoHint() {\n return this.webex.internal.services.fetchClientRegionInfo();\n }\n\n /**\n * fetch login user information\n * @returns {Promise<object>} loginUserInformation\n */\n fetchLoginUserInformation() {\n return this.webex.internal.services.fetchLoginUserInformation();\n }\n\n\n // locus federation, determines and populate locus if the responseBody has remote URLs to fetch locus details\n\n /**\n * Fetches indivdual locus rather then getting all at once\n * @param {object} responseBody determine the locus and fetch them if a remoteUrl is given\n * @returns {Promise} returns locusObject array\n */\n determineRedirections(responseBody) {\n if (responseBody.remoteLocusClusterUrls && responseBody.remoteLocusClusterUrls.length) {\n return Promise.all(responseBody.remoteLocusClusterUrls.map((url) => this.request({\n method: HTTP_VERBS.GET,\n url,\n runWhitelistedDomains: true // allows auth token for whitelisted domain\n })\n .then((res) => {\n responseBody.loci = responseBody.loci.concat(res.body.loci);\n responseBody.locusUrls = responseBody.locusUrls.concat(res.body.locusUrls);\n\n return Promise.resolve(responseBody);\n })\n .catch((error) => {\n LoggerProxy.logger.error(`Meetings:request#determineRedirections --> failed to get locus details from url: ${url}, reason: ${error}`);\n })))\n .then(() => Promise.resolve(responseBody));\n }\n\n return Promise.resolve(responseBody);\n }\n}\n"]}
|
package/dist/meetings/util.js
CHANGED
|
@@ -79,6 +79,23 @@ MeetingsUtil.checkForCorrelationId = function (deviceUrl, locus) {
|
|
|
79
79
|
|
|
80
80
|
return false;
|
|
81
81
|
};
|
|
82
|
+
|
|
83
|
+
MeetingsUtil.parseUserPreferences = function (userPreferences) {
|
|
84
|
+
var webexSite = null;
|
|
85
|
+
userPreferences.find(function (item) {
|
|
86
|
+
// eslint-disable-next-line no-useless-escape
|
|
87
|
+
var regex = /"preferredWebExSite\":\"(\S+)\"/;
|
|
88
|
+
var preferredSite = item.match(regex);
|
|
89
|
+
|
|
90
|
+
if (preferredSite) {
|
|
91
|
+
webexSite = preferredSite[1];
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return false;
|
|
96
|
+
});
|
|
97
|
+
return webexSite;
|
|
98
|
+
};
|
|
82
99
|
/**
|
|
83
100
|
* Will check to see if the H.264 media codec is supported.
|
|
84
101
|
* @async
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["util.js"],"names":["MeetingsUtil","getMeetingAddedType","type","_LOCUS_ID_","_INCOMING_","_CREATED_","handleRoapMercury","envelope","meetingCollection","data","eventType","LOCUSEVENT","MESSAGE_ROAP","meeting","getByKey","CORRELATION_ID","correlationId","roap","roapEvent","checkForCorrelationId","deviceUrl","locus","devices","self","foundDevice","find","device","url","hasH264Codec","hasCodec","pc","window","RTCPeerConnection","createOffer","offerToReceiveVideo","offer","sdp","
|
|
1
|
+
{"version":3,"sources":["util.js"],"names":["MeetingsUtil","getMeetingAddedType","type","_LOCUS_ID_","_INCOMING_","_CREATED_","handleRoapMercury","envelope","meetingCollection","data","eventType","LOCUSEVENT","MESSAGE_ROAP","meeting","getByKey","CORRELATION_ID","correlationId","roap","roapEvent","checkForCorrelationId","deviceUrl","locus","devices","self","foundDevice","find","device","url","parseUserPreferences","userPreferences","webexSite","item","regex","preferredSite","match","hasH264Codec","hasCodec","pc","window","RTCPeerConnection","createOffer","offerToReceiveVideo","offer","sdp","close","LoggerProxy","logger","warn","checkH264Support","options","firstChecked","disableNotifications","delay","maxDuration","shouldTrigger","undefined","shouldStopChecking","Trigger","trigger","file","function","EVENT_TRIGGERS","MEDIA_CODEC_LOADED","log","error","MEDIA_CODEC_MISSING","setTimeout","timestamp","call"],"mappings":";;;;;;;;;;;;;;;;;;AAEA;;AAQA;;AACA;;AAXA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,IAAMA,YAAY,GAAG,EAArB;;AAEAA,YAAY,CAACC,mBAAb,GAAmC,UAACC,IAAD;AAAA,SAAWA,IAAI,KAAKC,qBAAT,GAAsBC,qBAAtB,GAAmCC,oBAA9C;AAAA,CAAnC;;AAEAL,YAAY,CAACM,iBAAb,GAAiC,UAACC,QAAD,EAAWC,iBAAX,EAAiC;AAChE,MAAOC,IAAP,GAAeF,QAAf,CAAOE,IAAP;AACA,MAAOC,SAAP,GAAoBD,IAApB,CAAOC,SAAP;;AAEA,MAAI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AA;AAAA;AAAA;AAAA;AAAA;;AAiB5BsB,kCAAQC,OAAR,CACE,IADF,EAEE;AACEC,cAAAA,IAAI,EAAE,eADR;AAEEC,cAAAA,QAAQ,EAAE;AAFZ,aAFF,EAMEC,0BAAeC,kBANjB;;AAQAjB,iCAAYC,MAAZ,CAAmBiB,GAAnB,CAAuB,oEAAvB;;AAzB4B;;AAAA;AAAA,iBA+B1BP,kBA/B0B;AAAA;AAAA;AAAA;;AAgC5BX,iCAAYC,MAAZ,CAAmBkB,KAAnB,CAAyB,8EAAzB;;AAhC4B;;AAAA;AAqC9B;AACA,gBAAIV,aAAJ,EAAmB;AACjBG,oCAAQC,OAAR,CACE,IADF,EAEE;AACEC,gBAAAA,IAAI,EAAE,eADR;AAEEC,gBAAAA,QAAQ,EAAE;AAFZ,eAFF,EAMEC,0BAAeI,mBANjB;;AAQApB,mCAAYC,MAAZ,CAAmBiB,GAAnB,CAAuB,2DAAvB;AACD,aAhD6B,CAkD9B;;;AACAzB,YAAAA,MAAM,CAAC4B,UAAP,CAAkB,YAAM;AACtB,kBAAMC,SAAS,GAAGjB,YAAY,IAAI,mBAAlC;AAEAlD,cAAAA,YAAY,CAACgD,gBAAb,CAA8BoB,IAA9B,CAAmC,KAAnC,EAAyC;AAAClB,gBAAAA,YAAY,EAAEiB;AAAf,eAAzC;AACD,aAJD,EAIGf,KAJH;;AAnD8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAAhC;;AAAA,WAA+CJ,gBAA/C;AAAA;AAAA;;AAAA,SAA+CA,gBAA/C;AAAA;;eA0DehD,Y","sourcesContent":["/* globals window */\n\nimport {\n _LOCUS_ID_,\n _INCOMING_,\n _CREATED_,\n LOCUSEVENT,\n CORRELATION_ID,\n EVENT_TRIGGERS\n} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport Trigger from '../common/events/trigger-proxy';\n\n/**\n * Meetings Media Codec Missing Event\n * Emitted when H.264 codec is not\n * found in the browser.\n * @event media:codec:missing\n * @instance\n * @memberof MeetingsUtil\n */\n\n/**\n * Meetings Media Codec Loaded Event\n * Emitted when H.264 codec has been\n * loaded in the browser.\n * @event media:codec:loaded\n * @instance\n * @memberof MeetingsUtil\n */\n\nconst MeetingsUtil = {};\n\nMeetingsUtil.getMeetingAddedType = (type) => (type === _LOCUS_ID_ ? _INCOMING_ : _CREATED_);\n\nMeetingsUtil.handleRoapMercury = (envelope, meetingCollection) => {\n const {data} = envelope;\n const {eventType} = data;\n\n if (eventType === LOCUSEVENT.MESSAGE_ROAP) {\n const meeting = meetingCollection.getByKey(CORRELATION_ID, data.correlationId);\n\n if (meeting) {\n meeting.roap.roapEvent(data);\n }\n }\n};\n\nMeetingsUtil.checkForCorrelationId = (deviceUrl, locus) => {\n let devices = [];\n\n if (locus) {\n if (locus && locus.self && locus.self.devices) {\n devices = locus.self.devices;\n }\n\n const foundDevice = devices.find((device) => device.url === deviceUrl);\n\n if (foundDevice && foundDevice.correlationId) {\n return foundDevice.correlationId;\n }\n }\n\n return false;\n};\n\nMeetingsUtil.parseUserPreferences = (userPreferences) => {\n let webexSite = null;\n\n userPreferences.find((item) => {\n // eslint-disable-next-line no-useless-escape\n const regex = /\"preferredWebExSite\\\":\\\"(\\S+)\\\"/;\n const preferredSite = item.match(regex);\n\n if (preferredSite) {\n webexSite = preferredSite[1];\n\n return true;\n }\n\n return false;\n });\n\n return webexSite;\n};\n\n/**\n * Will check to see if the H.264 media codec is supported.\n * @async\n * @private\n * @returns {Promise<boolean>}\n */\nMeetingsUtil.hasH264Codec = async () => {\n let hasCodec = false;\n\n try {\n const pc = new window.RTCPeerConnection();\n const offer = await pc.createOffer({offerToReceiveVideo: true});\n\n if (offer.sdp.match(/^a=rtpmap:\\d+\\s+H264\\/\\d+/m)) {\n hasCodec = true;\n }\n pc.close();\n }\n catch (error) {\n LoggerProxy.logger.warn('Meetings:util#hasH264Codec --> Error creating peerConnection for H.264 test.');\n }\n\n return hasCodec;\n};\n\n\n/**\n * Notifies the user whether or not the H.264\n * codec is present. Will continuously check\n * until max duration.\n * @async\n * @private\n * @param {object} options\n * @param {Number} options.firstChecked Timestamp in milliseconds\n * @param {boolean} options.disableNotifications Default is false. Boolean to enable/disable notification and events\n * @returns {undefined}\n */\nMeetingsUtil.checkH264Support = async function checkH264Support(options) {\n const {hasH264Codec} = MeetingsUtil;\n const {firstChecked, disableNotifications} = options || {};\n const delay = 5e3; // ms\n const maxDuration = 3e5; // ms\n const shouldTrigger = (firstChecked === undefined);\n const shouldStopChecking = firstChecked && (Date.now() - firstChecked) >= maxDuration;\n\n // Disable notifications and start H.264 download only\n if (disableNotifications) {\n hasH264Codec();\n\n return;\n }\n\n // Codec loaded trigger event notification\n if (await hasH264Codec()) {\n Trigger.trigger(\n this,\n {\n file: 'meetings/util',\n function: 'checkH264Support'\n },\n EVENT_TRIGGERS.MEDIA_CODEC_LOADED\n );\n LoggerProxy.logger.log('Meetings:util#checkH264Support --> H264 codec loaded successfully.');\n\n return;\n }\n\n // Stop checking if past the timelimit\n if (shouldStopChecking) {\n LoggerProxy.logger.error('Meetings:util#checkH264Support --> Timed out waiting for H264 codec to load.');\n\n return;\n }\n\n // Trigger only once\n if (shouldTrigger) {\n Trigger.trigger(\n this,\n {\n file: 'meetings/util',\n function: 'checkH264Support'\n },\n EVENT_TRIGGERS.MEDIA_CODEC_MISSING\n );\n LoggerProxy.logger.log('Meetings:util#checkH264Support --> H264 codec is missing.');\n }\n\n // Keep checking in intervals to see if codec loaded\n window.setTimeout(() => {\n const timestamp = firstChecked || Date.now();\n\n MeetingsUtil.checkH264Support.call(this, {firstChecked: timestamp});\n }, delay);\n};\n\nexport default MeetingsUtil;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/plugin-meetings",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.159.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"contributors": [
|
|
@@ -24,18 +24,19 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime-corejs2": "^7.14.8",
|
|
27
|
-
"@webex/webex-core": "1.
|
|
28
|
-
"@webex/internal-plugin-mercury": "1.
|
|
27
|
+
"@webex/webex-core": "1.159.2",
|
|
28
|
+
"@webex/internal-plugin-mercury": "1.159.2",
|
|
29
|
+
"@webex/internal-plugin-conversation": "1.159.2",
|
|
29
30
|
"webrtc-adapter": "^7.7.0",
|
|
30
31
|
"lodash": "^4.17.21",
|
|
31
32
|
"uuid": "^3.3.2",
|
|
32
33
|
"global": "^4.4.0",
|
|
33
34
|
"ip-anonymize": "^0.1.0",
|
|
34
|
-
"@webex/common": "1.
|
|
35
|
+
"@webex/common": "1.159.2",
|
|
35
36
|
"bowser": "^2.11.0",
|
|
36
37
|
"sdp-transform": "^2.12.0",
|
|
37
38
|
"readable-stream": "^3.6.0",
|
|
38
|
-
"@webex/common-timers": "1.
|
|
39
|
+
"@webex/common-timers": "1.159.2",
|
|
39
40
|
"btoa": "^1.2.1",
|
|
40
41
|
"javascript-state-machine": "^3.1.0",
|
|
41
42
|
"envify": "^4.1.0"
|
package/src/config.js
CHANGED
package/src/meeting/index.js
CHANGED
|
@@ -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
|
-
|
|
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,
|
|
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
|
-
|
|
997
|
+
password, captchaCode
|
|
983
998
|
})
|
|
984
999
|
.then(() => ({isPasswordValid: true, requiredCaptcha: null, failureReason: MEETING_INFO_FAILURE_REASON.NONE}))
|
|
985
1000
|
.catch((error) => {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
import {HTTP_VERBS} from '../constants';
|
|
2
|
+
import {HTTP_VERBS, _CONVERSATION_URL_} from '../constants';
|
|
3
3
|
|
|
4
4
|
import MeetingInfoUtil from './utilv2';
|
|
5
5
|
|
|
6
6
|
const PASSWORD_ERROR_DEFAULT_MESSAGE = 'Password required. Call fetchMeetingInfo() with password argument';
|
|
7
7
|
const CAPTCHA_ERROR_DEFAULT_MESSAGE = 'Captcha required. Call fetchMeetingInfo() with captchaInfo argument';
|
|
8
|
+
const ADHOC_MEETING_DEFAULT_ERROR = 'Failed starting the adhoc meeting, Please contact support team ';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Error to indicate that wbxappapi requires a password
|
|
@@ -28,7 +29,27 @@ export class MeetingInfoV2PasswordError extends Error {
|
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
|
-
|
|
32
|
+
* Error generating a adhoc space meeting
|
|
33
|
+
*/
|
|
34
|
+
export class MeetingInfoV2AdhocMeetingError extends Error {
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @constructor
|
|
38
|
+
* @param {Number} [wbxAppApiErrorCode]
|
|
39
|
+
* @param {String} [message]
|
|
40
|
+
*/
|
|
41
|
+
constructor(wbxAppApiErrorCode, message = ADHOC_MEETING_DEFAULT_ERROR) {
|
|
42
|
+
super(`${message}, code=${wbxAppApiErrorCode}`);
|
|
43
|
+
this.name = 'MeetingInfoV2AdhocMeetingError';
|
|
44
|
+
this.sdkMessage = message;
|
|
45
|
+
this.stack = (new Error()).stack;
|
|
46
|
+
this.wbxAppApiCode = wbxAppApiErrorCode;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Error to indicate that preferred webex site not present to start adhoc meeting
|
|
32
53
|
*/
|
|
33
54
|
export class MeetingInfoV2CaptchaError extends Error {
|
|
34
55
|
/**
|
|
@@ -65,7 +86,7 @@ export default class MeetingInfoV2 {
|
|
|
65
86
|
* converts hydra id into conversation url and persons Id
|
|
66
87
|
* @param {String} destination one of many different types of destinations to look up info for
|
|
67
88
|
* @param {String} [type] to match up with the destination value
|
|
68
|
-
* @returns {Promise}
|
|
89
|
+
* @returns {Promise} destination and type
|
|
69
90
|
* @public
|
|
70
91
|
* @memberof MeetingInfo
|
|
71
92
|
*/
|
|
@@ -77,6 +98,59 @@ export default class MeetingInfoV2 {
|
|
|
77
98
|
});
|
|
78
99
|
}
|
|
79
100
|
|
|
101
|
+
/**
|
|
102
|
+
* Creates adhoc space meetings for a space by fetching the conversation infomation
|
|
103
|
+
* @param {String} conversationUrl conversationUrl to start adhoc meeting on
|
|
104
|
+
* @returns {Promise} returns a meeting info object
|
|
105
|
+
* @public
|
|
106
|
+
* @memberof MeetingInfo
|
|
107
|
+
*/
|
|
108
|
+
async createAdhocSpaceMeeting(conversationUrl) {
|
|
109
|
+
if (!this.webex.meetings.preferredWebexSite) {
|
|
110
|
+
throw Error('No preferred webex site found');
|
|
111
|
+
}
|
|
112
|
+
const getInvitees = (particpants = []) => {
|
|
113
|
+
const invitees = [];
|
|
114
|
+
|
|
115
|
+
if (particpants) {
|
|
116
|
+
particpants.forEach((participant) => {
|
|
117
|
+
invitees.push({
|
|
118
|
+
email: participant.emailAddress,
|
|
119
|
+
ciUserUuid: participant.entryUUID
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return invitees;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
return this.webex.internal.conversation.get(
|
|
128
|
+
{url: conversationUrl},
|
|
129
|
+
{includeParticipants: true, disableTransform: true}
|
|
130
|
+
)
|
|
131
|
+
.then((conversation) => {
|
|
132
|
+
const body = {
|
|
133
|
+
title: conversation.displayName,
|
|
134
|
+
spaceUrl: conversation.url,
|
|
135
|
+
keyUrl: conversation.encryptionKeyUrl,
|
|
136
|
+
kroUrl: conversation.kmsResourceObjectUrl,
|
|
137
|
+
invitees: getInvitees(conversation.participants?.items)
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const uri = this.webex.meetings.preferredWebexSite ?
|
|
141
|
+
`https://${this.webex.meetings.preferredWebexSite}/wbxappapi/v2/meetings/spaceInstant` : '';
|
|
142
|
+
|
|
143
|
+
return this.webex.request({
|
|
144
|
+
method: HTTP_VERBS.POST,
|
|
145
|
+
uri,
|
|
146
|
+
body
|
|
147
|
+
})
|
|
148
|
+
.catch((err) => {
|
|
149
|
+
throw new MeetingInfoV2AdhocMeetingError(err.body?.code, err.body?.message);
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
80
154
|
/**
|
|
81
155
|
* Fetches meeting info from the server
|
|
82
156
|
* @param {String} destination one of many different types of destinations to look up info for
|
|
@@ -95,6 +169,11 @@ export default class MeetingInfoV2 {
|
|
|
95
169
|
type,
|
|
96
170
|
webex: this.webex
|
|
97
171
|
});
|
|
172
|
+
|
|
173
|
+
if (destinationType.type === _CONVERSATION_URL_ && this.webex.config.meetings.experimental.enableAdhocMeetings) {
|
|
174
|
+
return this.createAdhocSpaceMeeting(destinationType.destination);
|
|
175
|
+
}
|
|
176
|
+
|
|
98
177
|
const body = await MeetingInfoUtil.getRequestBody({...destinationType, password, captchaInfo});
|
|
99
178
|
|
|
100
179
|
const options = {
|