@webex/internal-plugin-support 2.59.2 → 2.59.3-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-support
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 Support-related endpoints
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-support
19
- ```
20
-
21
- ## Usage
22
-
23
- ```js
24
- import '@webex/internal-plugin-support';
25
-
26
- import WebexCore from '@webex/webex-core';
27
-
28
- const webex = new WebexCore();
29
- webex.internal.support.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-support
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 Support-related endpoints
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-support
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ```js
24
+ import '@webex/internal-plugin-support';
25
+
26
+ import WebexCore from '@webex/webex-core';
27
+
28
+ const webex = new WebexCore();
29
+ webex.internal.support.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
  device: {
@@ -1 +1 @@
1
- {"version":3,"names":["_default","device","preDiscoveryServices","atlasServiceUrl","process","env","ATLAS_SERVICE_URL","atlas","clientLogs","CLIENT_LOGS_SERVICE_URL","clientLogsServiceUrl","support","appType","appVersion","languageCode","exports","default"],"sources":["config.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nexport default {\n device: {\n preDiscoveryServices: {\n atlasServiceUrl: process.env.ATLAS_SERVICE_URL || 'https://atlas-a.wbx2.com/admin/api/v1',\n atlas: process.env.ATLAS_SERVICE_URL || 'https://atlas-a.wbx2.com/admin/api/v1',\n clientLogs: process.env.CLIENT_LOGS_SERVICE_URL || 'https://client-logs-a.wbx2.com/api/v1',\n clientLogsServiceUrl:\n process.env.CLIENT_LOGS_SERVICE_URL || 'https://client-logs-a.wbx2.com/api/v1',\n },\n },\n\n support: {\n appType: '',\n appVersion: '',\n languageCode: '',\n },\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAFA,IAAAA,QAAA,GAIe;EACbC,MAAM,EAAE;IACNC,oBAAoB,EAAE;MACpBC,eAAe,EAAEC,OAAO,CAACC,GAAG,CAACC,iBAAiB,IAAI,uCAAuC;MACzFC,KAAK,EAAEH,OAAO,CAACC,GAAG,CAACC,iBAAiB,IAAI,uCAAuC;MAC/EE,UAAU,EAAEJ,OAAO,CAACC,GAAG,CAACI,uBAAuB,IAAI,uCAAuC;MAC1FC,oBAAoB,EAClBN,OAAO,CAACC,GAAG,CAACI,uBAAuB,IAAI;IAC3C;EACF,CAAC;EAEDE,OAAO,EAAE;IACPC,OAAO,EAAE,EAAE;IACXC,UAAU,EAAE,EAAE;IACdC,YAAY,EAAE;EAChB;AACF,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAhB,QAAA"}
1
+ {"version":3,"names":["_default","device","preDiscoveryServices","atlasServiceUrl","process","env","ATLAS_SERVICE_URL","atlas","clientLogs","CLIENT_LOGS_SERVICE_URL","clientLogsServiceUrl","support","appType","appVersion","languageCode","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 device: {\r\n preDiscoveryServices: {\r\n atlasServiceUrl: process.env.ATLAS_SERVICE_URL || 'https://atlas-a.wbx2.com/admin/api/v1',\r\n atlas: process.env.ATLAS_SERVICE_URL || 'https://atlas-a.wbx2.com/admin/api/v1',\r\n clientLogs: process.env.CLIENT_LOGS_SERVICE_URL || 'https://client-logs-a.wbx2.com/api/v1',\r\n clientLogsServiceUrl:\r\n process.env.CLIENT_LOGS_SERVICE_URL || 'https://client-logs-a.wbx2.com/api/v1',\r\n },\r\n },\r\n\r\n support: {\r\n appType: '',\r\n appVersion: '',\r\n languageCode: '',\r\n },\r\n};\r\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAFA,IAAAA,QAAA,GAIe;EACbC,MAAM,EAAE;IACNC,oBAAoB,EAAE;MACpBC,eAAe,EAAEC,OAAO,CAACC,GAAG,CAACC,iBAAiB,IAAI,uCAAuC;MACzFC,KAAK,EAAEH,OAAO,CAACC,GAAG,CAACC,iBAAiB,IAAI,uCAAuC;MAC/EE,UAAU,EAAEJ,OAAO,CAACC,GAAG,CAACI,uBAAuB,IAAI,uCAAuC;MAC1FC,oBAAoB,EAClBN,OAAO,CAACC,GAAG,CAACI,uBAAuB,IAAI;IAC3C;EACF,CAAC;EAEDE,OAAO,EAAE;IACPC,OAAO,EAAE,EAAE;IACXC,UAAU,EAAE,EAAE;IACdC,YAAY,EAAE;EAChB;AACF,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAhB,QAAA"}
package/dist/index.js CHANGED
@@ -15,8 +15,8 @@ require("@webex/internal-plugin-device");
15
15
  var _webexCore = require("@webex/webex-core");
16
16
  var _support = _interopRequireDefault(require("./support"));
17
17
  var _config = _interopRequireDefault(require("./config"));
18
- /*!
19
- * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
18
+ /*!
19
+ * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
20
20
  */
21
21
 
22
22
  (0, _webexCore.registerInternalPlugin)('support', _support.default, {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["require","_webexCore","_support","_interopRequireDefault","_config","registerInternalPlugin","Support","config"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nimport '@webex/internal-plugin-device';\n\nimport {registerInternalPlugin} from '@webex/webex-core';\n\nimport Support from './support';\nimport config from './config';\n\nregisterInternalPlugin('support', Support, {\n config,\n});\n\nexport {default} from './support';\n"],"mappings":";;;;;;;;;;;;;AAGAA,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAD,sBAAA,CAAAH,OAAA;AARA;AACA;AACA;;AAQA,IAAAK,iCAAsB,EAAC,SAAS,EAAEC,gBAAO,EAAE;EACzCC,MAAM,EAANA;AACF,CAAC,CAAC"}
1
+ {"version":3,"names":["require","_webexCore","_support","_interopRequireDefault","_config","registerInternalPlugin","Support","config"],"sources":["index.js"],"sourcesContent":["/*!\r\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\r\n */\r\nimport '@webex/internal-plugin-device';\r\n\r\nimport {registerInternalPlugin} from '@webex/webex-core';\r\n\r\nimport Support from './support';\r\nimport config from './config';\r\n\r\nregisterInternalPlugin('support', Support, {\r\n config,\r\n});\r\n\r\nexport {default} from './support';\r\n"],"mappings":";;;;;;;;;;;;;AAGAA,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAD,sBAAA,CAAAH,OAAA;AARA;AACA;AACA;;AAQA,IAAAK,iCAAsB,EAAC,SAAS,EAAEC,gBAAO,EAAE;EACzCC,MAAM,EAANA;AACF,CAAC,CAAC"}
package/dist/support.js CHANGED
@@ -11,8 +11,8 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/
11
11
  var _defaults2 = _interopRequireDefault(require("lodash/defaults"));
12
12
  var _webexCore = require("@webex/webex-core");
13
13
  var _uuid = _interopRequireDefault(require("uuid"));
14
- /*!
15
- * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
14
+ /*!
15
+ * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
16
16
  */
17
17
 
18
18
  var Support = _webexCore.WebexPlugin.extend({
@@ -123,10 +123,10 @@ var Support = _webexCore.WebexPlugin.extend({
123
123
  return body;
124
124
  });
125
125
  },
126
- /**
127
- * Constructs an array of key-value pairs for log upload.
128
- * @param {*} metadata
129
- * @returns {array}
126
+ /**
127
+ * Constructs an array of key-value pairs for log upload.
128
+ * @param {*} metadata
129
+ * @returns {array}
130
130
  */
131
131
  _constructFileMetadata: function _constructFileMetadata(metadata) {
132
132
  var metadataArray = ['locusId', 'callStart', 'feedbackId', 'correlationId', 'meetingId', 'surveySessionId'].map(function (key) {
@@ -160,7 +160,7 @@ var Support = _webexCore.WebexPlugin.extend({
160
160
  }
161
161
  return metadataArray;
162
162
  },
163
- version: "2.59.2"
163
+ version: "2.59.0"
164
164
  });
165
165
  var _default = Support;
166
166
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"names":["_webexCore","require","_uuid","_interopRequireDefault","Support","WebexPlugin","extend","namespace","getFeedbackUrl","options","request","method","api","resource","body","_defaults2","default","appVersion","config","appType","feedbackId","uuid","v4","languageCode","then","res","url","getSupportUrl","webex","qs","submitLogs","metadata","logs","_this","metadataArray","_constructFileMetadata","logger","sdkBuffer","clientBuffer","buffer","formatLogs","filename","locusId","callStart","concat","sessionId","userId","credentials","getUserToken","catch","getClientToken","_ref","_asyncToGenerator2","_regenerator","mark","_callee","token","headers","initalOpts","finalOpts","wrap","_callee$","_context","prev","next","authorization","toString","service","file","shouldAttemptReauth","phases","initialize","upload","$uri","session","tempURL","finalize","$body","logFilename","data","internal","device","abrupt","stop","_x","apply","arguments","map","key","value","filter","entry","Boolean","push","orgId","version","_default","exports"],"sources":["support.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {WebexPlugin} from '@webex/webex-core';\nimport {defaults} from 'lodash';\nimport uuid from 'uuid';\n\nconst Support = WebexPlugin.extend({\n namespace: 'Support',\n\n getFeedbackUrl(options) {\n options = options || {};\n\n return this.request({\n method: 'POST',\n api: 'conversation',\n resource: 'users/deskFeedbackUrl',\n body: defaults(options, {\n appVersion: this.config.appVersion,\n appType: this.config.appType,\n feedbackId: options.feedbackId || uuid.v4(),\n languageCode: this.config.languageCode,\n }),\n }).then((res) => res.body.url);\n },\n\n getSupportUrl() {\n return this.webex\n .request({\n method: 'GET',\n api: 'conversation',\n resource: 'users/deskSupportUrl',\n qs: {\n languageCode: this.config.languageCode,\n },\n })\n .then((res) => res.body.url);\n },\n\n submitLogs(metadata, logs) {\n const metadataArray = this._constructFileMetadata(metadata);\n\n // this is really testing that Ampersand is fully ready. once it's ready, these exist\n if (\n !logs &&\n this.webex.logger.sdkBuffer &&\n this.webex.logger.clientBuffer &&\n this.webex.logger.buffer\n ) {\n logs = this.webex.logger.formatLogs();\n }\n\n let filename;\n\n if (metadata.locusId && metadata.callStart) {\n filename = `${metadata.locusId}_${metadata.callStart}.txt`;\n } else {\n filename = `${this.webex.sessionId}.txt`;\n }\n\n let userId;\n\n return this.webex.credentials\n .getUserToken()\n .catch(() => this.webex.credentials.getClientToken())\n .then(async (token) => {\n const headers = {authorization: token.toString()};\n\n const initalOpts = {\n service: 'clientLogs',\n resource: 'logs/urls',\n };\n\n const finalOpts = {\n service: 'clientLogs',\n resource: 'logs/meta',\n };\n\n const options = defaults(initalOpts, {\n file: logs,\n shouldAttemptReauth: false,\n headers,\n phases: {\n initialize: {\n body: {\n file: filename,\n },\n },\n upload: {\n $uri: (session) => session.tempURL,\n },\n finalize: defaults(finalOpts, {\n $body: (session) => {\n userId = session.userId;\n\n return {\n filename: session.logFilename,\n data: metadataArray,\n userId: this.webex.internal.device.userId || session.userId,\n };\n },\n }),\n },\n });\n\n return this.webex.upload(options);\n })\n .then((body) => {\n if (userId && !body.userId) {\n body.userId = userId;\n }\n\n return body;\n });\n },\n\n /**\n * Constructs an array of key-value pairs for log upload.\n * @param {*} metadata\n * @returns {array}\n */\n _constructFileMetadata(metadata) {\n const metadataArray = [\n 'locusId',\n 'callStart',\n 'feedbackId',\n 'correlationId',\n 'meetingId',\n 'surveySessionId',\n ]\n .map((key) => {\n if (metadata[key]) {\n return {\n key,\n value: metadata[key],\n };\n }\n\n return null;\n })\n .filter((entry) => Boolean(entry));\n\n if (this.webex.sessionId) {\n metadataArray.push({\n key: 'trackingId',\n value: this.webex.sessionId,\n });\n }\n\n if (this.webex.internal.device.userId) {\n metadataArray.push({\n key: 'userId',\n value: this.webex.internal.device.userId,\n });\n }\n\n if (this.webex.internal.device.orgId) {\n metadataArray.push({\n key: 'orgId',\n value: this.webex.internal.device.orgId,\n });\n }\n\n return metadataArray;\n },\n});\n\nexport default Support;\n"],"mappings":";;;;;;;;;;;AAIA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AANA;AACA;AACA;;AAMA,IAAMG,OAAO,GAAGC,sBAAW,CAACC,MAAM,CAAC;EACjCC,SAAS,EAAE,SAAS;EAEpBC,cAAc,WAAAA,eAACC,OAAO,EAAE;IACtBA,OAAO,GAAGA,OAAO,IAAI,CAAC,CAAC;IAEvB,OAAO,IAAI,CAACC,OAAO,CAAC;MAClBC,MAAM,EAAE,MAAM;MACdC,GAAG,EAAE,cAAc;MACnBC,QAAQ,EAAE,uBAAuB;MACjCC,IAAI,EAAE,IAAAC,UAAA,CAAAC,OAAA,EAASP,OAAO,EAAE;QACtBQ,UAAU,EAAE,IAAI,CAACC,MAAM,CAACD,UAAU;QAClCE,OAAO,EAAE,IAAI,CAACD,MAAM,CAACC,OAAO;QAC5BC,UAAU,EAAEX,OAAO,CAACW,UAAU,IAAIC,aAAI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AS,EAAE;MACxBX,aAAa,CAAC2D,IAAI,CAAC;QACjBL,GAAG,EAAE,YAAY;QACjBC,KAAK,EAAE,IAAI,CAAC7D,KAAK,CAACiB;MACpB,CAAC,CAAC;IACJ;IAEA,IAAI,IAAI,CAACjB,KAAK,CAACoD,QAAQ,CAACC,MAAM,CAACnC,MAAM,EAAE;MACrCZ,aAAa,CAAC2D,IAAI,CAAC;QACjBL,GAAG,EAAE,QAAQ;QACbC,KAAK,EAAE,IAAI,CAAC7D,KAAK,CAACoD,QAAQ,CAACC,MAAM,CAACnC;MACpC,CAAC,CAAC;IACJ;IAEA,IAAI,IAAI,CAAClB,KAAK,CAACoD,QAAQ,CAACC,MAAM,CAACa,KAAK,EAAE;MACpC5D,aAAa,CAAC2D,IAAI,CAAC;QACjBL,GAAG,EAAE,OAAO;QACZC,KAAK,EAAE,IAAI,CAAC7D,KAAK,CAACoD,QAAQ,CAACC,MAAM,CAACa;MACpC,CAAC,CAAC;IACJ;IAEA,OAAO5D,aAAa;EACtB,CAAC;EAAA6D,OAAA;AACH,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEY5F,OAAO;AAAA6F,OAAA,CAAAjF,OAAA,GAAAgF,QAAA"}
1
+ {"version":3,"names":["_webexCore","require","_uuid","_interopRequireDefault","Support","WebexPlugin","extend","namespace","getFeedbackUrl","options","request","method","api","resource","body","_defaults2","default","appVersion","config","appType","feedbackId","uuid","v4","languageCode","then","res","url","getSupportUrl","webex","qs","submitLogs","metadata","logs","_this","metadataArray","_constructFileMetadata","logger","sdkBuffer","clientBuffer","buffer","formatLogs","filename","locusId","callStart","concat","sessionId","userId","credentials","getUserToken","catch","getClientToken","_ref","_asyncToGenerator2","_regenerator","mark","_callee","token","headers","initalOpts","finalOpts","wrap","_callee$","_context","prev","next","authorization","toString","service","file","shouldAttemptReauth","phases","initialize","upload","$uri","session","tempURL","finalize","$body","logFilename","data","internal","device","abrupt","stop","_x","apply","arguments","map","key","value","filter","entry","Boolean","push","orgId","version","_default","exports"],"sources":["support.js"],"sourcesContent":["/*!\r\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\r\n */\r\n\r\nimport {WebexPlugin} from '@webex/webex-core';\r\nimport {defaults} from 'lodash';\r\nimport uuid from 'uuid';\r\n\r\nconst Support = WebexPlugin.extend({\r\n namespace: 'Support',\r\n\r\n getFeedbackUrl(options) {\r\n options = options || {};\r\n\r\n return this.request({\r\n method: 'POST',\r\n api: 'conversation',\r\n resource: 'users/deskFeedbackUrl',\r\n body: defaults(options, {\r\n appVersion: this.config.appVersion,\r\n appType: this.config.appType,\r\n feedbackId: options.feedbackId || uuid.v4(),\r\n languageCode: this.config.languageCode,\r\n }),\r\n }).then((res) => res.body.url);\r\n },\r\n\r\n getSupportUrl() {\r\n return this.webex\r\n .request({\r\n method: 'GET',\r\n api: 'conversation',\r\n resource: 'users/deskSupportUrl',\r\n qs: {\r\n languageCode: this.config.languageCode,\r\n },\r\n })\r\n .then((res) => res.body.url);\r\n },\r\n\r\n submitLogs(metadata, logs) {\r\n const metadataArray = this._constructFileMetadata(metadata);\r\n\r\n // this is really testing that Ampersand is fully ready. once it's ready, these exist\r\n if (\r\n !logs &&\r\n this.webex.logger.sdkBuffer &&\r\n this.webex.logger.clientBuffer &&\r\n this.webex.logger.buffer\r\n ) {\r\n logs = this.webex.logger.formatLogs();\r\n }\r\n\r\n let filename;\r\n\r\n if (metadata.locusId && metadata.callStart) {\r\n filename = `${metadata.locusId}_${metadata.callStart}.txt`;\r\n } else {\r\n filename = `${this.webex.sessionId}.txt`;\r\n }\r\n\r\n let userId;\r\n\r\n return this.webex.credentials\r\n .getUserToken()\r\n .catch(() => this.webex.credentials.getClientToken())\r\n .then(async (token) => {\r\n const headers = {authorization: token.toString()};\r\n\r\n const initalOpts = {\r\n service: 'clientLogs',\r\n resource: 'logs/urls',\r\n };\r\n\r\n const finalOpts = {\r\n service: 'clientLogs',\r\n resource: 'logs/meta',\r\n };\r\n\r\n const options = defaults(initalOpts, {\r\n file: logs,\r\n shouldAttemptReauth: false,\r\n headers,\r\n phases: {\r\n initialize: {\r\n body: {\r\n file: filename,\r\n },\r\n },\r\n upload: {\r\n $uri: (session) => session.tempURL,\r\n },\r\n finalize: defaults(finalOpts, {\r\n $body: (session) => {\r\n userId = session.userId;\r\n\r\n return {\r\n filename: session.logFilename,\r\n data: metadataArray,\r\n userId: this.webex.internal.device.userId || session.userId,\r\n };\r\n },\r\n }),\r\n },\r\n });\r\n\r\n return this.webex.upload(options);\r\n })\r\n .then((body) => {\r\n if (userId && !body.userId) {\r\n body.userId = userId;\r\n }\r\n\r\n return body;\r\n });\r\n },\r\n\r\n /**\r\n * Constructs an array of key-value pairs for log upload.\r\n * @param {*} metadata\r\n * @returns {array}\r\n */\r\n _constructFileMetadata(metadata) {\r\n const metadataArray = [\r\n 'locusId',\r\n 'callStart',\r\n 'feedbackId',\r\n 'correlationId',\r\n 'meetingId',\r\n 'surveySessionId',\r\n ]\r\n .map((key) => {\r\n if (metadata[key]) {\r\n return {\r\n key,\r\n value: metadata[key],\r\n };\r\n }\r\n\r\n return null;\r\n })\r\n .filter((entry) => Boolean(entry));\r\n\r\n if (this.webex.sessionId) {\r\n metadataArray.push({\r\n key: 'trackingId',\r\n value: this.webex.sessionId,\r\n });\r\n }\r\n\r\n if (this.webex.internal.device.userId) {\r\n metadataArray.push({\r\n key: 'userId',\r\n value: this.webex.internal.device.userId,\r\n });\r\n }\r\n\r\n if (this.webex.internal.device.orgId) {\r\n metadataArray.push({\r\n key: 'orgId',\r\n value: this.webex.internal.device.orgId,\r\n });\r\n }\r\n\r\n return metadataArray;\r\n },\r\n});\r\n\r\nexport default Support;\r\n"],"mappings":";;;;;;;;;;;AAIA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AANA;AACA;AACA;;AAMA,IAAMG,OAAO,GAAGC,sBAAW,CAACC,MAAM,CAAC;EACjCC,SAAS,EAAE,SAAS;EAE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.exports = config;
1
+ const config = require('@webex/jest-config-legacy');
2
+
3
+ module.exports = config;
package/package.json CHANGED
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "name": "@webex/internal-plugin-support",
3
- "version": "2.59.2",
4
3
  "description": "",
5
4
  "license": "MIT",
6
5
  "author": "nickclar <nickclar@cisco.com>",
@@ -21,19 +20,20 @@
21
20
  ]
22
21
  },
23
22
  "dependencies": {
24
- "@webex/internal-plugin-device": "2.59.2",
25
- "@webex/internal-plugin-search": "2.59.2",
26
- "@webex/test-helper-chai": "2.59.2",
27
- "@webex/test-helper-file": "2.59.2",
28
- "@webex/test-helper-mock-webex": "2.59.2",
29
- "@webex/test-helper-test-users": "2.59.2",
30
- "@webex/webex-core": "2.59.2",
23
+ "@webex/internal-plugin-device": "^2.59.3-next.1",
24
+ "@webex/internal-plugin-search": "^2.59.3-next.1",
25
+ "@webex/test-helper-chai": "^2.59.3-next.1",
26
+ "@webex/test-helper-file": "^2.59.3-next.1",
27
+ "@webex/test-helper-mock-webex": "^2.59.3-next.1",
28
+ "@webex/test-helper-test-users": "^2.59.3-next.1",
29
+ "@webex/webex-core": "^2.59.3-next.1",
31
30
  "lodash": "^4.17.21",
32
31
  "uuid": "^3.3.2"
33
32
  },
34
33
  "scripts": {
35
34
  "build": "yarn build:src",
36
35
  "build:src": "webex-legacy-tools build -dest \"./dist\" -src \"./src\" -js -ts -maps",
36
+ "deploy:npm": "yarn npm publish",
37
37
  "test": "yarn test:style && yarn test:unit && yarn test:integration && yarn test:browser",
38
38
  "test:browser:broken": "webex-legacy-tools test --integration --unit --runner karma",
39
39
  "test:integratio:broken": "webex-legacy-tools test --integration --runner mocha",
@@ -42,15 +42,16 @@
42
42
  },
43
43
  "devDependencies": {
44
44
  "@babel/core": "^7.17.10",
45
- "@webex/babel-config-legacy": "2.59.2",
46
- "@webex/eslint-config-legacy": "2.59.2",
47
- "@webex/jest-config-legacy": "2.59.2",
48
- "@webex/legacy-tools": "2.59.2",
49
- "@webex/test-helper-chai": "2.59.2",
50
- "@webex/test-helper-mocha": "2.59.2",
51
- "@webex/test-helper-mock-webex": "2.59.2",
52
- "@webex/test-helper-test-users": "2.59.2",
45
+ "@webex/babel-config-legacy": "^0.0.0",
46
+ "@webex/eslint-config-legacy": "^0.0.0",
47
+ "@webex/jest-config-legacy": "^0.0.0",
48
+ "@webex/legacy-tools": "^0.0.0",
49
+ "@webex/test-helper-chai": "^2.59.3-next.1",
50
+ "@webex/test-helper-mocha": "^2.59.3-next.1",
51
+ "@webex/test-helper-mock-webex": "^2.59.3-next.1",
52
+ "@webex/test-helper-test-users": "^2.59.3-next.1",
53
53
  "eslint": "^8.24.0",
54
54
  "prettier": "^2.7.1"
55
- }
56
- }
55
+ },
56
+ "version": "2.59.3-next.1"
57
+ }
package/process CHANGED
@@ -1 +1 @@
1
- module.exports = {browser: true};
1
+ module.exports = {browser: true};
package/src/config.js CHANGED
@@ -1,21 +1,21 @@
1
- /*!
2
- * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
- */
4
-
5
- export default {
6
- device: {
7
- preDiscoveryServices: {
8
- atlasServiceUrl: process.env.ATLAS_SERVICE_URL || 'https://atlas-a.wbx2.com/admin/api/v1',
9
- atlas: process.env.ATLAS_SERVICE_URL || 'https://atlas-a.wbx2.com/admin/api/v1',
10
- clientLogs: process.env.CLIENT_LOGS_SERVICE_URL || 'https://client-logs-a.wbx2.com/api/v1',
11
- clientLogsServiceUrl:
12
- process.env.CLIENT_LOGS_SERVICE_URL || 'https://client-logs-a.wbx2.com/api/v1',
13
- },
14
- },
15
-
16
- support: {
17
- appType: '',
18
- appVersion: '',
19
- languageCode: '',
20
- },
21
- };
1
+ /*!
2
+ * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
+ */
4
+
5
+ export default {
6
+ device: {
7
+ preDiscoveryServices: {
8
+ atlasServiceUrl: process.env.ATLAS_SERVICE_URL || 'https://atlas-a.wbx2.com/admin/api/v1',
9
+ atlas: process.env.ATLAS_SERVICE_URL || 'https://atlas-a.wbx2.com/admin/api/v1',
10
+ clientLogs: process.env.CLIENT_LOGS_SERVICE_URL || 'https://client-logs-a.wbx2.com/api/v1',
11
+ clientLogsServiceUrl:
12
+ process.env.CLIENT_LOGS_SERVICE_URL || 'https://client-logs-a.wbx2.com/api/v1',
13
+ },
14
+ },
15
+
16
+ support: {
17
+ appType: '',
18
+ appVersion: '',
19
+ languageCode: '',
20
+ },
21
+ };
package/src/index.js CHANGED
@@ -1,15 +1,15 @@
1
- /*!
2
- * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
- */
4
- import '@webex/internal-plugin-device';
5
-
6
- import {registerInternalPlugin} from '@webex/webex-core';
7
-
8
- import Support from './support';
9
- import config from './config';
10
-
11
- registerInternalPlugin('support', Support, {
12
- config,
13
- });
14
-
15
- export {default} from './support';
1
+ /*!
2
+ * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
+ */
4
+ import '@webex/internal-plugin-device';
5
+
6
+ import {registerInternalPlugin} from '@webex/webex-core';
7
+
8
+ import Support from './support';
9
+ import config from './config';
10
+
11
+ registerInternalPlugin('support', Support, {
12
+ config,
13
+ });
14
+
15
+ export {default} from './support';
package/src/support.js CHANGED
@@ -1,169 +1,169 @@
1
- /*!
2
- * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
- */
4
-
5
- import {WebexPlugin} from '@webex/webex-core';
6
- import {defaults} from 'lodash';
7
- import uuid from 'uuid';
8
-
9
- const Support = WebexPlugin.extend({
10
- namespace: 'Support',
11
-
12
- getFeedbackUrl(options) {
13
- options = options || {};
14
-
15
- return this.request({
16
- method: 'POST',
17
- api: 'conversation',
18
- resource: 'users/deskFeedbackUrl',
19
- body: defaults(options, {
20
- appVersion: this.config.appVersion,
21
- appType: this.config.appType,
22
- feedbackId: options.feedbackId || uuid.v4(),
23
- languageCode: this.config.languageCode,
24
- }),
25
- }).then((res) => res.body.url);
26
- },
27
-
28
- getSupportUrl() {
29
- return this.webex
30
- .request({
31
- method: 'GET',
32
- api: 'conversation',
33
- resource: 'users/deskSupportUrl',
34
- qs: {
35
- languageCode: this.config.languageCode,
36
- },
37
- })
38
- .then((res) => res.body.url);
39
- },
40
-
41
- submitLogs(metadata, logs) {
42
- const metadataArray = this._constructFileMetadata(metadata);
43
-
44
- // this is really testing that Ampersand is fully ready. once it's ready, these exist
45
- if (
46
- !logs &&
47
- this.webex.logger.sdkBuffer &&
48
- this.webex.logger.clientBuffer &&
49
- this.webex.logger.buffer
50
- ) {
51
- logs = this.webex.logger.formatLogs();
52
- }
53
-
54
- let filename;
55
-
56
- if (metadata.locusId && metadata.callStart) {
57
- filename = `${metadata.locusId}_${metadata.callStart}.txt`;
58
- } else {
59
- filename = `${this.webex.sessionId}.txt`;
60
- }
61
-
62
- let userId;
63
-
64
- return this.webex.credentials
65
- .getUserToken()
66
- .catch(() => this.webex.credentials.getClientToken())
67
- .then(async (token) => {
68
- const headers = {authorization: token.toString()};
69
-
70
- const initalOpts = {
71
- service: 'clientLogs',
72
- resource: 'logs/urls',
73
- };
74
-
75
- const finalOpts = {
76
- service: 'clientLogs',
77
- resource: 'logs/meta',
78
- };
79
-
80
- const options = defaults(initalOpts, {
81
- file: logs,
82
- shouldAttemptReauth: false,
83
- headers,
84
- phases: {
85
- initialize: {
86
- body: {
87
- file: filename,
88
- },
89
- },
90
- upload: {
91
- $uri: (session) => session.tempURL,
92
- },
93
- finalize: defaults(finalOpts, {
94
- $body: (session) => {
95
- userId = session.userId;
96
-
97
- return {
98
- filename: session.logFilename,
99
- data: metadataArray,
100
- userId: this.webex.internal.device.userId || session.userId,
101
- };
102
- },
103
- }),
104
- },
105
- });
106
-
107
- return this.webex.upload(options);
108
- })
109
- .then((body) => {
110
- if (userId && !body.userId) {
111
- body.userId = userId;
112
- }
113
-
114
- return body;
115
- });
116
- },
117
-
118
- /**
119
- * Constructs an array of key-value pairs for log upload.
120
- * @param {*} metadata
121
- * @returns {array}
122
- */
123
- _constructFileMetadata(metadata) {
124
- const metadataArray = [
125
- 'locusId',
126
- 'callStart',
127
- 'feedbackId',
128
- 'correlationId',
129
- 'meetingId',
130
- 'surveySessionId',
131
- ]
132
- .map((key) => {
133
- if (metadata[key]) {
134
- return {
135
- key,
136
- value: metadata[key],
137
- };
138
- }
139
-
140
- return null;
141
- })
142
- .filter((entry) => Boolean(entry));
143
-
144
- if (this.webex.sessionId) {
145
- metadataArray.push({
146
- key: 'trackingId',
147
- value: this.webex.sessionId,
148
- });
149
- }
150
-
151
- if (this.webex.internal.device.userId) {
152
- metadataArray.push({
153
- key: 'userId',
154
- value: this.webex.internal.device.userId,
155
- });
156
- }
157
-
158
- if (this.webex.internal.device.orgId) {
159
- metadataArray.push({
160
- key: 'orgId',
161
- value: this.webex.internal.device.orgId,
162
- });
163
- }
164
-
165
- return metadataArray;
166
- },
167
- });
168
-
169
- export default Support;
1
+ /*!
2
+ * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
+ */
4
+
5
+ import {WebexPlugin} from '@webex/webex-core';
6
+ import {defaults} from 'lodash';
7
+ import uuid from 'uuid';
8
+
9
+ const Support = WebexPlugin.extend({
10
+ namespace: 'Support',
11
+
12
+ getFeedbackUrl(options) {
13
+ options = options || {};
14
+
15
+ return this.request({
16
+ method: 'POST',
17
+ api: 'conversation',
18
+ resource: 'users/deskFeedbackUrl',
19
+ body: defaults(options, {
20
+ appVersion: this.config.appVersion,
21
+ appType: this.config.appType,
22
+ feedbackId: options.feedbackId || uuid.v4(),
23
+ languageCode: this.config.languageCode,
24
+ }),
25
+ }).then((res) => res.body.url);
26
+ },
27
+
28
+ getSupportUrl() {
29
+ return this.webex
30
+ .request({
31
+ method: 'GET',
32
+ api: 'conversation',
33
+ resource: 'users/deskSupportUrl',
34
+ qs: {
35
+ languageCode: this.config.languageCode,
36
+ },
37
+ })
38
+ .then((res) => res.body.url);
39
+ },
40
+
41
+ submitLogs(metadata, logs) {
42
+ const metadataArray = this._constructFileMetadata(metadata);
43
+
44
+ // this is really testing that Ampersand is fully ready. once it's ready, these exist
45
+ if (
46
+ !logs &&
47
+ this.webex.logger.sdkBuffer &&
48
+ this.webex.logger.clientBuffer &&
49
+ this.webex.logger.buffer
50
+ ) {
51
+ logs = this.webex.logger.formatLogs();
52
+ }
53
+
54
+ let filename;
55
+
56
+ if (metadata.locusId && metadata.callStart) {
57
+ filename = `${metadata.locusId}_${metadata.callStart}.txt`;
58
+ } else {
59
+ filename = `${this.webex.sessionId}.txt`;
60
+ }
61
+
62
+ let userId;
63
+
64
+ return this.webex.credentials
65
+ .getUserToken()
66
+ .catch(() => this.webex.credentials.getClientToken())
67
+ .then(async (token) => {
68
+ const headers = {authorization: token.toString()};
69
+
70
+ const initalOpts = {
71
+ service: 'clientLogs',
72
+ resource: 'logs/urls',
73
+ };
74
+
75
+ const finalOpts = {
76
+ service: 'clientLogs',
77
+ resource: 'logs/meta',
78
+ };
79
+
80
+ const options = defaults(initalOpts, {
81
+ file: logs,
82
+ shouldAttemptReauth: false,
83
+ headers,
84
+ phases: {
85
+ initialize: {
86
+ body: {
87
+ file: filename,
88
+ },
89
+ },
90
+ upload: {
91
+ $uri: (session) => session.tempURL,
92
+ },
93
+ finalize: defaults(finalOpts, {
94
+ $body: (session) => {
95
+ userId = session.userId;
96
+
97
+ return {
98
+ filename: session.logFilename,
99
+ data: metadataArray,
100
+ userId: this.webex.internal.device.userId || session.userId,
101
+ };
102
+ },
103
+ }),
104
+ },
105
+ });
106
+
107
+ return this.webex.upload(options);
108
+ })
109
+ .then((body) => {
110
+ if (userId && !body.userId) {
111
+ body.userId = userId;
112
+ }
113
+
114
+ return body;
115
+ });
116
+ },
117
+
118
+ /**
119
+ * Constructs an array of key-value pairs for log upload.
120
+ * @param {*} metadata
121
+ * @returns {array}
122
+ */
123
+ _constructFileMetadata(metadata) {
124
+ const metadataArray = [
125
+ 'locusId',
126
+ 'callStart',
127
+ 'feedbackId',
128
+ 'correlationId',
129
+ 'meetingId',
130
+ 'surveySessionId',
131
+ ]
132
+ .map((key) => {
133
+ if (metadata[key]) {
134
+ return {
135
+ key,
136
+ value: metadata[key],
137
+ };
138
+ }
139
+
140
+ return null;
141
+ })
142
+ .filter((entry) => Boolean(entry));
143
+
144
+ if (this.webex.sessionId) {
145
+ metadataArray.push({
146
+ key: 'trackingId',
147
+ value: this.webex.sessionId,
148
+ });
149
+ }
150
+
151
+ if (this.webex.internal.device.userId) {
152
+ metadataArray.push({
153
+ key: 'userId',
154
+ value: this.webex.internal.device.userId,
155
+ });
156
+ }
157
+
158
+ if (this.webex.internal.device.orgId) {
159
+ metadataArray.push({
160
+ key: 'orgId',
161
+ value: this.webex.internal.device.orgId,
162
+ });
163
+ }
164
+
165
+ return metadataArray;
166
+ },
167
+ });
168
+
169
+ export default Support;
@@ -1,65 +1,65 @@
1
- /*!
2
- * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
- */
4
-
5
- import '@webex/internal-plugin-search';
6
-
7
- import {assert} from '@webex/test-helper-chai';
8
- import WebexCore, {WebexHttpError} from '@webex/webex-core';
9
- import fh from '@webex/test-helper-file';
10
- import testUsers from '@webex/test-helper-test-users';
11
-
12
- require('@webex/internal-plugin-support');
13
-
14
- const {TooManyRequests} = WebexHttpError;
15
-
16
- describe('plugin-support', function () {
17
- this.timeout(60000);
18
-
19
- let webex;
20
-
21
- let sampleTextOne = 'sample-text-one.txt';
22
-
23
- before('fetch fixtures', () =>
24
- Promise.all([fh.fetch(sampleTextOne)]).then((res) => {
25
- [sampleTextOne] = res;
26
- })
27
- );
28
-
29
- // Disabled because rackspace is broken
30
- describe('#submitLogs()', () => {
31
- describe('when the current user is authorized', () => {
32
- before(() =>
33
- testUsers.create({count: 1}).then((users) => {
34
- webex = new WebexCore({
35
- credentials: {
36
- authorization: users[0].token,
37
- },
38
- });
39
-
40
- return webex.internal.device.register();
41
- })
42
- );
43
-
44
- it('uploads logs', () =>
45
- webex.internal.support
46
- .submitLogs({}, sampleTextOne)
47
- .then((body) => {
48
- assert.isDefined(body);
49
- assert.property(body, 'url');
50
- assert.property(body, 'userId');
51
- assert.equal(body.userId, webex.internal.device.userId);
52
- })
53
- // Atlas has a really unfortunate rate limit in place, so we're going
54
- // to rely on hope that enough of the node/browser runs don't get rate
55
- // limited to prove this code works.
56
- .catch((err) => {
57
- if (err instanceof TooManyRequests) {
58
- return;
59
- }
60
-
61
- throw err;
62
- }));
63
- });
64
- });
65
- });
1
+ /*!
2
+ * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
+ */
4
+
5
+ import '@webex/internal-plugin-search';
6
+
7
+ import {assert} from '@webex/test-helper-chai';
8
+ import WebexCore, {WebexHttpError} from '@webex/webex-core';
9
+ import fh from '@webex/test-helper-file';
10
+ import testUsers from '@webex/test-helper-test-users';
11
+
12
+ require('@webex/internal-plugin-support');
13
+
14
+ const {TooManyRequests} = WebexHttpError;
15
+
16
+ describe('plugin-support', function () {
17
+ this.timeout(60000);
18
+
19
+ let webex;
20
+
21
+ let sampleTextOne = 'sample-text-one.txt';
22
+
23
+ before('fetch fixtures', () =>
24
+ Promise.all([fh.fetch(sampleTextOne)]).then((res) => {
25
+ [sampleTextOne] = res;
26
+ })
27
+ );
28
+
29
+ // Disabled because rackspace is broken
30
+ describe('#submitLogs()', () => {
31
+ describe('when the current user is authorized', () => {
32
+ before(() =>
33
+ testUsers.create({count: 1}).then((users) => {
34
+ webex = new WebexCore({
35
+ credentials: {
36
+ authorization: users[0].token,
37
+ },
38
+ });
39
+
40
+ return webex.internal.device.register();
41
+ })
42
+ );
43
+
44
+ it('uploads logs', () =>
45
+ webex.internal.support
46
+ .submitLogs({}, sampleTextOne)
47
+ .then((body) => {
48
+ assert.isDefined(body);
49
+ assert.property(body, 'url');
50
+ assert.property(body, 'userId');
51
+ assert.equal(body.userId, webex.internal.device.userId);
52
+ })
53
+ // Atlas has a really unfortunate rate limit in place, so we're going
54
+ // to rely on hope that enough of the node/browser runs don't get rate
55
+ // limited to prove this code works.
56
+ .catch((err) => {
57
+ if (err instanceof TooManyRequests) {
58
+ return;
59
+ }
60
+
61
+ throw err;
62
+ }));
63
+ });
64
+ });
65
+ });
@@ -1,85 +1,85 @@
1
- /*!
2
- * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
- */
4
-
5
- /* eslint-disable no-underscore-dangle */
6
-
7
- import Support from '@webex/internal-plugin-support';
8
- import {assert} from '@webex/test-helper-chai';
9
- import MockWebex from '@webex/test-helper-mock-webex';
10
-
11
- describe('plugin-support', () => {
12
- let webex;
13
-
14
- beforeEach(() => {
15
- webex = new MockWebex({
16
- children: {
17
- support: Support,
18
- },
19
- });
20
-
21
- webex.internal.device.userId = 'user-abc-123';
22
- webex.internal.device.orgId = 'org-abc-123';
23
- });
24
-
25
- describe('#_constructFileMetadata()', () => {
26
- it('constructs a sample File Meta Data', () => {
27
- const result = webex.internal.support._constructFileMetadata({});
28
-
29
- assert.equal(result.length, 3);
30
- assert.deepEqual(result, [
31
- {
32
- key: 'trackingId',
33
- value: 'mock-webex_88888888-4444-4444-4444-aaaaaaaaaaaa',
34
- },
35
- {
36
- key: 'userId',
37
- value: webex.internal.device.userId,
38
- },
39
- {
40
- key: 'orgId',
41
- value: webex.internal.device.orgId,
42
- },
43
- ]);
44
- });
45
-
46
- it('does not send sessionId key if sessionId is not defined', () => {
47
- webex.sessionId = null;
48
-
49
- const result = webex.internal.support._constructFileMetadata({});
50
-
51
- assert.isTrue(result.filter((r) => r.key === 'sessionId').length === 0);
52
- });
53
-
54
- it('does not send userID key if device userId is not defined', () => {
55
- webex.internal.device.userId = null;
56
-
57
- const result = webex.internal.support._constructFileMetadata({});
58
-
59
- assert.isTrue(result.filter((r) => r.key === 'userId').length === 0);
60
- });
61
-
62
- it('does not send orgId key if device orgId is not defined', () => {
63
- webex.internal.device.orgId = null;
64
-
65
- const result = webex.internal.support._constructFileMetadata({});
66
-
67
- assert.isTrue(result.filter((r) => r.key === 'orgId').length === 0);
68
- });
69
-
70
- it('sends surveySessionId if specified in metadata', () => {
71
- const surveySessionId = 'survey-session-id';
72
- const result = webex.internal.support._constructFileMetadata({surveySessionId});
73
- const found = result.find((attr) => attr.key === 'surveySessionId');
74
-
75
- assert.equal(found?.value, surveySessionId);
76
- });
77
- });
78
-
79
- describe('#submitLogs()', () => {
80
- it('calls getUserToken', () => {
81
- webex.internal.support.submitLogs({});
82
- assert.calledOnce(webex.credentials.getUserToken);
83
- });
84
- });
85
- });
1
+ /*!
2
+ * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
+ */
4
+
5
+ /* eslint-disable no-underscore-dangle */
6
+
7
+ import Support from '@webex/internal-plugin-support';
8
+ import {assert} from '@webex/test-helper-chai';
9
+ import MockWebex from '@webex/test-helper-mock-webex';
10
+
11
+ describe('plugin-support', () => {
12
+ let webex;
13
+
14
+ beforeEach(() => {
15
+ webex = new MockWebex({
16
+ children: {
17
+ support: Support,
18
+ },
19
+ });
20
+
21
+ webex.internal.device.userId = 'user-abc-123';
22
+ webex.internal.device.orgId = 'org-abc-123';
23
+ });
24
+
25
+ describe('#_constructFileMetadata()', () => {
26
+ it('constructs a sample File Meta Data', () => {
27
+ const result = webex.internal.support._constructFileMetadata({});
28
+
29
+ assert.equal(result.length, 3);
30
+ assert.deepEqual(result, [
31
+ {
32
+ key: 'trackingId',
33
+ value: 'mock-webex_88888888-4444-4444-4444-aaaaaaaaaaaa',
34
+ },
35
+ {
36
+ key: 'userId',
37
+ value: webex.internal.device.userId,
38
+ },
39
+ {
40
+ key: 'orgId',
41
+ value: webex.internal.device.orgId,
42
+ },
43
+ ]);
44
+ });
45
+
46
+ it('does not send sessionId key if sessionId is not defined', () => {
47
+ webex.sessionId = null;
48
+
49
+ const result = webex.internal.support._constructFileMetadata({});
50
+
51
+ assert.isTrue(result.filter((r) => r.key === 'sessionId').length === 0);
52
+ });
53
+
54
+ it('does not send userID key if device userId is not defined', () => {
55
+ webex.internal.device.userId = null;
56
+
57
+ const result = webex.internal.support._constructFileMetadata({});
58
+
59
+ assert.isTrue(result.filter((r) => r.key === 'userId').length === 0);
60
+ });
61
+
62
+ it('does not send orgId key if device orgId is not defined', () => {
63
+ webex.internal.device.orgId = null;
64
+
65
+ const result = webex.internal.support._constructFileMetadata({});
66
+
67
+ assert.isTrue(result.filter((r) => r.key === 'orgId').length === 0);
68
+ });
69
+
70
+ it('sends surveySessionId if specified in metadata', () => {
71
+ const surveySessionId = 'survey-session-id';
72
+ const result = webex.internal.support._constructFileMetadata({surveySessionId});
73
+ const found = result.find((attr) => attr.key === 'surveySessionId');
74
+
75
+ assert.equal(found?.value, surveySessionId);
76
+ });
77
+ });
78
+
79
+ describe('#submitLogs()', () => {
80
+ it('calls getUserToken', () => {
81
+ webex.internal.support.submitLogs({});
82
+ assert.calledOnce(webex.credentials.getUserToken);
83
+ });
84
+ });
85
+ });