@webex/internal-plugin-locus 2.59.3-next.1 → 2.59.4-next.1
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/.eslintrc.js +6 -6
- package/README.md +42 -42
- package/babel.config.js +3 -3
- package/dist/event-keys.js +2 -2
- package/dist/event-keys.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/locus.js +158 -162
- package/dist/locus.js.map +1 -1
- package/jest.config.js +3 -3
- package/package.json +9 -9
- package/process +1 -1
- package/src/event-keys.js +25 -25
- package/src/index.js +14 -14
- package/src/locus.js +672 -672
- package/test/unit/lib/BasicSeqCmp.json +975 -975
- package/test/unit/lib/SeqCmp.json +522 -522
- package/test/unit/spec/locus.js +102 -102
package/.eslintrc.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const config = {
|
|
2
|
-
root: true,
|
|
3
|
-
extends: ['@webex/eslint-config-legacy'],
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
module.exports = config;
|
|
1
|
+
const config = {
|
|
2
|
+
root: true,
|
|
3
|
+
extends: ['@webex/eslint-config-legacy'],
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
module.exports = config;
|
package/README.md
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
# @webex/internal-plugin-locus
|
|
2
|
-
|
|
3
|
-
[](https://github.com/RichardLitt/standard-readme)
|
|
4
|
-
|
|
5
|
-
> Plugin for the Locus service
|
|
6
|
-
|
|
7
|
-
This is an internal Cisco Webex plugin. As such, it does not strictly adhere to semantic versioning. Use at your own risk. If you're not working on one of our first party clients, please look at our [developer api](https://developer.webex.com/) and stick to our public plugins.
|
|
8
|
-
|
|
9
|
-
- [Install](#install)
|
|
10
|
-
- [Usage](#usage)
|
|
11
|
-
- [Contribute](#contribute)
|
|
12
|
-
- [Maintainers](#maintainers)
|
|
13
|
-
- [License](#license)
|
|
14
|
-
|
|
15
|
-
## Install
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm install --save @webex/internal-plugin-locus
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
```js
|
|
24
|
-
import '@webex/internal-plugin-locus';
|
|
25
|
-
|
|
26
|
-
import WebexCore from '@webex/webex-core';
|
|
27
|
-
|
|
28
|
-
const webex = new WebexCore();
|
|
29
|
-
webex.internal.locus.WHATEVER;
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Maintainers
|
|
33
|
-
|
|
34
|
-
This package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).
|
|
35
|
-
|
|
36
|
-
## Contribute
|
|
37
|
-
|
|
38
|
-
Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/webex-js-sdk/blob/master/CONTRIBUTING.md) for more details.
|
|
39
|
-
|
|
40
|
-
## License
|
|
41
|
-
|
|
42
|
-
© 2016-2020 Cisco and/or its affiliates. All Rights Reserved.
|
|
1
|
+
# @webex/internal-plugin-locus
|
|
2
|
+
|
|
3
|
+
[](https://github.com/RichardLitt/standard-readme)
|
|
4
|
+
|
|
5
|
+
> Plugin for the Locus service
|
|
6
|
+
|
|
7
|
+
This is an internal Cisco Webex plugin. As such, it does not strictly adhere to semantic versioning. Use at your own risk. If you're not working on one of our first party clients, please look at our [developer api](https://developer.webex.com/) and stick to our public plugins.
|
|
8
|
+
|
|
9
|
+
- [Install](#install)
|
|
10
|
+
- [Usage](#usage)
|
|
11
|
+
- [Contribute](#contribute)
|
|
12
|
+
- [Maintainers](#maintainers)
|
|
13
|
+
- [License](#license)
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install --save @webex/internal-plugin-locus
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import '@webex/internal-plugin-locus';
|
|
25
|
+
|
|
26
|
+
import WebexCore from '@webex/webex-core';
|
|
27
|
+
|
|
28
|
+
const webex = new WebexCore();
|
|
29
|
+
webex.internal.locus.WHATEVER;
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Maintainers
|
|
33
|
+
|
|
34
|
+
This package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).
|
|
35
|
+
|
|
36
|
+
## Contribute
|
|
37
|
+
|
|
38
|
+
Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/webex-js-sdk/blob/master/CONTRIBUTING.md) for more details.
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
© 2016-2020 Cisco and/or its affiliates. All Rights Reserved.
|
package/babel.config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const babelConfigLegacy = require('@webex/babel-config-legacy');
|
|
2
|
-
|
|
3
|
-
module.exports = babelConfigLegacy;
|
|
1
|
+
const babelConfigLegacy = require('@webex/babel-config-legacy');
|
|
2
|
+
|
|
3
|
+
module.exports = babelConfigLegacy;
|
package/dist/event-keys.js
CHANGED
|
@@ -5,8 +5,8 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.locusEventKeys = exports.default = void 0;
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
var locusEventKeys = ['locus.summary', 'locus.self_changed', 'locus.participant_joined', 'locus.participant_left', 'locus.participant_declined', 'locus.participant_alerted', 'locus.participant_updated', 'locus.participant_roles_updated', 'locus.participant_audio_muted', 'locus.participant_audio_unmuted', 'locus.participant_video_muted', 'locus.participant_video_unmuted', 'locus.floor_granted', 'locus.floor_released', 'locus.space_users_modified', 'locus.controls_updated', 'locus.participant_controls_updated'];
|
package/dist/event-keys.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["locusEventKeys","exports","_default","default"],"sources":["event-keys.js"],"sourcesContent":["/*!\
|
|
1
|
+
{"version":3,"names":["locusEventKeys","exports","_default","default"],"sources":["event-keys.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nexport const locusEventKeys = [\n 'locus.summary',\n 'locus.self_changed',\n 'locus.participant_joined',\n 'locus.participant_left',\n 'locus.participant_declined',\n 'locus.participant_alerted',\n 'locus.participant_updated',\n 'locus.participant_roles_updated',\n 'locus.participant_audio_muted',\n 'locus.participant_audio_unmuted',\n 'locus.participant_video_muted',\n 'locus.participant_video_unmuted',\n 'locus.floor_granted',\n 'locus.floor_released',\n 'locus.space_users_modified',\n 'locus.controls_updated',\n 'locus.participant_controls_updated',\n];\n\nexport default locusEventKeys;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;;AAEO,IAAMA,cAAc,GAAG,CAC5B,eAAe,EACf,oBAAoB,EACpB,0BAA0B,EAC1B,wBAAwB,EACxB,4BAA4B,EAC5B,2BAA2B,EAC3B,2BAA2B,EAC3B,iCAAiC,EACjC,+BAA+B,EAC/B,iCAAiC,EACjC,+BAA+B,EAC/B,iCAAiC,EACjC,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,EAC5B,wBAAwB,EACxB,oCAAoC,CACrC;AAACC,OAAA,CAAAD,cAAA,GAAAA,cAAA;AAAA,IAAAE,QAAA,GAEaF,cAAc;AAAAC,OAAA,CAAAE,OAAA,GAAAD,QAAA"}
|
package/dist/index.js
CHANGED
|
@@ -62,8 +62,8 @@ var _locus = _interopRequireWildcard(require("./locus"));
|
|
|
62
62
|
var _eventKeys = require("./event-keys");
|
|
63
63
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
64
64
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
65
|
-
/*!
|
|
66
|
-
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
65
|
+
/*!
|
|
66
|
+
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
67
67
|
*/
|
|
68
68
|
|
|
69
69
|
(0, _webexCore.registerInternalPlugin)('locus', _locus.default);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["require","_webexCore","_locus","_interopRequireWildcard","_eventKeys","_getRequireWildcardCache","nodeInterop","_WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","default","cache","has","get","newObj","hasPropertyDescriptor","_Object$defineProperty","_Object$getOwnPropertyDescriptor","key","Object","prototype","hasOwnProperty","call","desc","set","registerInternalPlugin","Locus","_default","exports"],"sources":["index.js"],"sourcesContent":["/*!\
|
|
1
|
+
{"version":3,"names":["require","_webexCore","_locus","_interopRequireWildcard","_eventKeys","_getRequireWildcardCache","nodeInterop","_WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","default","cache","has","get","newObj","hasPropertyDescriptor","_Object$defineProperty","_Object$getOwnPropertyDescriptor","key","Object","prototype","hasOwnProperty","call","desc","set","registerInternalPlugin","Locus","_default","exports"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport '@webex/internal-plugin-mercury';\nimport {registerInternalPlugin} from '@webex/webex-core';\n\nimport Locus from './locus';\n\nregisterInternalPlugin('locus', Locus);\n\nexport default Locus;\nexport {locusEventKeys as eventKeys} from './event-keys';\nexport {USE_INCOMING, USE_CURRENT, EQUAL, FETCH, GREATER_THAN, LESS_THAN, DESYNC} from './locus';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIAA,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AAKA,IAAAI,UAAA,GAAAJ,OAAA;AAAyD,SAAAK,yBAAAC,WAAA,eAAAC,QAAA,kCAAAC,iBAAA,OAAAD,QAAA,QAAAE,gBAAA,OAAAF,QAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,4BAAAG,OAAA,EAAAH,GAAA,UAAAI,KAAA,GAAAT,wBAAA,CAAAC,WAAA,OAAAQ,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAL,GAAA,YAAAI,KAAA,CAAAE,GAAA,CAAAN,GAAA,SAAAO,MAAA,WAAAC,qBAAA,GAAAC,sBAAA,IAAAC,gCAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAC,MAAA,CAAAC,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAf,GAAA,EAAAW,GAAA,SAAAK,IAAA,GAAAR,qBAAA,GAAAE,gCAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAK,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,sBAAA,CAAAF,MAAA,EAAAI,GAAA,EAAAK,IAAA,YAAAT,MAAA,CAAAI,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAJ,MAAA,CAAAJ,OAAA,GAAAH,GAAA,MAAAI,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAjB,GAAA,EAAAO,MAAA,YAAAA,MAAA;AAZzD;AACA;AACA;;AAOA,IAAAW,iCAAsB,EAAC,OAAO,EAAEC,cAAK,CAAC;AAAC,IAAAC,QAAA,GAExBD,cAAK;AAAAE,OAAA,CAAAlB,OAAA,GAAAiB,QAAA"}
|
package/dist/locus.js
CHANGED
|
@@ -17,12 +17,8 @@ var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/objec
|
|
|
17
17
|
var _set = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/set"));
|
|
18
18
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/map"));
|
|
19
19
|
var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
|
|
20
|
-
var _memoize2 = _interopRequireDefault(require("lodash/memoize"));
|
|
21
|
-
var _last2 = _interopRequireDefault(require("lodash/last"));
|
|
22
|
-
var _first2 = _interopRequireDefault(require("lodash/first"));
|
|
23
|
-
var _difference2 = _interopRequireDefault(require("lodash/difference"));
|
|
24
|
-
var _cloneDeep2 = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
25
20
|
var _webexCore = require("@webex/webex-core");
|
|
21
|
+
var _lodash = require("lodash");
|
|
26
22
|
var _uuid = _interopRequireDefault(require("uuid"));
|
|
27
23
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && o[_Symbol$iterator] || o["@@iterator"]; if (!it) { if (_Array$isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
28
24
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -41,11 +37,11 @@ var LESS_THAN = 'LESS_THAN';
|
|
|
41
37
|
exports.LESS_THAN = LESS_THAN;
|
|
42
38
|
var DESYNC = 'DESYNC';
|
|
43
39
|
|
|
44
|
-
/**
|
|
45
|
-
* Transates the result of a sequence comparison into an intended behavior
|
|
46
|
-
* @param {string} result
|
|
47
|
-
* @private
|
|
48
|
-
* @returns {string}
|
|
40
|
+
/**
|
|
41
|
+
* Transates the result of a sequence comparison into an intended behavior
|
|
42
|
+
* @param {string} result
|
|
43
|
+
* @private
|
|
44
|
+
* @returns {string}
|
|
49
45
|
*/
|
|
50
46
|
exports.DESYNC = DESYNC;
|
|
51
47
|
function compareToAction(result) {
|
|
@@ -62,18 +58,18 @@ function compareToAction(result) {
|
|
|
62
58
|
}
|
|
63
59
|
}
|
|
64
60
|
|
|
65
|
-
/**
|
|
66
|
-
* @class
|
|
61
|
+
/**
|
|
62
|
+
* @class
|
|
67
63
|
*/
|
|
68
64
|
var Locus = _webexCore.WebexPlugin.extend({
|
|
69
65
|
namespace: 'Locus',
|
|
70
|
-
/**
|
|
71
|
-
* Alert the specified locus that the local user has been notified of the
|
|
72
|
-
* locus's active state
|
|
73
|
-
* @instance
|
|
74
|
-
* @memberof Locus
|
|
75
|
-
* @param {Types~Locus} locus
|
|
76
|
-
* @returns {Promise}
|
|
66
|
+
/**
|
|
67
|
+
* Alert the specified locus that the local user has been notified of the
|
|
68
|
+
* locus's active state
|
|
69
|
+
* @instance
|
|
70
|
+
* @memberof Locus
|
|
71
|
+
* @param {Types~Locus} locus
|
|
72
|
+
* @returns {Promise}
|
|
77
73
|
*/
|
|
78
74
|
alert: function alert(locus) {
|
|
79
75
|
return this.request({
|
|
@@ -87,20 +83,20 @@ var Locus = _webexCore.WebexPlugin.extend({
|
|
|
87
83
|
return res.body;
|
|
88
84
|
});
|
|
89
85
|
},
|
|
90
|
-
/**
|
|
91
|
-
* Compares two loci to determine which one contains the most recent state
|
|
92
|
-
* @instance
|
|
93
|
-
* @memberof Locus
|
|
94
|
-
* @param {Types~Locus} current
|
|
95
|
-
* @param {Types~Locus} incoming
|
|
96
|
-
* @returns {string} one of USE_INCOMING, USE_CURRENT, or FETCH
|
|
86
|
+
/**
|
|
87
|
+
* Compares two loci to determine which one contains the most recent state
|
|
88
|
+
* @instance
|
|
89
|
+
* @memberof Locus
|
|
90
|
+
* @param {Types~Locus} current
|
|
91
|
+
* @param {Types~Locus} incoming
|
|
92
|
+
* @returns {string} one of USE_INCOMING, USE_CURRENT, or FETCH
|
|
97
93
|
*/
|
|
98
94
|
compare: function compare(current, incoming) {
|
|
99
|
-
/**
|
|
100
|
-
* Determines if a paricular locus's sequence is empty
|
|
101
|
-
* @param {Types~Locus} locus
|
|
102
|
-
* @private
|
|
103
|
-
* @returns {bool}
|
|
95
|
+
/**
|
|
96
|
+
* Determines if a paricular locus's sequence is empty
|
|
97
|
+
* @param {Types~Locus} locus
|
|
98
|
+
* @private
|
|
99
|
+
* @returns {bool}
|
|
104
100
|
*/
|
|
105
101
|
function isEmpty(locus) {
|
|
106
102
|
var sequence = locus.sequence;
|
|
@@ -114,15 +110,15 @@ var Locus = _webexCore.WebexPlugin.extend({
|
|
|
114
110
|
}
|
|
115
111
|
return compareToAction(this.compareSequence(current.sequence, incoming.sequence));
|
|
116
112
|
},
|
|
117
|
-
/**
|
|
118
|
-
* Compares two loci sequences (with delta params) and indicates what action
|
|
119
|
-
* to take.
|
|
120
|
-
* @instance
|
|
121
|
-
* @memberof Locus
|
|
122
|
-
* @param {Types~Locus} current
|
|
123
|
-
* @param {Types~Locus} incoming
|
|
124
|
-
* @private
|
|
125
|
-
* @returns {string} one of USE_INCOMING, USE_CURRENT, or FETCH
|
|
113
|
+
/**
|
|
114
|
+
* Compares two loci sequences (with delta params) and indicates what action
|
|
115
|
+
* to take.
|
|
116
|
+
* @instance
|
|
117
|
+
* @memberof Locus
|
|
118
|
+
* @param {Types~Locus} current
|
|
119
|
+
* @param {Types~Locus} incoming
|
|
120
|
+
* @private
|
|
121
|
+
* @returns {string} one of USE_INCOMING, USE_CURRENT, or FETCH
|
|
126
122
|
*/
|
|
127
123
|
compareDelta: function compareDelta(current, incoming) {
|
|
128
124
|
var ret = this.compareSequence(current.sequence, incoming.sequence);
|
|
@@ -138,13 +134,13 @@ var Locus = _webexCore.WebexPlugin.extend({
|
|
|
138
134
|
return FETCH;
|
|
139
135
|
}
|
|
140
136
|
},
|
|
141
|
-
/**
|
|
142
|
-
* Compares two Locus sequences
|
|
143
|
-
* @instance
|
|
144
|
-
* @memberof Locus
|
|
145
|
-
* @param {LocusSequence} current
|
|
146
|
-
* @param {LocusSequence} incoming
|
|
147
|
-
* @returns {string} one of LESS_THAN, GREATER_THAN, EQUAL, or DESYNC
|
|
137
|
+
/**
|
|
138
|
+
* Compares two Locus sequences
|
|
139
|
+
* @instance
|
|
140
|
+
* @memberof Locus
|
|
141
|
+
* @param {LocusSequence} current
|
|
142
|
+
* @param {LocusSequence} incoming
|
|
143
|
+
* @returns {string} one of LESS_THAN, GREATER_THAN, EQUAL, or DESYNC
|
|
148
144
|
*/
|
|
149
145
|
compareSequence: function compareSequence(current, incoming) {
|
|
150
146
|
if (!current) {
|
|
@@ -166,24 +162,24 @@ var Locus = _webexCore.WebexPlugin.extend({
|
|
|
166
162
|
// those in the test suite, I have to assume memoize can only help and the
|
|
167
163
|
// overhead of memoizing these methods is not a problem.
|
|
168
164
|
|
|
169
|
-
var getEntriesFirstValue = (0,
|
|
170
|
-
return sequence.entries.length === 0 ? 0 : (0,
|
|
165
|
+
var getEntriesFirstValue = (0, _lodash.memoize)(function (sequence) {
|
|
166
|
+
return sequence.entries.length === 0 ? 0 : (0, _lodash.first)(sequence.entries);
|
|
171
167
|
});
|
|
172
|
-
var getEntriesLastValue = (0,
|
|
173
|
-
return sequence.entries.length === 0 ? 0 : (0,
|
|
168
|
+
var getEntriesLastValue = (0, _lodash.memoize)(function (sequence) {
|
|
169
|
+
return sequence.entries.length === 0 ? 0 : (0, _lodash.last)(sequence.entries);
|
|
174
170
|
});
|
|
175
|
-
var getCompareFirstValue = (0,
|
|
171
|
+
var getCompareFirstValue = (0, _lodash.memoize)(function (sequence) {
|
|
176
172
|
return sequence.rangeStart || getEntriesFirstValue(sequence);
|
|
177
173
|
});
|
|
178
|
-
var getCompareLastValue = (0,
|
|
174
|
+
var getCompareLastValue = (0, _lodash.memoize)(function (sequence) {
|
|
179
175
|
return getEntriesLastValue(sequence) || sequence.rangeEnd;
|
|
180
176
|
});
|
|
181
177
|
|
|
182
|
-
/**
|
|
183
|
-
* @param {number} entry
|
|
184
|
-
* @param {LocusSequence} sequence
|
|
185
|
-
* @private
|
|
186
|
-
* @returns {Boolean}
|
|
178
|
+
/**
|
|
179
|
+
* @param {number} entry
|
|
180
|
+
* @param {LocusSequence} sequence
|
|
181
|
+
* @private
|
|
182
|
+
* @returns {Boolean}
|
|
187
183
|
*/
|
|
188
184
|
function inRange(entry, sequence) {
|
|
189
185
|
return entry >= sequence.rangeStart && entry <= sequence.rangeEnd;
|
|
@@ -194,8 +190,8 @@ var Locus = _webexCore.WebexPlugin.extend({
|
|
|
194
190
|
if (getCompareLastValue(current) < getCompareFirstValue(incoming)) {
|
|
195
191
|
return LESS_THAN;
|
|
196
192
|
}
|
|
197
|
-
var currentOnlyEntries = (0,
|
|
198
|
-
var incomingOnlyEntries = (0,
|
|
193
|
+
var currentOnlyEntries = (0, _lodash.difference)(current.entries, incoming.entries);
|
|
194
|
+
var incomingOnlyEntries = (0, _lodash.difference)(incoming.entries, current.entries);
|
|
199
195
|
var currentOnly = [];
|
|
200
196
|
var incomingOnly = [];
|
|
201
197
|
var _iterator = _createForOfIteratorHelper(currentOnlyEntries),
|
|
@@ -261,15 +257,15 @@ var Locus = _webexCore.WebexPlugin.extend({
|
|
|
261
257
|
}
|
|
262
258
|
return LESS_THAN;
|
|
263
259
|
},
|
|
264
|
-
/**
|
|
265
|
-
* Calls the specified invitee and offers the specified media via
|
|
266
|
-
* options.localSdp
|
|
267
|
-
* @instance
|
|
268
|
-
* @memberof Locus
|
|
269
|
-
* @param {string} invitee
|
|
270
|
-
* @param {Object} options
|
|
271
|
-
* @param {Object} options.localSdp
|
|
272
|
-
* @returns {Promise<Types~Locus>}
|
|
260
|
+
/**
|
|
261
|
+
* Calls the specified invitee and offers the specified media via
|
|
262
|
+
* options.localSdp
|
|
263
|
+
* @instance
|
|
264
|
+
* @memberof Locus
|
|
265
|
+
* @param {string} invitee
|
|
266
|
+
* @param {Object} options
|
|
267
|
+
* @param {Object} options.localSdp
|
|
268
|
+
* @returns {Promise<Types~Locus>}
|
|
273
269
|
*/
|
|
274
270
|
create: function create(invitee) {
|
|
275
271
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -309,15 +305,15 @@ var Locus = _webexCore.WebexPlugin.extend({
|
|
|
309
305
|
return res.body.locus;
|
|
310
306
|
});
|
|
311
307
|
},
|
|
312
|
-
/**
|
|
313
|
-
* This is mostly an internal function to simplify the phone plugin. Decides
|
|
314
|
-
* which path to call based on the type of the thing being joined.
|
|
315
|
-
* @instance
|
|
316
|
-
* @memberof Locus
|
|
317
|
-
* @param {Object|Types~Locus} target
|
|
318
|
-
* @param {Object} options
|
|
319
|
-
* @private
|
|
320
|
-
* @returns {Promise<Types~Locus>}
|
|
308
|
+
/**
|
|
309
|
+
* This is mostly an internal function to simplify the phone plugin. Decides
|
|
310
|
+
* which path to call based on the type of the thing being joined.
|
|
311
|
+
* @instance
|
|
312
|
+
* @memberof Locus
|
|
313
|
+
* @param {Object|Types~Locus} target
|
|
314
|
+
* @param {Object} options
|
|
315
|
+
* @private
|
|
316
|
+
* @returns {Promise<Types~Locus>}
|
|
321
317
|
*/
|
|
322
318
|
createOrJoin: function createOrJoin(target, options) {
|
|
323
319
|
if (target.url) {
|
|
@@ -325,12 +321,12 @@ var Locus = _webexCore.WebexPlugin.extend({
|
|
|
325
321
|
}
|
|
326
322
|
return this.create(target, options);
|
|
327
323
|
},
|
|
328
|
-
/**
|
|
329
|
-
* Decline to join the specified Locus
|
|
330
|
-
* @instance
|
|
331
|
-
* @memberof Locus
|
|
332
|
-
* @param {Types~Locus} locus
|
|
333
|
-
* @returns {Promise<Types~Locus>}
|
|
324
|
+
/**
|
|
325
|
+
* Decline to join the specified Locus
|
|
326
|
+
* @instance
|
|
327
|
+
* @memberof Locus
|
|
328
|
+
* @param {Types~Locus} locus
|
|
329
|
+
* @returns {Promise<Types~Locus>}
|
|
334
330
|
*/
|
|
335
331
|
decline: function decline(locus) {
|
|
336
332
|
var _this = this;
|
|
@@ -350,12 +346,12 @@ var Locus = _webexCore.WebexPlugin.extend({
|
|
|
350
346
|
return _promise.default.reject(reason);
|
|
351
347
|
});
|
|
352
348
|
},
|
|
353
|
-
/**
|
|
354
|
-
* Retrieves a single Locus
|
|
355
|
-
* @instance
|
|
356
|
-
* @memberof Locus
|
|
357
|
-
* @param {Types~Locus} locus
|
|
358
|
-
* @returns {Types~Locus}
|
|
349
|
+
/**
|
|
350
|
+
* Retrieves a single Locus
|
|
351
|
+
* @instance
|
|
352
|
+
* @memberof Locus
|
|
353
|
+
* @param {Types~Locus} locus
|
|
354
|
+
* @returns {Types~Locus}
|
|
359
355
|
*/
|
|
360
356
|
get: function get(locus) {
|
|
361
357
|
return this.request({
|
|
@@ -365,13 +361,13 @@ var Locus = _webexCore.WebexPlugin.extend({
|
|
|
365
361
|
return res.body;
|
|
366
362
|
});
|
|
367
363
|
},
|
|
368
|
-
/**
|
|
369
|
-
* Retrieves the call history for the current user
|
|
370
|
-
* @instance
|
|
371
|
-
* @memberof Locus
|
|
372
|
-
* @param {Object} options
|
|
373
|
-
* @param {Date|number} options.from
|
|
374
|
-
* @returns {Promise<Object>}
|
|
364
|
+
/**
|
|
365
|
+
* Retrieves the call history for the current user
|
|
366
|
+
* @instance
|
|
367
|
+
* @memberof Locus
|
|
368
|
+
* @param {Object} options
|
|
369
|
+
* @param {Date|number} options.from
|
|
370
|
+
* @returns {Promise<Object>}
|
|
375
371
|
*/
|
|
376
372
|
getCallHistory: function getCallHistory() {
|
|
377
373
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -387,14 +383,14 @@ var Locus = _webexCore.WebexPlugin.extend({
|
|
|
387
383
|
return res.body;
|
|
388
384
|
});
|
|
389
385
|
},
|
|
390
|
-
/**
|
|
391
|
-
* Join the specified Locus and offer to send it media
|
|
392
|
-
* @instance
|
|
393
|
-
* @memberof Locus
|
|
394
|
-
* @param {Types~Locus} locus
|
|
395
|
-
* @param {Object} options
|
|
396
|
-
* @param {Object} options.localSdp
|
|
397
|
-
* @returns {Types~Locus}
|
|
386
|
+
/**
|
|
387
|
+
* Join the specified Locus and offer to send it media
|
|
388
|
+
* @instance
|
|
389
|
+
* @memberof Locus
|
|
390
|
+
* @param {Types~Locus} locus
|
|
391
|
+
* @param {Object} options
|
|
392
|
+
* @param {Object} options.localSdp
|
|
393
|
+
* @returns {Types~Locus}
|
|
398
394
|
*/
|
|
399
395
|
join: function join(locus) {
|
|
400
396
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -430,12 +426,12 @@ var Locus = _webexCore.WebexPlugin.extend({
|
|
|
430
426
|
return res.body.locus;
|
|
431
427
|
});
|
|
432
428
|
},
|
|
433
|
-
/**
|
|
434
|
-
* Leave the specified Locus
|
|
435
|
-
* @instance
|
|
436
|
-
* @memberof Locus
|
|
437
|
-
* @param {Types~Locus} locus
|
|
438
|
-
* @returns {Promise<Types~Locus>}
|
|
429
|
+
/**
|
|
430
|
+
* Leave the specified Locus
|
|
431
|
+
* @instance
|
|
432
|
+
* @memberof Locus
|
|
433
|
+
* @param {Types~Locus} locus
|
|
434
|
+
* @returns {Promise<Types~Locus>}
|
|
439
435
|
*/
|
|
440
436
|
leave: function leave(locus) {
|
|
441
437
|
var _this2 = this;
|
|
@@ -455,11 +451,11 @@ var Locus = _webexCore.WebexPlugin.extend({
|
|
|
455
451
|
return _promise.default.reject(reason);
|
|
456
452
|
});
|
|
457
453
|
},
|
|
458
|
-
/**
|
|
459
|
-
* Lists active loci
|
|
460
|
-
* @instance
|
|
461
|
-
* @memberof Locus
|
|
462
|
-
* @returns {Promise<Array<Types~Locus>>}
|
|
454
|
+
/**
|
|
455
|
+
* Lists active loci
|
|
456
|
+
* @instance
|
|
457
|
+
* @memberof Locus
|
|
458
|
+
* @returns {Promise<Array<Types~Locus>>}
|
|
463
459
|
*/
|
|
464
460
|
list: function list() {
|
|
465
461
|
return this.request({
|
|
@@ -470,20 +466,20 @@ var Locus = _webexCore.WebexPlugin.extend({
|
|
|
470
466
|
return res.body.loci;
|
|
471
467
|
});
|
|
472
468
|
},
|
|
473
|
-
/**
|
|
474
|
-
* Merges two locus DTOs (for the same locus)
|
|
475
|
-
* @instance
|
|
476
|
-
* @memberof Locus
|
|
477
|
-
* @param {Types~Locus} current
|
|
478
|
-
* @param {Types~Locus|Types~LocusDelta} incoming
|
|
479
|
-
* @returns {Type~Locus}
|
|
469
|
+
/**
|
|
470
|
+
* Merges two locus DTOs (for the same locus)
|
|
471
|
+
* @instance
|
|
472
|
+
* @memberof Locus
|
|
473
|
+
* @param {Types~Locus} current
|
|
474
|
+
* @param {Types~Locus|Types~LocusDelta} incoming
|
|
475
|
+
* @returns {Type~Locus}
|
|
480
476
|
*/
|
|
481
477
|
merge: function merge(current, incoming) {
|
|
482
478
|
// if incoming is not a delta event, treat it as a new full locus.
|
|
483
479
|
if (!incoming.baseSequence) {
|
|
484
480
|
return incoming;
|
|
485
481
|
}
|
|
486
|
-
var next = (0,
|
|
482
|
+
var next = (0, _lodash.cloneDeep)(current);
|
|
487
483
|
|
|
488
484
|
// 1. All non-null elements in the delta event except the "baseSequence" and
|
|
489
485
|
// the "participants" collection should be used to replace their existing
|
|
@@ -531,12 +527,12 @@ var Locus = _webexCore.WebexPlugin.extend({
|
|
|
531
527
|
}
|
|
532
528
|
return next;
|
|
533
529
|
},
|
|
534
|
-
/**
|
|
535
|
-
* Signals to locus that the current user is done sharing their additional
|
|
536
|
-
* media stream
|
|
537
|
-
* @param {Types~Locus} locus
|
|
538
|
-
* @param {Types~MediaShare} share
|
|
539
|
-
* @returns {Promise}
|
|
530
|
+
/**
|
|
531
|
+
* Signals to locus that the current user is done sharing their additional
|
|
532
|
+
* media stream
|
|
533
|
+
* @param {Types~Locus} locus
|
|
534
|
+
* @param {Types~MediaShare} share
|
|
535
|
+
* @returns {Promise}
|
|
540
536
|
*/
|
|
541
537
|
releaseFloorGrant: function releaseFloorGrant(locus, share) {
|
|
542
538
|
return this.webex.request({
|
|
@@ -552,12 +548,12 @@ var Locus = _webexCore.WebexPlugin.extend({
|
|
|
552
548
|
return body;
|
|
553
549
|
});
|
|
554
550
|
},
|
|
555
|
-
/**
|
|
556
|
-
* Signals to locus that the current user would like to share an additional
|
|
557
|
-
* media stream
|
|
558
|
-
* @param {Types~Locus} locus
|
|
559
|
-
* @param {Types~MediaShare} share
|
|
560
|
-
* @returns {Promise}
|
|
551
|
+
/**
|
|
552
|
+
* Signals to locus that the current user would like to share an additional
|
|
553
|
+
* media stream
|
|
554
|
+
* @param {Types~Locus} locus
|
|
555
|
+
* @param {Types~MediaShare} share
|
|
556
|
+
* @returns {Promise}
|
|
561
557
|
*/
|
|
562
558
|
requestFloorGrant: function requestFloorGrant(locus, share) {
|
|
563
559
|
return this.webex.request({
|
|
@@ -579,13 +575,13 @@ var Locus = _webexCore.WebexPlugin.extend({
|
|
|
579
575
|
return body;
|
|
580
576
|
});
|
|
581
577
|
},
|
|
582
|
-
/**
|
|
583
|
-
* Sends a string of DTMF tones to the locus
|
|
584
|
-
* @instance
|
|
585
|
-
* @memberof Locus
|
|
586
|
-
* @param {Types~Locus} locus
|
|
587
|
-
* @param {string} tones
|
|
588
|
-
* @returns {Promise}
|
|
578
|
+
/**
|
|
579
|
+
* Sends a string of DTMF tones to the locus
|
|
580
|
+
* @instance
|
|
581
|
+
* @memberof Locus
|
|
582
|
+
* @param {Types~Locus} locus
|
|
583
|
+
* @param {string} tones
|
|
584
|
+
* @returns {Promise}
|
|
589
585
|
*/
|
|
590
586
|
sendDtmf: function sendDtmf(locus, tones) {
|
|
591
587
|
return this.request({
|
|
@@ -600,12 +596,12 @@ var Locus = _webexCore.WebexPlugin.extend({
|
|
|
600
596
|
}
|
|
601
597
|
});
|
|
602
598
|
},
|
|
603
|
-
/**
|
|
604
|
-
* Fetches the delta for the locus from its syncUrl. *Does not merge*
|
|
605
|
-
* @instance
|
|
606
|
-
* @memberof Locus
|
|
607
|
-
* @param {Types~Locus} locus
|
|
608
|
-
* @returns {Types~LocusDelta}
|
|
599
|
+
/**
|
|
600
|
+
* Fetches the delta for the locus from its syncUrl. *Does not merge*
|
|
601
|
+
* @instance
|
|
602
|
+
* @memberof Locus
|
|
603
|
+
* @param {Types~Locus} locus
|
|
604
|
+
* @returns {Types~LocusDelta}
|
|
609
605
|
*/
|
|
610
606
|
sync: function sync(locus) {
|
|
611
607
|
return this.request({
|
|
@@ -618,18 +614,18 @@ var Locus = _webexCore.WebexPlugin.extend({
|
|
|
618
614
|
return res.body || {};
|
|
619
615
|
});
|
|
620
616
|
},
|
|
621
|
-
/**
|
|
622
|
-
* Send a new sdp to Linus via the Locus API to update media state (e.g. to
|
|
623
|
-
* start or stop sending audio or video)
|
|
624
|
-
* @instance
|
|
625
|
-
* @memberof Locus
|
|
626
|
-
* @param {Types~Locus} locus
|
|
627
|
-
* @param {Object} options
|
|
628
|
-
* @param {string} options.localSdp
|
|
629
|
-
* @param {string} options.mediaId
|
|
630
|
-
* @param {Boolean} options.audioMuted
|
|
631
|
-
* @param {Boolean} options.videoMuted
|
|
632
|
-
* @returns {Promise<Types~Locus>}
|
|
617
|
+
/**
|
|
618
|
+
* Send a new sdp to Linus via the Locus API to update media state (e.g. to
|
|
619
|
+
* start or stop sending audio or video)
|
|
620
|
+
* @instance
|
|
621
|
+
* @memberof Locus
|
|
622
|
+
* @param {Types~Locus} locus
|
|
623
|
+
* @param {Object} options
|
|
624
|
+
* @param {string} options.localSdp
|
|
625
|
+
* @param {string} options.mediaId
|
|
626
|
+
* @param {Boolean} options.audioMuted
|
|
627
|
+
* @param {Boolean} options.videoMuted
|
|
628
|
+
* @returns {Promise<Types~Locus>}
|
|
633
629
|
*/
|
|
634
630
|
updateMedia: function updateMedia(locus, _ref3) {
|
|
635
631
|
var sdp = _ref3.sdp,
|
|
@@ -659,7 +655,7 @@ var Locus = _webexCore.WebexPlugin.extend({
|
|
|
659
655
|
return res.body.locus;
|
|
660
656
|
});
|
|
661
657
|
},
|
|
662
|
-
version: "2.59.
|
|
658
|
+
version: "2.59.4-next.1"
|
|
663
659
|
});
|
|
664
660
|
var _default = Locus;
|
|
665
661
|
exports.default = _default;
|