@webex/plugin-meetings 3.0.0-beta.115 → 3.0.0-beta.117
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/breakouts/breakout.js +23 -6
- package/dist/breakouts/breakout.js.map +1 -1
- package/dist/breakouts/index.js +178 -139
- package/dist/breakouts/index.js.map +1 -1
- package/dist/constants.js +1 -0
- package/dist/constants.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js +15 -1
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/meeting/index.js +73 -103
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +3 -0
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +1 -1
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +27 -20
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/util.js +463 -426
- package/dist/meeting/util.js.map +1 -1
- package/dist/members/index.js +4 -1
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +75 -45
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js +308 -317
- package/dist/members/util.js.map +1 -1
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/meeting/index.d.ts +20 -21
- package/dist/types/meeting/locusMediaRequest.d.ts +2 -0
- package/dist/types/meeting/request.d.ts +16 -8
- package/dist/types/meeting/util.d.ts +75 -1
- package/dist/types/members/request.d.ts +56 -11
- package/dist/types/members/util.d.ts +209 -1
- package/package.json +19 -19
- package/src/breakouts/breakout.ts +26 -4
- package/src/breakouts/index.ts +32 -17
- package/src/constants.ts +1 -0
- package/src/locus-info/mediaSharesUtils.ts +16 -0
- package/src/meeting/index.ts +20 -42
- package/src/meeting/locusMediaRequest.ts +6 -0
- package/src/meeting/muteState.ts +1 -1
- package/src/meeting/request.ts +26 -17
- package/src/meeting/util.ts +446 -410
- package/src/members/index.ts +7 -1
- package/src/members/request.ts +61 -21
- package/src/members/util.ts +316 -326
- package/test/unit/spec/breakouts/breakout.ts +26 -7
- package/test/unit/spec/breakouts/index.ts +48 -3
- package/test/unit/spec/meeting/index.js +53 -33
- package/test/unit/spec/meeting/locusMediaRequest.ts +25 -3
- package/test/unit/spec/meeting/muteState.js +5 -2
- package/test/unit/spec/meeting/request.js +215 -42
- package/test/unit/spec/meeting/utils.js +151 -7
- package/test/unit/spec/members/index.js +22 -1
- package/test/unit/spec/members/request.js +167 -35
|
@@ -219,6 +219,9 @@ var LocusMediaRequest = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
219
219
|
body.clientMediaPreferences.joinCookie = request.joinCookie;
|
|
220
220
|
break;
|
|
221
221
|
}
|
|
222
|
+
if (request.sequence) {
|
|
223
|
+
body.sequence = request.sequence;
|
|
224
|
+
}
|
|
222
225
|
body.localMedias = [{
|
|
223
226
|
localSdp: (0, _stringify.default)(localMedias),
|
|
224
227
|
// this part must be JSON stringified, Locus requires this
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["InternalRequestInfo","request","pendingPromise","sendRequestFn","pendingPromises","push","then","result","forEach","d","resolve","catch","e","reject","isRequestAffectingConfluenceState","type","roapMessage","messageType","ROAP","ROAP_TYPES","OFFER","LocusMediaRequest","config","options","isRequestInProgress","queuedRequests","confluenceState","info","length","addPendingPromises","getPendingPromises","filter","r","nextRequest","shift","execute","executeNextQueuedRequest","audioMuted","latestAudioMuted","undefined","videoMuted","latestVideoMuted","uri","selfUrl","MEDIA","getLatestMuteState","body","device","correlationId","clientMediaPreferences","preferTranscoding","localMedias","respOnlySdp","usingResource","reachability","joinCookie","localSdp","mediaId","LoggerProxy","logger","method","HTTP_VERBS","PUT","muteOptions","Defer","newRequest","sendHttpRequest","bind","addToQueue","promise","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';\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 joinCookie: any; // any, because this is opaque to the client, we pass whatever object we got from one backend component (Orpheus) to the other (Locus)\n};\n\nexport type LocalMuteRequest = {\n type: 'LocalMute';\n selfUrl: string;\n mediaId: string;\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 };\n correlationId: 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 clientMediaPreferences: {\n preferTranscoding: this.config.preferTranscoding,\n },\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.joinCookie = request.joinCookie;\n break;\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 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 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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AAAsD;AAAA;AA0BtD;AAAA,IACMA,mBAAmB;EAKvB;EACA,6BACEC,OAAgB,EAChBC,cAAqB,EACrBC,aAA2D,EAC3D;IAAA;IAAA;IAAA;IAAA;IACA,IAAI,CAACF,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACG,eAAe,GAAG,CAACF,cAAc,CAAC;IACvC,IAAI,CAACC,aAAa,GAAGA,aAAa;EACpC;;EAEA;AACF;AACA;EAFE;IAAA;IAAA,OAGA,8BAA4B;MAC1B,OAAO,IAAI,CAACC,eAAe;IAC7B;;IAEA;AACF;AACA;EAFE;IAAA;IAAA,OAGA,4BAA0BA,eAAwB,EAAE;MAAA;MAClD,6BAAI,CAACA,eAAe,EAACC,IAAI,+DAAID,eAAe,EAAC;IAC/C;;IAEA;AACF;AACA;AACA;EAHE;IAAA;IAAA,OAIA,mBAAgC;MAAA;MAC9B,OAAO,IAAI,CAACD,aAAa,CAAC,IAAI,CAACF,OAAO,CAAC,CACpCK,IAAI,CAAC,UAACC,MAAM,EAAK;QAChB;QACA,KAAI,CAACH,eAAe,CAACI,OAAO,CAAC,UAACC,CAAC;UAAA,OAAKA,CAAC,CAACC,OAAO,CAACH,MAAM,CAAC;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;EAAC;EAAA;AAAA,EAxMoCC,sBAAW;AAAA"}
|
|
1
|
+
{"version":3,"names":["InternalRequestInfo","request","pendingPromise","sendRequestFn","pendingPromises","push","then","result","forEach","d","resolve","catch","e","reject","isRequestAffectingConfluenceState","type","roapMessage","messageType","ROAP","ROAP_TYPES","OFFER","LocusMediaRequest","config","options","isRequestInProgress","queuedRequests","confluenceState","info","length","addPendingPromises","getPendingPromises","filter","r","nextRequest","shift","execute","executeNextQueuedRequest","audioMuted","latestAudioMuted","undefined","videoMuted","latestVideoMuted","uri","selfUrl","MEDIA","getLatestMuteState","body","device","correlationId","clientMediaPreferences","preferTranscoding","localMedias","respOnlySdp","usingResource","reachability","joinCookie","sequence","localSdp","mediaId","LoggerProxy","logger","method","HTTP_VERBS","PUT","muteOptions","Defer","newRequest","sendHttpRequest","bind","addToQueue","promise","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';\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 sequence?: any;\n joinCookie: any; // any, because this is opaque to the client, we pass whatever object we got from one backend component (Orpheus) to the other (Locus)\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 };\n correlationId: 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 clientMediaPreferences: {\n preferTranscoding: this.config.preferTranscoding,\n },\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.joinCookie = request.joinCookie;\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 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 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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AAAsD;AAAA;AA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;MACpD,IAAIA,OAAO,CAACc,IAAI,KAAK,WAAW,EAAE;QAChC,2BAAiCd,OAAO,CAAC+D,WAAW;UAA7C3B,UAAU,wBAAVA,UAAU;UAAEG,UAAU,wBAAVA,UAAU;QAE7B,IAAIH,UAAU,KAAKE,SAAS,EAAE;UAC5B,IAAI,CAACD,gBAAgB,GAAGD,UAAU;QACpC;QACA,IAAIG,UAAU,KAAKD,SAAS,EAAE;UAC5B,IAAI,CAACE,gBAAgB,GAAGD,UAAU;QACpC;QAEA,IAAI,IAAI,CAACd,eAAe,KAAK,aAAa,EAAE;UAC1C;UACA;UACA;UACA;UACAiC,oBAAW,CAACC,MAAM,CAACjC,IAAI,CACrB,6FAA6F,CAC9F;UAED,OAAO,iBAAQjB,OAAO,CAAC,CAAC,CAAC,CAAC;QAC5B;MACF;MAEA,IAAMR,cAAc,GAAG,IAAI+D,aAAK,EAAE;MAElC,IAAMC,UAAU,GAAG,IAAIlE,mBAAmB,CACxCC,OAAO,EACPC,cAAc,EACd,IAAI,CAACiE,eAAe,CAACC,IAAI,CAAC,IAAI,CAAC,CAChC;MAED,IAAI,CAACC,UAAU,CAACH,UAAU,CAAC;MAE3B,qBAAM;QAAA,OAAM,MAAI,CAAC9B,wBAAwB,EAAE;MAAA,EAAC;MAE5C,OAAOlC,cAAc,CAACoE,OAAO;IAC/B;EAAC;EAAA;AAAA,EA5MoCC,sBAAW;AAAA"}
|
|
@@ -320,7 +320,7 @@ var MuteState = /*#__PURE__*/function () {
|
|
|
320
320
|
_loggerProxy.default.logger.info("Meeting:muteState#sendLocalMuteRequestToServer --> ".concat(_this4.type, ": local mute (audio=").concat(audioMuted, ", video=").concat(videoMuted, ") applied to server"));
|
|
321
321
|
_this4.state.server.localMute = _this4.type === _constants.AUDIO ? audioMuted : videoMuted;
|
|
322
322
|
if (locus) {
|
|
323
|
-
meeting.locusInfo.
|
|
323
|
+
meeting.locusInfo.onDeltaLocus(locus);
|
|
324
324
|
}
|
|
325
325
|
return locus;
|
|
326
326
|
}).catch(function (remoteUpdateError) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createMuteState","type","meeting","mediaDirection","sdkOwnsLocalTrack","AUDIO","sendAudio","VIDEO","sendVideo","LoggerProxy","logger","info","id","muteState","MuteState","init","ParameterError","ignoreMuteStateChange","state","client","localMute","server","remoteMute","remoteMuted","remoteVideoMuted","unmuteAllowed","unmuteVideoAllowed","syncToServerInProgress","pendingPromiseResolve","pendingPromiseReject","applyUnmuteAllowedToTrack","muteLocalTrack","initialMute","mediaProperties","audioTrack","muted","videoTrack","undefined","applyClientStateToServer","sendLocalMuteRequestToServer","then","catch","mute","reason","setServerMuted","reject","PermissionError","applyClientStateLocally","resolve","error","setMuted","localMuteRequiresSync","remoteMuteRequiresSync","localMuteSyncPromise","sendRemoteMuteRequestToServer","e","applyServerMuteToLocalTrack","audioMuted","videoMuted","MeetingUtil","remoteUpdateAudioVideo","locus","locusInfo","onFullLocus","remoteUpdateError","warn","members","muteMember","selfId","serverMuteReason","setUnmuteAllowed","Error","isMuted","isSelf"],"sources":["muteState.ts"],"sourcesContent":["import {ServerMuteReason} from '@webex/media-helpers';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport ParameterError from '../common/errors/parameter';\nimport PermissionError from '../common/errors/permission';\nimport MeetingUtil from './util';\nimport {AUDIO, VIDEO} from '../constants';\n/* Certain aspects of server interaction for video muting are not implemented as we currently don't support remote muting of video.\n If we ever need to support it, search for REMOTE_MUTE_VIDEO_MISSING_IMPLEMENTATION string to find the places that need updating\n*/\n\n// eslint-disable-next-line import/prefer-default-export\nexport const createMuteState = (type, meeting, mediaDirection, sdkOwnsLocalTrack: boolean) => {\n // todo: remove mediaDirection argument (SPARK-399695)\n // todo: remove the meeting argument (SPARK-399695)\n if (type === AUDIO && !mediaDirection.sendAudio) {\n return null;\n }\n if (type === VIDEO && !mediaDirection.sendVideo) {\n return null;\n }\n\n LoggerProxy.logger.info(\n `Meeting:muteState#createMuteState --> ${type}: creating MuteState for meeting id ${meeting?.id}`\n );\n\n const muteState = new MuteState(type, meeting, sdkOwnsLocalTrack);\n\n muteState.init(meeting);\n\n return muteState;\n};\n\n/** The purpose of this class is to manage the local and remote mute state and make sure that the server state always matches\n the last requested state by the client.\n\n More info about Locus muting API: https://sqbu-github.cisco.com/pages/WebExSquared/locus/guides/mute.html#\n\n This class is exported only for unit tests. It should never be instantiated directly with new MuteState(), instead createMuteState() should be called\n*/\nexport class MuteState {\n pendingPromiseReject: any;\n pendingPromiseResolve: any;\n state: any;\n type: any;\n sdkOwnsLocalTrack: boolean; // todo: remove this when doing SPARK-399695\n ignoreMuteStateChange: boolean;\n\n /**\n * Constructor\n *\n * @param {String} type - audio or video\n * @param {Object} meeting - the meeting object (used for reading current remote mute status)\n * @param {boolean} sdkOwnsLocalTrack - if false, then client app owns the local track (for now that's the case only for multistream meetings)\n */\n constructor(type: string, meeting: any, sdkOwnsLocalTrack: boolean) {\n if (type !== AUDIO && type !== VIDEO) {\n throw new ParameterError('Mute state is designed for handling audio or video only');\n }\n this.type = type;\n this.sdkOwnsLocalTrack = sdkOwnsLocalTrack;\n this.ignoreMuteStateChange = false;\n this.state = {\n client: {\n localMute: false,\n },\n server: {\n localMute: true,\n // because remoteVideoMuted and unmuteVideoAllowed are updated seperately, they might be undefined\n remoteMute: type === AUDIO ? meeting.remoteMuted : meeting.remoteVideoMuted ?? false,\n unmuteAllowed: type === AUDIO ? meeting.unmuteAllowed : meeting.unmuteVideoAllowed ?? true,\n },\n syncToServerInProgress: false,\n };\n // these 2 hold the resolve, reject methods for the promise we returned to the client in last handleClientRequest() call\n this.pendingPromiseResolve = null;\n this.pendingPromiseReject = null;\n }\n\n /**\n * Starts the mute state machine. Needs to be called after a new MuteState instance is created.\n *\n * @param {Object} meeting - the meeting object\n * @returns {void}\n */\n public init(meeting: any) {\n if (!this.sdkOwnsLocalTrack) {\n this.applyUnmuteAllowedToTrack(meeting);\n\n // if we are remotely muted, we need to apply that to the local track now (mute on-entry)\n if (this.state.server.remoteMute) {\n this.muteLocalTrack(meeting, this.state.server.remoteMute, 'remotelyMuted');\n }\n\n const initialMute =\n this.type === AUDIO\n ? meeting.mediaProperties.audioTrack?.muted\n : meeting.mediaProperties.videoTrack?.muted;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#init --> ${this.type}: local track initial mute state: ${initialMute}`\n );\n\n if (initialMute !== undefined) {\n this.state.client.localMute = initialMute;\n\n this.applyClientStateToServer(meeting);\n }\n } else {\n // in the mode where sdkOwnsLocalTrack is false (transcoded meetings),\n // SDK API currently doesn't allow to start with audio/video muted,\n // so we need to apply the initial local mute state (false) to server\n this.state.syncToServerInProgress = true;\n this.sendLocalMuteRequestToServer(meeting)\n .then(() => {\n this.state.syncToServerInProgress = false;\n })\n .catch(() => {\n this.state.syncToServerInProgress = false;\n // not much we can do here...\n });\n }\n }\n\n /**\n * This method needs to be called whenever the local audio/video track has changed.\n * It reapplies the remote mute state onto the new track and also reads the current\n * local mute state from the track and updates the internal state machine and sends\n * any required requests to the server.\n *\n * @param {Object} meeting - the meeting object\n * @returns {void}\n */\n public handleLocalTrackChange(meeting: any) {\n return this.init(meeting);\n }\n\n /**\n * Mutes/unmutes local track\n *\n * @param {Object} meeting - the meeting object\n * @param {Boolean} mute - true to mute the track, false to unmute it\n * @param {ServerMuteReason} reason - reason for muting/unmuting\n * @returns {void}\n */\n private muteLocalTrack(meeting: any, mute: boolean, reason: ServerMuteReason) {\n this.ignoreMuteStateChange = true;\n if (this.type === AUDIO) {\n meeting.mediaProperties.audioTrack?.setServerMuted(mute, reason);\n } else {\n meeting.mediaProperties.videoTrack?.setServerMuted(mute, reason);\n }\n this.ignoreMuteStateChange = false;\n }\n\n /**\n * Handles mute/unmute request from the client/user. Returns a promise that's resolved once the server update is completed or\n * at the point that this request becomese superseded by another client request.\n *\n * The client doesn't have to wait for the returned promise to resolve before calling handleClientRequest() again. If\n * handleClientRequest() is called again before the previous one resolved, the MuteState class will make sure that eventually\n * the server state will match the last requested state from the client.\n *\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @param {Boolean} [mute] true for muting, false for unmuting request\n * @returns {Promise}\n */\n public handleClientRequest(meeting: object, mute?: boolean) {\n // todo: this whole method will be removed in SPARK-399695\n LoggerProxy.logger.info(\n `Meeting:muteState#handleClientRequest --> ${this.type}: user requesting new mute state: ${mute}`\n );\n\n if (!mute && !this.state.server.unmuteAllowed) {\n return Promise.reject(\n new PermissionError('User is not allowed to unmute self (hard mute feature is being used)')\n );\n }\n\n // we don't check if we're already in the same state, because even if we were, we would still have to apply the mute state locally,\n // because the client may have changed the audio/video tracks\n this.state.client.localMute = mute;\n\n this.applyClientStateLocally(meeting);\n\n return new Promise((resolve, reject) => {\n if (this.pendingPromiseResolve) {\n // resolve the last promise we returned to the client as the client has issued a new request that has superseded the previous one\n this.pendingPromiseResolve();\n }\n this.pendingPromiseResolve = resolve;\n this.pendingPromiseReject = reject;\n this.applyClientStateToServer(meeting);\n });\n }\n\n /**\n * This method should be called when the local track mute state is changed\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @param {Boolean} [mute] true for muting, false for unmuting request\n * @returns {void}\n */\n public handleLocalTrackMuteStateChange(meeting?: object, mute?: boolean) {\n if (this.ignoreMuteStateChange) {\n return;\n }\n LoggerProxy.logger.info(\n `Meeting:muteState#handleLocalTrackMuteStateChange --> ${this.type}: local track new mute state: ${mute}`\n );\n\n if (this.pendingPromiseReject) {\n LoggerProxy.logger.error(\n `Meeting:muteState#handleLocalTrackMuteStateChange --> ${this.type}: Local track mute state change handler called while a client request is handled - this should never happen!, mute state: ${mute}`\n );\n }\n\n this.state.client.localMute = mute;\n\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Applies the current mute state to the local track (by enabling or disabling it accordingly)\n *\n * @public\n * @param {Object} [meeting] the meeting object\n * @param {ServerMuteReason} reason - reason why we're applying our client state to the local track\n * @memberof MuteState\n * @returns {void}\n */\n public applyClientStateLocally(meeting?: any, reason?: ServerMuteReason) {\n if (this.sdkOwnsLocalTrack) {\n if (this.type === AUDIO) {\n meeting.mediaProperties.audioTrack?.setMuted(this.state.client.localMute);\n } else {\n meeting.mediaProperties.videoTrack?.setMuted(this.state.client.localMute);\n }\n } else {\n this.muteLocalTrack(meeting, this.state.client.localMute, reason);\n }\n }\n\n /**\n * Updates the server local and remote mute values so that they match the current client desired state.\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {void}\n */\n private applyClientStateToServer(meeting?: object) {\n if (this.state.syncToServerInProgress) {\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: request to server in progress, we need to wait for it to complete`\n );\n\n return;\n }\n\n const localMuteRequiresSync = this.state.client.localMute !== this.state.server.localMute;\n const remoteMuteRequiresSync = !this.state.client.localMute && this.state.server.remoteMute;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: localMuteRequiresSync: ${localMuteRequiresSync} (${this.state.client.localMute} ?= ${this.state.server.localMute})`\n );\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: remoteMuteRequiresSync: ${remoteMuteRequiresSync}`\n );\n\n if (!localMuteRequiresSync && !remoteMuteRequiresSync) {\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: client state already matching server state, nothing to do`\n );\n\n if (this.pendingPromiseResolve) {\n this.pendingPromiseResolve();\n }\n this.pendingPromiseResolve = null;\n this.pendingPromiseReject = null;\n\n return;\n }\n\n this.state.syncToServerInProgress = true;\n\n // first sync local mute with server\n const localMuteSyncPromise = localMuteRequiresSync\n ? this.sendLocalMuteRequestToServer(meeting)\n : Promise.resolve();\n\n localMuteSyncPromise\n .then(() =>\n // then follow it up with remote mute sync\n remoteMuteRequiresSync ? this.sendRemoteMuteRequestToServer(meeting) : Promise.resolve()\n )\n .then(() => {\n this.state.syncToServerInProgress = false;\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: sync with server completed`\n );\n\n // need to check if a new sync is required, because this.state.client may have changed while we were doing the current sync\n this.applyClientStateToServer(meeting);\n })\n .catch((e) => {\n this.state.syncToServerInProgress = false;\n\n if (this.pendingPromiseReject) {\n this.pendingPromiseReject(e);\n }\n this.pendingPromiseResolve = null;\n this.pendingPromiseReject = null;\n\n this.applyServerMuteToLocalTrack(meeting, 'clientRequestFailed');\n });\n }\n\n /**\n * Sets the local mute value in the server\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {Promise}\n */\n private sendLocalMuteRequestToServer(meeting?: any) {\n const audioMuted = this.type === AUDIO ? this.state.client.localMute : undefined;\n const videoMuted = this.type === VIDEO ? this.state.client.localMute : undefined;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: sending local mute (audio=${audioMuted}, video=${videoMuted}) to server`\n );\n\n return MeetingUtil.remoteUpdateAudioVideo(meeting, audioMuted, videoMuted)\n .then((locus) => {\n LoggerProxy.logger.info(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: local mute (audio=${audioMuted}, video=${videoMuted}) applied to server`\n );\n\n this.state.server.localMute = this.type === AUDIO ? audioMuted : videoMuted;\n\n if (locus) {\n meeting.locusInfo.onFullLocus(locus);\n }\n\n return locus;\n })\n .catch((remoteUpdateError) => {\n LoggerProxy.logger.warn(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: failed to apply local mute (audio=${audioMuted}, video=${videoMuted}) to server: ${remoteUpdateError}`\n );\n\n return Promise.reject(remoteUpdateError);\n });\n }\n\n /**\n * Sets the remote mute value in the server\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {Promise}\n */\n private sendRemoteMuteRequestToServer(meeting?: any) {\n const remoteMute = this.state.client.localMute;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: sending remote mute:${remoteMute} to server`\n );\n\n return meeting.members\n .muteMember(meeting.members.selfId, remoteMute, this.type === AUDIO)\n .then(() => {\n LoggerProxy.logger.info(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: remote mute:${remoteMute} applied to server`\n );\n\n this.state.server.remoteMute = remoteMute;\n })\n .catch((remoteUpdateError) => {\n LoggerProxy.logger.warn(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: failed to apply remote mute ${remoteMute} to server: ${remoteUpdateError}`\n );\n\n return Promise.reject(remoteUpdateError);\n });\n }\n\n /** Sets the mute state of the local track according to what server thinks is our state\n * @param {Object} meeting - the meeting object\n * @param {ServerMuteReason} serverMuteReason - reason why we're applying server mute to the local track\n * @returns {void}\n */\n private applyServerMuteToLocalTrack(meeting: any, serverMuteReason: ServerMuteReason) {\n if (!this.sdkOwnsLocalTrack) {\n const muted = this.state.server.localMute || this.state.server.remoteMute;\n\n // update the local track mute state, but not this.state.client.localMute\n this.muteLocalTrack(meeting, muted, serverMuteReason);\n }\n }\n\n /** Applies the current value for unmute allowed to the underlying track\n *\n * @param {Meeting} meeting\n * @returns {void}\n */\n private applyUnmuteAllowedToTrack(meeting: any) {\n if (!this.sdkOwnsLocalTrack) {\n if (this.type === AUDIO) {\n meeting.mediaProperties.audioTrack?.setUnmuteAllowed(this.state.server.unmuteAllowed);\n } else {\n meeting.mediaProperties.videoTrack?.setUnmuteAllowed(this.state.server.unmuteAllowed);\n }\n }\n }\n\n /**\n * This method should be called whenever the server remote mute state is changed\n *\n * @public\n * @memberof MuteState\n * @param {Meeting} meeting\n * @param {Boolean} [muted] true if user is remotely muted, false otherwise\n * @param {Boolean} [unmuteAllowed] indicates if user is allowed to unmute self (false when \"hard mute\" feature is used)\n * @returns {undefined}\n */\n public handleServerRemoteMuteUpdate(meeting: any, muted?: boolean, unmuteAllowed?: boolean) {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleServerRemoteMuteUpdate --> ${this.type}: updating server remoteMute to (${muted})`\n );\n if (unmuteAllowed !== undefined) {\n this.state.server.unmuteAllowed = unmuteAllowed;\n this.applyUnmuteAllowedToTrack(meeting);\n }\n if (muted !== undefined) {\n this.state.server.remoteMute = muted;\n this.applyServerMuteToLocalTrack(meeting, 'remotelyMuted');\n }\n }\n\n /**\n * This method should be called whenever we receive from the server a requirement to locally unmute\n *\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @returns {undefined}\n */\n public handleServerLocalUnmuteRequired(meeting?: object) {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleServerLocalUnmuteRequired --> ${this.type}: localAudioUnmuteRequired received -> doing local unmute`\n );\n\n // todo: I'm seeing \"you can now unmute yourself \" popup when this happens - but same thing happens on web.w.c so we can ignore for now\n this.state.server.remoteMute = false;\n this.state.client.localMute = false;\n\n if (this.pendingPromiseReject) {\n this.pendingPromiseReject(\n new Error('Server requested local unmute - this overrides any client request in progress')\n );\n this.pendingPromiseResolve = null;\n this.pendingPromiseReject = null;\n }\n\n this.applyClientStateLocally(meeting, 'localUnmuteRequired');\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Returns true if the user is locally or remotely muted\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isMuted() {\n return (\n this.state.client.localMute || this.state.server.localMute || this.state.server.remoteMute\n );\n }\n\n /**\n * Returns true if the user is remotely muted\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isRemotelyMuted() {\n return this.state.server.remoteMute;\n }\n\n /**\n * Returns true if unmute is allowed\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isUnmuteAllowed() {\n return this.state.server.unmuteAllowed;\n }\n\n /**\n * Returns true if the user is locally muted\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isLocallyMuted() {\n return this.state.client.localMute || this.state.server.localMute;\n }\n\n /**\n * Returns true if the user is muted as a result of the client request (and not remotely muted)\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isSelf() {\n return this.state.client.localMute && !this.state.server.remoteMute;\n }\n\n // defined for backwards compatibility with the old AudioStateMachine/VideoStateMachine classes\n get muted() {\n return this.isMuted();\n }\n\n // defined for backwards compatibility with the old AudioStateMachine/VideoStateMachine classes\n get self() {\n return this.isSelf();\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACO,IAAMA,eAAe,GAAG,SAAlBA,eAAe,CAAIC,IAAI,EAAEC,OAAO,EAAEC,cAAc,EAAEC,iBAA0B,EAAK;EAC5F;EACA;EACA,IAAIH,IAAI,KAAKI,gBAAK,IAAI,CAACF,cAAc,CAACG,SAAS,EAAE;IAC/C,OAAO,IAAI;EACb;EACA,IAAIL,IAAI,KAAKM,gBAAK,IAAI,CAACJ,cAAc,CAACK,SAAS,EAAE;IAC/C,OAAO,IAAI;EACb;EAEAC,oBAAW,CAACC,MAAM,CAACC,IAAI,iDACoBV,IAAI,iDAAuCC,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEU,EAAE,EAChG;EAED,IAAMC,SAAS,GAAG,IAAIC,SAAS,CAACb,IAAI,EAAEC,OAAO,EAAEE,iBAAiB,CAAC;EAEjES,SAAS,CAACE,IAAI,CAACb,OAAO,CAAC;EAEvB,OAAOW,SAAS;AAClB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANA;AAAA,IAOaC,SAAS;EAKQ;;EAG5B;AACF;AACA;AACA;AACA;AACA;AACA;EACE,mBAAYb,IAAY,EAAEC,OAAY,EAAEE,iBAA0B,EAAE;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAClE,IAAIH,IAAI,KAAKI,gBAAK,IAAIJ,IAAI,KAAKM,gBAAK,EAAE;MACpC,MAAM,IAAIS,kBAAc,CAAC,yDAAyD,CAAC;IACrF;IACA,IAAI,CAACf,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACG,iBAAiB,GAAGA,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A;AAAA;AAAA"}
|
|
1
|
+
{"version":3,"names":["createMuteState","type","meeting","mediaDirection","sdkOwnsLocalTrack","AUDIO","sendAudio","VIDEO","sendVideo","LoggerProxy","logger","info","id","muteState","MuteState","init","ParameterError","ignoreMuteStateChange","state","client","localMute","server","remoteMute","remoteMuted","remoteVideoMuted","unmuteAllowed","unmuteVideoAllowed","syncToServerInProgress","pendingPromiseResolve","pendingPromiseReject","applyUnmuteAllowedToTrack","muteLocalTrack","initialMute","mediaProperties","audioTrack","muted","videoTrack","undefined","applyClientStateToServer","sendLocalMuteRequestToServer","then","catch","mute","reason","setServerMuted","reject","PermissionError","applyClientStateLocally","resolve","error","setMuted","localMuteRequiresSync","remoteMuteRequiresSync","localMuteSyncPromise","sendRemoteMuteRequestToServer","e","applyServerMuteToLocalTrack","audioMuted","videoMuted","MeetingUtil","remoteUpdateAudioVideo","locus","locusInfo","onDeltaLocus","remoteUpdateError","warn","members","muteMember","selfId","serverMuteReason","setUnmuteAllowed","Error","isMuted","isSelf"],"sources":["muteState.ts"],"sourcesContent":["import {ServerMuteReason} from '@webex/media-helpers';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport ParameterError from '../common/errors/parameter';\nimport PermissionError from '../common/errors/permission';\nimport MeetingUtil from './util';\nimport {AUDIO, VIDEO} from '../constants';\n/* Certain aspects of server interaction for video muting are not implemented as we currently don't support remote muting of video.\n If we ever need to support it, search for REMOTE_MUTE_VIDEO_MISSING_IMPLEMENTATION string to find the places that need updating\n*/\n\n// eslint-disable-next-line import/prefer-default-export\nexport const createMuteState = (type, meeting, mediaDirection, sdkOwnsLocalTrack: boolean) => {\n // todo: remove mediaDirection argument (SPARK-399695)\n // todo: remove the meeting argument (SPARK-399695)\n if (type === AUDIO && !mediaDirection.sendAudio) {\n return null;\n }\n if (type === VIDEO && !mediaDirection.sendVideo) {\n return null;\n }\n\n LoggerProxy.logger.info(\n `Meeting:muteState#createMuteState --> ${type}: creating MuteState for meeting id ${meeting?.id}`\n );\n\n const muteState = new MuteState(type, meeting, sdkOwnsLocalTrack);\n\n muteState.init(meeting);\n\n return muteState;\n};\n\n/** The purpose of this class is to manage the local and remote mute state and make sure that the server state always matches\n the last requested state by the client.\n\n More info about Locus muting API: https://sqbu-github.cisco.com/pages/WebExSquared/locus/guides/mute.html#\n\n This class is exported only for unit tests. It should never be instantiated directly with new MuteState(), instead createMuteState() should be called\n*/\nexport class MuteState {\n pendingPromiseReject: any;\n pendingPromiseResolve: any;\n state: any;\n type: any;\n sdkOwnsLocalTrack: boolean; // todo: remove this when doing SPARK-399695\n ignoreMuteStateChange: boolean;\n\n /**\n * Constructor\n *\n * @param {String} type - audio or video\n * @param {Object} meeting - the meeting object (used for reading current remote mute status)\n * @param {boolean} sdkOwnsLocalTrack - if false, then client app owns the local track (for now that's the case only for multistream meetings)\n */\n constructor(type: string, meeting: any, sdkOwnsLocalTrack: boolean) {\n if (type !== AUDIO && type !== VIDEO) {\n throw new ParameterError('Mute state is designed for handling audio or video only');\n }\n this.type = type;\n this.sdkOwnsLocalTrack = sdkOwnsLocalTrack;\n this.ignoreMuteStateChange = false;\n this.state = {\n client: {\n localMute: false,\n },\n server: {\n localMute: true,\n // because remoteVideoMuted and unmuteVideoAllowed are updated seperately, they might be undefined\n remoteMute: type === AUDIO ? meeting.remoteMuted : meeting.remoteVideoMuted ?? false,\n unmuteAllowed: type === AUDIO ? meeting.unmuteAllowed : meeting.unmuteVideoAllowed ?? true,\n },\n syncToServerInProgress: false,\n };\n // these 2 hold the resolve, reject methods for the promise we returned to the client in last handleClientRequest() call\n this.pendingPromiseResolve = null;\n this.pendingPromiseReject = null;\n }\n\n /**\n * Starts the mute state machine. Needs to be called after a new MuteState instance is created.\n *\n * @param {Object} meeting - the meeting object\n * @returns {void}\n */\n public init(meeting: any) {\n if (!this.sdkOwnsLocalTrack) {\n this.applyUnmuteAllowedToTrack(meeting);\n\n // if we are remotely muted, we need to apply that to the local track now (mute on-entry)\n if (this.state.server.remoteMute) {\n this.muteLocalTrack(meeting, this.state.server.remoteMute, 'remotelyMuted');\n }\n\n const initialMute =\n this.type === AUDIO\n ? meeting.mediaProperties.audioTrack?.muted\n : meeting.mediaProperties.videoTrack?.muted;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#init --> ${this.type}: local track initial mute state: ${initialMute}`\n );\n\n if (initialMute !== undefined) {\n this.state.client.localMute = initialMute;\n\n this.applyClientStateToServer(meeting);\n }\n } else {\n // in the mode where sdkOwnsLocalTrack is false (transcoded meetings),\n // SDK API currently doesn't allow to start with audio/video muted,\n // so we need to apply the initial local mute state (false) to server\n this.state.syncToServerInProgress = true;\n this.sendLocalMuteRequestToServer(meeting)\n .then(() => {\n this.state.syncToServerInProgress = false;\n })\n .catch(() => {\n this.state.syncToServerInProgress = false;\n // not much we can do here...\n });\n }\n }\n\n /**\n * This method needs to be called whenever the local audio/video track has changed.\n * It reapplies the remote mute state onto the new track and also reads the current\n * local mute state from the track and updates the internal state machine and sends\n * any required requests to the server.\n *\n * @param {Object} meeting - the meeting object\n * @returns {void}\n */\n public handleLocalTrackChange(meeting: any) {\n return this.init(meeting);\n }\n\n /**\n * Mutes/unmutes local track\n *\n * @param {Object} meeting - the meeting object\n * @param {Boolean} mute - true to mute the track, false to unmute it\n * @param {ServerMuteReason} reason - reason for muting/unmuting\n * @returns {void}\n */\n private muteLocalTrack(meeting: any, mute: boolean, reason: ServerMuteReason) {\n this.ignoreMuteStateChange = true;\n if (this.type === AUDIO) {\n meeting.mediaProperties.audioTrack?.setServerMuted(mute, reason);\n } else {\n meeting.mediaProperties.videoTrack?.setServerMuted(mute, reason);\n }\n this.ignoreMuteStateChange = false;\n }\n\n /**\n * Handles mute/unmute request from the client/user. Returns a promise that's resolved once the server update is completed or\n * at the point that this request becomese superseded by another client request.\n *\n * The client doesn't have to wait for the returned promise to resolve before calling handleClientRequest() again. If\n * handleClientRequest() is called again before the previous one resolved, the MuteState class will make sure that eventually\n * the server state will match the last requested state from the client.\n *\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @param {Boolean} [mute] true for muting, false for unmuting request\n * @returns {Promise}\n */\n public handleClientRequest(meeting: object, mute?: boolean) {\n // todo: this whole method will be removed in SPARK-399695\n LoggerProxy.logger.info(\n `Meeting:muteState#handleClientRequest --> ${this.type}: user requesting new mute state: ${mute}`\n );\n\n if (!mute && !this.state.server.unmuteAllowed) {\n return Promise.reject(\n new PermissionError('User is not allowed to unmute self (hard mute feature is being used)')\n );\n }\n\n // we don't check if we're already in the same state, because even if we were, we would still have to apply the mute state locally,\n // because the client may have changed the audio/video tracks\n this.state.client.localMute = mute;\n\n this.applyClientStateLocally(meeting);\n\n return new Promise((resolve, reject) => {\n if (this.pendingPromiseResolve) {\n // resolve the last promise we returned to the client as the client has issued a new request that has superseded the previous one\n this.pendingPromiseResolve();\n }\n this.pendingPromiseResolve = resolve;\n this.pendingPromiseReject = reject;\n this.applyClientStateToServer(meeting);\n });\n }\n\n /**\n * This method should be called when the local track mute state is changed\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @param {Boolean} [mute] true for muting, false for unmuting request\n * @returns {void}\n */\n public handleLocalTrackMuteStateChange(meeting?: object, mute?: boolean) {\n if (this.ignoreMuteStateChange) {\n return;\n }\n LoggerProxy.logger.info(\n `Meeting:muteState#handleLocalTrackMuteStateChange --> ${this.type}: local track new mute state: ${mute}`\n );\n\n if (this.pendingPromiseReject) {\n LoggerProxy.logger.error(\n `Meeting:muteState#handleLocalTrackMuteStateChange --> ${this.type}: Local track mute state change handler called while a client request is handled - this should never happen!, mute state: ${mute}`\n );\n }\n\n this.state.client.localMute = mute;\n\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Applies the current mute state to the local track (by enabling or disabling it accordingly)\n *\n * @public\n * @param {Object} [meeting] the meeting object\n * @param {ServerMuteReason} reason - reason why we're applying our client state to the local track\n * @memberof MuteState\n * @returns {void}\n */\n public applyClientStateLocally(meeting?: any, reason?: ServerMuteReason) {\n if (this.sdkOwnsLocalTrack) {\n if (this.type === AUDIO) {\n meeting.mediaProperties.audioTrack?.setMuted(this.state.client.localMute);\n } else {\n meeting.mediaProperties.videoTrack?.setMuted(this.state.client.localMute);\n }\n } else {\n this.muteLocalTrack(meeting, this.state.client.localMute, reason);\n }\n }\n\n /**\n * Updates the server local and remote mute values so that they match the current client desired state.\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {void}\n */\n private applyClientStateToServer(meeting?: object) {\n if (this.state.syncToServerInProgress) {\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: request to server in progress, we need to wait for it to complete`\n );\n\n return;\n }\n\n const localMuteRequiresSync = this.state.client.localMute !== this.state.server.localMute;\n const remoteMuteRequiresSync = !this.state.client.localMute && this.state.server.remoteMute;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: localMuteRequiresSync: ${localMuteRequiresSync} (${this.state.client.localMute} ?= ${this.state.server.localMute})`\n );\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: remoteMuteRequiresSync: ${remoteMuteRequiresSync}`\n );\n\n if (!localMuteRequiresSync && !remoteMuteRequiresSync) {\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: client state already matching server state, nothing to do`\n );\n\n if (this.pendingPromiseResolve) {\n this.pendingPromiseResolve();\n }\n this.pendingPromiseResolve = null;\n this.pendingPromiseReject = null;\n\n return;\n }\n\n this.state.syncToServerInProgress = true;\n\n // first sync local mute with server\n const localMuteSyncPromise = localMuteRequiresSync\n ? this.sendLocalMuteRequestToServer(meeting)\n : Promise.resolve();\n\n localMuteSyncPromise\n .then(() =>\n // then follow it up with remote mute sync\n remoteMuteRequiresSync ? this.sendRemoteMuteRequestToServer(meeting) : Promise.resolve()\n )\n .then(() => {\n this.state.syncToServerInProgress = false;\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: sync with server completed`\n );\n\n // need to check if a new sync is required, because this.state.client may have changed while we were doing the current sync\n this.applyClientStateToServer(meeting);\n })\n .catch((e) => {\n this.state.syncToServerInProgress = false;\n\n if (this.pendingPromiseReject) {\n this.pendingPromiseReject(e);\n }\n this.pendingPromiseResolve = null;\n this.pendingPromiseReject = null;\n\n this.applyServerMuteToLocalTrack(meeting, 'clientRequestFailed');\n });\n }\n\n /**\n * Sets the local mute value in the server\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {Promise}\n */\n private sendLocalMuteRequestToServer(meeting?: any) {\n const audioMuted = this.type === AUDIO ? this.state.client.localMute : undefined;\n const videoMuted = this.type === VIDEO ? this.state.client.localMute : undefined;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: sending local mute (audio=${audioMuted}, video=${videoMuted}) to server`\n );\n\n return MeetingUtil.remoteUpdateAudioVideo(meeting, audioMuted, videoMuted)\n .then((locus) => {\n LoggerProxy.logger.info(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: local mute (audio=${audioMuted}, video=${videoMuted}) applied to server`\n );\n\n this.state.server.localMute = this.type === AUDIO ? audioMuted : videoMuted;\n\n if (locus) {\n meeting.locusInfo.onDeltaLocus(locus);\n }\n\n return locus;\n })\n .catch((remoteUpdateError) => {\n LoggerProxy.logger.warn(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: failed to apply local mute (audio=${audioMuted}, video=${videoMuted}) to server: ${remoteUpdateError}`\n );\n\n return Promise.reject(remoteUpdateError);\n });\n }\n\n /**\n * Sets the remote mute value in the server\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {Promise}\n */\n private sendRemoteMuteRequestToServer(meeting?: any) {\n const remoteMute = this.state.client.localMute;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: sending remote mute:${remoteMute} to server`\n );\n\n return meeting.members\n .muteMember(meeting.members.selfId, remoteMute, this.type === AUDIO)\n .then(() => {\n LoggerProxy.logger.info(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: remote mute:${remoteMute} applied to server`\n );\n\n this.state.server.remoteMute = remoteMute;\n })\n .catch((remoteUpdateError) => {\n LoggerProxy.logger.warn(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: failed to apply remote mute ${remoteMute} to server: ${remoteUpdateError}`\n );\n\n return Promise.reject(remoteUpdateError);\n });\n }\n\n /** Sets the mute state of the local track according to what server thinks is our state\n * @param {Object} meeting - the meeting object\n * @param {ServerMuteReason} serverMuteReason - reason why we're applying server mute to the local track\n * @returns {void}\n */\n private applyServerMuteToLocalTrack(meeting: any, serverMuteReason: ServerMuteReason) {\n if (!this.sdkOwnsLocalTrack) {\n const muted = this.state.server.localMute || this.state.server.remoteMute;\n\n // update the local track mute state, but not this.state.client.localMute\n this.muteLocalTrack(meeting, muted, serverMuteReason);\n }\n }\n\n /** Applies the current value for unmute allowed to the underlying track\n *\n * @param {Meeting} meeting\n * @returns {void}\n */\n private applyUnmuteAllowedToTrack(meeting: any) {\n if (!this.sdkOwnsLocalTrack) {\n if (this.type === AUDIO) {\n meeting.mediaProperties.audioTrack?.setUnmuteAllowed(this.state.server.unmuteAllowed);\n } else {\n meeting.mediaProperties.videoTrack?.setUnmuteAllowed(this.state.server.unmuteAllowed);\n }\n }\n }\n\n /**\n * This method should be called whenever the server remote mute state is changed\n *\n * @public\n * @memberof MuteState\n * @param {Meeting} meeting\n * @param {Boolean} [muted] true if user is remotely muted, false otherwise\n * @param {Boolean} [unmuteAllowed] indicates if user is allowed to unmute self (false when \"hard mute\" feature is used)\n * @returns {undefined}\n */\n public handleServerRemoteMuteUpdate(meeting: any, muted?: boolean, unmuteAllowed?: boolean) {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleServerRemoteMuteUpdate --> ${this.type}: updating server remoteMute to (${muted})`\n );\n if (unmuteAllowed !== undefined) {\n this.state.server.unmuteAllowed = unmuteAllowed;\n this.applyUnmuteAllowedToTrack(meeting);\n }\n if (muted !== undefined) {\n this.state.server.remoteMute = muted;\n this.applyServerMuteToLocalTrack(meeting, 'remotelyMuted');\n }\n }\n\n /**\n * This method should be called whenever we receive from the server a requirement to locally unmute\n *\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @returns {undefined}\n */\n public handleServerLocalUnmuteRequired(meeting?: object) {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleServerLocalUnmuteRequired --> ${this.type}: localAudioUnmuteRequired received -> doing local unmute`\n );\n\n // todo: I'm seeing \"you can now unmute yourself \" popup when this happens - but same thing happens on web.w.c so we can ignore for now\n this.state.server.remoteMute = false;\n this.state.client.localMute = false;\n\n if (this.pendingPromiseReject) {\n this.pendingPromiseReject(\n new Error('Server requested local unmute - this overrides any client request in progress')\n );\n this.pendingPromiseResolve = null;\n this.pendingPromiseReject = null;\n }\n\n this.applyClientStateLocally(meeting, 'localUnmuteRequired');\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Returns true if the user is locally or remotely muted\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isMuted() {\n return (\n this.state.client.localMute || this.state.server.localMute || this.state.server.remoteMute\n );\n }\n\n /**\n * Returns true if the user is remotely muted\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isRemotelyMuted() {\n return this.state.server.remoteMute;\n }\n\n /**\n * Returns true if unmute is allowed\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isUnmuteAllowed() {\n return this.state.server.unmuteAllowed;\n }\n\n /**\n * Returns true if the user is locally muted\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isLocallyMuted() {\n return this.state.client.localMute || this.state.server.localMute;\n }\n\n /**\n * Returns true if the user is muted as a result of the client request (and not remotely muted)\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isSelf() {\n return this.state.client.localMute && !this.state.server.remoteMute;\n }\n\n // defined for backwards compatibility with the old AudioStateMachine/VideoStateMachine classes\n get muted() {\n return this.isMuted();\n }\n\n // defined for backwards compatibility with the old AudioStateMachine/VideoStateMachine classes\n get self() {\n return this.isSelf();\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACO,IAAMA,eAAe,GAAG,SAAlBA,eAAe,CAAIC,IAAI,EAAEC,OAAO,EAAEC,cAAc,EAAEC,iBAA0B,EAAK;EAC5F;EACA;EACA,IAAIH,IAAI,KAAKI,gBAAK,IAAI,CAACF,cAAc,CAACG,SAAS,EAAE;IAC/C,OAAO,IAAI;EACb;EACA,IAAIL,IAAI,KAAKM,gBAAK,IAAI,CAACJ,cAAc,CAACK,SAAS,EAAE;IAC/C,OAAO,IAAI;EACb;EAEAC,oBAAW,CAACC,MAAM,CAACC,IAAI,iDACoBV,IAAI,iDAAuCC,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEU,EAAE,EAChG;EAED,IAAMC,SAAS,GAAG,IAAIC,SAAS,CAACb,IAAI,EAAEC,OAAO,EAAEE,iBAAiB,CAAC;EAEjES,SAAS,CAACE,IAAI,CAACb,OAAO,CAAC;EAEvB,OAAOW,SAAS;AAClB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANA;AAAA,IAOaC,SAAS;EAKQ;;EAG5B;AACF;AACA;AACA;AACA;AACA;AACA;EACE,mBAAYb,IAAY,EAAEC,OAAY,EAAEE,iBAA0B,EAAE;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAClE,IAAIH,IAAI,KAAKI,gBAAK,IAAIJ,IAAI,KAAKM,gBAAK,EAAE;MACpC,MAAM,IAAIS,kBAAc,CAAC,yDAAyD,CAAC;IACrF;IACA,IAAI,CAACf,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACG,iBAAiB,GAAGA,iBAAiB;IAC1C,IAAI,CAACa,qBAA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,IAAI,CAAC3C,qBAAqB,GAAG,IAAI;QACjC,IAAI,CAACC,oBAAoB,GAAG,IAAI;MAClC;MAEA,IAAI,CAACkB,uBAAuB,CAAC7C,OAAO,EAAE,qBAAqB,CAAC;MAC5D,IAAI,CAACoC,wBAAwB,CAACpC,OAAO,CAAC;IACxC;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAA;IAAA,OAOA,mBAAiB;MACf,OACE,IAAI,CAACgB,KAAK,CAACC,MAAM,CAACC,SAAS,IAAI,IAAI,CAACF,KAAK,CAACG,MAAM,CAACD,SAAS,IAAI,IAAI,CAACF,KAAK,CAACG,MAAM,CAACC,UAAU;IAE9F;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAA;IAAA,OAOA,2BAAyB;MACvB,OAAO,IAAI,CAACJ,KAAK,CAACG,MAAM,CAACC,UAAU;IACrC;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAA;IAAA,OAOA,2BAAyB;MACvB,OAAO,IAAI,CAACJ,KAAK,CAACG,MAAM,CAACI,aAAa;IACxC;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAA;IAAA,OAOA,0BAAwB;MACtB,OAAO,IAAI,CAACP,KAAK,CAACC,MAAM,CAACC,SAAS,IAAI,IAAI,CAACF,KAAK,CAACG,MAAM,CAACD,SAAS;IACnE;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAA;IAAA,OAOA,kBAAgB;MACd,OAAO,IAAI,CAACF,KAAK,CAACC,MAAM,CAACC,SAAS,IAAI,CAAC,IAAI,CAACF,KAAK,CAACG,MAAM,CAACC,UAAU;IACrE;;IAEA;EAAA;IAAA;IAAA,KACA,eAAY;MACV,OAAO,IAAI,CAACkD,OAAO,EAAE;IACvB;;IAEA;EAAA;IAAA;IAAA,KACA,eAAW;MACT,OAAO,IAAI,CAACC,MAAM,EAAE;IACtB;EAAC;EAAA;AAAA;AAAA"}
|
package/dist/meeting/request.js
CHANGED
|
@@ -16,6 +16,7 @@ var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/pr
|
|
|
16
16
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
17
17
|
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
18
18
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
19
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/objectWithoutProperties"));
|
|
19
20
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
20
21
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
21
22
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/assertThisInitialized"));
|
|
@@ -29,6 +30,8 @@ var _webexCore = require("@webex/webex-core");
|
|
|
29
30
|
var _common = require("@webex/common");
|
|
30
31
|
var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
|
|
31
32
|
var _constants = require("../constants");
|
|
33
|
+
var _util = _interopRequireDefault(require("./util"));
|
|
34
|
+
var _excluded = ["meeting"];
|
|
32
35
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
33
36
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
34
37
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
@@ -47,8 +50,12 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
47
50
|
function MeetingRequest(attrs, options) {
|
|
48
51
|
var _this;
|
|
49
52
|
(0, _classCallCheck2.default)(this, MeetingRequest);
|
|
50
|
-
|
|
53
|
+
var meeting = attrs.meeting,
|
|
54
|
+
otherAttrs = (0, _objectWithoutProperties2.default)(attrs, _excluded);
|
|
55
|
+
_this = _super.call(this, otherAttrs, options);
|
|
51
56
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeVideoLayoutDebounced", void 0);
|
|
57
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "meetingRef", void 0);
|
|
58
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "locusDeltaRequest", void 0);
|
|
52
59
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getJoinCookie", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
53
60
|
var joinCookieRaw, joinCookie;
|
|
54
61
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
@@ -84,6 +91,7 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
84
91
|
}
|
|
85
92
|
}, _callee, null, [[4, 10]]);
|
|
86
93
|
})));
|
|
94
|
+
_this.locusDeltaRequest = _util.default.generateLocusDeltaRequest(meeting);
|
|
87
95
|
_this.changeVideoLayoutDebounced = (0, _debounce2.default)(_this.changeVideoLayout, 2000, {
|
|
88
96
|
leading: true,
|
|
89
97
|
trailing: true
|
|
@@ -294,7 +302,7 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
294
302
|
};
|
|
295
303
|
|
|
296
304
|
// @ts-ignore
|
|
297
|
-
return this.
|
|
305
|
+
return this.locusDeltaRequest({
|
|
298
306
|
method: _constants.HTTP_VERBS.POST,
|
|
299
307
|
uri: uri,
|
|
300
308
|
body: body
|
|
@@ -337,7 +345,7 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
337
345
|
};
|
|
338
346
|
|
|
339
347
|
// @ts-ignore
|
|
340
|
-
return this.
|
|
348
|
+
return this.locusDeltaRequest({
|
|
341
349
|
method: _constants.HTTP_VERBS.POST,
|
|
342
350
|
uri: uri,
|
|
343
351
|
body: body
|
|
@@ -435,7 +443,7 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
435
443
|
};
|
|
436
444
|
|
|
437
445
|
// @ts-ignore
|
|
438
|
-
return this.
|
|
446
|
+
return this.locusDeltaRequest({
|
|
439
447
|
method: _constants.HTTP_VERBS.PUT,
|
|
440
448
|
uri: uri,
|
|
441
449
|
body: body
|
|
@@ -474,9 +482,7 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
474
482
|
usingResource: resourceId || null,
|
|
475
483
|
correlationId: correlationId
|
|
476
484
|
};
|
|
477
|
-
|
|
478
|
-
// @ts-ignore
|
|
479
|
-
return this.request({
|
|
485
|
+
return this.locusDeltaRequest({
|
|
480
486
|
method: _constants.HTTP_VERBS.PUT,
|
|
481
487
|
uri: uri,
|
|
482
488
|
body: body
|
|
@@ -503,14 +509,19 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
503
509
|
},
|
|
504
510
|
correlationId: options.correlationId
|
|
505
511
|
};
|
|
506
|
-
|
|
507
|
-
// @ts-ignore
|
|
508
|
-
return this.request({
|
|
512
|
+
return this.locusDeltaRequest({
|
|
509
513
|
method: _constants.HTTP_VERBS.PUT,
|
|
510
514
|
uri: uri,
|
|
511
515
|
body: body
|
|
512
516
|
});
|
|
513
517
|
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Makes a network request to lock the meeting
|
|
521
|
+
* @param {Object} options
|
|
522
|
+
* @param {Boolean} options.lock Whether it is locked or not
|
|
523
|
+
* @returns {Promise}
|
|
524
|
+
*/
|
|
514
525
|
}, {
|
|
515
526
|
key: "lockMeeting",
|
|
516
527
|
value: function lockMeeting(options) {
|
|
@@ -520,9 +531,7 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
520
531
|
locked: options.lock
|
|
521
532
|
}
|
|
522
533
|
};
|
|
523
|
-
|
|
524
|
-
// @ts-ignore
|
|
525
|
-
return this.request({
|
|
534
|
+
return this.locusDeltaRequest({
|
|
526
535
|
method: _constants.HTTP_VERBS.PATCH,
|
|
527
536
|
uri: uri,
|
|
528
537
|
body: body
|
|
@@ -550,9 +559,7 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
550
559
|
}, options.reason && {
|
|
551
560
|
reason: options.reason
|
|
552
561
|
});
|
|
553
|
-
|
|
554
|
-
// @ts-ignore
|
|
555
|
-
return this.request({
|
|
562
|
+
return this.locusDeltaRequest({
|
|
556
563
|
method: _constants.HTTP_VERBS.PUT,
|
|
557
564
|
uri: uri,
|
|
558
565
|
body: body
|
|
@@ -627,7 +634,7 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
627
634
|
deviceUrl = _ref7.deviceUrl,
|
|
628
635
|
tones = _ref7.tones;
|
|
629
636
|
// @ts-ignore
|
|
630
|
-
return this.
|
|
637
|
+
return this.locusDeltaRequest({
|
|
631
638
|
method: _constants.HTTP_VERBS.POST,
|
|
632
639
|
uri: "".concat(locusUrl, "/").concat(_constants.SEND_DTMF_ENDPOINT),
|
|
633
640
|
body: {
|
|
@@ -685,7 +692,7 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
685
692
|
} : undefined;
|
|
686
693
|
|
|
687
694
|
// @ts-ignore
|
|
688
|
-
return this.
|
|
695
|
+
return this.locusDeltaRequest({
|
|
689
696
|
method: _constants.HTTP_VERBS.PUT,
|
|
690
697
|
uri: "".concat(locusUrl, "/").concat(_constants.CONTROLS),
|
|
691
698
|
body: {
|
|
@@ -711,7 +718,7 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
711
718
|
var uri = "".concat(locusUrl, "/").concat(_constants.END);
|
|
712
719
|
|
|
713
720
|
// @ts-ignore
|
|
714
|
-
return this.
|
|
721
|
+
return this.locusDeltaRequest({
|
|
715
722
|
method: _constants.HTTP_VERBS.POST,
|
|
716
723
|
uri: uri
|
|
717
724
|
});
|
|
@@ -778,7 +785,7 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
778
785
|
var uri = "".concat(locusUrl, "/").concat(_constants.CONTROLS);
|
|
779
786
|
|
|
780
787
|
// @ts-ignore
|
|
781
|
-
return this.
|
|
788
|
+
return this.locusDeltaRequest({
|
|
782
789
|
method: _constants.HTTP_VERBS.PUT,
|
|
783
790
|
uri: uri,
|
|
784
791
|
body: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MeetingRequest","attrs","options","webex","boundedStorage","get","REACHABILITY","namespace","localStorageJoinCookie","catch","joinCookieRaw","joinCookie","JSON","parse","LoggerProxy","logger","error","changeVideoLayoutDebounced","changeVideoLayout","leading","trailing","asResourceOccupant","inviteeAddress","meetingNumber","permissionToken","deviceUrl","locusUrl","resourceId","correlationId","ensureConversation","moderator","pin","moveToResource","roapMessage","preferTranscoding","breakoutsSupported","locale","deviceCapabilities","liveAnnotationSupported","info","url","getJoinCookie","body","device","deviceType","config","meetings","usingResource","moveMediaToResource","respOnlySdp","allowMultiDevice","supportsNativeLobby","clientMediaPreferences","push","BREAKOUTS","BREAKOUTS_SUPPORTED","ANNOTATION","ANNOTATION_ON_SHARE_SUPPORTED","length","clientRegion","countryCode","regionCode","undefined","PARTICIPANT","internal","services","waitForCatalog","LOCI","CALL","invitee","address","concat","ALTERNATE_REDIRECT_TRUE","callPreferences","requestedMedia","_SLIDES_","localMedias","request","method","HTTP_VERBS","POST","uri","captchaRefreshUrl","captchaId","err","dialInUrl","clientUrl","PROVISIONAL","provisionalType","PROVISIONAL_TYPE_DIAL_IN","dialOutUrl","phoneNumber","PROVISIONAL_TYPE_DIAL_OUT","dialoutAddress","desync","syncUrl","split","LOCUS","SYNCDEBUG","GET","reject","phoneUrl","selfId","LEAVE","PUT","ALERT","CONTROLS","lock","locked","PATCH","DECLINE","reason","floorReq","disposition","FLOOR_ACTION","GRANTED","beneficiary","personUrl","devices","requester","floor","resourceUrl","resourceToken","annotation","tones","SEND_DTMF_ENDPOINT","dtmf","uuid","v4","layoutType","main","content","width","height","Error","renderInfoMain","renderInfoContent","layoutParams","renderInfo","layout","type","END","keepAliveUrl","reactionChannelUrl","reaction","participantId","sender","enable","requestingParticipantId","reactions","enabled","StatelessWebexPlugin"],"sources":["request.ts"],"sourcesContent":["import uuid from 'uuid';\nimport {debounce} from 'lodash';\n// @ts-ignore\nimport {StatelessWebexPlugin} from '@webex/webex-core';\n// @ts-ignore\nimport {deviceType} from '@webex/common';\n\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {\n ALERT,\n ALTERNATE_REDIRECT_TRUE,\n BREAKOUTS,\n CALL,\n CONTROLS,\n DECLINE,\n END,\n FLOOR_ACTION,\n HTTP_VERBS,\n LEAVE,\n LOCI,\n LOCUS,\n MEDIA,\n PARTICIPANT,\n PROVISIONAL_TYPE_DIAL_IN,\n PROVISIONAL_TYPE_DIAL_OUT,\n REACHABILITY,\n SEND_DTMF_ENDPOINT,\n _SLIDES_,\n ANNOTATION,\n} from '../constants';\nimport {SendReactionOptions, ToggleReactionsOptions} from './request.type';\n\n/**\n * @class MeetingRequest\n */\nexport default class MeetingRequest extends StatelessWebexPlugin {\n changeVideoLayoutDebounced: any;\n\n /**\n * Constructor\n * @param {Object} attrs\n * @param {Object} options\n */\n constructor(attrs: any, options: any) {\n super(attrs, options);\n this.changeVideoLayoutDebounced = debounce(this.changeVideoLayout, 2000, {\n leading: true,\n trailing: true,\n });\n }\n\n /**\n * Returns joinCookie from boundedStorage if present.\n * @returns {Object} joinCookie\n */\n private getJoinCookie = async () => {\n // @ts-ignore\n const joinCookieRaw = await this.webex.boundedStorage\n .get(REACHABILITY.namespace, REACHABILITY.localStorageJoinCookie)\n .catch(() => {});\n\n if (joinCookieRaw) {\n try {\n const joinCookie = JSON.parse(joinCookieRaw);\n if (joinCookie) {\n return joinCookie;\n }\n } catch (e) {\n LoggerProxy.logger.error(\n `MeetingRequest#constructor --> Error in parsing join cookie data: ${e}`\n );\n }\n }\n\n return null;\n };\n\n /**\n * Make a network request to join a meeting\n * @param {Object} options\n * @param {String} options.sipUri\n * @param {String} options.deviceUrl\n * @param {String} options.locusUrl\n * @param {String} options.resourceId,\n * @param {String} options.correlationId\n * @param {boolean} options.ensureConversation\n * @param {boolean} options.moderator\n * @param {boolean} options.pin\n * @param {boolean} options.moveToResource\n * @param {Object} options.roapMessage\n * @param {boolean} options.breakoutsSupported\n * @param {String} options.locale,\n * @param {Array} options.deviceCapabilities\n * @param {boolean} options.liveAnnotationSupported\n * @returns {Promise}\n */\n async joinMeeting(options: {\n sipUri: string;\n deviceUrl: string;\n locusUrl: string;\n resourceId: string;\n correlationId: string;\n ensureConversation: boolean;\n moderator: boolean;\n pin: boolean;\n moveToResource: boolean;\n roapMessage: any;\n asResourceOccupant: any;\n inviteeAddress: any;\n meetingNumber: any;\n permissionToken: any;\n preferTranscoding: any;\n breakoutsSupported: boolean;\n locale?: string;\n deviceCapabilities?: Array<string>;\n liveAnnotationSupported: boolean;\n }) {\n const {\n asResourceOccupant,\n inviteeAddress,\n meetingNumber,\n permissionToken,\n deviceUrl,\n locusUrl,\n resourceId,\n correlationId,\n ensureConversation,\n moderator,\n pin,\n moveToResource,\n roapMessage,\n preferTranscoding,\n breakoutsSupported,\n locale,\n deviceCapabilities = [],\n liveAnnotationSupported,\n } = options;\n\n LoggerProxy.logger.info('Meeting:request#joinMeeting --> Joining a meeting', correlationId);\n\n let url = '';\n\n const joinCookie = await this.getJoinCookie();\n\n const body: any = {\n asResourceOccupant,\n device: {\n url: deviceUrl,\n // @ts-ignore - config comes from registerPlugin\n deviceType: this.config.meetings.deviceType,\n },\n usingResource: resourceId || null,\n moveMediaToResource: (resourceId && moveToResource) || false,\n correlationId,\n respOnlySdp: true,\n allowMultiDevice: true,\n ensureConversation: ensureConversation || false,\n supportsNativeLobby: 1,\n clientMediaPreferences: {\n preferTranscoding: preferTranscoding ?? true,\n joinCookie,\n },\n };\n\n if (breakoutsSupported) {\n deviceCapabilities.push(BREAKOUTS.BREAKOUTS_SUPPORTED);\n }\n if (liveAnnotationSupported) {\n deviceCapabilities.push(ANNOTATION.ANNOTATION_ON_SHARE_SUPPORTED);\n }\n\n if (locale) {\n body.locale = locale;\n }\n\n // add deviceCapabilities prop\n if (deviceCapabilities.length) {\n body.deviceCapabilities = deviceCapabilities;\n }\n // @ts-ignore\n if (this.webex.meetings.clientRegion) {\n // @ts-ignore\n body.device.countryCode = this.webex.meetings.clientRegion.countryCode;\n // @ts-ignore\n body.device.regionCode = this.webex.meetings.clientRegion.regionCode;\n }\n\n if (moderator !== undefined) {\n body.moderator = moderator;\n }\n\n if (permissionToken) {\n body.permissionToken = permissionToken;\n }\n\n if (pin !== undefined) {\n body.pin = pin;\n }\n\n if (locusUrl) {\n url = `${locusUrl}/${PARTICIPANT}`;\n } else if (inviteeAddress || meetingNumber) {\n try {\n // @ts-ignore\n await this.webex.internal.services.waitForCatalog('postauth');\n // @ts-ignore\n url = `${this.webex.internal.services.get('locus')}/${LOCI}/${CALL}`;\n body.invitee = {\n address: inviteeAddress || `wbxmn:${meetingNumber}`,\n };\n } catch (e) {\n LoggerProxy.logger.error(\n `Meeting:request#joinMeeting Error Joining ${inviteeAddress || meetingNumber} --> ${e}`\n );\n throw e;\n }\n }\n\n // TODO: -- this will be resolved in SDK request\n url = url.concat(`?${ALTERNATE_REDIRECT_TRUE}`);\n\n if (resourceId === inviteeAddress) {\n body.callPreferences = {\n requestedMedia: [_SLIDES_],\n };\n }\n\n if (roapMessage) {\n body.localMedias = roapMessage.localMedias;\n }\n\n /// @ts-ignore\n return this.request({\n method: HTTP_VERBS.POST,\n uri: url,\n body,\n });\n }\n\n /**\n * Send a request to refresh the captcha\n * @param {Object} options\n * @param {String} options.captchaRefreshUrl\n * @param {String} options.captchaId\n * @returns {Promise}\n * @private\n */\n private refreshCaptcha({\n captchaRefreshUrl,\n captchaId,\n }: {\n captchaRefreshUrl: string;\n captchaId: string;\n }) {\n const body = {\n captchaId,\n };\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.POST,\n uri: captchaRefreshUrl,\n body,\n }).catch((err) => {\n LoggerProxy.logger.error(`Meeting:request#refreshCaptcha --> Error: ${err}`);\n\n throw err;\n });\n }\n\n /**\n * Make a network request to add a dial in device\n * @param {Object} options\n * @param {String} options.correlationId\n * @param {String} options.locusUrl url for the meeting\n * @param {String} options.dialInUrl identifier for the to-be provisioned device\n * @param {String} options.clientUrl identifier for the web device\n * @returns {Promise}\n * @private\n */\n private dialIn({\n locusUrl,\n dialInUrl,\n clientUrl,\n correlationId,\n }: {\n correlationId: string;\n locusUrl: string;\n dialInUrl: string;\n clientUrl: string;\n }) {\n LoggerProxy.logger.info(\n 'Meeting:request#dialIn --> Provisioning a dial in device',\n correlationId\n );\n const uri = `${locusUrl}/${PARTICIPANT}`;\n\n const body = {\n device: {\n deviceType: deviceType.PROVISIONAL,\n provisionalType: PROVISIONAL_TYPE_DIAL_IN,\n url: dialInUrl,\n clientUrl,\n },\n correlationId,\n };\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.POST,\n uri,\n body,\n }).catch((err) => {\n LoggerProxy.logger.error(\n `Meeting:request#dialIn --> Error provisioning a dial in device, error ${err}`\n );\n\n throw err;\n });\n }\n\n /**\n * Make a network request to add a dial out device\n * @param {Object} options\n * @param {String} options.correlationId\n * @param {String} options.locusUrl url for the meeting\n * @param {String} options.dialOutUrl identifier for the to-be provisioned device\n * @param {String} options.phoneNumber phone number to dial out to\n * @param {String} options.clientUrl identifier for the web device\n * @returns {Promise}\n * @private\n */\n private dialOut({\n locusUrl,\n dialOutUrl,\n phoneNumber,\n clientUrl,\n correlationId,\n }: {\n correlationId: string;\n locusUrl: string;\n dialOutUrl: string;\n phoneNumber: string;\n clientUrl: string;\n }) {\n LoggerProxy.logger.info(\n 'Meeting:request#dialOut --> Provisioning a dial out device',\n correlationId\n );\n const uri = `${locusUrl}/${PARTICIPANT}`;\n\n const body = {\n device: {\n deviceType: deviceType.PROVISIONAL,\n provisionalType: PROVISIONAL_TYPE_DIAL_OUT,\n url: dialOutUrl,\n dialoutAddress: phoneNumber,\n clientUrl,\n },\n correlationId,\n };\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.POST,\n uri,\n body,\n }).catch((err) => {\n LoggerProxy.logger.error(\n `Meeting:request#dialOut --> Error provisioning a dial out device, error ${err}`\n );\n\n throw err;\n });\n }\n\n /**\n * Syns the missed delta event\n * @param {Object} options\n * @param {boolean} options.desync flag to get partial or whole locus object\n * @param {String} options.syncUrl sync url to get ht elatest locus delta\n * @returns {Promise}\n */\n syncMeeting(options: {desync: boolean; syncUrl: string}) {\n /* eslint-disable no-else-return */\n const {desync} = options;\n let {syncUrl} = options;\n\n /* istanbul ignore else */\n if (desync) {\n // check for existing URL parameters\n syncUrl = syncUrl\n .concat(syncUrl.split('?')[1] ? '&' : '?')\n .concat(`${LOCUS.SYNCDEBUG}=${desync}`);\n }\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.GET,\n uri: syncUrl,\n }) // TODO: Handle if delta sync failed . Get the full locus object\n .catch((err) => {\n LoggerProxy.logger.error(\n `Meeting:request#syncMeeting --> Error syncing meeting, error ${err}`\n );\n\n return err;\n });\n }\n\n /**\n * Request to get the complete locus object\n * @param {Object} options\n * @param {boolean} options.desync flag to get partial or whole locus object\n * @param {String} options.locusUrl sync url to get ht elatest locus delta\n * @returns {Promise}\n */\n getFullLocus(options: {desync: boolean; locusUrl: string}) {\n let {locusUrl} = options;\n const {desync} = options;\n\n if (locusUrl) {\n if (desync) {\n locusUrl += `?${LOCUS.SYNCDEBUG}=${desync}`;\n }\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.GET,\n uri: locusUrl,\n }).catch((err) => {\n LoggerProxy.logger.error(\n `Meeting:request#getFullLocus --> Error getting full locus, error ${err}`\n );\n\n return err;\n });\n }\n\n return Promise.reject();\n }\n\n /**\n * Make a network request to make a provisioned phone leave the meeting\n * @param {Object} options\n * @param {String} options.locusUrl\n * @param {String} options.phoneUrl\n * @param {String} options.correlationId\n * @param {String} options.selfId\n * @returns {Promise}\n * @private\n */\n private disconnectPhoneAudio({\n locusUrl,\n phoneUrl,\n correlationId,\n selfId,\n }: {\n locusUrl: string;\n phoneUrl: string;\n correlationId: string;\n selfId: string;\n }) {\n LoggerProxy.logger.info(\n `Meeting:request#disconnectPhoneAudio --> request phone ${phoneUrl} to leave`,\n correlationId\n );\n const uri = `${locusUrl}/${PARTICIPANT}/${selfId}/${LEAVE}`;\n\n const body = {\n device: {\n deviceType: deviceType.PROVISIONAL,\n url: phoneUrl,\n },\n correlationId,\n };\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.PUT,\n uri,\n body,\n }).catch((err) => {\n LoggerProxy.logger.error(\n `Meeting:request#disconnectPhoneAudio --> Error when requesting phone ${phoneUrl} to leave, error ${err}`\n );\n\n throw err;\n });\n }\n\n /**\n * Make a network request to leave a meeting\n * @param {Object} options\n * @param {Url} options.locusUrl\n * @param {String} options.selfId\n * @param {Url} options.deviceUrl\n * @param {String} options.resourceId,\n * @param {String} options.correlationId\n * @returns {Promise}\n */\n leaveMeeting({\n locusUrl,\n selfId,\n deviceUrl: url,\n resourceId,\n correlationId,\n }: {\n locusUrl: string;\n selfId: string;\n deviceUrl: string;\n resourceId: string;\n correlationId: string;\n }) {\n LoggerProxy.logger.info('Meeting:request#leaveMeeting --> Leaving a meeting', correlationId);\n\n const uri = `${locusUrl}/${PARTICIPANT}/${selfId}/${LEAVE}`;\n const body = {\n device: {\n // @ts-ignore\n deviceType: this.config.meetings.deviceType,\n url,\n },\n usingResource: resourceId || null,\n correlationId,\n };\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.PUT,\n uri,\n body,\n });\n }\n\n /**\n * Make a network request to acknowledge a meeting\n * @param {Object} options\n * @param {String} options.locusUrl\n * @param {String} options.deviceUrl\n * @param {String} options.correlationId\n * @returns {Promise}\n */\n acknowledgeMeeting(options: {locusUrl: string; deviceUrl: string; correlationId: string}) {\n const uri = `${options.locusUrl}/${PARTICIPANT}/${ALERT}`;\n const body = {\n device: {\n // @ts-ignore\n deviceType: this.config.meetings.deviceType,\n url: options.deviceUrl,\n },\n correlationId: options.correlationId,\n };\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.PUT,\n uri,\n body,\n });\n }\n\n lockMeeting(options) {\n const uri = `${options.locusUrl}/${CONTROLS}`;\n const body = {\n lock: {\n locked: options.lock,\n },\n };\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.PATCH,\n uri,\n body,\n });\n }\n\n /**\n * Make a network request to decline a meeting\n * @param {Object} options\n * @param {String} options.locusUrl\n * @param {String} options.deviceUrl\n * @param {String} options.reason\n * @returns {Promise}\n */\n declineMeeting(options: {locusUrl: string; deviceUrl: string; reason: string}) {\n const uri = `${options.locusUrl}/${PARTICIPANT}/${DECLINE}`;\n const body = {\n device: {\n // @ts-ignore\n deviceType: this.config.meetings.deviceType,\n url: options.deviceUrl,\n },\n ...(options.reason && {reason: options.reason}),\n };\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.PUT,\n uri,\n body,\n });\n }\n\n /**\n * change the content floor grant\n * @param {Object} options options for floor grant\n * @param {String} options.disposition floor action (granted/released)\n * @param {String} options.personUrl personUrl who is requesting floor\n * @param {String} options.deviceUrl Url of a device\n * @param {String} options.resourceId Populated if you are paired to a device\n * @param {String} options.uri floor grant uri\n * @returns {Promise}\n */\n changeMeetingFloor(\n options:\n | {\n disposition: string;\n personUrl: string;\n deviceUrl: string;\n resourceId: string;\n uri: string;\n annotation: any;\n }\n | any\n ) {\n let floorReq: any = {disposition: options.disposition};\n\n /* istanbul ignore else */\n if (options.disposition === FLOOR_ACTION.GRANTED) {\n floorReq = {\n beneficiary: {\n url: options.personUrl,\n devices: [\n {\n // @ts-ignore\n deviceType: this.config.meetings.deviceType,\n url: options.deviceUrl,\n },\n ],\n },\n disposition: options.disposition,\n requester: {\n url: options.personUrl,\n },\n };\n }\n\n const body: any = {\n floor: floorReq,\n resourceUrl: options.resourceUrl,\n };\n\n if (options?.resourceToken) {\n body.resourceToken = options?.resourceToken;\n }\n if (options?.annotation) {\n body.annotation = options?.annotation;\n }\n\n // @ts-ignore\n return this.request({\n uri: options.uri,\n method: HTTP_VERBS.PUT,\n body,\n });\n }\n\n /**\n * Sends a request to the DTMF endpoint to send tones\n * @param {Object} options\n * @param {String} options.locusUrl\n * @param {String} options.deviceUrl\n * @param {String} options.tones a string of one or more DTMF tones to send\n * @returns {Promise}\n */\n sendDTMF({locusUrl, deviceUrl, tones}: {locusUrl: string; deviceUrl: string; tones: string}) {\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.POST,\n uri: `${locusUrl}/${SEND_DTMF_ENDPOINT}`,\n body: {\n deviceUrl,\n dtmf: {\n correlationId: uuid.v4(),\n tones,\n },\n },\n });\n }\n\n /**\n * Sends a request to the controls endpoint to set the video layout\n * @param {Object} options\n * @param {String} options.locusUrl\n * @param {String} options.deviceUrl\n * @param {String} options.layoutType a layout type that should be available in meeting constants {@link #layout_types}\n * @param {Object} options.main preferred dimensions for the remote main video stream\n * @param {Number} options.main.width preferred width of main video stream\n * @param {Number} options.main.height preferred height of main video stream\n * @param {Object} options.content preferred dimensions for the remote content share stream\n * @param {Number} options.content.width preferred width of content share stream\n * @param {Number} options.content.height preferred height of content share stream\n * @returns {Promise}\n */\n changeVideoLayout({\n locusUrl,\n deviceUrl,\n layoutType,\n main,\n content,\n }: {\n locusUrl: string;\n deviceUrl: string;\n layoutType: string;\n main: {\n width: number;\n height: number;\n };\n content: {\n width: number;\n height: number;\n };\n }) {\n // send main/content renderInfo only if both width and height are specified\n if (main && (!main.width || !main.height)) {\n return Promise.reject(\n new Error(\n `Both width and height must be specified. One of them is missing for main: ${JSON.stringify(\n main\n )}`\n )\n );\n }\n\n if (content && (!content.width || !content.height)) {\n return Promise.reject(\n new Error(\n `Both width and height must be specified. One of them is missing for content: ${JSON.stringify(\n content\n )}`\n )\n );\n }\n\n const renderInfoMain = main ? {width: main.width, height: main.height} : undefined;\n const renderInfoContent = content ? {width: content.width, height: content.height} : undefined;\n\n const layoutParams =\n renderInfoMain || renderInfoContent\n ? {\n renderInfo: {\n main: renderInfoMain,\n content: renderInfoContent,\n },\n }\n : undefined;\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.PUT,\n uri: `${locusUrl}/${CONTROLS}`,\n body: {\n layout: {\n deviceUrl,\n type: layoutType,\n layoutParams,\n },\n },\n });\n }\n\n /**\n * Make a network request to end meeting for all\n * @param {Object} options\n * @param {Url} options.locusUrl\n * @returns {Promise}\n */\n endMeetingForAll({locusUrl}: {locusUrl: string}) {\n const uri = `${locusUrl}/${END}`;\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.POST,\n uri,\n });\n }\n\n /**\n * Send a locus keepAlive (used in lobby)\n * @param {Object} options\n * @param {Url} options.keepAliveUrl\n * @returns {Promise}\n */\n keepAlive({keepAliveUrl}: {keepAliveUrl: string}) {\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.GET,\n uri: keepAliveUrl,\n });\n }\n\n /**\n * Make a network request to send a reaction.\n * @param {Object} options\n * @param {Url} options.reactionChannelUrl\n * @param {Reaction} options.reaction\n * @param {string} options.senderID\n * @returns {Promise}\n */\n sendReaction({reactionChannelUrl, reaction, participantId}: SendReactionOptions) {\n const uri = reactionChannelUrl;\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.POST,\n uri,\n body: {\n sender: {participantId},\n reaction,\n },\n });\n }\n\n /**\n * Make a network request to enable or disable reactions.\n * @param {boolean} options.enable - determines if we need to enable or disable.\n * @param {locusUrl} options.locusUrl\n * @returns {Promise}\n */\n toggleReactions({enable, locusUrl, requestingParticipantId}: ToggleReactionsOptions) {\n const uri = `${locusUrl}/${CONTROLS}`;\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.PUT,\n uri,\n body: {\n reactions: {\n enabled: enable,\n },\n requestingParticipantId,\n },\n });\n }\n\n getLocusStatusByUrl(locusUrl: string) {\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.GET,\n uri: locusUrl,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAGA;AAEA;AAEA;AACA;AAqBsB;AAAA;AAAA;AAAA;AAGtB;AACA;AACA;AAFA,IAGqBA,cAAc;EAAA;EAAA;EAGjC;AACF;AACA;AACA;AACA;EACE,wBAAYC,KAAU,EAAEC,OAAY,EAAE;IAAA;IAAA;IACpC,0BAAMD,KAAK,EAAEC,OAAO;IAAE;IAAA,iLAWA;MAAA;MAAA;QAAA;UAAA;YAAA;YAAA,OAEM,MAAKC,KAAK,CAACC,cAAc,CAClDC,GAAG,CAACC,uBAAY,CAACC,SAAS,EAAED,uBAAY,CAACE,sBAAsB,CAAC,CAChEC,KAAK,CAAC,YAAM,CAAC,CAAC,CAAC;UAAA;YAFZC,aAAa;YAAA,KAIfA,aAAa;cAAA;cAAA;YAAA;YAAA;YAEPC,UAAU,GAAGC,IAAI,CAACC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AE;;MAErC;MACA,OAAO,IAAI,CAAC7B,OAAO,CAAC;QAClBC,MAAM,EAAEC,qBAAU,CAACyB,GAAG;QACtBvB,GAAG,EAAHA,GAAG;QACHvC,IAAI,EAAE;UACJ2G,SAAS,EAAE;YACTC,OAAO,EAAEH;UACX,CAAC;UACDC,uBAAuB,EAAvBA;QACF;MACF,CAAC,CAAC;IACJ;EAAC;IAAA;IAAA,OAED,6BAAoB1H,QAAgB,EAAE;MACpC;MACA,OAAO,IAAI,CAACmD,OAAO,CAAC;QAClBC,MAAM,EAAEC,qBAAU,CAACoB,GAAG;QACtBlB,GAAG,EAAEvD;MACP,CAAC,CAAC;IACJ;EAAC;EAAA;AAAA,EAlzByC6H,+BAAoB;AAAA"}
|
|
1
|
+
{"version":3,"names":["MeetingRequest","attrs","options","meeting","otherAttrs","webex","boundedStorage","get","REACHABILITY","namespace","localStorageJoinCookie","catch","joinCookieRaw","joinCookie","JSON","parse","LoggerProxy","logger","error","locusDeltaRequest","MeetingUtil","generateLocusDeltaRequest","changeVideoLayoutDebounced","changeVideoLayout","leading","trailing","asResourceOccupant","inviteeAddress","meetingNumber","permissionToken","deviceUrl","locusUrl","resourceId","correlationId","ensureConversation","moderator","pin","moveToResource","roapMessage","preferTranscoding","breakoutsSupported","locale","deviceCapabilities","liveAnnotationSupported","info","url","getJoinCookie","body","device","deviceType","config","meetings","usingResource","moveMediaToResource","respOnlySdp","allowMultiDevice","supportsNativeLobby","clientMediaPreferences","push","BREAKOUTS","BREAKOUTS_SUPPORTED","ANNOTATION","ANNOTATION_ON_SHARE_SUPPORTED","length","clientRegion","countryCode","regionCode","undefined","PARTICIPANT","internal","services","waitForCatalog","LOCI","CALL","invitee","address","concat","ALTERNATE_REDIRECT_TRUE","callPreferences","requestedMedia","_SLIDES_","localMedias","request","method","HTTP_VERBS","POST","uri","captchaRefreshUrl","captchaId","err","dialInUrl","clientUrl","PROVISIONAL","provisionalType","PROVISIONAL_TYPE_DIAL_IN","dialOutUrl","phoneNumber","PROVISIONAL_TYPE_DIAL_OUT","dialoutAddress","desync","syncUrl","split","LOCUS","SYNCDEBUG","GET","reject","phoneUrl","selfId","LEAVE","PUT","ALERT","CONTROLS","lock","locked","PATCH","DECLINE","reason","floorReq","disposition","FLOOR_ACTION","GRANTED","beneficiary","personUrl","devices","requester","floor","resourceUrl","resourceToken","annotation","tones","SEND_DTMF_ENDPOINT","dtmf","uuid","v4","layoutType","main","content","width","height","Error","renderInfoMain","renderInfoContent","layoutParams","renderInfo","layout","type","END","keepAliveUrl","reactionChannelUrl","reaction","participantId","sender","enable","requestingParticipantId","reactions","enabled","StatelessWebexPlugin"],"sources":["request.ts"],"sourcesContent":["import uuid from 'uuid';\nimport {debounce} from 'lodash';\n// @ts-ignore\nimport {StatelessWebexPlugin} from '@webex/webex-core';\n// @ts-ignore\nimport {deviceType} from '@webex/common';\n\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {\n ALERT,\n ALTERNATE_REDIRECT_TRUE,\n BREAKOUTS,\n CALL,\n CONTROLS,\n DECLINE,\n END,\n FLOOR_ACTION,\n HTTP_VERBS,\n LEAVE,\n LOCI,\n LOCUS,\n PARTICIPANT,\n PROVISIONAL_TYPE_DIAL_IN,\n PROVISIONAL_TYPE_DIAL_OUT,\n REACHABILITY,\n SEND_DTMF_ENDPOINT,\n _SLIDES_,\n ANNOTATION,\n} from '../constants';\nimport {SendReactionOptions, ToggleReactionsOptions} from './request.type';\nimport MeetingUtil from './util';\n\n/**\n * @class MeetingRequest\n */\nexport default class MeetingRequest extends StatelessWebexPlugin {\n changeVideoLayoutDebounced: any;\n meetingRef: WeakRef<any>;\n locusDeltaRequest: (options: object) => Promise<any>;\n\n /**\n * Constructor\n * @param {Object} attrs\n * @param {Object} options\n */\n constructor(attrs: any, options: any) {\n const {meeting, ...otherAttrs} = attrs;\n\n super(otherAttrs, options);\n\n this.locusDeltaRequest = MeetingUtil.generateLocusDeltaRequest(meeting);\n\n this.changeVideoLayoutDebounced = debounce(this.changeVideoLayout, 2000, {\n leading: true,\n trailing: true,\n });\n }\n\n /**\n * Returns joinCookie from boundedStorage if present.\n * @returns {Object} joinCookie\n */\n private getJoinCookie = async () => {\n // @ts-ignore\n const joinCookieRaw = await this.webex.boundedStorage\n .get(REACHABILITY.namespace, REACHABILITY.localStorageJoinCookie)\n .catch(() => {});\n\n if (joinCookieRaw) {\n try {\n const joinCookie = JSON.parse(joinCookieRaw);\n if (joinCookie) {\n return joinCookie;\n }\n } catch (e) {\n LoggerProxy.logger.error(\n `MeetingRequest#constructor --> Error in parsing join cookie data: ${e}`\n );\n }\n }\n\n return null;\n };\n\n /**\n * Make a network request to join a meeting\n * @param {Object} options\n * @param {String} options.sipUri\n * @param {String} options.deviceUrl\n * @param {String} options.locusUrl\n * @param {String} options.resourceId,\n * @param {String} options.correlationId\n * @param {boolean} options.ensureConversation\n * @param {boolean} options.moderator\n * @param {boolean} options.pin\n * @param {boolean} options.moveToResource\n * @param {Object} options.roapMessage\n * @param {boolean} options.breakoutsSupported\n * @param {String} options.locale,\n * @param {Array} options.deviceCapabilities\n * @param {boolean} options.liveAnnotationSupported\n * @returns {Promise}\n */\n async joinMeeting(options: {\n sipUri: string;\n deviceUrl: string;\n locusUrl: string;\n resourceId: string;\n correlationId: string;\n ensureConversation: boolean;\n moderator: boolean;\n pin: boolean;\n moveToResource: boolean;\n roapMessage: any;\n asResourceOccupant: any;\n inviteeAddress: any;\n meetingNumber: any;\n permissionToken: any;\n preferTranscoding: any;\n breakoutsSupported: boolean;\n locale?: string;\n deviceCapabilities?: Array<string>;\n liveAnnotationSupported: boolean;\n }) {\n const {\n asResourceOccupant,\n inviteeAddress,\n meetingNumber,\n permissionToken,\n deviceUrl,\n locusUrl,\n resourceId,\n correlationId,\n ensureConversation,\n moderator,\n pin,\n moveToResource,\n roapMessage,\n preferTranscoding,\n breakoutsSupported,\n locale,\n deviceCapabilities = [],\n liveAnnotationSupported,\n } = options;\n\n LoggerProxy.logger.info('Meeting:request#joinMeeting --> Joining a meeting', correlationId);\n\n let url = '';\n\n const joinCookie = await this.getJoinCookie();\n\n const body: any = {\n asResourceOccupant,\n device: {\n url: deviceUrl,\n // @ts-ignore - config comes from registerPlugin\n deviceType: this.config.meetings.deviceType,\n },\n usingResource: resourceId || null,\n moveMediaToResource: (resourceId && moveToResource) || false,\n correlationId,\n respOnlySdp: true,\n allowMultiDevice: true,\n ensureConversation: ensureConversation || false,\n supportsNativeLobby: 1,\n clientMediaPreferences: {\n preferTranscoding: preferTranscoding ?? true,\n joinCookie,\n },\n };\n\n if (breakoutsSupported) {\n deviceCapabilities.push(BREAKOUTS.BREAKOUTS_SUPPORTED);\n }\n if (liveAnnotationSupported) {\n deviceCapabilities.push(ANNOTATION.ANNOTATION_ON_SHARE_SUPPORTED);\n }\n\n if (locale) {\n body.locale = locale;\n }\n\n // add deviceCapabilities prop\n if (deviceCapabilities.length) {\n body.deviceCapabilities = deviceCapabilities;\n }\n // @ts-ignore\n if (this.webex.meetings.clientRegion) {\n // @ts-ignore\n body.device.countryCode = this.webex.meetings.clientRegion.countryCode;\n // @ts-ignore\n body.device.regionCode = this.webex.meetings.clientRegion.regionCode;\n }\n\n if (moderator !== undefined) {\n body.moderator = moderator;\n }\n\n if (permissionToken) {\n body.permissionToken = permissionToken;\n }\n\n if (pin !== undefined) {\n body.pin = pin;\n }\n\n if (locusUrl) {\n url = `${locusUrl}/${PARTICIPANT}`;\n } else if (inviteeAddress || meetingNumber) {\n try {\n // @ts-ignore\n await this.webex.internal.services.waitForCatalog('postauth');\n // @ts-ignore\n url = `${this.webex.internal.services.get('locus')}/${LOCI}/${CALL}`;\n body.invitee = {\n address: inviteeAddress || `wbxmn:${meetingNumber}`,\n };\n } catch (e) {\n LoggerProxy.logger.error(\n `Meeting:request#joinMeeting Error Joining ${inviteeAddress || meetingNumber} --> ${e}`\n );\n throw e;\n }\n }\n\n // TODO: -- this will be resolved in SDK request\n url = url.concat(`?${ALTERNATE_REDIRECT_TRUE}`);\n\n if (resourceId === inviteeAddress) {\n body.callPreferences = {\n requestedMedia: [_SLIDES_],\n };\n }\n\n if (roapMessage) {\n body.localMedias = roapMessage.localMedias;\n }\n\n /// @ts-ignore\n return this.request({\n method: HTTP_VERBS.POST,\n uri: url,\n body,\n });\n }\n\n /**\n * Send a request to refresh the captcha\n * @param {Object} options\n * @param {String} options.captchaRefreshUrl\n * @param {String} options.captchaId\n * @returns {Promise}\n * @private\n */\n private refreshCaptcha({\n captchaRefreshUrl,\n captchaId,\n }: {\n captchaRefreshUrl: string;\n captchaId: string;\n }) {\n const body = {\n captchaId,\n };\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.POST,\n uri: captchaRefreshUrl,\n body,\n }).catch((err) => {\n LoggerProxy.logger.error(`Meeting:request#refreshCaptcha --> Error: ${err}`);\n\n throw err;\n });\n }\n\n /**\n * Make a network request to add a dial in device\n * @param {Object} options\n * @param {String} options.correlationId\n * @param {String} options.locusUrl url for the meeting\n * @param {String} options.dialInUrl identifier for the to-be provisioned device\n * @param {String} options.clientUrl identifier for the web device\n * @returns {Promise}\n * @private\n */\n private dialIn({\n locusUrl,\n dialInUrl,\n clientUrl,\n correlationId,\n }: {\n correlationId: string;\n locusUrl: string;\n dialInUrl: string;\n clientUrl: string;\n }) {\n LoggerProxy.logger.info(\n 'Meeting:request#dialIn --> Provisioning a dial in device',\n correlationId\n );\n const uri = `${locusUrl}/${PARTICIPANT}`;\n\n const body = {\n device: {\n deviceType: deviceType.PROVISIONAL,\n provisionalType: PROVISIONAL_TYPE_DIAL_IN,\n url: dialInUrl,\n clientUrl,\n },\n correlationId,\n };\n\n // @ts-ignore\n return this.locusDeltaRequest({\n method: HTTP_VERBS.POST,\n uri,\n body,\n }).catch((err) => {\n LoggerProxy.logger.error(\n `Meeting:request#dialIn --> Error provisioning a dial in device, error ${err}`\n );\n\n throw err;\n });\n }\n\n /**\n * Make a network request to add a dial out device\n * @param {Object} options\n * @param {String} options.correlationId\n * @param {String} options.locusUrl url for the meeting\n * @param {String} options.dialOutUrl identifier for the to-be provisioned device\n * @param {String} options.phoneNumber phone number to dial out to\n * @param {String} options.clientUrl identifier for the web device\n * @returns {Promise}\n * @private\n */\n private dialOut({\n locusUrl,\n dialOutUrl,\n phoneNumber,\n clientUrl,\n correlationId,\n }: {\n correlationId: string;\n locusUrl: string;\n dialOutUrl: string;\n phoneNumber: string;\n clientUrl: string;\n }) {\n LoggerProxy.logger.info(\n 'Meeting:request#dialOut --> Provisioning a dial out device',\n correlationId\n );\n const uri = `${locusUrl}/${PARTICIPANT}`;\n\n const body = {\n device: {\n deviceType: deviceType.PROVISIONAL,\n provisionalType: PROVISIONAL_TYPE_DIAL_OUT,\n url: dialOutUrl,\n dialoutAddress: phoneNumber,\n clientUrl,\n },\n correlationId,\n };\n\n // @ts-ignore\n return this.locusDeltaRequest({\n method: HTTP_VERBS.POST,\n uri,\n body,\n }).catch((err) => {\n LoggerProxy.logger.error(\n `Meeting:request#dialOut --> Error provisioning a dial out device, error ${err}`\n );\n\n throw err;\n });\n }\n\n /**\n * Syns the missed delta event\n * @param {Object} options\n * @param {boolean} options.desync flag to get partial or whole locus object\n * @param {String} options.syncUrl sync url to get ht elatest locus delta\n * @returns {Promise}\n */\n syncMeeting(options: {desync: boolean; syncUrl: string}) {\n /* eslint-disable no-else-return */\n const {desync} = options;\n let {syncUrl} = options;\n\n /* istanbul ignore else */\n if (desync) {\n // check for existing URL parameters\n syncUrl = syncUrl\n .concat(syncUrl.split('?')[1] ? '&' : '?')\n .concat(`${LOCUS.SYNCDEBUG}=${desync}`);\n }\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.GET,\n uri: syncUrl,\n }) // TODO: Handle if delta sync failed . Get the full locus object\n .catch((err) => {\n LoggerProxy.logger.error(\n `Meeting:request#syncMeeting --> Error syncing meeting, error ${err}`\n );\n\n return err;\n });\n }\n\n /**\n * Request to get the complete locus object\n * @param {Object} options\n * @param {boolean} options.desync flag to get partial or whole locus object\n * @param {String} options.locusUrl sync url to get ht elatest locus delta\n * @returns {Promise}\n */\n getFullLocus(options: {desync: boolean; locusUrl: string}) {\n let {locusUrl} = options;\n const {desync} = options;\n\n if (locusUrl) {\n if (desync) {\n locusUrl += `?${LOCUS.SYNCDEBUG}=${desync}`;\n }\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.GET,\n uri: locusUrl,\n }).catch((err) => {\n LoggerProxy.logger.error(\n `Meeting:request#getFullLocus --> Error getting full locus, error ${err}`\n );\n\n return err;\n });\n }\n\n return Promise.reject();\n }\n\n /**\n * Make a network request to make a provisioned phone leave the meeting\n * @param {Object} options\n * @param {String} options.locusUrl\n * @param {String} options.phoneUrl\n * @param {String} options.correlationId\n * @param {String} options.selfId\n * @returns {Promise}\n * @private\n */\n private disconnectPhoneAudio({\n locusUrl,\n phoneUrl,\n correlationId,\n selfId,\n }: {\n locusUrl: string;\n phoneUrl: string;\n correlationId: string;\n selfId: string;\n }) {\n LoggerProxy.logger.info(\n `Meeting:request#disconnectPhoneAudio --> request phone ${phoneUrl} to leave`,\n correlationId\n );\n const uri = `${locusUrl}/${PARTICIPANT}/${selfId}/${LEAVE}`;\n\n const body = {\n device: {\n deviceType: deviceType.PROVISIONAL,\n url: phoneUrl,\n },\n correlationId,\n };\n\n // @ts-ignore\n return this.locusDeltaRequest({\n method: HTTP_VERBS.PUT,\n uri,\n body,\n }).catch((err) => {\n LoggerProxy.logger.error(\n `Meeting:request#disconnectPhoneAudio --> Error when requesting phone ${phoneUrl} to leave, error ${err}`\n );\n\n throw err;\n });\n }\n\n /**\n * Make a network request to leave a meeting\n * @param {Object} options\n * @param {Url} options.locusUrl\n * @param {String} options.selfId\n * @param {Url} options.deviceUrl\n * @param {String} options.resourceId,\n * @param {String} options.correlationId\n * @returns {Promise}\n */\n leaveMeeting({\n locusUrl,\n selfId,\n deviceUrl: url,\n resourceId,\n correlationId,\n }: {\n locusUrl: string;\n selfId: string;\n deviceUrl: string;\n resourceId: string;\n correlationId: string;\n }) {\n LoggerProxy.logger.info('Meeting:request#leaveMeeting --> Leaving a meeting', correlationId);\n\n const uri = `${locusUrl}/${PARTICIPANT}/${selfId}/${LEAVE}`;\n const body = {\n device: {\n // @ts-ignore\n deviceType: this.config.meetings.deviceType,\n url,\n },\n usingResource: resourceId || null,\n correlationId,\n };\n\n return this.locusDeltaRequest({\n method: HTTP_VERBS.PUT,\n uri,\n body,\n });\n }\n\n /**\n * Make a network request to acknowledge a meeting\n * @param {Object} options\n * @param {String} options.locusUrl\n * @param {String} options.deviceUrl\n * @param {String} options.correlationId\n * @returns {Promise}\n */\n acknowledgeMeeting(options: {locusUrl: string; deviceUrl: string; correlationId: string}) {\n const uri = `${options.locusUrl}/${PARTICIPANT}/${ALERT}`;\n const body = {\n device: {\n // @ts-ignore\n deviceType: this.config.meetings.deviceType,\n url: options.deviceUrl,\n },\n correlationId: options.correlationId,\n };\n\n return this.locusDeltaRequest({\n method: HTTP_VERBS.PUT,\n uri,\n body,\n });\n }\n\n /**\n * Makes a network request to lock the meeting\n * @param {Object} options\n * @param {Boolean} options.lock Whether it is locked or not\n * @returns {Promise}\n */\n lockMeeting(options) {\n const uri = `${options.locusUrl}/${CONTROLS}`;\n const body = {\n lock: {\n locked: options.lock,\n },\n };\n\n return this.locusDeltaRequest({\n method: HTTP_VERBS.PATCH,\n uri,\n body,\n });\n }\n\n /**\n * Make a network request to decline a meeting\n * @param {Object} options\n * @param {String} options.locusUrl\n * @param {String} options.deviceUrl\n * @param {String} options.reason\n * @returns {Promise}\n */\n declineMeeting(options: {locusUrl: string; deviceUrl: string; reason: string}) {\n const uri = `${options.locusUrl}/${PARTICIPANT}/${DECLINE}`;\n const body = {\n device: {\n // @ts-ignore\n deviceType: this.config.meetings.deviceType,\n url: options.deviceUrl,\n },\n ...(options.reason && {reason: options.reason}),\n };\n\n return this.locusDeltaRequest({\n method: HTTP_VERBS.PUT,\n uri,\n body,\n });\n }\n\n /**\n * change the content floor grant\n * @param {Object} options options for floor grant\n * @param {String} options.disposition floor action (granted/released)\n * @param {String} options.personUrl personUrl who is requesting floor\n * @param {String} options.deviceUrl Url of a device\n * @param {String} options.resourceId Populated if you are paired to a device\n * @param {String} options.uri floor grant uri\n * @returns {Promise}\n */\n changeMeetingFloor(\n options:\n | {\n disposition: string;\n personUrl: string;\n deviceUrl: string;\n resourceId: string;\n uri: string;\n annotation: any;\n }\n | any\n ) {\n let floorReq: any = {disposition: options.disposition};\n\n /* istanbul ignore else */\n if (options.disposition === FLOOR_ACTION.GRANTED) {\n floorReq = {\n beneficiary: {\n url: options.personUrl,\n devices: [\n {\n // @ts-ignore\n deviceType: this.config.meetings.deviceType,\n url: options.deviceUrl,\n },\n ],\n },\n disposition: options.disposition,\n requester: {\n url: options.personUrl,\n },\n };\n }\n\n const body: any = {\n floor: floorReq,\n resourceUrl: options.resourceUrl,\n };\n\n if (options?.resourceToken) {\n body.resourceToken = options?.resourceToken;\n }\n if (options?.annotation) {\n body.annotation = options?.annotation;\n }\n\n // @ts-ignore\n return this.request({\n uri: options.uri,\n method: HTTP_VERBS.PUT,\n body,\n });\n }\n\n /**\n * Sends a request to the DTMF endpoint to send tones\n * @param {Object} options\n * @param {String} options.locusUrl\n * @param {String} options.deviceUrl\n * @param {String} options.tones a string of one or more DTMF tones to send\n * @returns {Promise}\n */\n sendDTMF({locusUrl, deviceUrl, tones}: {locusUrl: string; deviceUrl: string; tones: string}) {\n // @ts-ignore\n return this.locusDeltaRequest({\n method: HTTP_VERBS.POST,\n uri: `${locusUrl}/${SEND_DTMF_ENDPOINT}`,\n body: {\n deviceUrl,\n dtmf: {\n correlationId: uuid.v4(),\n tones,\n },\n },\n });\n }\n\n /**\n * Sends a request to the controls endpoint to set the video layout\n * @param {Object} options\n * @param {String} options.locusUrl\n * @param {String} options.deviceUrl\n * @param {String} options.layoutType a layout type that should be available in meeting constants {@link #layout_types}\n * @param {Object} options.main preferred dimensions for the remote main video stream\n * @param {Number} options.main.width preferred width of main video stream\n * @param {Number} options.main.height preferred height of main video stream\n * @param {Object} options.content preferred dimensions for the remote content share stream\n * @param {Number} options.content.width preferred width of content share stream\n * @param {Number} options.content.height preferred height of content share stream\n * @returns {Promise}\n */\n changeVideoLayout({\n locusUrl,\n deviceUrl,\n layoutType,\n main,\n content,\n }: {\n locusUrl: string;\n deviceUrl: string;\n layoutType: string;\n main: {\n width: number;\n height: number;\n };\n content: {\n width: number;\n height: number;\n };\n }) {\n // send main/content renderInfo only if both width and height are specified\n if (main && (!main.width || !main.height)) {\n return Promise.reject(\n new Error(\n `Both width and height must be specified. One of them is missing for main: ${JSON.stringify(\n main\n )}`\n )\n );\n }\n\n if (content && (!content.width || !content.height)) {\n return Promise.reject(\n new Error(\n `Both width and height must be specified. One of them is missing for content: ${JSON.stringify(\n content\n )}`\n )\n );\n }\n\n const renderInfoMain = main ? {width: main.width, height: main.height} : undefined;\n const renderInfoContent = content ? {width: content.width, height: content.height} : undefined;\n\n const layoutParams =\n renderInfoMain || renderInfoContent\n ? {\n renderInfo: {\n main: renderInfoMain,\n content: renderInfoContent,\n },\n }\n : undefined;\n\n // @ts-ignore\n return this.locusDeltaRequest({\n method: HTTP_VERBS.PUT,\n uri: `${locusUrl}/${CONTROLS}`,\n body: {\n layout: {\n deviceUrl,\n type: layoutType,\n layoutParams,\n },\n },\n });\n }\n\n /**\n * Make a network request to end meeting for all\n * @param {Object} options\n * @param {Url} options.locusUrl\n * @returns {Promise}\n */\n endMeetingForAll({locusUrl}: {locusUrl: string}) {\n const uri = `${locusUrl}/${END}`;\n\n // @ts-ignore\n return this.locusDeltaRequest({\n method: HTTP_VERBS.POST,\n uri,\n });\n }\n\n /**\n * Send a locus keepAlive (used in lobby)\n * @param {Object} options\n * @param {Url} options.keepAliveUrl\n * @returns {Promise}\n */\n keepAlive({keepAliveUrl}: {keepAliveUrl: string}) {\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.GET,\n uri: keepAliveUrl,\n });\n }\n\n /**\n * Make a network request to send a reaction.\n * @param {Object} options\n * @param {Url} options.reactionChannelUrl\n * @param {Reaction} options.reaction\n * @param {string} options.senderID\n * @returns {Promise}\n */\n sendReaction({reactionChannelUrl, reaction, participantId}: SendReactionOptions) {\n const uri = reactionChannelUrl;\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.POST,\n uri,\n body: {\n sender: {participantId},\n reaction,\n },\n });\n }\n\n /**\n * Make a network request to enable or disable reactions.\n * @param {boolean} options.enable - determines if we need to enable or disable.\n * @param {locusUrl} options.locusUrl\n * @returns {Promise}\n */\n toggleReactions({enable, locusUrl, requestingParticipantId}: ToggleReactionsOptions) {\n const uri = `${locusUrl}/${CONTROLS}`;\n\n // @ts-ignore\n return this.locusDeltaRequest({\n method: HTTP_VERBS.PUT,\n uri,\n body: {\n reactions: {\n enabled: enable,\n },\n requestingParticipantId,\n },\n });\n }\n\n getLocusStatusByUrl(locusUrl: string) {\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.GET,\n uri: locusUrl,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAGA;AAEA;AAEA;AACA;AAsBA;AAAiC;AAAA;AAAA;AAAA;AAAA;AAEjC;AACA;AACA;AAFA,IAGqBA,cAAc;EAAA;EAAA;EAKjC;AACF;AACA;AACA;AACA;EACE,wBAAYC,KAAU,EAAEC,OAAY,EAAE;IAAA;IAAA;IACpC,IAAOC,OAAO,GAAmBF,KAAK,CAA/BE,OAAO;MAAKC,UAAU,0CAAIH,KAAK;IAEtC,0BAAMG,UAAU,EAAEF,OAAO;IAAE;IAAA;IAAA;IAAA,iLAcL;MAAA;MAAA;QAAA;UAAA;YAAA;YAAA,OAEM,MAAKG,KAAK,CAACC,cAAc,CAClDC,GAAG,CAACC,uBAAY,CAACC,SAAS,EAAED,uBAAY,CAACE,sBAAsB,CAAC,CAChEC,KAAK,CAAC,YAAM,CAAC,CAAC,CAAC;UAAA;YAFZC,aAAa;YAAA,KAIfA,aAAa;cAAA;cAAA;YAAA;YAAA;YAEPC,U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