@webex/internal-plugin-support 2.60.0-next.8 → 2.60.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/dist/config.js CHANGED
@@ -8,7 +8,7 @@ exports.default = void 0;
8
8
  /*!
9
9
  * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
10
10
  */
11
- var _default = exports.default = {
11
+ var _default = {
12
12
  device: {
13
13
  preDiscoveryServices: {
14
14
  atlasServiceUrl: process.env.ATLAS_SERVICE_URL || 'https://atlas-a.wbx2.com/admin/api/v1',
@@ -23,4 +23,5 @@ var _default = exports.default = {
23
23
  languageCode: ''
24
24
  }
25
25
  };
26
+ exports.default = _default;
26
27
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_default","exports","default","device","preDiscoveryServices","atlasServiceUrl","process","env","ATLAS_SERVICE_URL","atlas","clientLogs","CLIENT_LOGS_SERVICE_URL","clientLogsServiceUrl","support","appType","appVersion","languageCode"],"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,GAAAC,OAAA,CAAAC,OAAA,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"}
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/support.js CHANGED
@@ -8,8 +8,8 @@ _Object$defineProperty(exports, "__esModule", {
8
8
  exports.default = void 0;
9
9
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
10
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
11
+ var _defaults2 = _interopRequireDefault(require("lodash/defaults"));
11
12
  var _webexCore = require("@webex/webex-core");
12
- var _lodash = require("lodash");
13
13
  var _uuid = _interopRequireDefault(require("uuid"));
14
14
  /*!
15
15
  * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
@@ -23,7 +23,7 @@ var Support = _webexCore.WebexPlugin.extend({
23
23
  method: 'POST',
24
24
  api: 'conversation',
25
25
  resource: 'users/deskFeedbackUrl',
26
- body: (0, _lodash.defaults)(options, {
26
+ body: (0, _defaults2.default)(options, {
27
27
  appVersion: this.config.appVersion,
28
28
  appType: this.config.appType,
29
29
  feedbackId: options.feedbackId || _uuid.default.v4(),
@@ -79,7 +79,7 @@ var Support = _webexCore.WebexPlugin.extend({
79
79
  service: 'clientLogs',
80
80
  resource: 'logs/meta'
81
81
  };
82
- options = (0, _lodash.defaults)(initalOpts, {
82
+ options = (0, _defaults2.default)(initalOpts, {
83
83
  file: logs,
84
84
  shouldAttemptReauth: false,
85
85
  headers: headers,
@@ -94,7 +94,7 @@ var Support = _webexCore.WebexPlugin.extend({
94
94
  return session.tempURL;
95
95
  }
96
96
  },
97
- finalize: (0, _lodash.defaults)(finalOpts, {
97
+ finalize: (0, _defaults2.default)(finalOpts, {
98
98
  $body: function $body(session) {
99
99
  userId = session.userId;
100
100
  return {
@@ -129,7 +129,7 @@ var Support = _webexCore.WebexPlugin.extend({
129
129
  * @returns {array}
130
130
  */
131
131
  _constructFileMetadata: function _constructFileMetadata(metadata) {
132
- var metadataArray = ['locusId', 'appVersion', 'callStart', 'feedbackId', 'correlationId', 'meetingId', 'surveySessionId', 'productAreaTag', 'issueTypeTag', 'locussessionid', 'autoupload'].map(function (key) {
132
+ var metadataArray = ['locusId', 'callStart', 'feedbackId', 'correlationId', 'meetingId', 'surveySessionId'].map(function (key) {
133
133
  if (metadata[key]) {
134
134
  return {
135
135
  key: key,
@@ -146,12 +146,6 @@ var Support = _webexCore.WebexPlugin.extend({
146
146
  value: this.webex.sessionId
147
147
  });
148
148
  }
149
- if (this.webex.internal.support.config.appVersion) {
150
- metadataArray.push({
151
- key: 'appVersion',
152
- value: this.webex.internal.support.config.appVersion
153
- });
154
- }
155
149
  if (this.webex.internal.device.userId) {
156
150
  metadataArray.push({
157
151
  key: 'userId',
@@ -166,7 +160,8 @@ var Support = _webexCore.WebexPlugin.extend({
166
160
  }
167
161
  return metadataArray;
168
162
  },
169
- version: "2.60.0-next.8"
163
+ version: "2.60.1"
170
164
  });
171
- var _default = exports.default = Support;
165
+ var _default = Support;
166
+ exports.default = _default;
172
167
  //# sourceMappingURL=support.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_webexCore","require","_lodash","_uuid","_interopRequireDefault","Support","WebexPlugin","extend","namespace","getFeedbackUrl","options","request","method","api","resource","body","defaults","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","default","_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","support","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 'appVersion',\n 'callStart',\n 'feedbackId',\n 'correlationId',\n 'meetingId',\n 'surveySessionId',\n 'productAreaTag',\n 'issueTypeTag',\n 'locussessionid',\n 'autoupload',\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.support.config.appVersion) {\n metadataArray.push({\n key: 'appVersion',\n value: this.webex.internal.support.config.appVersion,\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;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAC,sBAAA,CAAAH,OAAA;AANA;AACA;AACA;;AAMA,IAAMI,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,EAA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AC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA9C,OAAA,GAEYhD,OAAO"}
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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AAC,IAAAC,QAAA,GAEY5F,OAAO;AAAA6F,OAAA,CAAAjF,OAAA,GAAAgF,QAAA"}
package/package.json CHANGED
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "name": "@webex/internal-plugin-support",
3
+ "version": "2.60.1",
3
4
  "description": "",
4
5
  "license": "MIT",
5
6
  "author": "nickclar <nickclar@cisco.com>",
@@ -11,7 +12,7 @@
11
12
  "directory": "packages/@webex/internal-plugin-support"
12
13
  },
13
14
  "engines": {
14
- "node": ">=16"
15
+ "node": ">=14"
15
16
  },
16
17
  "browserify": {
17
18
  "transform": [
@@ -20,20 +21,19 @@
20
21
  ]
21
22
  },
22
23
  "dependencies": {
23
- "@webex/internal-plugin-device": "2.60.0-next.8",
24
- "@webex/internal-plugin-search": "2.60.0-next.8",
25
- "@webex/test-helper-chai": "2.60.0-next.8",
26
- "@webex/test-helper-file": "2.60.0-next.8",
27
- "@webex/test-helper-mock-webex": "2.60.0-next.8",
28
- "@webex/test-helper-test-users": "2.60.0-next.8",
29
- "@webex/webex-core": "2.60.0-next.8",
24
+ "@webex/internal-plugin-device": "2.60.1",
25
+ "@webex/internal-plugin-search": "2.60.1",
26
+ "@webex/test-helper-chai": "2.60.1",
27
+ "@webex/test-helper-file": "2.60.1",
28
+ "@webex/test-helper-mock-webex": "2.60.1",
29
+ "@webex/test-helper-test-users": "2.60.1",
30
+ "@webex/webex-core": "2.60.1",
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": "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.60.0-next.8",
50
- "@webex/test-helper-mocha": "2.60.0-next.8",
51
- "@webex/test-helper-mock-webex": "2.60.0-next.8",
52
- "@webex/test-helper-test-users": "2.60.0-next.8",
45
+ "@webex/babel-config-legacy": "2.60.1",
46
+ "@webex/eslint-config-legacy": "2.60.1",
47
+ "@webex/jest-config-legacy": "2.60.1",
48
+ "@webex/legacy-tools": "2.60.1",
49
+ "@webex/test-helper-chai": "2.60.1",
50
+ "@webex/test-helper-mocha": "2.60.1",
51
+ "@webex/test-helper-mock-webex": "2.60.1",
52
+ "@webex/test-helper-test-users": "2.60.1",
53
53
  "eslint": "^8.24.0",
54
54
  "prettier": "^2.7.1"
55
- },
56
- "version": "2.60.0-next.8"
57
- }
55
+ }
56
+ }
package/src/support.js CHANGED
@@ -123,16 +123,11 @@ const Support = WebexPlugin.extend({
123
123
  _constructFileMetadata(metadata) {
124
124
  const metadataArray = [
125
125
  'locusId',
126
- 'appVersion',
127
126
  'callStart',
128
127
  'feedbackId',
129
128
  'correlationId',
130
129
  'meetingId',
131
130
  'surveySessionId',
132
- 'productAreaTag',
133
- 'issueTypeTag',
134
- 'locussessionid',
135
- 'autoupload',
136
131
  ]
137
132
  .map((key) => {
138
133
  if (metadata[key]) {
@@ -153,13 +148,6 @@ const Support = WebexPlugin.extend({
153
148
  });
154
149
  }
155
150
 
156
- if (this.webex.internal.support.config.appVersion) {
157
- metadataArray.push({
158
- key: 'appVersion',
159
- value: this.webex.internal.support.config.appVersion,
160
- });
161
- }
162
-
163
151
  if (this.webex.internal.device.userId) {
164
152
  metadataArray.push({
165
153
  key: 'userId',
@@ -20,23 +20,18 @@ describe('plugin-support', () => {
20
20
 
21
21
  webex.internal.device.userId = 'user-abc-123';
22
22
  webex.internal.device.orgId = 'org-abc-123';
23
- webex.internal.support.config.appVersion = '0.0.0.0';
24
23
  });
25
24
 
26
25
  describe('#_constructFileMetadata()', () => {
27
26
  it('constructs a sample File Meta Data', () => {
28
27
  const result = webex.internal.support._constructFileMetadata({});
29
28
 
30
- assert.equal(result.length, 4);
29
+ assert.equal(result.length, 3);
31
30
  assert.deepEqual(result, [
32
31
  {
33
32
  key: 'trackingId',
34
33
  value: 'mock-webex_88888888-4444-4444-4444-aaaaaaaaaaaa',
35
34
  },
36
- {
37
- key: 'appVersion',
38
- value: '0.0.0.0',
39
- },
40
35
  {
41
36
  key: 'userId',
42
37
  value: webex.internal.device.userId,
@@ -79,78 +74,6 @@ describe('plugin-support', () => {
79
74
 
80
75
  assert.equal(found?.value, surveySessionId);
81
76
  });
82
-
83
- it('sends productAreaTag if specified in metadata', () => {
84
- const productAreaTag = 'product-area-tag';
85
- const result = webex.internal.support._constructFileMetadata({productAreaTag});
86
- const found = result.find((attr) => attr.key === 'productAreaTag');
87
-
88
- assert.equal(found?.value, productAreaTag);
89
- });
90
-
91
- it('sends issueTypeTag if specified in metadata', () => {
92
- const issueTypeTag = 'issueTypeTag';
93
- const result = webex.internal.support._constructFileMetadata({issueTypeTag});
94
- const found = result.find((attr) => attr.key === 'issueTypeTag');
95
-
96
- assert.equal(found?.value, issueTypeTag);
97
- });
98
-
99
- it('sends locussessionid if specified in metadata', () => {
100
- const locussessionid = 'locussessionid';
101
- const result = webex.internal.support._constructFileMetadata({locussessionid});
102
- const found = result.find((attr) => attr.key === 'locussessionid');
103
-
104
- assert.equal(found?.value, locussessionid);
105
- });
106
-
107
- it('sends locusId if specified in metadata', () => {
108
- const locusId = 'locusId';
109
- const result = webex.internal.support._constructFileMetadata({locusId});
110
- const found = result.find((attr) => attr.key === 'locusId');
111
-
112
- assert.equal(found?.value, locusId);
113
- });
114
-
115
- it('sends callStart if specified in metadata', () => {
116
- const callStart = 'callStart';
117
- const result = webex.internal.support._constructFileMetadata({callStart});
118
- const found = result.find((attr) => attr.key === 'callStart');
119
-
120
- assert.equal(found?.value, callStart);
121
- });
122
-
123
- it('sends feedbackId if specified in metadata', () => {
124
- const feedbackId = 'feedbackId';
125
- const result = webex.internal.support._constructFileMetadata({feedbackId});
126
- const found = result.find((attr) => attr.key === 'feedbackId');
127
-
128
- assert.equal(found?.value, feedbackId);
129
- });
130
-
131
- it('sends correlationId if specified in metadata', () => {
132
- const correlationId = 'correlationId';
133
- const result = webex.internal.support._constructFileMetadata({correlationId});
134
- const found = result.find((attr) => attr.key === 'correlationId');
135
-
136
- assert.equal(found?.value, correlationId);
137
- });
138
-
139
- it('sends meetingId if specified in metadata', () => {
140
- const meetingId = 'meetingId';
141
- const result = webex.internal.support._constructFileMetadata({meetingId});
142
- const found = result.find((attr) => attr.key === 'meetingId');
143
-
144
- assert.equal(found?.value, meetingId);
145
- });
146
-
147
- it('sends autoupload if specified in metadata', () => {
148
- const autoupload = 'autoupload';
149
- const result = webex.internal.support._constructFileMetadata({autoupload});
150
- const found = result.find((attr) => attr.key === 'autoupload');
151
-
152
- assert.equal(found?.value, autoupload);
153
- });
154
77
  });
155
78
 
156
79
  describe('#submitLogs()', () => {