@webex/internal-plugin-team 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 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-team
2
-
3
- [![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
4
-
5
- > Plugin for the Team 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-team
19
- ```
20
-
21
- ## Usage
22
-
23
- ```js
24
- import '@webex/internal-plugin-team';
25
-
26
- import WebexCore from '@webex/webex-core';
27
-
28
- const webex = new WebexCore();
29
- webex.internal.team.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-team
2
+
3
+ [![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
4
+
5
+ > Plugin for the Team 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-team
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ```js
24
+ import '@webex/internal-plugin-team';
25
+
26
+ import WebexCore from '@webex/webex-core';
27
+
28
+ const webex = new WebexCore();
29
+ webex.internal.team.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/config.js CHANGED
@@ -5,8 +5,8 @@ _Object$defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  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
  var _default = {
12
12
  team: {}
@@ -1 +1 @@
1
- {"version":3,"names":["_default","team","exports","default"],"sources":["config.js"],"sourcesContent":["/*!\r\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\r\n */\r\n\r\nexport default {\r\n team: {},\r\n};\r\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAFA,IAAAA,QAAA,GAIe;EACbC,IAAI,EAAE,CAAC;AACT,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAH,QAAA"}
1
+ {"version":3,"names":["_default","team","exports","default"],"sources":["config.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nexport default {\n team: {},\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAFA,IAAAA,QAAA,GAIe;EACbC,IAAI,EAAE,CAAC;AACT,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAH,QAAA"}
package/dist/index.js CHANGED
@@ -12,17 +12,15 @@ _Object$defineProperty(exports, "default", {
12
12
  }
13
13
  });
14
14
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
15
- var _get2 = _interopRequireDefault(require("lodash/get"));
16
- var _has2 = _interopRequireDefault(require("lodash/has"));
17
- var _isArray2 = _interopRequireDefault(require("lodash/isArray"));
18
15
  require("@webex/internal-plugin-conversation");
19
16
  require("@webex/internal-plugin-user");
20
17
  require("@webex/internal-plugin-encryption");
18
+ var _lodash = require("lodash");
21
19
  var _webexCore = require("@webex/webex-core");
22
20
  var _team = _interopRequireDefault(require("./team"));
23
21
  var _config = _interopRequireDefault(require("./config"));
24
- /*!
25
- * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
22
+ /*!
23
+ * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
26
24
  */
27
25
 
28
26
  (0, _webexCore.registerInternalPlugin)('team', _team.default, {
@@ -31,7 +29,7 @@ var _config = _interopRequireDefault(require("./config"));
31
29
  name: 'decryptTeamRoomStatus',
32
30
  direction: 'inbound',
33
31
  test: function test(ctx, optionsOrResponse) {
34
- return _promise.default.resolve((0, _has2.default)(optionsOrResponse, 'activity.object.activityEvent') && (0, _get2.default)(optionsOrResponse, 'activity.object.objectType') === 'teamRoomStatus');
32
+ return _promise.default.resolve((0, _lodash.has)(optionsOrResponse, 'activity.object.activityEvent') && (0, _lodash.get)(optionsOrResponse, 'activity.object.objectType') === 'teamRoomStatus');
35
33
  },
36
34
  extract: function extract(optionsOrResponse) {
37
35
  return _promise.default.resolve(optionsOrResponse.activity.object);
@@ -58,7 +56,7 @@ var _config = _interopRequireDefault(require("./config"));
58
56
  name: 'decryptTeamRoomStatus',
59
57
  direction: 'inbound',
60
58
  fn: function fn(ctx, teamRoomStatus) {
61
- var keyUrl = (0, _get2.default)(teamRoomStatus, 'activityEvent.encryptionKeyUrl');
59
+ var keyUrl = (0, _lodash.get)(teamRoomStatus, 'activityEvent.encryptionKeyUrl');
62
60
  return ctx.transform('decryptObject', keyUrl, teamRoomStatus.activityEvent);
63
61
  }
64
62
  }, {
@@ -77,7 +75,7 @@ var _config = _interopRequireDefault(require("./config"));
77
75
  return _promise.default.resolve(key || ctx.webex.internal.encryption.kms.createUnboundKeys({
78
76
  count: 1
79
77
  })).then(function (keys) {
80
- var k = (0, _isArray2.default)(keys) ? keys[0] : keys;
78
+ var k = (0, _lodash.isArray)(keys) ? keys[0] : keys;
81
79
  if (team.kmsMessage && team.kmsMessage.keyUris && !team.kmsMessage.keyUris.includes(k.uri)) {
82
80
  team.kmsMessage.keyUris.push(k.uri);
83
81
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["require","_webexCore","_team","_interopRequireDefault","_config","registerInternalPlugin","Team","payloadTransformer","predicates","name","direction","test","ctx","optionsOrResponse","_promise","default","resolve","_has2","_get2","extract","activity","object","transforms","fn","key","team","promises","conversations","items","push","all","map","item","transform","usableKey","encryptionKeyUrl","teamRoomStatus","keyUrl","activityEvent","webex","internal","encryption","kms","createUnboundKeys","count","then","keys","k","_isArray2","kmsMessage","keyUris","includes","uri","defaultActivityEncryptionKeyUrl","teamMembers","config"],"sources":["index.js"],"sourcesContent":["/*!\r\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\r\n */\r\n\r\nimport '@webex/internal-plugin-conversation';\r\nimport '@webex/internal-plugin-user';\r\nimport '@webex/internal-plugin-encryption';\r\nimport {isArray, has, get} from 'lodash';\r\nimport {registerInternalPlugin} from '@webex/webex-core';\r\n\r\nimport Team from './team';\r\nimport config from './config';\r\n\r\nregisterInternalPlugin('team', Team, {\r\n payloadTransformer: {\r\n predicates: [\r\n {\r\n name: 'decryptTeamRoomStatus',\r\n direction: 'inbound',\r\n test(ctx, optionsOrResponse) {\r\n return Promise.resolve(\r\n has(optionsOrResponse, 'activity.object.activityEvent') &&\r\n get(optionsOrResponse, 'activity.object.objectType') === 'teamRoomStatus'\r\n );\r\n },\r\n extract(optionsOrResponse) {\r\n return Promise.resolve(optionsOrResponse.activity.object);\r\n },\r\n },\r\n ],\r\n transforms: [\r\n {\r\n name: 'decryptTeam',\r\n direction: 'inbound',\r\n fn(ctx, key, team) {\r\n const promises = [];\r\n\r\n if (team.conversations.items) {\r\n promises.push(\r\n Promise.all(\r\n team.conversations.items.map((item) => ctx.transform('decryptObject', null, item))\r\n )\r\n );\r\n }\r\n\r\n const usableKey = team.encryptionKeyUrl || key;\r\n\r\n if (usableKey) {\r\n promises.push(ctx.transform('decryptPropDisplayName', usableKey, team));\r\n promises.push(ctx.transform('decryptPropSummary', usableKey, team));\r\n }\r\n\r\n return Promise.all(promises);\r\n },\r\n },\r\n {\r\n name: 'decryptTeamRoomStatus',\r\n direction: 'inbound',\r\n fn(ctx, teamRoomStatus) {\r\n const keyUrl = get(teamRoomStatus, 'activityEvent.encryptionKeyUrl');\r\n\r\n return ctx.transform('decryptObject', keyUrl, teamRoomStatus.activityEvent);\r\n },\r\n },\r\n {\r\n name: 'decryptPropSummary',\r\n direction: 'inbound',\r\n fn(ctx, key, team) {\r\n return ctx.transform('decryptTextProp', 'summary', key, team);\r\n },\r\n },\r\n {\r\n name: 'encryptTeam',\r\n direction: 'outbound',\r\n fn(ctx, key, team) {\r\n if (key === false) {\r\n return Promise.resolve();\r\n }\r\n\r\n return Promise.resolve(\r\n key || ctx.webex.internal.encryption.kms.createUnboundKeys({count: 1})\r\n ).then((keys) => {\r\n const k = isArray(keys) ? keys[0] : keys;\r\n\r\n if (\r\n team.kmsMessage &&\r\n team.kmsMessage.keyUris &&\r\n !team.kmsMessage.keyUris.includes(k.uri)\r\n ) {\r\n team.kmsMessage.keyUris.push(k.uri);\r\n }\r\n\r\n return Promise.all([\r\n ctx.transform('encryptPropDisplayName', k, team),\r\n ctx.transform('encryptPropSummary', k, team),\r\n ]).then(() => {\r\n team.encryptionKeyUrl = k.uri || k;\r\n\r\n // we only want to set the defaultActivityEncryptionKeyUrl if we've\r\n // bound a new key\r\n if (!key) {\r\n team.defaultActivityEncryptionKeyUrl =\r\n team.defaultActivityEncryptionKeyUrl || k.uri || k;\r\n }\r\n });\r\n });\r\n },\r\n },\r\n {\r\n name: 'encryptPropSummary',\r\n direction: 'outbound',\r\n fn(ctx, key, team) {\r\n return ctx.transform('encryptTextProp', 'summary', key, team);\r\n },\r\n },\r\n {\r\n name: 'normalizeTeam',\r\n fn(ctx, team) {\r\n team.conversations = team.conversations || {};\r\n team.conversations.items = team.conversations.items || [];\r\n team.teamMembers = team.teamMembers || {};\r\n team.teamMembers.items = team.teamMembers.items || [];\r\n\r\n return Promise.all([\r\n Promise.all(\r\n team.conversations.items.map((item) => ctx.transform('normalizeObject', item))\r\n ),\r\n Promise.all(\r\n team.teamMembers.items.map((item) => ctx.transform('normalizeObject', item))\r\n ),\r\n ]);\r\n },\r\n },\r\n ],\r\n },\r\n config,\r\n});\r\n\r\nexport {default} from './team';\r\n"],"mappings":";;;;;;;;;;;;;;;;;AAIAA,OAAA;AACAA,OAAA;AACAA,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,KAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAD,sBAAA,CAAAH,OAAA;AAXA;AACA;AACA;;AAWA,IAAAK,iCAAsB,EAAC,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,KAAK,IAAI,EAAE;QACzDH,IAAI,CAAC6B,WAAW,GAAG7B,IAAI,CAAC6B,WAAW,IAAI,CAAC,CAAC;QACzC7B,IAAI,CAAC6B,WAAW,CAAC1B,KAAK,GAAGH,IAAI,CAAC6B,WAAW,CAAC1B,KAAK,IAAI,EAAE;QAErD,OAAOd,QAAA,CAAAC,OAAA,CAAQe,GAAG,CAAC,CACjBhB,QAAA,CAAAC,OAAA,CAAQe,GAAG,CACTL,IAAI,CAACE,aAAa,CAACC,KAAK,CAACG,GAAG,CAAC,UAACC,IAAI;UAAA,OAAKpB,GAAG,CAACqB,SAAS,CAAC,iBAAiB,EAAED,IAAI,CAAC;QAAA,EAAC,CAC/E,EACDlB,QAAA,CAAAC,OAAA,CAAQe,GAAG,CACTL,IAAI,CAAC6B,WAAW,CAAC1B,KAAK,CAACG,GAAG,CAAC,UAACC,IAAI;UAAA,OAAKpB,GAAG,CAACqB,SAAS,CAAC,iBAAiB,EAAED,IAAI,CAAC;QAAA,EAAC,CAC7E,CACF,CAAC;MACJ;IACF,CAAC;EAEL,CAAC;EACDuB,MAAM,EAANA;AACF,CAAC,CAAC"}
1
+ {"version":3,"names":["require","_lodash","_webexCore","_team","_interopRequireDefault","_config","registerInternalPlugin","Team","payloadTransformer","predicates","name","direction","test","ctx","optionsOrResponse","_promise","default","resolve","has","get","extract","activity","object","transforms","fn","key","team","promises","conversations","items","push","all","map","item","transform","usableKey","encryptionKeyUrl","teamRoomStatus","keyUrl","activityEvent","webex","internal","encryption","kms","createUnboundKeys","count","then","keys","k","isArray","kmsMessage","keyUris","includes","uri","defaultActivityEncryptionKeyUrl","teamMembers","config"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport '@webex/internal-plugin-conversation';\nimport '@webex/internal-plugin-user';\nimport '@webex/internal-plugin-encryption';\nimport {isArray, has, get} from 'lodash';\nimport {registerInternalPlugin} from '@webex/webex-core';\n\nimport Team from './team';\nimport config from './config';\n\nregisterInternalPlugin('team', Team, {\n payloadTransformer: {\n predicates: [\n {\n name: 'decryptTeamRoomStatus',\n direction: 'inbound',\n test(ctx, optionsOrResponse) {\n return Promise.resolve(\n has(optionsOrResponse, 'activity.object.activityEvent') &&\n get(optionsOrResponse, 'activity.object.objectType') === 'teamRoomStatus'\n );\n },\n extract(optionsOrResponse) {\n return Promise.resolve(optionsOrResponse.activity.object);\n },\n },\n ],\n transforms: [\n {\n name: 'decryptTeam',\n direction: 'inbound',\n fn(ctx, key, team) {\n const promises = [];\n\n if (team.conversations.items) {\n promises.push(\n Promise.all(\n team.conversations.items.map((item) => ctx.transform('decryptObject', null, item))\n )\n );\n }\n\n const usableKey = team.encryptionKeyUrl || key;\n\n if (usableKey) {\n promises.push(ctx.transform('decryptPropDisplayName', usableKey, team));\n promises.push(ctx.transform('decryptPropSummary', usableKey, team));\n }\n\n return Promise.all(promises);\n },\n },\n {\n name: 'decryptTeamRoomStatus',\n direction: 'inbound',\n fn(ctx, teamRoomStatus) {\n const keyUrl = get(teamRoomStatus, 'activityEvent.encryptionKeyUrl');\n\n return ctx.transform('decryptObject', keyUrl, teamRoomStatus.activityEvent);\n },\n },\n {\n name: 'decryptPropSummary',\n direction: 'inbound',\n fn(ctx, key, team) {\n return ctx.transform('decryptTextProp', 'summary', key, team);\n },\n },\n {\n name: 'encryptTeam',\n direction: 'outbound',\n fn(ctx, key, team) {\n if (key === false) {\n return Promise.resolve();\n }\n\n return Promise.resolve(\n key || ctx.webex.internal.encryption.kms.createUnboundKeys({count: 1})\n ).then((keys) => {\n const k = isArray(keys) ? keys[0] : keys;\n\n if (\n team.kmsMessage &&\n team.kmsMessage.keyUris &&\n !team.kmsMessage.keyUris.includes(k.uri)\n ) {\n team.kmsMessage.keyUris.push(k.uri);\n }\n\n return Promise.all([\n ctx.transform('encryptPropDisplayName', k, team),\n ctx.transform('encryptPropSummary', k, team),\n ]).then(() => {\n team.encryptionKeyUrl = k.uri || k;\n\n // we only want to set the defaultActivityEncryptionKeyUrl if we've\n // bound a new key\n if (!key) {\n team.defaultActivityEncryptionKeyUrl =\n team.defaultActivityEncryptionKeyUrl || k.uri || k;\n }\n });\n });\n },\n },\n {\n name: 'encryptPropSummary',\n direction: 'outbound',\n fn(ctx, key, team) {\n return ctx.transform('encryptTextProp', 'summary', key, team);\n },\n },\n {\n name: 'normalizeTeam',\n fn(ctx, team) {\n team.conversations = team.conversations || {};\n team.conversations.items = team.conversations.items || [];\n team.teamMembers = team.teamMembers || {};\n team.teamMembers.items = team.teamMembers.items || [];\n\n return Promise.all([\n Promise.all(\n team.conversations.items.map((item) => ctx.transform('normalizeObject', item))\n ),\n Promise.all(\n team.teamMembers.items.map((item) => ctx.transform('normalizeObject', item))\n ),\n ]);\n },\n },\n ],\n },\n config,\n});\n\nexport {default} from './team';\n"],"mappings":";;;;;;;;;;;;;;AAIAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAXA;AACA;AACA;;AAWA,IAAAM,iCAAsB,EAAC,MAAM,EAAEC,aAAI,EAAE;EACnCC,kBAAkB,EAAE;IAClBC,UAAU,EAAE,CACV;MACEC,IAAI,EAAE,uBAAuB;MAC7BC,SAAS,EAAE,SAAS;MACpBC,IAAI,WAAAA,KAACC,GAAG,EAAEC,iBAAiB,EAAE;QAC3B,OAAOC,QAAA,CAAAC,OAAA,CAAQC,OAAO,CACpB,IAAAC,WAAG,EAACJ,iBAAiB,EAAE,+BAA+B,CAAC,IACrD,IAAAK,WAAG,EAACL,iBAAiB,EAAE,4BAA4B,CAAC,KAAK,gBAAgB,CAC5E;MACH,CAAC;MACDM,OAAO,WAAAA,QAACN,iBAAiB,EAAE;QACzB,OAAOC,QAAA,CAAAC,OAAA,CAAQC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C1B,KAAK,CAACG,GAAG,CAAC,UAACC,IAAI;UAAA,OAAKpB,GAAG,CAACqB,SAAS,CAAC,iBAAiB,EAAED,IAAI,CAAC;QAAA,EAAC,CAC7E,CACF,CAAC;MACJ;IACF,CAAC;EAEL,CAAC;EACDuB,MAAM,EAANA;AACF,CAAC,CAAC"}
package/dist/team.js CHANGED
@@ -16,14 +16,12 @@ _Object$defineProperty(exports, "__esModule", {
16
16
  });
17
17
  exports.default = void 0;
18
18
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
19
- var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
20
19
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
21
20
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
22
- var _uniq2 = _interopRequireDefault(require("lodash/uniq"));
23
- var _pick2 = _interopRequireDefault(require("lodash/pick"));
24
- var _find2 = _interopRequireDefault(require("lodash/find"));
21
+ var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
25
22
  var _querystring = _interopRequireDefault(require("querystring"));
26
23
  var _uuid = _interopRequireDefault(require("uuid"));
24
+ var _lodash = require("lodash");
27
25
  var _webexCore = require("@webex/webex-core");
28
26
  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; } } }; }
29
27
  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); }
@@ -32,14 +30,14 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
32
30
  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; }
33
31
  var Team = _webexCore.WebexPlugin.extend({
34
32
  namespace: 'Team',
35
- /**
36
- * Move an existing group conversation into a team.
37
- * @param {TeamObject} team
38
- * @param {ConversationObject} conversation
39
- * @param {Object} activity Reference to the activity that will eventually be
40
- * posted. Use this to (a) pass in e.g. clientTempId and (b) render a
41
- * provisional activity
42
- * @returns {Promise} Resolves with the add activity
33
+ /**
34
+ * Move an existing group conversation into a team.
35
+ * @param {TeamObject} team
36
+ * @param {ConversationObject} conversation
37
+ * @param {Object} activity Reference to the activity that will eventually be
38
+ * posted. Use this to (a) pass in e.g. clientTempId and (b) render a
39
+ * provisional activity
40
+ * @returns {Promise} Resolves with the add activity
43
41
  */
44
42
  addConversation: function addConversation(team, conversation, activity) {
45
43
  var _this = this;
@@ -62,14 +60,14 @@ var Team = _webexCore.WebexPlugin.extend({
62
60
  return _this.webex.internal.conversation.submit(a);
63
61
  });
64
62
  },
65
- /**
66
- * Add a member to a team
67
- * @param {TeamObject} team
68
- * @param {Object} participant
69
- * @param {Object} activity Reference to the activity that will eventually be
70
- * posted. Use this to (a) pass in e.g. clientTempId and (b) render a
71
- * provisional activity
72
- * @returns {Promise} Resolves with activity that was posted
63
+ /**
64
+ * Add a member to a team
65
+ * @param {TeamObject} team
66
+ * @param {Object} participant
67
+ * @param {Object} activity Reference to the activity that will eventually be
68
+ * posted. Use this to (a) pass in e.g. clientTempId and (b) render a
69
+ * provisional activity
70
+ * @returns {Promise} Resolves with activity that was posted
73
71
  */
74
72
  addMember: function addMember(team, participant, activity) {
75
73
  var _this2 = this;
@@ -77,13 +75,13 @@ var Team = _webexCore.WebexPlugin.extend({
77
75
  return _this2.webex.internal.conversation.add(generalConversation, participant, activity);
78
76
  });
79
77
  },
80
- /**
81
- * Create a team
82
- * @param {NewTeamObject} params
83
- * @param {string} params.displayName
84
- * @param {string} params.summary
85
- * @param {Array} params.participants
86
- * @returns {Promise} Resolves with the created team
78
+ /**
79
+ * Create a team
80
+ * @param {NewTeamObject} params
81
+ * @param {string} params.displayName
82
+ * @param {string} params.summary
83
+ * @param {Array} params.participants
84
+ * @returns {Promise} Resolves with the created team
87
85
  */
88
86
  create: function create(params) {
89
87
  var _this3 = this;
@@ -99,7 +97,7 @@ var Team = _webexCore.WebexPlugin.extend({
99
97
  });
100
98
  })).then(function (participants) {
101
99
  participants.unshift(_this3.webex.internal.device.userId);
102
- params.participants = (0, _uniq2.default)(participants);
100
+ params.participants = (0, _lodash.uniq)(participants);
103
101
  }).then(function () {
104
102
  return _this3._prepareTeam(params);
105
103
  }).then(function (payload) {
@@ -113,17 +111,17 @@ var Team = _webexCore.WebexPlugin.extend({
113
111
  return res.body;
114
112
  });
115
113
  },
116
- /**
117
- * Create a conversation within a team. Currently does not support
118
- * activities besides add (ie no post or share activities).
119
- * @param {TeamObject} team
120
- * @param {NewConversationObject} params
121
- * @param {string} params.displayName
122
- * @param {string} params.summary
123
- * @param {Array} params.participants
124
- * @param {Object} options
125
- * @param {boolean} options.includeAllTeamMembers
126
- * @returns {Promise} Resolves with the newly created conversation
114
+ /**
115
+ * Create a conversation within a team. Currently does not support
116
+ * activities besides add (ie no post or share activities).
117
+ * @param {TeamObject} team
118
+ * @param {NewConversationObject} params
119
+ * @param {string} params.displayName
120
+ * @param {string} params.summary
121
+ * @param {Array} params.participants
122
+ * @param {Object} options
123
+ * @param {boolean} options.includeAllTeamMembers
124
+ * @returns {Promise} Resolves with the newly created conversation
127
125
  */
128
126
  createConversation: function createConversation(team, params) {
129
127
  var _this4 = this;
@@ -141,7 +139,7 @@ var Team = _webexCore.WebexPlugin.extend({
141
139
  });
142
140
  })).then(function (participants) {
143
141
  participants.unshift(_this4.webex.internal.device.userId);
144
- params.participants = (0, _uniq2.default)(participants);
142
+ params.participants = (0, _lodash.uniq)(participants);
145
143
  }).then(function () {
146
144
  return _this4._prepareTeamConversation(generalConversation, params);
147
145
  });
@@ -149,21 +147,21 @@ var Team = _webexCore.WebexPlugin.extend({
149
147
  return _this4.webex.request({
150
148
  method: 'POST',
151
149
  uri: "".concat(team.url, "/conversations"),
152
- qs: (0, _pick2.default)(options, 'includeAllTeamMembers'),
150
+ qs: (0, _lodash.pick)(options, 'includeAllTeamMembers'),
153
151
  body: payload
154
152
  });
155
153
  }).then(function (res) {
156
154
  return res.body;
157
155
  });
158
156
  },
159
- /**
160
- * Retrieve a single team
161
- * @param {Object|Team~TeamObject} team
162
- * @param {string} team.url
163
- * @param {Object} options
164
- * @param {boolean} options.includeTeamConversations
165
- * @param {boolean} options.includeTeamMembers
166
- * @returns {Promise} Resolves with the requested team
157
+ /**
158
+ * Retrieve a single team
159
+ * @param {Object|Team~TeamObject} team
160
+ * @param {string} team.url
161
+ * @param {Object} options
162
+ * @param {boolean} options.includeTeamConversations
163
+ * @param {boolean} options.includeTeamMembers
164
+ * @returns {Promise} Resolves with the requested team
167
165
  */
168
166
  get: function get(_ref) {
169
167
  var _this5 = this;
@@ -185,11 +183,11 @@ var Team = _webexCore.WebexPlugin.extend({
185
183
  });
186
184
  });
187
185
  },
188
- /**
189
- * Get the list of conversations for a particular team
190
- * @param {TeamObject} team
191
- * @param {String} team.url
192
- * @returns {Promise} Resolves with an array of conversations
186
+ /**
187
+ * Get the list of conversations for a particular team
188
+ * @param {TeamObject} team
189
+ * @param {String} team.url
190
+ * @returns {Promise} Resolves with an array of conversations
193
191
  */
194
192
  listConversations: function listConversations(_ref2) {
195
193
  var url = _ref2.url;
@@ -202,12 +200,12 @@ var Team = _webexCore.WebexPlugin.extend({
202
200
  return res.body.items;
203
201
  });
204
202
  },
205
- /**
206
- * Join a team conversation
207
- * @param {TeamObject} team
208
- * @param {ConversationObject} conversation
209
- * @param {userId} userId
210
- * @returns {Promise} Resolves with the conversation
203
+ /**
204
+ * Join a team conversation
205
+ * @param {TeamObject} team
206
+ * @param {ConversationObject} conversation
207
+ * @param {userId} userId
208
+ * @returns {Promise} Resolves with the conversation
211
209
  */
212
210
  joinConversation: function joinConversation(team, conversation, userId) {
213
211
  if (!userId) {
@@ -237,12 +235,12 @@ var Team = _webexCore.WebexPlugin.extend({
237
235
  return res.body;
238
236
  });
239
237
  },
240
- /**
241
- * Retrieve all teams
242
- * @param {Object} options
243
- * @param {boolean} options.includeTeamConversations
244
- * @param {boolean} options.includeTeamMembers
245
- * @returns {Promise} Resolves with the requested teams
238
+ /**
239
+ * Retrieve all teams
240
+ * @param {Object} options
241
+ * @param {boolean} options.includeTeamConversations
242
+ * @param {boolean} options.includeTeamMembers
243
+ * @returns {Promise} Resolves with the requested teams
246
244
  */
247
245
  list: function list() {
248
246
  var _arguments = arguments,
@@ -308,14 +306,14 @@ var Team = _webexCore.WebexPlugin.extend({
308
306
  }, _callee);
309
307
  }))();
310
308
  },
311
- /**
312
- * Remove a member from a team
313
- * @param {TeamObject} team
314
- * @param {Object} participant
315
- * @param {Object} activity Reference to the activity that will eventually be
316
- * posted. Use this to (a) pass in e.g. clientTempId and (b) render a
317
- * provisional activity
318
- * @returns {Promise} Resolves with activity that was posted
309
+ /**
310
+ * Remove a member from a team
311
+ * @param {TeamObject} team
312
+ * @param {Object} participant
313
+ * @param {Object} activity Reference to the activity that will eventually be
314
+ * posted. Use this to (a) pass in e.g. clientTempId and (b) render a
315
+ * provisional activity
316
+ * @returns {Promise} Resolves with activity that was posted
319
317
  */
320
318
  removeMember: function removeMember(team, participant, activity) {
321
319
  var _this7 = this;
@@ -323,22 +321,22 @@ var Team = _webexCore.WebexPlugin.extend({
323
321
  return _this7.webex.internal.conversation.leave(generalConversation, participant, activity);
324
322
  });
325
323
  },
326
- /**
327
- * Remove a team conversation from a team.
328
- * @param {TeamObject} team
329
- * @param {ConversationObject} conversation to be removed
330
- * @param {Object} activity Reference to the activity that will eventually be
331
- * posted. Use this to (a) pass in e.g. clientTempId and (b) render a
332
- * provisional activity
333
- * @returns {Promise} Resolves with the leave activity
324
+ /**
325
+ * Remove a team conversation from a team.
326
+ * @param {TeamObject} team
327
+ * @param {ConversationObject} conversation to be removed
328
+ * @param {Object} activity Reference to the activity that will eventually be
329
+ * posted. Use this to (a) pass in e.g. clientTempId and (b) render a
330
+ * provisional activity
331
+ * @returns {Promise} Resolves with the leave activity
334
332
  */
335
333
  removeConversation: function removeConversation(team, conversation, activity) {
336
334
  var _this8 = this;
337
335
  return this._ensureGeneralConversation(team).then(function (generalConversation) {
338
336
  var properties = {
339
337
  verb: 'remove',
340
- object: (0, _pick2.default)(conversation, 'id', 'url', 'objectType'),
341
- target: (0, _pick2.default)(generalConversation, 'id', 'url', 'objectType'),
338
+ object: (0, _lodash.pick)(conversation, 'id', 'url', 'objectType'),
339
+ target: (0, _lodash.pick)(generalConversation, 'id', 'url', 'objectType'),
342
340
  kmsMessage: {
343
341
  method: 'delete',
344
342
  uri: "<KRO>/authorizations?".concat(_querystring.default.stringify({
@@ -351,14 +349,14 @@ var Team = _webexCore.WebexPlugin.extend({
351
349
  return _this8.webex.internal.conversation.submit(a);
352
350
  });
353
351
  },
354
- /**
355
- * Update the displayName, summary, or teamColor field for a team.
356
- * @param {TeamObject} team to be updated
357
- * @param {Object} object with updated displayName, summary, and/or teamColor
358
- * @param {Object} activity Reference to the activity that will eventually be
359
- * posted. Use this to (a) pass in e.g. clientTempId and (b) render a
360
- * provisional activity
361
- * @returns {Promise} Resolves with posted activity
352
+ /**
353
+ * Update the displayName, summary, or teamColor field for a team.
354
+ * @param {TeamObject} team to be updated
355
+ * @param {Object} object with updated displayName, summary, and/or teamColor
356
+ * @param {Object} activity Reference to the activity that will eventually be
357
+ * posted. Use this to (a) pass in e.g. clientTempId and (b) render a
358
+ * provisional activity
359
+ * @returns {Promise} Resolves with posted activity
362
360
  */
363
361
  update: function update(team, object, activity) {
364
362
  return this.webex.internal.conversation.update(team, object, activity);
@@ -368,7 +366,7 @@ var Team = _webexCore.WebexPlugin.extend({
368
366
  return _promise.default.reject(new Error('`team.generalConversationUuid` must be present'));
369
367
  }
370
368
  if (team.conversations.items.length) {
371
- var generalConversation = (0, _find2.default)(team.conversations.items, {
369
+ var generalConversation = (0, _lodash.find)(team.conversations.items, {
372
370
  id: team.generalConversationUuid
373
371
  });
374
372
  if (generalConversation) {
@@ -414,15 +412,15 @@ var Team = _webexCore.WebexPlugin.extend({
414
412
  });
415
413
  }));
416
414
  } /* eslint-enable require-jsdoc */,
417
- version: "2.59.0"
415
+ version: "2.59.4-next.1"
418
416
  });
419
417
 
420
- /**
421
- * Assign or unassign a team member to be a moderator of a team
422
- * @param {TeamObject} team
423
- * @param {Object} participant
424
- * @param {Object} activity
425
- * @returns {Promise} Resolves with activity that was posted
418
+ /**
419
+ * Assign or unassign a team member to be a moderator of a team
420
+ * @param {TeamObject} team
421
+ * @param {Object} participant
422
+ * @param {Object} activity
423
+ * @returns {Promise} Resolves with activity that was posted
426
424
  */
427
425
  ['assignModerator', 'unassignModerator'].forEach(function (verb) {
428
426
  Team.prototype[verb] = function submitModerationChangeActivity(team, member, activity) {
@@ -433,13 +431,13 @@ var Team = _webexCore.WebexPlugin.extend({
433
431
  };
434
432
  });
435
433
 
436
- /**
437
- * Archive or unarchive a team or team conversation.
438
- * @param {TeamObject|ConversationObject} target team or team conversation that should be archived
439
- * @param {Object} activity Reference to the activity that will eventually be
440
- * posted. Use this to (a) pass in e.g. clientTempId and (b) render a
441
- * provisional activity
442
- * @returns {Promise} Resolves with the posted activity
434
+ /**
435
+ * Archive or unarchive a team or team conversation.
436
+ * @param {TeamObject|ConversationObject} target team or team conversation that should be archived
437
+ * @param {Object} activity Reference to the activity that will eventually be
438
+ * posted. Use this to (a) pass in e.g. clientTempId and (b) render a
439
+ * provisional activity
440
+ * @returns {Promise} Resolves with the posted activity
443
441
  */
444
442
  ['archive', 'unarchive'].forEach(function (verb) {
445
443
  Team.prototype[verb] = function submitArchiveStateChangeActivity(target, activity) {
@@ -449,8 +447,8 @@ var Team = _webexCore.WebexPlugin.extend({
449
447
  }
450
448
  var properties = {
451
449
  verb: verb,
452
- object: (0, _pick2.default)(target, 'id', 'url', 'objectType'),
453
- target: (0, _pick2.default)(target, 'id', 'url', 'objectType')
450
+ object: (0, _lodash.pick)(target, 'id', 'url', 'objectType'),
451
+ target: (0, _lodash.pick)(target, 'id', 'url', 'objectType')
454
452
  };
455
453
  var teamUrl = this.webex.internal.conversation.getConvoUrl(target);
456
454
  return this.webex.internal.conversation.prepare(activity, properties).then(function (a) {