@webex/plugin-meetings 3.8.0-next.5 → 3.8.0-next.7

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.
@@ -19,6 +19,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpe
19
19
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
20
20
  var _lodash = require("lodash");
21
21
  var _common = require("@webex/common");
22
+ var _events = require("events");
22
23
  var _webexCore = require("@webex/webex-core");
23
24
  var _constants = require("../constants");
24
25
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
@@ -236,13 +237,18 @@ var LocusMediaRequest = exports.LocusMediaRequest = /*#__PURE__*/function (_Webe
236
237
  if (isRequestAffectingConfluenceState(request) && this.confluenceState === 'not created') {
237
238
  this.confluenceState = 'creation in progress';
238
239
  }
239
-
240
- // @ts-ignore
241
- return this.request({
240
+ var upload = new _events.EventEmitter();
241
+ var download = new _events.EventEmitter();
242
+ var options = {
242
243
  method: _constants.HTTP_VERBS.PUT,
243
244
  uri: uri,
244
- body: body
245
- }).then(function (result) {
245
+ body: body,
246
+ upload: upload,
247
+ download: download
248
+ };
249
+
250
+ // @ts-ignore
251
+ var promise = this.request(options).then(function (result) {
246
252
  if (isRequestAffectingConfluenceState(request)) {
247
253
  _this4.confluenceState = 'created';
248
254
  }
@@ -272,6 +278,16 @@ var LocusMediaRequest = exports.LocusMediaRequest = /*#__PURE__*/function (_Webe
272
278
  }
273
279
  throw e;
274
280
  });
281
+ if (request.type === 'RoapMessage') {
282
+ var setupProgressListener = function setupProgressListener(direction, eventEmitter) {
283
+ eventEmitter.on('progress', function (progressEvent) {
284
+ _loggerProxy.default.logger.info("".concat(request.type, ": ").concat(direction, " Progress, Timestamp: ").concat(progressEvent.timeStamp, ", Progress: ").concat(progressEvent.loaded, "/").concat(progressEvent.total));
285
+ });
286
+ };
287
+ setupProgressListener('Upload', options.upload);
288
+ setupProgressListener('Download', options.download);
289
+ }
290
+ return promise;
275
291
  }
276
292
 
277
293
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["_lodash","require","_common","_webexCore","_constants","_loggerProxy","_interopRequireDefault","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","InternalRequestInfo","request","pendingPromise","sendRequestFn","_classCallCheck2","_defineProperty2","pendingPromises","_createClass2","key","value","getPendingPromises","addPendingPromises","_this$pendingPromises","push","_toConsumableArray2","execute","_this","then","forEach","d","resolve","catch","reject","isRequestAffectingConfluenceState","type","roapMessage","messageType","ROAP","ROAP_TYPES","OFFER","LocusMediaRequest","exports","_WebexPlugin","_inherits2","_super","config","options","_this2","_assertThisInitialized2","isRequestInProgress","queuedRequests","confluenceState","addToQueue","info","length","filter","r","executeNextQueuedRequest","_this3","nextRequest","shift","getLatestMuteState","audioMuted","latestAudioMuted","undefined","videoMuted","latestVideoMuted","sendHttpRequest","_this4","uri","concat","selfUrl","MEDIA","_this$getLatestMuteSt","body","device","correlationId","localMedias","respOnlySdp","usingResource","reachability","clientMediaPreferences","webex","internal","newMetrics","submitClientEvent","name","meetingId","sequence","localSdp","_stringify","mediaId","LoggerProxy","logger","method","HTTP_VERBS","PUT","rawError","send","_this5","_request$muteOptions","muteOptions","_promise","Defer","newRequest","bind","defer","promise","isConfluenceCreated","downgradeFromMultistreamToTranscoded","preferTranscoding","WebexPlugin"],"sources":["locusMediaRequest.ts"],"sourcesContent":["/* eslint-disable valid-jsdoc */\nimport {defer} from 'lodash';\nimport {Defer} from '@webex/common';\nimport {WebexPlugin} from '@webex/webex-core';\nimport {MEDIA, HTTP_VERBS, ROAP} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {ClientMediaPreferences} from '../reachability/reachability.types';\n\nexport type MediaRequestType = 'RoapMessage' | 'LocalMute';\nexport type RequestResult = any;\n\nexport type RoapRequest = {\n type: 'RoapMessage';\n selfUrl: string;\n mediaId: string;\n roapMessage: any;\n reachability: any;\n clientMediaPreferences: ClientMediaPreferences;\n sequence?: any;\n};\n\nexport type LocalMuteRequest = {\n type: 'LocalMute';\n selfUrl: string;\n mediaId: string;\n sequence?: any;\n muteOptions: {\n audioMuted?: boolean;\n videoMuted?: boolean;\n };\n};\n\nexport type Request = RoapRequest | LocalMuteRequest;\n\n/** Class representing a single /media request being sent to Locus */\nclass InternalRequestInfo {\n public readonly request: Request;\n private pendingPromises: Defer[];\n private sendRequestFn: (request: Request) => Promise<RequestResult>;\n\n /** Constructor */\n constructor(\n request: Request,\n pendingPromise: Defer,\n sendRequestFn: (request: Request) => Promise<RequestResult>\n ) {\n this.request = request;\n this.pendingPromises = [pendingPromise];\n this.sendRequestFn = sendRequestFn;\n }\n\n /**\n * Returns the list of pending promises associated with this request\n */\n public getPendingPromises() {\n return this.pendingPromises;\n }\n\n /**\n * Adds promises to the list of pending promises associated with this request\n */\n public addPendingPromises(pendingPromises: Defer[]) {\n this.pendingPromises.push(...pendingPromises);\n }\n\n /**\n * Executes the request. Returned promise is resolved once the request\n * is completed (no matter if it succeeded or failed).\n */\n public execute(): Promise<void> {\n return this.sendRequestFn(this.request)\n .then((result) => {\n // resolve all the pending promises associated with this request\n this.pendingPromises.forEach((d) => d.resolve(result));\n })\n .catch((e) => {\n // reject all the pending promises associated with this request\n this.pendingPromises.forEach((d) => d.reject(e));\n });\n }\n}\n\nexport type Config = {\n device: {\n url: string;\n deviceType: string;\n countryCode?: string;\n regionCode?: string;\n };\n correlationId: string;\n meetingId: string;\n preferTranscoding: boolean;\n};\n\n/**\n * Returns true if the request is triggering confluence creation in the server\n */\nfunction isRequestAffectingConfluenceState(request: Request): boolean {\n return (\n request.type === 'RoapMessage' && request.roapMessage.messageType === ROAP.ROAP_TYPES.OFFER\n );\n}\n\n/**\n * This class manages all /media API requests to Locus. Every call to that\n * Locus API has to go through this class.\n */\nexport class LocusMediaRequest extends WebexPlugin {\n private config: Config;\n private latestAudioMuted?: boolean;\n private latestVideoMuted?: boolean;\n private isRequestInProgress: boolean;\n private queuedRequests: InternalRequestInfo[];\n private confluenceState: 'not created' | 'creation in progress' | 'created';\n /**\n * Constructor\n */\n constructor(config: Config, options: any) {\n super({}, options);\n this.isRequestInProgress = false;\n this.queuedRequests = [];\n this.config = config;\n this.confluenceState = 'not created';\n }\n\n /**\n * Add a request to the internal queue.\n */\n private addToQueue(info: InternalRequestInfo) {\n if (info.request.type === 'LocalMute' && this.queuedRequests.length > 0) {\n // We don't need additional local mute requests in the queue.\n // We only need at most 1 local mute or 1 roap request, because\n // roap requests also include mute state, so whatever request\n // is sent out, it will send the latest local mute state.\n // We only need to store the pendingPromises so that they get resolved\n // when the roap request is sent out.\n this.queuedRequests[0].addPendingPromises(info.getPendingPromises());\n\n return;\n }\n\n if (info.request.type === 'RoapMessage' && this.queuedRequests.length > 0) {\n // remove any LocalMute requests from the queue, because this Roap message\n // will also update the mute status in Locus, so they are redundant\n this.queuedRequests = this.queuedRequests.filter((r) => {\n if (r.request.type === 'LocalMute') {\n // we need to keep the pending promises from the local mute request\n // that we're removing from the queue\n info.addPendingPromises(r.getPendingPromises());\n\n return false;\n }\n\n return true;\n });\n }\n\n this.queuedRequests.push(info);\n }\n\n /**\n * Takes the next request from the queue and executes it. Once that\n * request is completed, the next one will be taken from the queue\n * and executed and this is repeated until the queue is empty.\n */\n private executeNextQueuedRequest(): void {\n if (this.isRequestInProgress) {\n return;\n }\n\n const nextRequest = this.queuedRequests.shift();\n\n if (nextRequest) {\n this.isRequestInProgress = true;\n nextRequest.execute().then(() => {\n this.isRequestInProgress = false;\n this.executeNextQueuedRequest();\n });\n }\n }\n\n /**\n * Returns latest requested audio and video mute values. If they have never been\n * requested, we assume audio/video to be muted.\n */\n private getLatestMuteState() {\n const audioMuted = this.latestAudioMuted !== undefined ? this.latestAudioMuted : true;\n const videoMuted = this.latestVideoMuted !== undefined ? this.latestVideoMuted : true;\n\n return {audioMuted, videoMuted};\n }\n\n /**\n * Prepares the uri and body for the media request to be sent to Locus\n */\n private sendHttpRequest(request: Request) {\n const uri = `${request.selfUrl}/${MEDIA}`;\n\n const {audioMuted, videoMuted} = this.getLatestMuteState();\n\n // first setup things common to all requests\n const body: any = {\n device: this.config.device,\n correlationId: this.config.correlationId,\n };\n\n const localMedias: any = {\n audioMuted,\n videoMuted,\n };\n\n // now add things specific to request type\n switch (request.type) {\n case 'LocalMute':\n body.respOnlySdp = true;\n body.usingResource = null;\n break;\n\n case 'RoapMessage':\n localMedias.roapMessage = request.roapMessage;\n localMedias.reachability = request.reachability;\n body.clientMediaPreferences = request.clientMediaPreferences;\n\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.locus.media.request',\n options: {\n meetingId: this.config.meetingId,\n },\n });\n break;\n }\n\n if (request.sequence) {\n body.sequence = request.sequence;\n }\n\n body.localMedias = [\n {\n localSdp: JSON.stringify(localMedias), // this part must be JSON stringified, Locus requires this\n mediaId: request.mediaId,\n },\n ];\n\n LoggerProxy.logger.info(\n `Meeting:LocusMediaRequest#sendHttpRequest --> ${request.type} audioMuted=${audioMuted} videoMuted=${videoMuted}`\n );\n\n if (isRequestAffectingConfluenceState(request) && this.confluenceState === 'not created') {\n this.confluenceState = 'creation in progress';\n }\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.PUT,\n uri,\n body,\n })\n .then((result) => {\n if (isRequestAffectingConfluenceState(request)) {\n this.confluenceState = 'created';\n }\n\n if (request.type === 'RoapMessage') {\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.locus.media.response',\n options: {\n meetingId: this.config.meetingId,\n },\n });\n }\n\n return result;\n })\n .catch((e) => {\n if (\n isRequestAffectingConfluenceState(request) &&\n this.confluenceState === 'creation in progress'\n ) {\n this.confluenceState = 'not created';\n }\n\n if (request.type === 'RoapMessage') {\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.locus.media.response',\n options: {\n meetingId: this.config.meetingId,\n rawError: e,\n },\n });\n }\n\n throw e;\n });\n }\n\n /**\n * Sends a media request to Locus\n */\n public send(request: Request): Promise<RequestResult> {\n if (request.type === 'LocalMute') {\n const {audioMuted, videoMuted} = request.muteOptions;\n\n if (audioMuted !== undefined) {\n this.latestAudioMuted = audioMuted;\n }\n if (videoMuted !== undefined) {\n this.latestVideoMuted = videoMuted;\n }\n\n if (this.confluenceState === 'not created') {\n // if there is no confluence, there is no point sending out local mute request\n // as it will fail so we just store the latest audio/video muted values\n // and resolve immediately, so that higher layer (MuteState class) doesn't get blocked\n // and can call us again if user mutes/unmutes again before confluence is created\n LoggerProxy.logger.info(\n 'Meeting:LocusMediaRequest#send --> called with LocalMute request before confluence creation'\n );\n\n return Promise.resolve({});\n }\n }\n\n const pendingPromise = new Defer();\n\n const newRequest = new InternalRequestInfo(\n request,\n pendingPromise,\n this.sendHttpRequest.bind(this)\n );\n\n this.addToQueue(newRequest);\n\n defer(() => this.executeNextQueuedRequest());\n\n return pendingPromise.promise;\n }\n\n /** Returns true if a confluence on the server is already created */\n public isConfluenceCreated() {\n return this.confluenceState === 'created';\n }\n\n /**\n * This method needs to be called when we downgrade from multistream to transcoded connection.\n */\n public downgradeFromMultistreamToTranscoded() {\n this.config.preferTranscoding = true;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAC,sBAAA,CAAAL,OAAA;AAAsD,SAAAM,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,CAAAC,OAAA,EAAAN,OAAA,GAAAO,MAAA,MAAAN,yBAAA,Q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;AACA;EAFE;IAAAjC,GAAA;IAAAC,KAAA,EAGA,SAAA0F,qCAAA,EAA8C;MAC5C,IAAI,CAAChE,MAAM,CAACiE,iBAAiB,GAAG,IAAI;IACtC;EAAC;EAAA,OAAAtE,iBAAA;AAAA,EAnPoCuE,sBAAW"}
1
+ {"version":3,"names":["_lodash","require","_common","_events","_webexCore","_constants","_loggerProxy","_interopRequireDefault","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","InternalRequestInfo","request","pendingPromise","sendRequestFn","_classCallCheck2","_defineProperty2","pendingPromises","_createClass2","key","value","getPendingPromises","addPendingPromises","_this$pendingPromises","push","_toConsumableArray2","execute","_this","then","forEach","d","resolve","catch","reject","isRequestAffectingConfluenceState","type","roapMessage","messageType","ROAP","ROAP_TYPES","OFFER","LocusMediaRequest","exports","_WebexPlugin","_inherits2","_super","config","options","_this2","_assertThisInitialized2","isRequestInProgress","queuedRequests","confluenceState","addToQueue","info","length","filter","r","executeNextQueuedRequest","_this3","nextRequest","shift","getLatestMuteState","audioMuted","latestAudioMuted","undefined","videoMuted","latestVideoMuted","sendHttpRequest","_this4","uri","concat","selfUrl","MEDIA","_this$getLatestMuteSt","body","device","correlationId","localMedias","respOnlySdp","usingResource","reachability","clientMediaPreferences","webex","internal","newMetrics","submitClientEvent","name","meetingId","sequence","localSdp","_stringify","mediaId","LoggerProxy","logger","upload","EventEmitter","download","method","HTTP_VERBS","PUT","promise","rawError","setupProgressListener","direction","eventEmitter","on","progressEvent","timeStamp","loaded","total","send","_this5","_request$muteOptions","muteOptions","_promise","Defer","newRequest","bind","defer","isConfluenceCreated","downgradeFromMultistreamToTranscoded","preferTranscoding","WebexPlugin"],"sources":["locusMediaRequest.ts"],"sourcesContent":["/* eslint-disable valid-jsdoc */\nimport {defer} from 'lodash';\nimport {Defer, transferEvents} from '@webex/common';\nimport {EventEmitter} from 'events';\nimport {WebexPlugin} from '@webex/webex-core';\nimport {MEDIA, HTTP_VERBS, ROAP} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {ClientMediaPreferences} from '../reachability/reachability.types';\n\nexport type MediaRequestType = 'RoapMessage' | 'LocalMute';\nexport type RequestResult = any;\n\nexport type RoapRequest = {\n type: 'RoapMessage';\n selfUrl: string;\n mediaId: string;\n roapMessage: any;\n reachability: any;\n clientMediaPreferences: ClientMediaPreferences;\n sequence?: any;\n};\n\nexport type LocalMuteRequest = {\n type: 'LocalMute';\n selfUrl: string;\n mediaId: string;\n sequence?: any;\n muteOptions: {\n audioMuted?: boolean;\n videoMuted?: boolean;\n };\n};\n\nexport type Request = RoapRequest | LocalMuteRequest;\n\n/** Class representing a single /media request being sent to Locus */\nclass InternalRequestInfo {\n public readonly request: Request;\n private pendingPromises: Defer[];\n private sendRequestFn: (request: Request) => Promise<RequestResult>;\n\n /** Constructor */\n constructor(\n request: Request,\n pendingPromise: Defer,\n sendRequestFn: (request: Request) => Promise<RequestResult>\n ) {\n this.request = request;\n this.pendingPromises = [pendingPromise];\n this.sendRequestFn = sendRequestFn;\n }\n\n /**\n * Returns the list of pending promises associated with this request\n */\n public getPendingPromises() {\n return this.pendingPromises;\n }\n\n /**\n * Adds promises to the list of pending promises associated with this request\n */\n public addPendingPromises(pendingPromises: Defer[]) {\n this.pendingPromises.push(...pendingPromises);\n }\n\n /**\n * Executes the request. Returned promise is resolved once the request\n * is completed (no matter if it succeeded or failed).\n */\n public execute(): Promise<void> {\n return this.sendRequestFn(this.request)\n .then((result) => {\n // resolve all the pending promises associated with this request\n this.pendingPromises.forEach((d) => d.resolve(result));\n })\n .catch((e) => {\n // reject all the pending promises associated with this request\n this.pendingPromises.forEach((d) => d.reject(e));\n });\n }\n}\n\nexport type Config = {\n device: {\n url: string;\n deviceType: string;\n countryCode?: string;\n regionCode?: string;\n };\n correlationId: string;\n meetingId: string;\n preferTranscoding: boolean;\n};\n\n/**\n * Returns true if the request is triggering confluence creation in the server\n */\nfunction isRequestAffectingConfluenceState(request: Request): boolean {\n return (\n request.type === 'RoapMessage' && request.roapMessage.messageType === ROAP.ROAP_TYPES.OFFER\n );\n}\n\n/**\n * This class manages all /media API requests to Locus. Every call to that\n * Locus API has to go through this class.\n */\nexport class LocusMediaRequest extends WebexPlugin {\n private config: Config;\n private latestAudioMuted?: boolean;\n private latestVideoMuted?: boolean;\n private isRequestInProgress: boolean;\n private queuedRequests: InternalRequestInfo[];\n private confluenceState: 'not created' | 'creation in progress' | 'created';\n /**\n * Constructor\n */\n constructor(config: Config, options: any) {\n super({}, options);\n this.isRequestInProgress = false;\n this.queuedRequests = [];\n this.config = config;\n this.confluenceState = 'not created';\n }\n\n /**\n * Add a request to the internal queue.\n */\n private addToQueue(info: InternalRequestInfo) {\n if (info.request.type === 'LocalMute' && this.queuedRequests.length > 0) {\n // We don't need additional local mute requests in the queue.\n // We only need at most 1 local mute or 1 roap request, because\n // roap requests also include mute state, so whatever request\n // is sent out, it will send the latest local mute state.\n // We only need to store the pendingPromises so that they get resolved\n // when the roap request is sent out.\n this.queuedRequests[0].addPendingPromises(info.getPendingPromises());\n\n return;\n }\n\n if (info.request.type === 'RoapMessage' && this.queuedRequests.length > 0) {\n // remove any LocalMute requests from the queue, because this Roap message\n // will also update the mute status in Locus, so they are redundant\n this.queuedRequests = this.queuedRequests.filter((r) => {\n if (r.request.type === 'LocalMute') {\n // we need to keep the pending promises from the local mute request\n // that we're removing from the queue\n info.addPendingPromises(r.getPendingPromises());\n\n return false;\n }\n\n return true;\n });\n }\n\n this.queuedRequests.push(info);\n }\n\n /**\n * Takes the next request from the queue and executes it. Once that\n * request is completed, the next one will be taken from the queue\n * and executed and this is repeated until the queue is empty.\n */\n private executeNextQueuedRequest(): void {\n if (this.isRequestInProgress) {\n return;\n }\n\n const nextRequest = this.queuedRequests.shift();\n\n if (nextRequest) {\n this.isRequestInProgress = true;\n nextRequest.execute().then(() => {\n this.isRequestInProgress = false;\n this.executeNextQueuedRequest();\n });\n }\n }\n\n /**\n * Returns latest requested audio and video mute values. If they have never been\n * requested, we assume audio/video to be muted.\n */\n private getLatestMuteState() {\n const audioMuted = this.latestAudioMuted !== undefined ? this.latestAudioMuted : true;\n const videoMuted = this.latestVideoMuted !== undefined ? this.latestVideoMuted : true;\n\n return {audioMuted, videoMuted};\n }\n\n /**\n * Prepares the uri and body for the media request to be sent to Locus\n */\n private sendHttpRequest(request: Request) {\n const uri = `${request.selfUrl}/${MEDIA}`;\n\n const {audioMuted, videoMuted} = this.getLatestMuteState();\n\n // first setup things common to all requests\n const body: any = {\n device: this.config.device,\n correlationId: this.config.correlationId,\n };\n\n const localMedias: any = {\n audioMuted,\n videoMuted,\n };\n\n // now add things specific to request type\n switch (request.type) {\n case 'LocalMute':\n body.respOnlySdp = true;\n body.usingResource = null;\n break;\n\n case 'RoapMessage':\n localMedias.roapMessage = request.roapMessage;\n localMedias.reachability = request.reachability;\n body.clientMediaPreferences = request.clientMediaPreferences;\n\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.locus.media.request',\n options: {\n meetingId: this.config.meetingId,\n },\n });\n break;\n }\n\n if (request.sequence) {\n body.sequence = request.sequence;\n }\n\n body.localMedias = [\n {\n localSdp: JSON.stringify(localMedias), // this part must be JSON stringified, Locus requires this\n mediaId: request.mediaId,\n },\n ];\n\n LoggerProxy.logger.info(\n `Meeting:LocusMediaRequest#sendHttpRequest --> ${request.type} audioMuted=${audioMuted} videoMuted=${videoMuted}`\n );\n\n if (isRequestAffectingConfluenceState(request) && this.confluenceState === 'not created') {\n this.confluenceState = 'creation in progress';\n }\n\n const upload = new EventEmitter();\n const download = new EventEmitter();\n\n const options = {\n method: HTTP_VERBS.PUT,\n uri,\n body,\n upload,\n download,\n };\n\n // @ts-ignore\n const promise = this.request(options)\n .then((result) => {\n if (isRequestAffectingConfluenceState(request)) {\n this.confluenceState = 'created';\n }\n\n if (request.type === 'RoapMessage') {\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.locus.media.response',\n options: {\n meetingId: this.config.meetingId,\n },\n });\n }\n\n return result;\n })\n .catch((e) => {\n if (\n isRequestAffectingConfluenceState(request) &&\n this.confluenceState === 'creation in progress'\n ) {\n this.confluenceState = 'not created';\n }\n\n if (request.type === 'RoapMessage') {\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.locus.media.response',\n options: {\n meetingId: this.config.meetingId,\n rawError: e,\n },\n });\n }\n\n throw e;\n });\n\n if (request.type === 'RoapMessage') {\n const setupProgressListener = (direction: string, eventEmitter: EventEmitter) => {\n eventEmitter.on('progress', (progressEvent: ProgressEvent) => {\n LoggerProxy.logger.info(\n `${request.type}: ${direction} Progress, Timestamp: ${progressEvent.timeStamp}, Progress: ${progressEvent.loaded}/${progressEvent.total}`\n );\n });\n };\n\n setupProgressListener('Upload', options.upload);\n setupProgressListener('Download', options.download);\n }\n\n return promise;\n }\n\n /**\n * Sends a media request to Locus\n */\n public send(request: Request): Promise<RequestResult> {\n if (request.type === 'LocalMute') {\n const {audioMuted, videoMuted} = request.muteOptions;\n\n if (audioMuted !== undefined) {\n this.latestAudioMuted = audioMuted;\n }\n if (videoMuted !== undefined) {\n this.latestVideoMuted = videoMuted;\n }\n\n if (this.confluenceState === 'not created') {\n // if there is no confluence, there is no point sending out local mute request\n // as it will fail so we just store the latest audio/video muted values\n // and resolve immediately, so that higher layer (MuteState class) doesn't get blocked\n // and can call us again if user mutes/unmutes again before confluence is created\n LoggerProxy.logger.info(\n 'Meeting:LocusMediaRequest#send --> called with LocalMute request before confluence creation'\n );\n\n return Promise.resolve({});\n }\n }\n\n const pendingPromise = new Defer();\n\n const newRequest = new InternalRequestInfo(\n request,\n pendingPromise,\n this.sendHttpRequest.bind(this)\n );\n\n this.addToQueue(newRequest);\n\n defer(() => this.executeNextQueuedRequest());\n\n return pendingPromise.promise;\n }\n\n /** Returns true if a confluence on the server is already created */\n public isConfluenceCreated() {\n return this.confluenceState === 'created';\n }\n\n /**\n * This method needs to be called when we downgrade from multistream to transcoded connection.\n */\n public downgradeFromMultistreamToTranscoded() {\n this.config.preferTranscoding = true;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAC,sBAAA,CAAAN,OAAA;AAAsD,SAAAO,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,CAAAC,OAAA,EAAAN,OAAA,GAAAO,MAAA,MAAAN,yBAAA,QAAAO,SAAA,OAAAH,gBAAA,CAAAC,OAAA,QAAAG,WAAA,EAAAF,MAAA,GAAAG,kBAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAH,SAAA,YAAAD,MAAA,GAAAH,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,CAAAP,OAAA,QAAAC,MAAA;AAAA,SAAAL,0BAAA,eAAAY,OAAA,qBAAAJ,kBAAA,oBAAAA,kBAAA,CAAAK,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,kBAAA,CAAAO,OAAA,8CAAAI,CAAA,sBANtD;AAmCA;AAAA,IACMC,mBAAmB;EAKvB;EACA,SAAAA,oBACEC,OAAgB,EAChBC,cAAqB,EACrBC,aAA2D,EAC3D;IAAA,IAAAC,gBAAA,CAAApB,OAAA,QAAAgB,mBAAA;IAAA,IAAAK,gBAAA,CAAArB,OAAA;IAAA,IAAAqB,gBAAA,CAAArB,OAAA;IAAA,IAAAqB,gBAAA,CAAArB,OAAA;IACA,IA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cAAc,CAACwF,OAAO;IAC/B;;IAEA;EAAA;IAAAlF,GAAA;IAAAC,KAAA,EACA,SAAAoG,oBAAA,EAA6B;MAC3B,OAAO,IAAI,CAACpE,eAAe,KAAK,SAAS;IAC3C;;IAEA;AACF;AACA;EAFE;IAAAjC,GAAA;IAAAC,KAAA,EAGA,SAAAqG,qCAAA,EAA8C;MAC5C,IAAI,CAAC3E,MAAM,CAAC4E,iBAAiB,GAAG,IAAI;IACtC;EAAC;EAAA,OAAAjF,iBAAA;AAAA,EAzQoCkF,sBAAW"}
@@ -71,6 +71,8 @@ export type CallStateForMetrics = {
71
71
  sessionCorrelationId?: string;
72
72
  joinTrigger?: string;
73
73
  loginType?: string;
74
+ userNameInput?: string;
75
+ emailInput?: string;
74
76
  };
75
77
  export declare const MEDIA_UPDATE_TYPE: {
76
78
  TRANSCODED_MEDIA_CONNECTION: string;
@@ -495,6 +497,26 @@ export default class Meeting extends StatelessWebexPlugin {
495
497
  * @param {string} correlationId
496
498
  */
497
499
  set correlationId(correlationId: string);
500
+ /**
501
+ * Getter - Returns callStateForMetrics.userNameInput
502
+ * @returns {string}
503
+ */
504
+ get userNameInput(): string;
505
+ /**
506
+ * Setter - sets callStateForMetrics.userNameInput
507
+ * @param {string} userNameInput
508
+ */
509
+ set userNameInput(userNameInput: string);
510
+ /**
511
+ * Getter - Returns callStateForMetrics.emailInput
512
+ * @returns {string}
513
+ */
514
+ get emailInput(): string;
515
+ /**
516
+ * Setter - sets callStateForMetrics.emailInput
517
+ * @param {string} emailInput
518
+ */
519
+ set emailInput(emailInput: string);
498
520
  /**
499
521
  * Getter - Returns callStateForMetrics.sessionCorrelationId
500
522
  * @returns {string}
@@ -458,7 +458,7 @@ var Webinar = _webexCore.WebexPlugin.extend({
458
458
  }, _callee7);
459
459
  }))();
460
460
  },
461
- version: "3.8.0-next.5"
461
+ version: "3.8.0-next.7"
462
462
  });
463
463
  var _default = exports.default = Webinar;
464
464
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -43,13 +43,13 @@
43
43
  "@webex/eslint-config-legacy": "0.0.0",
44
44
  "@webex/jest-config-legacy": "0.0.0",
45
45
  "@webex/legacy-tools": "0.0.0",
46
- "@webex/plugin-meetings": "3.8.0-next.5",
47
- "@webex/plugin-rooms": "3.8.0-next.1",
48
- "@webex/test-helper-chai": "3.8.0-next.1",
49
- "@webex/test-helper-mocha": "3.8.0-next.1",
50
- "@webex/test-helper-mock-webex": "3.8.0-next.1",
51
- "@webex/test-helper-retry": "3.8.0-next.1",
52
- "@webex/test-helper-test-users": "3.8.0-next.1",
46
+ "@webex/plugin-meetings": "3.8.0-next.7",
47
+ "@webex/plugin-rooms": "3.8.0-next.2",
48
+ "@webex/test-helper-chai": "3.8.0-next.2",
49
+ "@webex/test-helper-mocha": "3.8.0-next.2",
50
+ "@webex/test-helper-mock-webex": "3.8.0-next.2",
51
+ "@webex/test-helper-retry": "3.8.0-next.2",
52
+ "@webex/test-helper-test-users": "3.8.0-next.2",
53
53
  "chai": "^4.3.4",
54
54
  "chai-as-promised": "^7.1.1",
55
55
  "eslint": "^8.24.0",
@@ -61,22 +61,22 @@
61
61
  "typescript": "^4.7.4"
62
62
  },
63
63
  "dependencies": {
64
- "@webex/common": "3.8.0-next.1",
64
+ "@webex/common": "3.8.0-next.2",
65
65
  "@webex/event-dictionary-ts": "^1.0.1688",
66
66
  "@webex/internal-media-core": "2.14.4",
67
- "@webex/internal-plugin-conversation": "3.8.0-next.1",
68
- "@webex/internal-plugin-device": "3.8.0-next.1",
69
- "@webex/internal-plugin-llm": "3.8.0-next.2",
70
- "@webex/internal-plugin-mercury": "3.8.0-next.1",
71
- "@webex/internal-plugin-metrics": "3.8.0-next.1",
72
- "@webex/internal-plugin-support": "3.8.0-next.1",
73
- "@webex/internal-plugin-user": "3.8.0-next.1",
74
- "@webex/internal-plugin-voicea": "3.8.0-next.5",
75
- "@webex/media-helpers": "3.8.0-next.1",
76
- "@webex/plugin-people": "3.8.0-next.1",
77
- "@webex/plugin-rooms": "3.8.0-next.1",
67
+ "@webex/internal-plugin-conversation": "3.8.0-next.2",
68
+ "@webex/internal-plugin-device": "3.8.0-next.2",
69
+ "@webex/internal-plugin-llm": "3.8.0-next.3",
70
+ "@webex/internal-plugin-mercury": "3.8.0-next.2",
71
+ "@webex/internal-plugin-metrics": "3.8.0-next.2",
72
+ "@webex/internal-plugin-support": "3.8.0-next.2",
73
+ "@webex/internal-plugin-user": "3.8.0-next.2",
74
+ "@webex/internal-plugin-voicea": "3.8.0-next.7",
75
+ "@webex/media-helpers": "3.8.0-next.2",
76
+ "@webex/plugin-people": "3.8.0-next.2",
77
+ "@webex/plugin-rooms": "3.8.0-next.2",
78
78
  "@webex/web-capabilities": "^1.4.0",
79
- "@webex/webex-core": "3.8.0-next.1",
79
+ "@webex/webex-core": "3.8.0-next.2",
80
80
  "ampersand-collection": "^2.0.2",
81
81
  "bowser": "^2.11.0",
82
82
  "btoa": "^1.2.1",
@@ -92,5 +92,5 @@
92
92
  "//": [
93
93
  "TODO: upgrade jwt-decode when moving to node 18"
94
94
  ],
95
- "version": "3.8.0-next.5"
95
+ "version": "3.8.0-next.7"
96
96
  }
@@ -241,6 +241,8 @@ export type CallStateForMetrics = {
241
241
  sessionCorrelationId?: string;
242
242
  joinTrigger?: string;
243
243
  loginType?: string;
244
+ userNameInput?: string;
245
+ emailInput?: string;
244
246
  };
245
247
 
246
248
  export const MEDIA_UPDATE_TYPE = {
@@ -1627,6 +1629,38 @@ export default class Meeting extends StatelessWebexPlugin {
1627
1629
  this.callStateForMetrics.correlationId = correlationId;
1628
1630
  }
1629
1631
 
1632
+ /**
1633
+ * Getter - Returns callStateForMetrics.userNameInput
1634
+ * @returns {string}
1635
+ */
1636
+ get userNameInput() {
1637
+ return this.callStateForMetrics?.userNameInput;
1638
+ }
1639
+
1640
+ /**
1641
+ * Setter - sets callStateForMetrics.userNameInput
1642
+ * @param {string} userNameInput
1643
+ */
1644
+ set userNameInput(userNameInput: string) {
1645
+ this.callStateForMetrics.userNameInput = userNameInput;
1646
+ }
1647
+
1648
+ /**
1649
+ * Getter - Returns callStateForMetrics.emailInput
1650
+ * @returns {string}
1651
+ */
1652
+ get emailInput() {
1653
+ return this.callStateForMetrics?.emailInput;
1654
+ }
1655
+
1656
+ /**
1657
+ * Setter - sets callStateForMetrics.emailInput
1658
+ * @param {string} emailInput
1659
+ */
1660
+ set emailInput(emailInput: string) {
1661
+ this.callStateForMetrics.emailInput = emailInput;
1662
+ }
1663
+
1630
1664
  /**
1631
1665
  * Getter - Returns callStateForMetrics.sessionCorrelationId
1632
1666
  * @returns {string}
@@ -1,6 +1,7 @@
1
1
  /* eslint-disable valid-jsdoc */
2
2
  import {defer} from 'lodash';
3
- import {Defer} from '@webex/common';
3
+ import {Defer, transferEvents} from '@webex/common';
4
+ import {EventEmitter} from 'events';
4
5
  import {WebexPlugin} from '@webex/webex-core';
5
6
  import {MEDIA, HTTP_VERBS, ROAP} from '../constants';
6
7
  import LoggerProxy from '../common/logs/logger-proxy';
@@ -250,12 +251,19 @@ export class LocusMediaRequest extends WebexPlugin {
250
251
  this.confluenceState = 'creation in progress';
251
252
  }
252
253
 
253
- // @ts-ignore
254
- return this.request({
254
+ const upload = new EventEmitter();
255
+ const download = new EventEmitter();
256
+
257
+ const options = {
255
258
  method: HTTP_VERBS.PUT,
256
259
  uri,
257
260
  body,
258
- })
261
+ upload,
262
+ download,
263
+ };
264
+
265
+ // @ts-ignore
266
+ const promise = this.request(options)
259
267
  .then((result) => {
260
268
  if (isRequestAffectingConfluenceState(request)) {
261
269
  this.confluenceState = 'created';
@@ -294,6 +302,21 @@ export class LocusMediaRequest extends WebexPlugin {
294
302
 
295
303
  throw e;
296
304
  });
305
+
306
+ if (request.type === 'RoapMessage') {
307
+ const setupProgressListener = (direction: string, eventEmitter: EventEmitter) => {
308
+ eventEmitter.on('progress', (progressEvent: ProgressEvent) => {
309
+ LoggerProxy.logger.info(
310
+ `${request.type}: ${direction} Progress, Timestamp: ${progressEvent.timeStamp}, Progress: ${progressEvent.loaded}/${progressEvent.total}`
311
+ );
312
+ });
313
+ };
314
+
315
+ setupProgressListener('Upload', options.upload);
316
+ setupProgressListener('Download', options.download);
317
+ }
318
+
319
+ return promise;
297
320
  }
298
321
 
299
322
  /**