@webex/internal-plugin-locus 3.0.0-beta.2 → 3.0.0-beta.20
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/README.md +1 -3
- package/dist/event-keys.js +1 -3
- package/dist/event-keys.js.map +1 -1
- package/dist/index.js +1 -20
- package/dist/index.js.map +1 -1
- package/dist/locus.js +28 -115
- package/dist/locus.js.map +1 -1
- package/package.json +6 -6
- package/src/event-keys.js +1 -1
- package/src/index.js +1 -9
- package/src/locus.js +144 -129
- package/test/unit/lib/BasicSeqCmp.json +88 -430
- package/test/unit/lib/SeqCmp.json +513 -685
- package/test/unit/spec/locus.js +4 -4
package/dist/locus.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["USE_INCOMING","USE_CURRENT","EQUAL","FETCH","GREATER_THAN","LESS_THAN","DESYNC","compareToAction","result","Error","Locus","WebexPlugin","extend","namespace","alert","locus","request","method","uri","url","body","deviceUrl","webex","internal","device","sequence","then","res","compare","current","incoming","isEmpty","entries","length","rangeStart","rangeEnd","baseSequence","compareDelta","compareSequence","ret","getEntriesFirstValue","getEntriesLastValue","getCompareFirstValue","getCompareLastValue","inRange","entry","currentOnlyEntries","incomingOnlyEntries","currentOnly","incomingOnly","i","push","create","invitee","options","correlationId","service","resource","localMedias","localSdp","type","sdp","self","devices","map","item","index","mediaConnections","createOrJoin","target","join","decline","catch","reason","WebexHttpError","Conflict","get","reject","getCallHistory","from","Date","toISOString","qs","leave","list","loci","merge","next","forEach","key","participants","toRemove","toUpsert","p","removed","add","set","reduce","acc","has","value","releaseFloorGrant","share","floor","disposition","requestFloorGrant","beneficiary","sendDtmf","tones","dtmf","uuid","v4","sync","syncUrl","updateMedia","audioMuted","videoMuted","mediaId"],"sources":["locus.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {WebexPlugin, WebexHttpError} from '@webex/webex-core';\nimport {cloneDeep, difference, first, last, memoize} from 'lodash';\nimport uuid from 'uuid';\n\nexport const USE_INCOMING = 'USE_INCOMING';\nexport const USE_CURRENT = 'USE_CURRENT';\nexport const EQUAL = 'EQUAL';\nexport const FETCH = 'FETCH';\nexport const GREATER_THAN = 'GREATER_THAN';\nexport const LESS_THAN = 'LESS_THAN';\nexport const DESYNC = 'DESYNC';\n\n/**\n * Transates the result of a sequence comparison into an intended behavior\n * @param {string} result\n * @private\n * @returns {string}\n */\nfunction compareToAction(result) {\n switch (result) {\n case EQUAL:\n case GREATER_THAN:\n return USE_CURRENT;\n case LESS_THAN:\n return USE_INCOMING;\n case DESYNC:\n return FETCH;\n default:\n throw new Error(`${result} is not a recognized sequence comparison result`);\n }\n}\n\n/**\n * @class\n */\nconst Locus = WebexPlugin.extend({\n namespace: 'Locus',\n\n /**\n * Alert the specified locus that the local user has been notified of the\n * locus's active state\n * @instance\n * @memberof Locus\n * @param {Types~Locus} locus\n * @returns {Promise}\n */\n alert(locus) {\n return this.request({\n method: 'PUT',\n uri: `${locus.url}/participant/alert`,\n body: {\n deviceUrl: this.webex.internal.device.url,\n sequence: locus.sequence\n }\n })\n .then((res) => res.body);\n },\n\n\n /**\n * Compares two loci to determine which one contains the most recent state\n * @instance\n * @memberof Locus\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {string} one of USE_INCOMING, USE_CURRENT, or FETCH\n */\n compare(current, incoming) {\n /**\n * Determines if a paricular locus's sequence is empty\n * @param {Types~Locus} locus\n * @private\n * @returns {bool}\n */\n function isEmpty(locus) {\n const {sequence} = locus;\n\n return (!sequence.entries || !sequence.entries.length) && sequence.rangeStart === 0 && sequence.rangeEnd === 0;\n }\n\n if (isEmpty(current) || isEmpty(incoming)) {\n return USE_INCOMING;\n }\n\n if (incoming.baseSequence) {\n return this.compareDelta(current, incoming);\n }\n\n return compareToAction(this.compareSequence(current.sequence, incoming.sequence));\n },\n\n /**\n * Compares two loci sequences (with delta params) and indicates what action\n * to take.\n * @instance\n * @memberof Locus\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @private\n * @returns {string} one of USE_INCOMING, USE_CURRENT, or FETCH\n */\n compareDelta(current, incoming) {\n let ret = this.compareSequence(current.sequence, incoming.sequence);\n\n if (ret !== LESS_THAN) {\n return compareToAction(ret);\n }\n\n ret = this.compareSequence(current.sequence, incoming.baseSequence);\n\n switch (ret) {\n case GREATER_THAN:\n case EQUAL:\n return USE_INCOMING;\n default:\n return FETCH;\n }\n },\n\n /**\n * Compares two Locus sequences\n * @instance\n * @memberof Locus\n * @param {LocusSequence} current\n * @param {LocusSequence} incoming\n * @returns {string} one of LESS_THAN, GREATER_THAN, EQUAL, or DESYNC\n */\n compareSequence(current, incoming) {\n if (!current) {\n throw new Error('`current` is required');\n }\n\n if (!incoming) {\n throw new Error('`incoming` is required');\n }\n // complexity here is unavoidable\n /* eslint complexity: [0] */\n /* eslint max-statements: [0] */\n\n // must pick one of arrow-body-style or no-confusing-arrow to disable\n /* eslint arrow-body-style: [0] */\n\n // after running the #compare() test suite in a loop, there doesn't seem to\n // be any appreciable difference when used with or without memoize; since\n // real locus sequences are likely to contain more sequence numbers than\n // those in the test suite, I have to assume memoize can only help and the\n // overhead of memoizing these methods is not a problem.\n\n const getEntriesFirstValue = memoize((sequence) => {\n return sequence.entries.length === 0 ? 0 : first(sequence.entries);\n });\n const getEntriesLastValue = memoize((sequence) => {\n return sequence.entries.length === 0 ? 0 : last(sequence.entries);\n });\n const getCompareFirstValue = memoize((sequence) => {\n return sequence.rangeStart || getEntriesFirstValue(sequence);\n });\n const getCompareLastValue = memoize((sequence) => {\n return getEntriesLastValue(sequence) || sequence.rangeEnd;\n });\n\n /**\n * @param {number} entry\n * @param {LocusSequence} sequence\n * @private\n * @returns {Boolean}\n */\n function inRange(entry, sequence) {\n return entry >= sequence.rangeStart && entry <= sequence.rangeEnd;\n }\n\n if (getCompareFirstValue(current) > getCompareLastValue(incoming)) {\n return GREATER_THAN;\n }\n\n if (getCompareLastValue(current) < getCompareFirstValue(incoming)) {\n return LESS_THAN;\n }\n\n const currentOnlyEntries = difference(current.entries, incoming.entries);\n const incomingOnlyEntries = difference(incoming.entries, current.entries);\n const currentOnly = [];\n const incomingOnly = [];\n\n for (const i of currentOnlyEntries) {\n if (!inRange(i, incoming)) {\n currentOnly.push(i);\n }\n }\n for (const i of incomingOnlyEntries) {\n if (!inRange(i, current)) {\n incomingOnly.push(i);\n }\n }\n\n if (!currentOnly.length && !incomingOnly.length) {\n if (current.rangeEnd - getCompareFirstValue(current) > incoming.rangeEnd - getCompareFirstValue(incoming)) {\n return GREATER_THAN;\n }\n\n if (current.rangeEnd - getCompareFirstValue(current) < incoming.rangeEnd - getCompareFirstValue(incoming)) {\n return LESS_THAN;\n }\n\n return EQUAL;\n }\n\n if (currentOnly.length && !incomingOnly.length) {\n return GREATER_THAN;\n }\n\n if (!currentOnly.length && incomingOnly.length) {\n return LESS_THAN;\n }\n\n if (!current.rangeStart && !current.rangeEnd && !incoming.rangeStart && !incoming.rangeEnd) {\n return DESYNC;\n }\n\n for (const i of currentOnly) {\n if (getCompareFirstValue(incoming) < i && i < getCompareLastValue(incoming)) {\n return DESYNC;\n }\n }\n\n for (const i of incomingOnly) {\n if (getCompareFirstValue(current) < i && i < getCompareLastValue(current)) {\n return DESYNC;\n }\n }\n\n if (currentOnly[0] > incomingOnly[0]) {\n return GREATER_THAN;\n }\n\n return LESS_THAN;\n },\n\n /**\n * Calls the specified invitee and offers the specified media via\n * options.localSdp\n * @instance\n * @memberof Locus\n * @param {string} invitee\n * @param {Object} options\n * @param {Object} options.localSdp\n * @returns {Promise<Types~Locus>}\n */\n create(invitee, options = {}) {\n const {correlationId} = options;\n\n if (!correlationId) {\n throw new Error('options.correlationId is required');\n }\n\n return this.request({\n method: 'POST',\n service: 'locus',\n resource: 'loci/call',\n body: {\n correlationId,\n deviceUrl: this.webex.internal.device.url,\n invitee: {\n invitee\n },\n localMedias: [{\n localSdp: JSON.stringify({\n type: 'SDP',\n sdp: options.localSdp\n })\n }],\n sequence: {\n entries: [],\n rangeStart: 0,\n rangeEnd: 0\n }\n }\n })\n // res.body.mediaConnections is deprecated so just return the locus\n .then((res) => {\n res.body.locus.self.devices.map((item, index) => {\n item.mediaConnections = [res.body.mediaConnections[index]];\n\n return item;\n });\n\n return res.body.locus;\n });\n },\n\n /**\n * This is mostly an internal function to simplify the phone plugin. Decides\n * which path to call based on the type of the thing being joined.\n * @instance\n * @memberof Locus\n * @param {Object|Types~Locus} target\n * @param {Object} options\n * @private\n * @returns {Promise<Types~Locus>}\n */\n createOrJoin(target, options) {\n if (target.url) {\n return this.join(target, options);\n }\n\n return this.create(target, options);\n },\n\n /**\n * Decline to join the specified Locus\n * @instance\n * @memberof Locus\n * @param {Types~Locus} locus\n * @returns {Promise<Types~Locus>}\n */\n decline(locus) {\n return this.request({\n method: 'PUT',\n uri: `${locus.url}/participant/decline`,\n body: {\n deviceUrl: this.webex.internal.device.url,\n sequence: locus.sequence\n }\n })\n .then((res) => res.body)\n .catch((reason) => {\n if (reason instanceof WebexHttpError.Conflict) {\n return this.get(locus);\n }\n\n return Promise.reject(reason);\n });\n },\n\n /**\n * Retrieves a single Locus\n * @instance\n * @memberof Locus\n * @param {Types~Locus} locus\n * @returns {Types~Locus}\n */\n get(locus) {\n return this.request({\n method: 'GET',\n uri: `${locus.url}`\n })\n .then((res) => res.body);\n },\n\n /**\n * Retrieves the call history for the current user\n * @instance\n * @memberof Locus\n * @param {Object} options\n * @param {Date|number} options.from\n * @returns {Promise<Object>}\n */\n getCallHistory(options = {}) {\n const from = (new Date(options.from || Date.now())).toISOString();\n\n return this.request({\n method: 'GET',\n service: 'janus',\n resource: 'history/userSessions',\n qs: {from}\n })\n .then((res) => res.body);\n },\n\n /**\n * Join the specified Locus and offer to send it media\n * @instance\n * @memberof Locus\n * @param {Types~Locus} locus\n * @param {Object} options\n * @param {Object} options.localSdp\n * @returns {Types~Locus}\n */\n join(locus, options = {}) {\n const correlationId = locus.correlationId || options.correlationId;\n\n if (!correlationId) {\n throw new Error('locus.correlationId or options.correlationId is required');\n }\n\n return this.request({\n method: 'POST',\n uri: `${locus.url}/participant`,\n body: {\n correlationId,\n deviceUrl: this.webex.internal.device.url,\n localMedias: [{\n localSdp: JSON.stringify({\n type: 'SDP',\n sdp: options.localSdp\n })\n }],\n sequence: locus.sequence || {\n entries: [],\n rangeStart: 0,\n rangeEnd: 0\n }\n }\n })\n // The mediaConnections object is deprecated, so just return the locus\n .then((res) => {\n res.body.locus.self.devices.map((item, index) => {\n item.mediaConnections = [res.body.mediaConnections[index]];\n\n return item;\n });\n\n return res.body.locus;\n });\n },\n\n /**\n * Leave the specified Locus\n * @instance\n * @memberof Locus\n * @param {Types~Locus} locus\n * @returns {Promise<Types~Locus>}\n */\n leave(locus) {\n return this.request({\n method: 'PUT',\n uri: `${locus.self.url}/leave`,\n body: {\n deviceUrl: this.webex.internal.device.url,\n sequence: locus.sequence\n }\n })\n .then((res) => res.body.locus)\n .catch((reason) => {\n if (reason instanceof WebexHttpError.Conflict) {\n return this.get(locus);\n }\n\n return Promise.reject(reason);\n });\n },\n\n /**\n * Lists active loci\n * @instance\n * @memberof Locus\n * @returns {Promise<Array<Types~Locus>>}\n */\n list() {\n return this.request({\n method: 'GET',\n service: 'locus',\n resource: 'loci'\n })\n .then((res) => res.body.loci);\n },\n\n /**\n * Merges two locus DTOs (for the same locus)\n * @instance\n * @memberof Locus\n * @param {Types~Locus} current\n * @param {Types~Locus|Types~LocusDelta} incoming\n * @returns {Type~Locus}\n */\n merge(current, incoming) {\n // if incoming is not a delta event, treat it as a new full locus.\n if (!incoming.baseSequence) {\n return incoming;\n }\n\n const next = cloneDeep(current);\n\n // 1. All non-null elements in the delta event except the \"baseSequence\" and\n // the \"participants\" collection should be used to replace their existing\n // values.\n Object.keys(incoming).forEach((key) => {\n if (key === 'baseSequence' || key === 'participants') {\n return;\n }\n\n next[key] = incoming[key] || next[key];\n });\n\n // 2. The \"baseSequence\" in the delta event can be discarded (it doesn't\n // need to be maintained in the local working copy).\n\n if (incoming.participants || incoming.participants.length) {\n const toRemove = new Set();\n const toUpsert = new Map();\n\n incoming.participants.forEach((p) => {\n if (p.removed) {\n // Elements of the delta event's \"participants\" list with the\n // attribute `removed=true` should be removed from the working copy's\n // \"participants\" collection.\n toRemove.add(p.url);\n }\n else {\n // Elements of the delta events \"participants\" list that are absent\n // from the local working copy should be added to that collection.\n toUpsert.set(p.url, p);\n }\n });\n\n // The \"participants\" collection in the delta event should be merged with\n // that of the local working copy of the Locus such that elements in the\n // delta event's \"participants\" replace those with the same url value in\n // the working copy \"participants\" collection.\n const participants = next.participants.reduce((acc, p) => {\n if (!toRemove.has(p.url)) {\n acc[p.url] = p;\n }\n\n return acc;\n }, {});\n\n toUpsert.forEach((value, key) => {\n participants[key] = value;\n });\n\n next.participants = Object.values(participants);\n }\n\n return next;\n },\n\n /**\n * Signals to locus that the current user is done sharing their additional\n * media stream\n * @param {Types~Locus} locus\n * @param {Types~MediaShare} share\n * @returns {Promise}\n */\n releaseFloorGrant(locus, share) {\n return this.webex.request({\n uri: share.url,\n method: 'PUT',\n body: {\n floor: {\n disposition: 'RELEASED'\n }\n }\n })\n .then(({body}) => body);\n },\n\n /**\n * Signals to locus that the current user would like to share an additional\n * media stream\n * @param {Types~Locus} locus\n * @param {Types~MediaShare} share\n * @returns {Promise}\n */\n requestFloorGrant(locus, share) {\n return this.webex.request({\n uri: share.url,\n method: 'PUT',\n body: {\n floor: {\n beneficiary: {\n url: locus.self.url,\n devices: [{url: this.webex.internal.device.url}]\n },\n disposition: 'GRANTED'\n }\n }\n })\n .then(({body}) => body);\n },\n\n /**\n * Sends a string of DTMF tones to the locus\n * @instance\n * @memberof Locus\n * @param {Types~Locus} locus\n * @param {string} tones\n * @returns {Promise}\n */\n sendDtmf(locus, tones) {\n return this.request({\n method: 'POST',\n uri: `${locus.self.url}/sendDtmf`,\n body: {\n deviceUrl: this.webex.internal.device.url,\n dtmf: {\n correlationId: uuid.v4(),\n tones\n }\n }\n });\n },\n\n /**\n * Fetches the delta for the locus from its syncUrl. *Does not merge*\n * @instance\n * @memberof Locus\n * @param {Types~Locus} locus\n * @returns {Types~LocusDelta}\n */\n sync(locus) {\n return this.request({\n method: 'GET',\n uri: locus.syncUrl\n })\n // the api may return a 204 no content, so we'll give back an empty\n // object in that case.\n .then((res) => res.body || {});\n },\n\n /**\n * Send a new sdp to Linus via the Locus API to update media state (e.g. to\n * start or stop sending audio or video)\n * @instance\n * @memberof Locus\n * @param {Types~Locus} locus\n * @param {Object} options\n * @param {string} options.localSdp\n * @param {string} options.mediaId\n * @param {Boolean} options.audioMuted\n * @param {Boolean} options.videoMuted\n * @returns {Promise<Types~Locus>}\n */\n updateMedia(locus, {\n sdp, audioMuted, videoMuted, mediaId\n }) {\n const localSdp = {\n audioMuted,\n videoMuted\n };\n\n if (sdp) {\n localSdp.type = 'SDP';\n localSdp.sdp = sdp;\n }\n\n return this.request({\n method: 'PUT',\n uri: `${locus.self.url}/media`,\n body: {\n deviceUrl: this.webex.internal.device.url,\n localMedias: [{\n localSdp: JSON.stringify(localSdp),\n mediaId\n }],\n sequence: locus.sequence\n }\n })\n .then((res) => res.body.locus);\n }\n});\n\nexport default Locus;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAEA;;;;;;;;AAEO,IAAMA,YAAY,GAAG,cAArB;;AACA,IAAMC,WAAW,GAAG,aAApB;;AACA,IAAMC,KAAK,GAAG,OAAd;;AACA,IAAMC,KAAK,GAAG,OAAd;;AACA,IAAMC,YAAY,GAAG,cAArB;;AACA,IAAMC,SAAS,GAAG,WAAlB;;AACA,IAAMC,MAAM,GAAG,QAAf;AAEP;AACA;AACA;AACA;AACA;AACA;;;;AACA,SAASC,eAAT,CAAyBC,MAAzB,EAAiC;EAC/B,QAAQA,MAAR;IACE,KAAKN,KAAL;IACA,KAAKE,YAAL;MACE,OAAOH,WAAP;;IACF,K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;IALK,CAMJvF,IANI,CAMC,UAACC,GAAD;MAAA,OAASA,GAAG,CAACP,IAAJ,IAAY,EAArB;IAAA,CAND,CAAP;EAOD,CA7jB8B;;EA+jB/B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE8F,WA5kB+B,uBA4kBnBnG,KA5kBmB,SA8kB5B;IAAA,IADD8C,GACC,SADDA,GACC;IAAA,IADIsD,UACJ,SADIA,UACJ;IAAA,IADgBC,UAChB,SADgBA,UAChB;IAAA,IAD4BC,OAC5B,SAD4BA,OAC5B;IACD,IAAM1D,QAAQ,GAAG;MACfwD,UAAU,EAAVA,UADe;MAEfC,UAAU,EAAVA;IAFe,CAAjB;;IAKA,IAAIvD,GAAJ,EAAS;MACPF,QAAQ,CAACC,IAAT,GAAgB,KAAhB;MACAD,QAAQ,CAACE,GAAT,GAAeA,GAAf;IACD;;IAED,OAAO,KAAK7C,OAAL,CAAa;MAClBC,MAAM,EAAE,KADU;MAElBC,GAAG,YAAKH,KAAK,CAAC+C,IAAN,CAAW3C,GAAhB,WAFe;MAGlBC,IAAI,EAAE;QACJC,SAAS,EAAE,KAAKC,KAAL,CAAWC,QAAX,CAAoBC,MAApB,CAA2BL,GADlC;QAEJuC,WAAW,EAAE,CAAC;UACZC,QAAQ,EAAE,wBAAeA,QAAf,CADE;UAEZ0D,OAAO,EAAPA;QAFY,CAAD,CAFT;QAMJ5F,QAAQ,EAAEV,KAAK,CAACU;MANZ;IAHY,CAAb,EAYJC,IAZI,CAYC,UAACC,GAAD;MAAA,OAASA,GAAG,CAACP,IAAJ,CAASL,KAAlB;IAAA,CAZD,CAAP;EAaD,CAtmB8B;EAAA;AAAA,CAAnB,CAAd;;eAymBeL,K"}
|
|
1
|
+
{"version":3,"names":["USE_INCOMING","USE_CURRENT","EQUAL","FETCH","GREATER_THAN","LESS_THAN","DESYNC","compareToAction","result","Error","Locus","WebexPlugin","extend","namespace","alert","locus","request","method","uri","url","body","deviceUrl","webex","internal","device","sequence","then","res","compare","current","incoming","isEmpty","entries","length","rangeStart","rangeEnd","baseSequence","compareDelta","compareSequence","ret","getEntriesFirstValue","getEntriesLastValue","getCompareFirstValue","getCompareLastValue","inRange","entry","currentOnlyEntries","incomingOnlyEntries","currentOnly","incomingOnly","i","push","create","invitee","options","correlationId","service","resource","localMedias","localSdp","type","sdp","self","devices","map","item","index","mediaConnections","createOrJoin","target","join","decline","catch","reason","WebexHttpError","Conflict","get","reject","getCallHistory","from","Date","toISOString","qs","leave","list","loci","merge","next","forEach","key","participants","toRemove","toUpsert","p","removed","add","set","reduce","acc","has","value","releaseFloorGrant","share","floor","disposition","requestFloorGrant","beneficiary","sendDtmf","tones","dtmf","uuid","v4","sync","syncUrl","updateMedia","audioMuted","videoMuted","mediaId"],"sources":["locus.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {WebexPlugin, WebexHttpError} from '@webex/webex-core';\nimport {cloneDeep, difference, first, last, memoize} from 'lodash';\nimport uuid from 'uuid';\n\nexport const USE_INCOMING = 'USE_INCOMING';\nexport const USE_CURRENT = 'USE_CURRENT';\nexport const EQUAL = 'EQUAL';\nexport const FETCH = 'FETCH';\nexport const GREATER_THAN = 'GREATER_THAN';\nexport const LESS_THAN = 'LESS_THAN';\nexport const DESYNC = 'DESYNC';\n\n/**\n * Transates the result of a sequence comparison into an intended behavior\n * @param {string} result\n * @private\n * @returns {string}\n */\nfunction compareToAction(result) {\n switch (result) {\n case EQUAL:\n case GREATER_THAN:\n return USE_CURRENT;\n case LESS_THAN:\n return USE_INCOMING;\n case DESYNC:\n return FETCH;\n default:\n throw new Error(`${result} is not a recognized sequence comparison result`);\n }\n}\n\n/**\n * @class\n */\nconst Locus = WebexPlugin.extend({\n namespace: 'Locus',\n\n /**\n * Alert the specified locus that the local user has been notified of the\n * locus's active state\n * @instance\n * @memberof Locus\n * @param {Types~Locus} locus\n * @returns {Promise}\n */\n alert(locus) {\n return this.request({\n method: 'PUT',\n uri: `${locus.url}/participant/alert`,\n body: {\n deviceUrl: this.webex.internal.device.url,\n sequence: locus.sequence,\n },\n }).then((res) => res.body);\n },\n\n /**\n * Compares two loci to determine which one contains the most recent state\n * @instance\n * @memberof Locus\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {string} one of USE_INCOMING, USE_CURRENT, or FETCH\n */\n compare(current, incoming) {\n /**\n * Determines if a paricular locus's sequence is empty\n * @param {Types~Locus} locus\n * @private\n * @returns {bool}\n */\n function isEmpty(locus) {\n const {sequence} = locus;\n\n return (\n (!sequence.entries || !sequence.entries.length) &&\n sequence.rangeStart === 0 &&\n sequence.rangeEnd === 0\n );\n }\n\n if (isEmpty(current) || isEmpty(incoming)) {\n return USE_INCOMING;\n }\n\n if (incoming.baseSequence) {\n return this.compareDelta(current, incoming);\n }\n\n return compareToAction(this.compareSequence(current.sequence, incoming.sequence));\n },\n\n /**\n * Compares two loci sequences (with delta params) and indicates what action\n * to take.\n * @instance\n * @memberof Locus\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @private\n * @returns {string} one of USE_INCOMING, USE_CURRENT, or FETCH\n */\n compareDelta(current, incoming) {\n let ret = this.compareSequence(current.sequence, incoming.sequence);\n\n if (ret !== LESS_THAN) {\n return compareToAction(ret);\n }\n\n ret = this.compareSequence(current.sequence, incoming.baseSequence);\n\n switch (ret) {\n case GREATER_THAN:\n case EQUAL:\n return USE_INCOMING;\n default:\n return FETCH;\n }\n },\n\n /**\n * Compares two Locus sequences\n * @instance\n * @memberof Locus\n * @param {LocusSequence} current\n * @param {LocusSequence} incoming\n * @returns {string} one of LESS_THAN, GREATER_THAN, EQUAL, or DESYNC\n */\n compareSequence(current, incoming) {\n if (!current) {\n throw new Error('`current` is required');\n }\n\n if (!incoming) {\n throw new Error('`incoming` is required');\n }\n // complexity here is unavoidable\n /* eslint complexity: [0] */\n /* eslint max-statements: [0] */\n\n // must pick one of arrow-body-style or no-confusing-arrow to disable\n /* eslint arrow-body-style: [0] */\n\n // after running the #compare() test suite in a loop, there doesn't seem to\n // be any appreciable difference when used with or without memoize; since\n // real locus sequences are likely to contain more sequence numbers than\n // those in the test suite, I have to assume memoize can only help and the\n // overhead of memoizing these methods is not a problem.\n\n const getEntriesFirstValue = memoize((sequence) => {\n return sequence.entries.length === 0 ? 0 : first(sequence.entries);\n });\n const getEntriesLastValue = memoize((sequence) => {\n return sequence.entries.length === 0 ? 0 : last(sequence.entries);\n });\n const getCompareFirstValue = memoize((sequence) => {\n return sequence.rangeStart || getEntriesFirstValue(sequence);\n });\n const getCompareLastValue = memoize((sequence) => {\n return getEntriesLastValue(sequence) || sequence.rangeEnd;\n });\n\n /**\n * @param {number} entry\n * @param {LocusSequence} sequence\n * @private\n * @returns {Boolean}\n */\n function inRange(entry, sequence) {\n return entry >= sequence.rangeStart && entry <= sequence.rangeEnd;\n }\n\n if (getCompareFirstValue(current) > getCompareLastValue(incoming)) {\n return GREATER_THAN;\n }\n\n if (getCompareLastValue(current) < getCompareFirstValue(incoming)) {\n return LESS_THAN;\n }\n\n const currentOnlyEntries = difference(current.entries, incoming.entries);\n const incomingOnlyEntries = difference(incoming.entries, current.entries);\n const currentOnly = [];\n const incomingOnly = [];\n\n for (const i of currentOnlyEntries) {\n if (!inRange(i, incoming)) {\n currentOnly.push(i);\n }\n }\n for (const i of incomingOnlyEntries) {\n if (!inRange(i, current)) {\n incomingOnly.push(i);\n }\n }\n\n if (!currentOnly.length && !incomingOnly.length) {\n if (\n current.rangeEnd - getCompareFirstValue(current) >\n incoming.rangeEnd - getCompareFirstValue(incoming)\n ) {\n return GREATER_THAN;\n }\n\n if (\n current.rangeEnd - getCompareFirstValue(current) <\n incoming.rangeEnd - getCompareFirstValue(incoming)\n ) {\n return LESS_THAN;\n }\n\n return EQUAL;\n }\n\n if (currentOnly.length && !incomingOnly.length) {\n return GREATER_THAN;\n }\n\n if (!currentOnly.length && incomingOnly.length) {\n return LESS_THAN;\n }\n\n if (!current.rangeStart && !current.rangeEnd && !incoming.rangeStart && !incoming.rangeEnd) {\n return DESYNC;\n }\n\n for (const i of currentOnly) {\n if (getCompareFirstValue(incoming) < i && i < getCompareLastValue(incoming)) {\n return DESYNC;\n }\n }\n\n for (const i of incomingOnly) {\n if (getCompareFirstValue(current) < i && i < getCompareLastValue(current)) {\n return DESYNC;\n }\n }\n\n if (currentOnly[0] > incomingOnly[0]) {\n return GREATER_THAN;\n }\n\n return LESS_THAN;\n },\n\n /**\n * Calls the specified invitee and offers the specified media via\n * options.localSdp\n * @instance\n * @memberof Locus\n * @param {string} invitee\n * @param {Object} options\n * @param {Object} options.localSdp\n * @returns {Promise<Types~Locus>}\n */\n create(invitee, options = {}) {\n const {correlationId} = options;\n\n if (!correlationId) {\n throw new Error('options.correlationId is required');\n }\n\n return (\n this.request({\n method: 'POST',\n service: 'locus',\n resource: 'loci/call',\n body: {\n correlationId,\n deviceUrl: this.webex.internal.device.url,\n invitee: {\n invitee,\n },\n localMedias: [\n {\n localSdp: JSON.stringify({\n type: 'SDP',\n sdp: options.localSdp,\n }),\n },\n ],\n sequence: {\n entries: [],\n rangeStart: 0,\n rangeEnd: 0,\n },\n },\n })\n // res.body.mediaConnections is deprecated so just return the locus\n .then((res) => {\n res.body.locus.self.devices.map((item, index) => {\n item.mediaConnections = [res.body.mediaConnections[index]];\n\n return item;\n });\n\n return res.body.locus;\n })\n );\n },\n\n /**\n * This is mostly an internal function to simplify the phone plugin. Decides\n * which path to call based on the type of the thing being joined.\n * @instance\n * @memberof Locus\n * @param {Object|Types~Locus} target\n * @param {Object} options\n * @private\n * @returns {Promise<Types~Locus>}\n */\n createOrJoin(target, options) {\n if (target.url) {\n return this.join(target, options);\n }\n\n return this.create(target, options);\n },\n\n /**\n * Decline to join the specified Locus\n * @instance\n * @memberof Locus\n * @param {Types~Locus} locus\n * @returns {Promise<Types~Locus>}\n */\n decline(locus) {\n return this.request({\n method: 'PUT',\n uri: `${locus.url}/participant/decline`,\n body: {\n deviceUrl: this.webex.internal.device.url,\n sequence: locus.sequence,\n },\n })\n .then((res) => res.body)\n .catch((reason) => {\n if (reason instanceof WebexHttpError.Conflict) {\n return this.get(locus);\n }\n\n return Promise.reject(reason);\n });\n },\n\n /**\n * Retrieves a single Locus\n * @instance\n * @memberof Locus\n * @param {Types~Locus} locus\n * @returns {Types~Locus}\n */\n get(locus) {\n return this.request({\n method: 'GET',\n uri: `${locus.url}`,\n }).then((res) => res.body);\n },\n\n /**\n * Retrieves the call history for the current user\n * @instance\n * @memberof Locus\n * @param {Object} options\n * @param {Date|number} options.from\n * @returns {Promise<Object>}\n */\n getCallHistory(options = {}) {\n const from = new Date(options.from || Date.now()).toISOString();\n\n return this.request({\n method: 'GET',\n service: 'janus',\n resource: 'history/userSessions',\n qs: {from},\n }).then((res) => res.body);\n },\n\n /**\n * Join the specified Locus and offer to send it media\n * @instance\n * @memberof Locus\n * @param {Types~Locus} locus\n * @param {Object} options\n * @param {Object} options.localSdp\n * @returns {Types~Locus}\n */\n join(locus, options = {}) {\n const correlationId = locus.correlationId || options.correlationId;\n\n if (!correlationId) {\n throw new Error('locus.correlationId or options.correlationId is required');\n }\n\n return (\n this.request({\n method: 'POST',\n uri: `${locus.url}/participant`,\n body: {\n correlationId,\n deviceUrl: this.webex.internal.device.url,\n localMedias: [\n {\n localSdp: JSON.stringify({\n type: 'SDP',\n sdp: options.localSdp,\n }),\n },\n ],\n sequence: locus.sequence || {\n entries: [],\n rangeStart: 0,\n rangeEnd: 0,\n },\n },\n })\n // The mediaConnections object is deprecated, so just return the locus\n .then((res) => {\n res.body.locus.self.devices.map((item, index) => {\n item.mediaConnections = [res.body.mediaConnections[index]];\n\n return item;\n });\n\n return res.body.locus;\n })\n );\n },\n\n /**\n * Leave the specified Locus\n * @instance\n * @memberof Locus\n * @param {Types~Locus} locus\n * @returns {Promise<Types~Locus>}\n */\n leave(locus) {\n return this.request({\n method: 'PUT',\n uri: `${locus.self.url}/leave`,\n body: {\n deviceUrl: this.webex.internal.device.url,\n sequence: locus.sequence,\n },\n })\n .then((res) => res.body.locus)\n .catch((reason) => {\n if (reason instanceof WebexHttpError.Conflict) {\n return this.get(locus);\n }\n\n return Promise.reject(reason);\n });\n },\n\n /**\n * Lists active loci\n * @instance\n * @memberof Locus\n * @returns {Promise<Array<Types~Locus>>}\n */\n list() {\n return this.request({\n method: 'GET',\n service: 'locus',\n resource: 'loci',\n }).then((res) => res.body.loci);\n },\n\n /**\n * Merges two locus DTOs (for the same locus)\n * @instance\n * @memberof Locus\n * @param {Types~Locus} current\n * @param {Types~Locus|Types~LocusDelta} incoming\n * @returns {Type~Locus}\n */\n merge(current, incoming) {\n // if incoming is not a delta event, treat it as a new full locus.\n if (!incoming.baseSequence) {\n return incoming;\n }\n\n const next = cloneDeep(current);\n\n // 1. All non-null elements in the delta event except the \"baseSequence\" and\n // the \"participants\" collection should be used to replace their existing\n // values.\n Object.keys(incoming).forEach((key) => {\n if (key === 'baseSequence' || key === 'participants') {\n return;\n }\n\n next[key] = incoming[key] || next[key];\n });\n\n // 2. The \"baseSequence\" in the delta event can be discarded (it doesn't\n // need to be maintained in the local working copy).\n\n if (incoming.participants || incoming.participants.length) {\n const toRemove = new Set();\n const toUpsert = new Map();\n\n incoming.participants.forEach((p) => {\n if (p.removed) {\n // Elements of the delta event's \"participants\" list with the\n // attribute `removed=true` should be removed from the working copy's\n // \"participants\" collection.\n toRemove.add(p.url);\n } else {\n // Elements of the delta events \"participants\" list that are absent\n // from the local working copy should be added to that collection.\n toUpsert.set(p.url, p);\n }\n });\n\n // The \"participants\" collection in the delta event should be merged with\n // that of the local working copy of the Locus such that elements in the\n // delta event's \"participants\" replace those with the same url value in\n // the working copy \"participants\" collection.\n const participants = next.participants.reduce((acc, p) => {\n if (!toRemove.has(p.url)) {\n acc[p.url] = p;\n }\n\n return acc;\n }, {});\n\n toUpsert.forEach((value, key) => {\n participants[key] = value;\n });\n\n next.participants = Object.values(participants);\n }\n\n return next;\n },\n\n /**\n * Signals to locus that the current user is done sharing their additional\n * media stream\n * @param {Types~Locus} locus\n * @param {Types~MediaShare} share\n * @returns {Promise}\n */\n releaseFloorGrant(locus, share) {\n return this.webex\n .request({\n uri: share.url,\n method: 'PUT',\n body: {\n floor: {\n disposition: 'RELEASED',\n },\n },\n })\n .then(({body}) => body);\n },\n\n /**\n * Signals to locus that the current user would like to share an additional\n * media stream\n * @param {Types~Locus} locus\n * @param {Types~MediaShare} share\n * @returns {Promise}\n */\n requestFloorGrant(locus, share) {\n return this.webex\n .request({\n uri: share.url,\n method: 'PUT',\n body: {\n floor: {\n beneficiary: {\n url: locus.self.url,\n devices: [{url: this.webex.internal.device.url}],\n },\n disposition: 'GRANTED',\n },\n },\n })\n .then(({body}) => body);\n },\n\n /**\n * Sends a string of DTMF tones to the locus\n * @instance\n * @memberof Locus\n * @param {Types~Locus} locus\n * @param {string} tones\n * @returns {Promise}\n */\n sendDtmf(locus, tones) {\n return this.request({\n method: 'POST',\n uri: `${locus.self.url}/sendDtmf`,\n body: {\n deviceUrl: this.webex.internal.device.url,\n dtmf: {\n correlationId: uuid.v4(),\n tones,\n },\n },\n });\n },\n\n /**\n * Fetches the delta for the locus from its syncUrl. *Does not merge*\n * @instance\n * @memberof Locus\n * @param {Types~Locus} locus\n * @returns {Types~LocusDelta}\n */\n sync(locus) {\n return (\n this.request({\n method: 'GET',\n uri: locus.syncUrl,\n })\n // the api may return a 204 no content, so we'll give back an empty\n // object in that case.\n .then((res) => res.body || {})\n );\n },\n\n /**\n * Send a new sdp to Linus via the Locus API to update media state (e.g. to\n * start or stop sending audio or video)\n * @instance\n * @memberof Locus\n * @param {Types~Locus} locus\n * @param {Object} options\n * @param {string} options.localSdp\n * @param {string} options.mediaId\n * @param {Boolean} options.audioMuted\n * @param {Boolean} options.videoMuted\n * @returns {Promise<Types~Locus>}\n */\n updateMedia(locus, {sdp, audioMuted, videoMuted, mediaId}) {\n const localSdp = {\n audioMuted,\n videoMuted,\n };\n\n if (sdp) {\n localSdp.type = 'SDP';\n localSdp.sdp = sdp;\n }\n\n return this.request({\n method: 'PUT',\n uri: `${locus.self.url}/media`,\n body: {\n deviceUrl: this.webex.internal.device.url,\n localMedias: [\n {\n localSdp: JSON.stringify(localSdp),\n mediaId,\n },\n ],\n sequence: locus.sequence,\n },\n }).then((res) => res.body.locus);\n },\n});\n\nexport default Locus;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAIA;AAEA;AAAwB;AAAA;AAAA;AAEjB,IAAMA,YAAY,GAAG,cAAc;AAAC;AACpC,IAAMC,WAAW,GAAG,aAAa;AAAC;AAClC,IAAMC,KAAK,GAAG,OAAO;AAAC;AACtB,IAAMC,KAAK,GAAG,OAAO;AAAC;AACtB,IAAMC,YAAY,GAAG,cAAc;AAAC;AACpC,IAAMC,SAAS,GAAG,WAAW;AAAC;AAC9B,IAAMC,MAAM,GAAG,QAAQ;;AAE9B;AACA;AACA;AACA;AACA;AACA;AALA;AAMA,SAASC,eAAe,CAACC,MAAM,EAAE;EAC/B,QAAQA,MAAM;IACZ,KAAKN,KAAK;IACV,KAAKE,YAAY;MACf,OAAOH,WAAW;IACpB,KAAKI,SAAS;MACZ,OAAOL,YAAY;IACrB,KAAKM,MAAM;MACT,OAAOH,KAAK;IACd;MACE,MAAM,IAAIM,KAAK,WAAID,MAAM,qDAAkD;EAAC;AAElF;;AAEA;AACA;AACA;AACA,IAAME,KAAK,GAAGC,sBAAW,CAACC,MAAM,CAAC;EAC/BC,SAAS,EAAE,OAAO;EAElB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,KAAK,iBAACC,KAAK,EAAE;IACX,OAAO,IAAI,CAACC,OAAO,CAAC;MAClBC,MAAM,EAAE,KAAK;MACbC,GAAG,YAAKH,KAAK,CAACI,GAAG,uBAAoB;MACrCC,IAAI,EAAE;QACJC,SAAS,EAAE,IAAI,CAACC,KAAK,CAACC,QAAQ,CAACC,MAAM,CAACL,GAAG;QACzCM,QAAQ,EAAEV,KAAK,CAAC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AACH,CAAC,CAAC;AAAC,eAEYL,KAAK;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/internal-plugin-locus",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.20",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
]
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@webex/internal-plugin-locus": "3.0.0-beta.
|
|
24
|
-
"@webex/internal-plugin-mercury": "3.0.0-beta.
|
|
25
|
-
"@webex/test-helper-chai": "3.0.0-beta.
|
|
26
|
-
"@webex/test-helper-mock-webex": "3.0.0-beta.
|
|
27
|
-
"@webex/webex-core": "3.0.0-beta.
|
|
23
|
+
"@webex/internal-plugin-locus": "3.0.0-beta.20",
|
|
24
|
+
"@webex/internal-plugin-mercury": "3.0.0-beta.20",
|
|
25
|
+
"@webex/test-helper-chai": "3.0.0-beta.20",
|
|
26
|
+
"@webex/test-helper-mock-webex": "3.0.0-beta.20",
|
|
27
|
+
"@webex/webex-core": "3.0.0-beta.20",
|
|
28
28
|
"lodash": "^4.17.21",
|
|
29
29
|
"uuid": "^3.3.2"
|
|
30
30
|
}
|
package/src/event-keys.js
CHANGED
package/src/index.js
CHANGED
|
@@ -11,12 +11,4 @@ registerInternalPlugin('locus', Locus);
|
|
|
11
11
|
|
|
12
12
|
export default Locus;
|
|
13
13
|
export {locusEventKeys as eventKeys} from './event-keys';
|
|
14
|
-
export {
|
|
15
|
-
USE_INCOMING,
|
|
16
|
-
USE_CURRENT,
|
|
17
|
-
EQUAL,
|
|
18
|
-
FETCH,
|
|
19
|
-
GREATER_THAN,
|
|
20
|
-
LESS_THAN,
|
|
21
|
-
DESYNC
|
|
22
|
-
} from './locus';
|
|
14
|
+
export {USE_INCOMING, USE_CURRENT, EQUAL, FETCH, GREATER_THAN, LESS_THAN, DESYNC} from './locus';
|
package/src/locus.js
CHANGED
|
@@ -54,13 +54,11 @@ const Locus = WebexPlugin.extend({
|
|
|
54
54
|
uri: `${locus.url}/participant/alert`,
|
|
55
55
|
body: {
|
|
56
56
|
deviceUrl: this.webex.internal.device.url,
|
|
57
|
-
sequence: locus.sequence
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
.then((res) => res.body);
|
|
57
|
+
sequence: locus.sequence,
|
|
58
|
+
},
|
|
59
|
+
}).then((res) => res.body);
|
|
61
60
|
},
|
|
62
61
|
|
|
63
|
-
|
|
64
62
|
/**
|
|
65
63
|
* Compares two loci to determine which one contains the most recent state
|
|
66
64
|
* @instance
|
|
@@ -79,7 +77,11 @@ const Locus = WebexPlugin.extend({
|
|
|
79
77
|
function isEmpty(locus) {
|
|
80
78
|
const {sequence} = locus;
|
|
81
79
|
|
|
82
|
-
return (
|
|
80
|
+
return (
|
|
81
|
+
(!sequence.entries || !sequence.entries.length) &&
|
|
82
|
+
sequence.rangeStart === 0 &&
|
|
83
|
+
sequence.rangeEnd === 0
|
|
84
|
+
);
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
if (isEmpty(current) || isEmpty(incoming)) {
|
|
@@ -198,11 +200,17 @@ const Locus = WebexPlugin.extend({
|
|
|
198
200
|
}
|
|
199
201
|
|
|
200
202
|
if (!currentOnly.length && !incomingOnly.length) {
|
|
201
|
-
if (
|
|
203
|
+
if (
|
|
204
|
+
current.rangeEnd - getCompareFirstValue(current) >
|
|
205
|
+
incoming.rangeEnd - getCompareFirstValue(incoming)
|
|
206
|
+
) {
|
|
202
207
|
return GREATER_THAN;
|
|
203
208
|
}
|
|
204
209
|
|
|
205
|
-
if (
|
|
210
|
+
if (
|
|
211
|
+
current.rangeEnd - getCompareFirstValue(current) <
|
|
212
|
+
incoming.rangeEnd - getCompareFirstValue(incoming)
|
|
213
|
+
) {
|
|
206
214
|
return LESS_THAN;
|
|
207
215
|
}
|
|
208
216
|
|
|
@@ -257,39 +265,43 @@ const Locus = WebexPlugin.extend({
|
|
|
257
265
|
throw new Error('options.correlationId is required');
|
|
258
266
|
}
|
|
259
267
|
|
|
260
|
-
return
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
invitee
|
|
268
|
+
return (
|
|
269
|
+
this.request({
|
|
270
|
+
method: 'POST',
|
|
271
|
+
service: 'locus',
|
|
272
|
+
resource: 'loci/call',
|
|
273
|
+
body: {
|
|
274
|
+
correlationId,
|
|
275
|
+
deviceUrl: this.webex.internal.device.url,
|
|
276
|
+
invitee: {
|
|
277
|
+
invitee,
|
|
278
|
+
},
|
|
279
|
+
localMedias: [
|
|
280
|
+
{
|
|
281
|
+
localSdp: JSON.stringify({
|
|
282
|
+
type: 'SDP',
|
|
283
|
+
sdp: options.localSdp,
|
|
284
|
+
}),
|
|
285
|
+
},
|
|
286
|
+
],
|
|
287
|
+
sequence: {
|
|
288
|
+
entries: [],
|
|
289
|
+
rangeStart: 0,
|
|
290
|
+
rangeEnd: 0,
|
|
291
|
+
},
|
|
269
292
|
},
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
})
|
|
283
|
-
// res.body.mediaConnections is deprecated so just return the locus
|
|
284
|
-
.then((res) => {
|
|
285
|
-
res.body.locus.self.devices.map((item, index) => {
|
|
286
|
-
item.mediaConnections = [res.body.mediaConnections[index]];
|
|
287
|
-
|
|
288
|
-
return item;
|
|
289
|
-
});
|
|
290
|
-
|
|
291
|
-
return res.body.locus;
|
|
292
|
-
});
|
|
293
|
+
})
|
|
294
|
+
// res.body.mediaConnections is deprecated so just return the locus
|
|
295
|
+
.then((res) => {
|
|
296
|
+
res.body.locus.self.devices.map((item, index) => {
|
|
297
|
+
item.mediaConnections = [res.body.mediaConnections[index]];
|
|
298
|
+
|
|
299
|
+
return item;
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
return res.body.locus;
|
|
303
|
+
})
|
|
304
|
+
);
|
|
293
305
|
},
|
|
294
306
|
|
|
295
307
|
/**
|
|
@@ -323,8 +335,8 @@ const Locus = WebexPlugin.extend({
|
|
|
323
335
|
uri: `${locus.url}/participant/decline`,
|
|
324
336
|
body: {
|
|
325
337
|
deviceUrl: this.webex.internal.device.url,
|
|
326
|
-
sequence: locus.sequence
|
|
327
|
-
}
|
|
338
|
+
sequence: locus.sequence,
|
|
339
|
+
},
|
|
328
340
|
})
|
|
329
341
|
.then((res) => res.body)
|
|
330
342
|
.catch((reason) => {
|
|
@@ -346,9 +358,8 @@ const Locus = WebexPlugin.extend({
|
|
|
346
358
|
get(locus) {
|
|
347
359
|
return this.request({
|
|
348
360
|
method: 'GET',
|
|
349
|
-
uri: `${locus.url}
|
|
350
|
-
})
|
|
351
|
-
.then((res) => res.body);
|
|
361
|
+
uri: `${locus.url}`,
|
|
362
|
+
}).then((res) => res.body);
|
|
352
363
|
},
|
|
353
364
|
|
|
354
365
|
/**
|
|
@@ -360,15 +371,14 @@ const Locus = WebexPlugin.extend({
|
|
|
360
371
|
* @returns {Promise<Object>}
|
|
361
372
|
*/
|
|
362
373
|
getCallHistory(options = {}) {
|
|
363
|
-
const from =
|
|
374
|
+
const from = new Date(options.from || Date.now()).toISOString();
|
|
364
375
|
|
|
365
376
|
return this.request({
|
|
366
377
|
method: 'GET',
|
|
367
378
|
service: 'janus',
|
|
368
379
|
resource: 'history/userSessions',
|
|
369
|
-
qs: {from}
|
|
370
|
-
})
|
|
371
|
-
.then((res) => res.body);
|
|
380
|
+
qs: {from},
|
|
381
|
+
}).then((res) => res.body);
|
|
372
382
|
},
|
|
373
383
|
|
|
374
384
|
/**
|
|
@@ -387,35 +397,39 @@ const Locus = WebexPlugin.extend({
|
|
|
387
397
|
throw new Error('locus.correlationId or options.correlationId is required');
|
|
388
398
|
}
|
|
389
399
|
|
|
390
|
-
return
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
400
|
+
return (
|
|
401
|
+
this.request({
|
|
402
|
+
method: 'POST',
|
|
403
|
+
uri: `${locus.url}/participant`,
|
|
404
|
+
body: {
|
|
405
|
+
correlationId,
|
|
406
|
+
deviceUrl: this.webex.internal.device.url,
|
|
407
|
+
localMedias: [
|
|
408
|
+
{
|
|
409
|
+
localSdp: JSON.stringify({
|
|
410
|
+
type: 'SDP',
|
|
411
|
+
sdp: options.localSdp,
|
|
412
|
+
}),
|
|
413
|
+
},
|
|
414
|
+
],
|
|
415
|
+
sequence: locus.sequence || {
|
|
416
|
+
entries: [],
|
|
417
|
+
rangeStart: 0,
|
|
418
|
+
rangeEnd: 0,
|
|
419
|
+
},
|
|
420
|
+
},
|
|
421
|
+
})
|
|
422
|
+
// The mediaConnections object is deprecated, so just return the locus
|
|
423
|
+
.then((res) => {
|
|
424
|
+
res.body.locus.self.devices.map((item, index) => {
|
|
425
|
+
item.mediaConnections = [res.body.mediaConnections[index]];
|
|
426
|
+
|
|
427
|
+
return item;
|
|
428
|
+
});
|
|
429
|
+
|
|
430
|
+
return res.body.locus;
|
|
431
|
+
})
|
|
432
|
+
);
|
|
419
433
|
},
|
|
420
434
|
|
|
421
435
|
/**
|
|
@@ -431,8 +445,8 @@ const Locus = WebexPlugin.extend({
|
|
|
431
445
|
uri: `${locus.self.url}/leave`,
|
|
432
446
|
body: {
|
|
433
447
|
deviceUrl: this.webex.internal.device.url,
|
|
434
|
-
sequence: locus.sequence
|
|
435
|
-
}
|
|
448
|
+
sequence: locus.sequence,
|
|
449
|
+
},
|
|
436
450
|
})
|
|
437
451
|
.then((res) => res.body.locus)
|
|
438
452
|
.catch((reason) => {
|
|
@@ -454,9 +468,8 @@ const Locus = WebexPlugin.extend({
|
|
|
454
468
|
return this.request({
|
|
455
469
|
method: 'GET',
|
|
456
470
|
service: 'locus',
|
|
457
|
-
resource: 'loci'
|
|
458
|
-
})
|
|
459
|
-
.then((res) => res.body.loci);
|
|
471
|
+
resource: 'loci',
|
|
472
|
+
}).then((res) => res.body.loci);
|
|
460
473
|
},
|
|
461
474
|
|
|
462
475
|
/**
|
|
@@ -499,8 +512,7 @@ const Locus = WebexPlugin.extend({
|
|
|
499
512
|
// attribute `removed=true` should be removed from the working copy's
|
|
500
513
|
// "participants" collection.
|
|
501
514
|
toRemove.add(p.url);
|
|
502
|
-
}
|
|
503
|
-
else {
|
|
515
|
+
} else {
|
|
504
516
|
// Elements of the delta events "participants" list that are absent
|
|
505
517
|
// from the local working copy should be added to that collection.
|
|
506
518
|
toUpsert.set(p.url, p);
|
|
@@ -537,15 +549,16 @@ const Locus = WebexPlugin.extend({
|
|
|
537
549
|
* @returns {Promise}
|
|
538
550
|
*/
|
|
539
551
|
releaseFloorGrant(locus, share) {
|
|
540
|
-
return this.webex
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
552
|
+
return this.webex
|
|
553
|
+
.request({
|
|
554
|
+
uri: share.url,
|
|
555
|
+
method: 'PUT',
|
|
556
|
+
body: {
|
|
557
|
+
floor: {
|
|
558
|
+
disposition: 'RELEASED',
|
|
559
|
+
},
|
|
560
|
+
},
|
|
561
|
+
})
|
|
549
562
|
.then(({body}) => body);
|
|
550
563
|
},
|
|
551
564
|
|
|
@@ -557,19 +570,20 @@ const Locus = WebexPlugin.extend({
|
|
|
557
570
|
* @returns {Promise}
|
|
558
571
|
*/
|
|
559
572
|
requestFloorGrant(locus, share) {
|
|
560
|
-
return this.webex
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
573
|
+
return this.webex
|
|
574
|
+
.request({
|
|
575
|
+
uri: share.url,
|
|
576
|
+
method: 'PUT',
|
|
577
|
+
body: {
|
|
578
|
+
floor: {
|
|
579
|
+
beneficiary: {
|
|
580
|
+
url: locus.self.url,
|
|
581
|
+
devices: [{url: this.webex.internal.device.url}],
|
|
582
|
+
},
|
|
583
|
+
disposition: 'GRANTED',
|
|
568
584
|
},
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
}
|
|
572
|
-
})
|
|
585
|
+
},
|
|
586
|
+
})
|
|
573
587
|
.then(({body}) => body);
|
|
574
588
|
},
|
|
575
589
|
|
|
@@ -589,9 +603,9 @@ const Locus = WebexPlugin.extend({
|
|
|
589
603
|
deviceUrl: this.webex.internal.device.url,
|
|
590
604
|
dtmf: {
|
|
591
605
|
correlationId: uuid.v4(),
|
|
592
|
-
tones
|
|
593
|
-
}
|
|
594
|
-
}
|
|
606
|
+
tones,
|
|
607
|
+
},
|
|
608
|
+
},
|
|
595
609
|
});
|
|
596
610
|
},
|
|
597
611
|
|
|
@@ -603,13 +617,15 @@ const Locus = WebexPlugin.extend({
|
|
|
603
617
|
* @returns {Types~LocusDelta}
|
|
604
618
|
*/
|
|
605
619
|
sync(locus) {
|
|
606
|
-
return
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
620
|
+
return (
|
|
621
|
+
this.request({
|
|
622
|
+
method: 'GET',
|
|
623
|
+
uri: locus.syncUrl,
|
|
624
|
+
})
|
|
625
|
+
// the api may return a 204 no content, so we'll give back an empty
|
|
626
|
+
// object in that case.
|
|
627
|
+
.then((res) => res.body || {})
|
|
628
|
+
);
|
|
613
629
|
},
|
|
614
630
|
|
|
615
631
|
/**
|
|
@@ -625,12 +641,10 @@ const Locus = WebexPlugin.extend({
|
|
|
625
641
|
* @param {Boolean} options.videoMuted
|
|
626
642
|
* @returns {Promise<Types~Locus>}
|
|
627
643
|
*/
|
|
628
|
-
updateMedia(locus, {
|
|
629
|
-
sdp, audioMuted, videoMuted, mediaId
|
|
630
|
-
}) {
|
|
644
|
+
updateMedia(locus, {sdp, audioMuted, videoMuted, mediaId}) {
|
|
631
645
|
const localSdp = {
|
|
632
646
|
audioMuted,
|
|
633
|
-
videoMuted
|
|
647
|
+
videoMuted,
|
|
634
648
|
};
|
|
635
649
|
|
|
636
650
|
if (sdp) {
|
|
@@ -643,15 +657,16 @@ const Locus = WebexPlugin.extend({
|
|
|
643
657
|
uri: `${locus.self.url}/media`,
|
|
644
658
|
body: {
|
|
645
659
|
deviceUrl: this.webex.internal.device.url,
|
|
646
|
-
localMedias: [
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
660
|
+
localMedias: [
|
|
661
|
+
{
|
|
662
|
+
localSdp: JSON.stringify(localSdp),
|
|
663
|
+
mediaId,
|
|
664
|
+
},
|
|
665
|
+
],
|
|
666
|
+
sequence: locus.sequence,
|
|
667
|
+
},
|
|
668
|
+
}).then((res) => res.body.locus);
|
|
669
|
+
},
|
|
655
670
|
});
|
|
656
671
|
|
|
657
672
|
export default Locus;
|