@webex/internal-plugin-support 2.59.3-next.1 → 2.59.4
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/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/support.js +7 -7
- package/dist/support.js.map +1 -1
- package/jest.config.js +3 -3
- package/package.json +18 -19
- package/process +1 -1
- package/src/config.js +21 -21
- package/src/index.js +15 -15
- package/src/support.js +169 -169
- package/test/integration/spec/support.js +65 -65
- package/test/unit/spec/support.js +85 -85
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
|
-
[](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
|
+
[](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: {
|
package/dist/config.js.map
CHANGED
|
@@ -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":["/*!\
|
|
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"}
|
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":["/*!\
|
|
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"}
|
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.
|
|
163
|
+
version: "2.59.4"
|
|
164
164
|
});
|
|
165
165
|
var _default = Support;
|
|
166
166
|
exports.default = _default;
|
package/dist/support.js.map
CHANGED
|
@@ -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":["/*!\
|
|
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,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OAAO;AAAA6F,OAAA,CAAAjF,OAAA,GAAAgF,QAAA"}
|
package/jest.config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const config = require('@webex/jest-config-legacy');
|
|
2
|
-
|
|
3
|
-
module.exports = config;
|
|
1
|
+
const config = require('@webex/jest-config-legacy');
|
|
2
|
+
|
|
3
|
+
module.exports = config;
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/internal-plugin-support",
|
|
3
|
+
"version": "2.59.4",
|
|
3
4
|
"description": "",
|
|
4
5
|
"license": "MIT",
|
|
5
6
|
"author": "nickclar <nickclar@cisco.com>",
|
|
@@ -20,20 +21,19 @@
|
|
|
20
21
|
]
|
|
21
22
|
},
|
|
22
23
|
"dependencies": {
|
|
23
|
-
"@webex/internal-plugin-device": "
|
|
24
|
-
"@webex/internal-plugin-search": "
|
|
25
|
-
"@webex/test-helper-chai": "
|
|
26
|
-
"@webex/test-helper-file": "
|
|
27
|
-
"@webex/test-helper-mock-webex": "
|
|
28
|
-
"@webex/test-helper-test-users": "
|
|
29
|
-
"@webex/webex-core": "
|
|
24
|
+
"@webex/internal-plugin-device": "2.59.4",
|
|
25
|
+
"@webex/internal-plugin-search": "2.59.4",
|
|
26
|
+
"@webex/test-helper-chai": "2.59.4",
|
|
27
|
+
"@webex/test-helper-file": "2.59.4",
|
|
28
|
+
"@webex/test-helper-mock-webex": "2.59.4",
|
|
29
|
+
"@webex/test-helper-test-users": "2.59.4",
|
|
30
|
+
"@webex/webex-core": "2.59.4",
|
|
30
31
|
"lodash": "^4.17.21",
|
|
31
32
|
"uuid": "^3.3.2"
|
|
32
33
|
},
|
|
33
34
|
"scripts": {
|
|
34
35
|
"build": "yarn build:src",
|
|
35
36
|
"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,16 +42,15 @@
|
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@babel/core": "^7.17.10",
|
|
45
|
-
"@webex/babel-config-legacy": "
|
|
46
|
-
"@webex/eslint-config-legacy": "
|
|
47
|
-
"@webex/jest-config-legacy": "
|
|
48
|
-
"@webex/legacy-tools": "
|
|
49
|
-
"@webex/test-helper-chai": "
|
|
50
|
-
"@webex/test-helper-mocha": "
|
|
51
|
-
"@webex/test-helper-mock-webex": "
|
|
52
|
-
"@webex/test-helper-test-users": "
|
|
45
|
+
"@webex/babel-config-legacy": "2.59.4",
|
|
46
|
+
"@webex/eslint-config-legacy": "2.59.4",
|
|
47
|
+
"@webex/jest-config-legacy": "2.59.4",
|
|
48
|
+
"@webex/legacy-tools": "2.59.4",
|
|
49
|
+
"@webex/test-helper-chai": "2.59.4",
|
|
50
|
+
"@webex/test-helper-mocha": "2.59.4",
|
|
51
|
+
"@webex/test-helper-mock-webex": "2.59.4",
|
|
52
|
+
"@webex/test-helper-test-users": "2.59.4",
|
|
53
53
|
"eslint": "^8.24.0",
|
|
54
54
|
"prettier": "^2.7.1"
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
}
|
|
55
|
+
}
|
|
56
|
+
}
|
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
|
+
});
|