@webex/internal-plugin-ediscovery 3.0.0-beta.13 → 3.0.0-beta.15
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/README.md +2 -6
- package/dist/config.js.map +1 -1
- package/dist/ediscovery.js +1 -1
- package/dist/ediscovery.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/report-request.js.map +1 -1
- package/dist/retry.js +1 -1
- package/dist/retry.js.map +1 -1
- package/dist/transforms.js.map +1 -1
- package/package.json +10 -10
- package/src/config.js +6 -4
- package/src/ediscovery.js +2 -2
- package/src/index.js +35 -22
- package/src/report-request.js +10 -1
- package/src/retry.js +23 -14
- package/src/transforms.js +460 -217
- package/test/integration/spec/ediscovery.js +62 -43
- package/test/unit/spec/content.js +304 -166
- package/test/unit/spec/report.js +76 -77
- package/test/unit/spec/transforms.js +168 -156
package/README.md
CHANGED
|
@@ -23,30 +23,26 @@ npm install --save @webex/internal-plugin-ediscovery
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
25
25
|
```js
|
|
26
|
-
|
|
27
26
|
import '@webex/internal-plugin-ediscovery';
|
|
28
27
|
|
|
29
28
|
import WebexCore from '@webex/webex-core';
|
|
30
29
|
|
|
31
30
|
const webex = new WebexCore();
|
|
32
|
-
webex.internal.plugin.ediscovery.WHATEVER
|
|
33
|
-
|
|
31
|
+
webex.internal.plugin.ediscovery.WHATEVER;
|
|
34
32
|
```
|
|
35
33
|
|
|
36
34
|
## Tests
|
|
37
35
|
|
|
38
|
-
Run the ediscovery from the top level using
|
|
36
|
+
Run the ediscovery from the top level using
|
|
39
37
|
|
|
40
38
|
> yarn run test --packages @webex/internal-plugin-ediscovery
|
|
41
39
|
|
|
42
|
-
|
|
43
40
|
## Debug Tests
|
|
44
41
|
|
|
45
42
|
Run the following command
|
|
46
43
|
|
|
47
44
|
> yarn run test --packages @webex/internal-plugin-ediscovery --grep "test name" --karmaDebug --browsers=Chrome
|
|
48
45
|
|
|
49
|
-
|
|
50
46
|
## Maintainers
|
|
51
47
|
|
|
52
48
|
This package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ediscovery","defaultOptions","offset","size","timeoutMs","types"],"sources":["config.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":["ediscovery","defaultOptions","offset","size","timeoutMs","types"],"sources":["config.js"],"sourcesContent":["export default {\n ediscovery: {\n defaultOptions: {\n offset: 0,\n size: 100,\n timeoutMs: 30000,\n types: [],\n },\n },\n};\n"],"mappings":";;;;;;;;;eAAe;EACbA,UAAU,EAAE;IACVC,cAAc,EAAE;MACdC,MAAM,EAAE,CADM;MAEdC,IAAI,EAAE,GAFQ;MAGdC,SAAS,EAAE,KAHG;MAIdC,KAAK,EAAE;IAJO;EADN;AADC,C"}
|
package/dist/ediscovery.js
CHANGED
|
@@ -722,7 +722,7 @@ var EDiscovery = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForVal
|
|
|
722
722
|
}, _callee10);
|
|
723
723
|
}))();
|
|
724
724
|
},
|
|
725
|
-
version: "3.0.0-beta.
|
|
725
|
+
version: "3.0.0-beta.15"
|
|
726
726
|
}, ((0, _applyDecoratedDescriptor2.default)(_obj, "createReport", [_dec], (0, _getOwnPropertyDescriptor.default)(_obj, "createReport"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "getReport", [_dec2], (0, _getOwnPropertyDescriptor.default)(_obj, "getReport"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "getReports", [_dec3], (0, _getOwnPropertyDescriptor.default)(_obj, "getReports"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "deleteReport", [_dec4], (0, _getOwnPropertyDescriptor.default)(_obj, "deleteReport"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "restartReport", [_dec5], (0, _getOwnPropertyDescriptor.default)(_obj, "restartReport"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "getContent", [_dec6, _dec7], (0, _getOwnPropertyDescriptor.default)(_obj, "getContent"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "getContentContainer", [_dec8, _dec9], (0, _getOwnPropertyDescriptor.default)(_obj, "getContentContainer"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "getContentContainerByContainerId", [_dec10, _dec11], (0, _getOwnPropertyDescriptor.default)(_obj, "getContentContainerByContainerId"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "getClientConfig", [_dec12], (0, _getOwnPropertyDescriptor.default)(_obj, "getClientConfig"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "postAuditLog", [_dec13], (0, _getOwnPropertyDescriptor.default)(_obj, "postAuditLog"), _obj)), _obj)));
|
|
727
727
|
|
|
728
728
|
var _default2 = EDiscovery;
|
package/dist/ediscovery.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createOneFlightKey","reportId","options","key","String","offset","size","types","EDiscovery","WebexPlugin","extend","waitForValue","oneFlight","keyFactory","containerId","namespace","session","contentContainerCache","type","default","createReport","reportRequest","Error","config","defaultOptions","body","request","method","service","resource","timeout","timeoutMs","_handleReportRequestError","reason","errorCode","InvalidEmailAddressError","getErrorCode","invalidEmails","JSON","parse","message","length","invalidEmailAddressError","reject","logger","warn","error","getReport","getReports","qs","deleteReport","restartReport","getContent","_createRequestOptions","requestOptions","getContentContainer","reportUUID","res","_writeToContentContainerCache","getContentContainerByContainerId","has","get","statusCode","containers","set","container","clearCache","clear","_getReportIdFromUrl","reportUrl","uuids","match","_isUrl","string","test","isUrl","substring","lastIndexOf","url","getClientConfig","postAuditLog"],"sources":["ediscovery.js"],"sourcesContent":["/* eslint-disable prefer-template */\n/* eslint-disable no-useless-escape */\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nimport {waitForValue, WebexPlugin} from '@webex/webex-core';\nimport {oneFlight} from '@webex/common';\n\nimport {InvalidEmailAddressError} from './ediscovery-error';\n\n/**\n * Creates a unique oneflight key for a request from the reportId and options params\n * It is important that the offset params are included if present to ensure paged requests get back the correct data\n * @param {Object} reportId - A set of criteria for determining the focus of the search\n * @param {Object} options - optional parameters for this method\n * @returns {String} oneFlight key which is a composite of the request parameters\n */\nfunction createOneFlightKey(reportId, options) {\n let key = String(reportId);\n\n if (options) {\n if (options.offset) {\n key += String(options.offset);\n }\n if (options.size) {\n key += String(options.size);\n }\n if (options.types) {\n key += String(options.types);\n }\n }\n\n return key;\n}\n\n/**\n * @class EDiscovery is used by compliance officers to run compliance reports\n *\n */\nconst EDiscovery = WebexPlugin.extend({\n namespace: 'EDiscovery',\n\n session: {\n contentContainerCache: {\n type: 'object',\n default() {\n return new Map();\n }\n }\n },\n\n @waitForValue('@')\n /**\n * Creates a compliance report with a specific set of search parameters\n * @param {Object} reportRequest - A set of criteria for determining the focus of the search\n * @param {Object} options - optional parameters for this method\n * @param {number} options.timeoutMs - connection timeout in milliseconds, defaults to 30s\n * @returns {Promise<ResponseEntity>} Http response containing the new report record\n */\n async createReport(reportRequest, options) {\n if (!reportRequest) {\n throw Error('Undefined parameter');\n }\n\n // use spread operator to set default options\n options = {...this.config.defaultOptions, ...options};\n\n const body = reportRequest;\n\n try {\n return await this.request({\n method: 'POST',\n service: 'ediscovery',\n resource: 'reports',\n timeout: options.timeoutMs,\n body\n });\n }\n catch (reason) {\n return this._handleReportRequestError(reason);\n }\n },\n\n /**\n * Checks the error from createReport and ensures the appropriate error is sent to the client\n * @param {Error} reason - Error response thrown by the request to createReport\n * @returns {Promise<Error>} Promise rejection containing the error\n */\n _handleReportRequestError(reason) {\n if (reason.body.errorCode === InvalidEmailAddressError.getErrorCode()) {\n try {\n const invalidEmails = JSON.parse(reason.body.message);\n\n if (Array.isArray(invalidEmails) && invalidEmails.length) {\n const invalidEmailAddressError = new InvalidEmailAddressError(invalidEmails);\n\n return Promise.reject(invalidEmailAddressError);\n }\n\n this.logger.warn('InvalidEmailAddress error received but the list could not be parsed to the correct format.');\n }\n catch (error) {\n // assume syntax error and continue\n this.logger.error('InvalidEmailAddress error received but an error occured while parsing the emails.');\n }\n }\n\n return Promise.reject(reason);\n },\n\n @waitForValue('@')\n /**\n * Retrieves information relating to a specified report\n * @param {UUID} reportId - Id of the report being requested\n * @param {Object} options - optional parameters for this method\n * @param {number} options.timeoutMs - connection timeout in milliseconds, defaults to 30s\n * @returns {Promise<ResponseEntity<ReportRecord>>} Http response containing the specified report record\n */\n async getReport(reportId, options) {\n if (!reportId) {\n throw Error('Undefined parameter');\n }\n\n // use spread operator to set default options\n options = {...this.config.defaultOptions, ...options};\n\n return this.request({\n method: 'GET',\n service: 'ediscovery',\n resource: `reports/${reportId}`,\n timeout: options.timeoutMs\n });\n },\n\n @waitForValue('@')\n /**\n * Retrieves all the compliance officers reports\n * @param {Object} options - optional parameters for this method\n * @param {number} options.offset - start position from which to retrieve records\n * @param {number} options.size - the number of records to retrieve\n * @param {number} options.timeoutMs - connection timeout in milliseconds, defaults to 30s\n * @returns {Promise<ResponseEntity<Array<ReportRecord>>>} Http Response containing a list of report records\n */\n async getReports(options) {\n // use spread operator to set default options\n options = {...this.config.defaultOptions, ...options};\n\n return this.request({\n method: 'GET',\n service: 'ediscovery',\n resource: 'reports',\n qs: {offset: options.offset, size: options.size},\n timeout: options.timeoutMs\n });\n },\n\n @waitForValue('@')\n /**\n * Deletes a specified report\n * @param {UUID} reportId - Id of the report being requested for deletion\n * @param {Object} options - optional parameters for this method\n * @param {number} options.timeoutMs - connection timeout in milliseconds, defaults to 30s\n * @returns {Promise<ResponseEntity>} HttpResponse indicating if delete was successful\n */\n async deleteReport(reportId, options) {\n if (!reportId) {\n throw Error('Undefined parameter');\n }\n\n // use spread operator to set default options\n options = {...this.config.defaultOptions, ...options};\n\n return this.request({\n method: 'DELETE',\n service: 'ediscovery',\n resource: `reports/${reportId}`,\n timeout: options.timeoutMs\n });\n },\n\n @waitForValue('@')\n /**\n * Restarts a completed or cancelled report so that it begins again from scratch\n * @param {UUID} reportId - Id of the report being requested\n * @param {Object} options - optional parameters for this method\n * @param {number} options.timeoutMs - connection timeout in milliseconds, defaults to 30s\n * @returns {Promise<ResponseEntity<ReportRecord>>} Http response containing the report record\n */\n async restartReport(reportId, options) {\n if (!reportId) {\n throw Error('Undefined parameter');\n }\n\n // use spread operator to set default options\n options = {...this.config.defaultOptions, ...options};\n\n return this.request({\n method: 'PUT',\n service: 'ediscovery',\n resource: `reports/${reportId}`,\n timeout: options.timeoutMs\n });\n },\n\n @waitForValue('@')\n @oneFlight({keyFactory: (reportId, options) => createOneFlightKey(reportId, options)})\n /**\n * Retrieves content associated with a report\n * @param {UUID|string} reportId - UUID or url of the report which contains the content\n * @param {Object} options - optional parameters for this method\n * @param {number} options.offset - start position from which to retrieve records\n * @param {number} options.size - the number of records to retrieve\n * @param {number} options.timeoutMs - connection timeout in milliseconds, defaults to 30s\n * @returns {Promise<ResponseEntity<[Activity]>>} Http response containing the activities\n */\n async getContent(reportId, options) {\n if (!reportId) {\n throw Error('Undefined parameter');\n }\n\n // use spread operator to set default options\n options = {...this.config.defaultOptions, ...options};\n\n const [requestOptions] = this._createRequestOptions(reportId, '/contents');\n\n return this.request({\n method: 'GET',\n ...requestOptions,\n qs: {offset: options.offset, size: options.size},\n timeout: options.timeoutMs\n });\n },\n\n @waitForValue('@')\n @oneFlight({keyFactory: (reportId, options) => createOneFlightKey(reportId, options)})\n /**\n * Retrieves a list of content containers relevant to a specified report\n * @param {UUID|string} reportId - UUID or url of the report being requested\n * @param {Object} options - optional parameters for this method\n * @param {number} options.offset - start position from which to retrieve records\n * @param {number} options.size - the number of records to retrieve\n * @param {number} options.timeoutMs - connection timeout in milliseconds, defaults to 30s\n * @param {Set<Object>} options.types - Set of ContentContainerTypes to be retrieved\n * @returns {Promise<ResponseEntity<ContentContainer>>} Http response containing the content containers\n */\n async getContentContainer(reportId, options) {\n if (!reportId) {\n throw Error('Undefined parameter');\n }\n\n // use spread operator to set default options\n options = {...this.config.defaultOptions, ...options};\n\n const [requestOptions, reportUUID] = this._createRequestOptions(reportId, '/contents/container');\n\n const res = await this.request({\n method: 'GET',\n ...requestOptions,\n qs: {offset: options.offset, size: options.size},\n timeout: options.timeoutMs,\n types: options.types\n });\n\n await this._writeToContentContainerCache(reportUUID, res.body);\n\n return res;\n },\n\n @waitForValue('@')\n @oneFlight({keyFactory: (reportId, containerId) => String(reportId + containerId)})\n /**\n * Retrieves information for a specific content container relevant to a specified report\n * @param {UUID|string} reportId - UUID or url of the report being requested\n * @param {UUID} containerId - Id of the contenyt container being requested\n * @param {Object} options - optional parameters for this method\n * @param {number} options.timeoutMs - connection timeout in milliseconds, defaults to 30s\n * @returns {Promise<ResponseEntity<ContentContainer>>} Http response containing the specified content container\n */\n async getContentContainerByContainerId(reportId, containerId, options) {\n if (!reportId || !containerId) {\n throw Error('Undefined parameter');\n }\n\n // use spread operator to set default options\n options = {...this.config.defaultOptions, ...options};\n\n const [requestOptions, reportUUID] = this._createRequestOptions(reportId, `/contents/container/${containerId}`);\n\n // If this content container has already been cached then it can be retrieved from there instead of making a network call to ediscovery\n if (this.contentContainerCache.has(reportUUID) && this.contentContainerCache.get(reportUUID).has(containerId)) {\n return {body: this.contentContainerCache.get(reportUUID).get(containerId), statusCode: 200};\n }\n\n this.logger.warn(`Cache miss for container ${containerId} in contentContainerCache`);\n\n const res = await this.request({\n method: 'GET',\n ...requestOptions,\n qs: {offset: options.offset, size: options.size},\n timeout: options.timeoutMs\n });\n\n await this._writeToContentContainerCache(reportUUID, [res.body]);\n\n return res;\n },\n\n /**\n * The results of a getContentContainer or getContentContainerByContainerId request are written to the contentContainerCache\n * since information for a container is likely to be accessed very frequently when decrypting activities\n * @param {UUID} reportId - Id of the report which contains the relevant content summary\n * @param {Array<Object>} containers - List of the container objects to be written to the cache\n * @returns {Promise} - Promise resolution indicating operation is complete\n */\n _writeToContentContainerCache(reportId, containers) {\n if (!reportId || !containers || !containers.length) {\n return;\n }\n\n if (!this.contentContainerCache.has(reportId)) {\n this.contentContainerCache.set(reportId, new Map());\n }\n\n for (const container of containers) {\n if (container && container.containerId) {\n try {\n this.contentContainerCache.get(reportId).set(container.containerId, container);\n }\n catch (error) {\n this.logger.error(`Error adding ${container.containerId} to contentContainerCache: ${error}`);\n }\n }\n else {\n this.logger.error('Error adding undefined container to contentContainerCache');\n }\n }\n },\n\n /**\n * Wipe the cache used by eDiscovery to store the space summaries and content containers.\n * Good practice to clear it down when finished with a report to save RAM.\n * @returns {undefined}\n */\n clearCache() {\n this.contentContainerCache.clear();\n },\n\n /**\n * Retrieves a uuid string from a report url\n * @param {String} reportUrl - full destination address (including report id parameter) for the http request being sent\n * e.g. 'http://ediscovery-intb.wbx2.com/ediscovery/api/v1/reports/3b10e625-2bd5-4efa-b866-58d6c93c505c'\n * @returns {String} - uuid of the report\n */\n _getReportIdFromUrl(reportUrl) {\n if (reportUrl) {\n const uuids = reportUrl.match(/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/);\n\n if (uuids && uuids.length > 0) {\n return uuids[0];\n }\n }\n\n return '';\n },\n\n _isUrl(string) {\n // Regex found from `https://ihateregex.io/expr/url`\n return /https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&\\/\\/=]*)/g.test(string);\n },\n\n /**\n * Create the appropriate request options based on whether the reportId is a url or a uuid.\n * @param {UUID|string} reportId - May be either a url for the report or a uuid.\n * e.g. 'http://ediscovery-intb.wbx2.com/ediscovery/api/v1/reports/3b10e625-2bd5-4efa-b866-58d6c93c505c' or '3b10e625-2bd5-4efa-b866-58d6c93c505c'.\n * @param {String} resource - The resource on the remote server to request\n * @returns {[Options, uuid]} - The options to pass to `request` and the report uuid.\n */\n _createRequestOptions(reportId, resource) {\n let requestOptions;\n let reportUUID;\n const isUrl = this._isUrl(reportId);\n\n if (isUrl) {\n reportUUID = this._getReportIdFromUrl(reportId);\n\n if (!reportUUID) {\n throw Error('Report url does not contain a report id');\n }\n\n // Ensure the url is formatted to\n // https://ediscovery.intb1.ciscospark.com/ediscovery/api/v1/reports/16bf0d01-b1f7-483b-89a2-915144158fb9\n // index.js for example passes the url in as\n // https://ediscovery.intb1.ciscospark.com/ediscovery/api/v1/reports/16bf0d01-b1f7-483b-89a2-915144158fb9/contents\n const reportUrl = reportId.substring(0, reportId.lastIndexOf(reportUUID) + reportUUID.length);\n\n requestOptions = {\n url: reportUrl + resource\n };\n }\n else {\n requestOptions = {\n service: 'ediscovery',\n resource: `reports/${reportId}/${resource}`\n };\n reportUUID = reportId;\n }\n\n return [requestOptions, reportUUID];\n },\n\n @waitForValue('@')\n /**\n * Retrieves a config object from the service which can be used by the client for optimal performance, e.g. content page size\n * @param {Object} options - optional parameters for this method\n * @param {number} options.timeoutMs - connection timeout in milliseconds, defaults to 30s\n * @returns {Promise<Config>} Http response containing the config object\n */\n async getClientConfig(options) {\n // use spread operator to set default options\n options = {...this.config.defaultOptions, ...options};\n\n return this.request({\n method: 'GET',\n service: 'ediscovery',\n resource: 'reports/clientconfig',\n timeout: options.timeoutMs\n });\n },\n\n @waitForValue('@')\n /**\n * Submits an audit event to the eDiscovery service for admin use. Only expected to be used for\n * the getContentContainer API\n * @param {UUID} reportId - Id of the report to send an audit log for\n * @param {Object} options - optional parameters for this method\n * @param {number} options.timeoutMs - connection timeout in milliseconds, defaults to 30s\n * @returns {Promise<Config>} Http response containing the config object\n */\n async postAuditLog(reportId, options) {\n if (!reportId) {\n throw Error('No report ID specified');\n }\n\n // use spread operator to set default options\n options = {...this.config.defaultOptions, ...options};\n\n return this.request({\n method: 'POST',\n service: 'ediscovery',\n resource: `reports/${reportId}/audit/summary-download`,\n timeout: options.timeoutMs\n });\n }\n\n});\n\nexport default EDiscovery;\n"],"mappings":";;;;;;;;;;;;;;;;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AA,IAC/BD,QAD+B;gBAAA;gBAAA;cAAA;;cAAA,MAE5BqB,KAAK,CAAC,wBAAD,CAFuB;;YAAA;cAKpC;cACApB,OAAO,mCAAO,OAAI,CAACqB,MAAL,CAAYC,cAAnB,GAAsCtB,OAAtC,CAAP;cANoC,mCAQ7B,OAAI,CAACwB,OAAL,CAAa;gBAClBC,MAAM,EAAE,MADU;gBAElBC,OAAO,EAAE,YAFS;gBAGlBC,QAAQ,oBAAa5B,QAAb,4BAHU;gBAIlB6B,OAAO,EAAE5B,OAAO,CAAC6B;cAJC,CAAb,CAR6B;;YAAA;YAAA;cAAA;UAAA;QAAA;MAAA;IAAA;EAcrC,CA7ZmC;EAAA;AAAA,CAAnB,28CAAnB;;gBAiaevB,U"}
|
|
1
|
+
{"version":3,"names":["createOneFlightKey","reportId","options","key","String","offset","size","types","EDiscovery","WebexPlugin","extend","waitForValue","oneFlight","keyFactory","containerId","namespace","session","contentContainerCache","type","default","createReport","reportRequest","Error","config","defaultOptions","body","request","method","service","resource","timeout","timeoutMs","_handleReportRequestError","reason","errorCode","InvalidEmailAddressError","getErrorCode","invalidEmails","JSON","parse","message","length","invalidEmailAddressError","reject","logger","warn","error","getReport","getReports","qs","deleteReport","restartReport","getContent","_createRequestOptions","requestOptions","getContentContainer","reportUUID","res","_writeToContentContainerCache","getContentContainerByContainerId","has","get","statusCode","containers","set","container","clearCache","clear","_getReportIdFromUrl","reportUrl","uuids","match","_isUrl","string","test","isUrl","substring","lastIndexOf","url","getClientConfig","postAuditLog"],"sources":["ediscovery.js"],"sourcesContent":["/* eslint-disable */\n\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nimport {waitForValue, WebexPlugin} from '@webex/webex-core';\nimport {oneFlight} from '@webex/common';\n\nimport {InvalidEmailAddressError} from './ediscovery-error';\n\n/**\n * Creates a unique oneflight key for a request from the reportId and options params\n * It is important that the offset params are included if present to ensure paged requests get back the correct data\n * @param {Object} reportId - A set of criteria for determining the focus of the search\n * @param {Object} options - optional parameters for this method\n * @returns {String} oneFlight key which is a composite of the request parameters\n */\nfunction createOneFlightKey(reportId, options) {\n let key = String(reportId);\n\n if (options) {\n if (options.offset) {\n key += String(options.offset);\n }\n if (options.size) {\n key += String(options.size);\n }\n if (options.types) {\n key += String(options.types);\n }\n }\n\n return key;\n}\n\n/**\n * @class EDiscovery is used by compliance officers to run compliance reports\n *\n */\nconst EDiscovery = WebexPlugin.extend({\n namespace: 'EDiscovery',\n\n session: {\n contentContainerCache: {\n type: 'object',\n default() {\n return new Map();\n }\n }\n },\n\n @waitForValue('@')\n /**\n * Creates a compliance report with a specific set of search parameters\n * @param {Object} reportRequest - A set of criteria for determining the focus of the search\n * @param {Object} options - optional parameters for this method\n * @param {number} options.timeoutMs - connection timeout in milliseconds, defaults to 30s\n * @returns {Promise<ResponseEntity>} Http response containing the new report record\n */\n async createReport(reportRequest, options) {\n if (!reportRequest) {\n throw Error('Undefined parameter');\n }\n\n // use spread operator to set default options\n options = {...this.config.defaultOptions, ...options};\n\n const body = reportRequest;\n\n try {\n return await this.request({\n method: 'POST',\n service: 'ediscovery',\n resource: 'reports',\n timeout: options.timeoutMs,\n body\n });\n }\n catch (reason) {\n return this._handleReportRequestError(reason);\n }\n },\n\n /**\n * Checks the error from createReport and ensures the appropriate error is sent to the client\n * @param {Error} reason - Error response thrown by the request to createReport\n * @returns {Promise<Error>} Promise rejection containing the error\n */\n _handleReportRequestError(reason) {\n if (reason.body.errorCode === InvalidEmailAddressError.getErrorCode()) {\n try {\n const invalidEmails = JSON.parse(reason.body.message);\n\n if (Array.isArray(invalidEmails) && invalidEmails.length) {\n const invalidEmailAddressError = new InvalidEmailAddressError(invalidEmails);\n\n return Promise.reject(invalidEmailAddressError);\n }\n\n this.logger.warn('InvalidEmailAddress error received but the list could not be parsed to the correct format.');\n }\n catch (error) {\n // assume syntax error and continue\n this.logger.error('InvalidEmailAddress error received but an error occured while parsing the emails.');\n }\n }\n\n return Promise.reject(reason);\n },\n\n @waitForValue('@')\n /**\n * Retrieves information relating to a specified report\n * @param {UUID} reportId - Id of the report being requested\n * @param {Object} options - optional parameters for this method\n * @param {number} options.timeoutMs - connection timeout in milliseconds, defaults to 30s\n * @returns {Promise<ResponseEntity<ReportRecord>>} Http response containing the specified report record\n */\n async getReport(reportId, options) {\n if (!reportId) {\n throw Error('Undefined parameter');\n }\n\n // use spread operator to set default options\n options = {...this.config.defaultOptions, ...options};\n\n return this.request({\n method: 'GET',\n service: 'ediscovery',\n resource: `reports/${reportId}`,\n timeout: options.timeoutMs\n });\n },\n\n @waitForValue('@')\n /**\n * Retrieves all the compliance officers reports\n * @param {Object} options - optional parameters for this method\n * @param {number} options.offset - start position from which to retrieve records\n * @param {number} options.size - the number of records to retrieve\n * @param {number} options.timeoutMs - connection timeout in milliseconds, defaults to 30s\n * @returns {Promise<ResponseEntity<Array<ReportRecord>>>} Http Response containing a list of report records\n */\n async getReports(options) {\n // use spread operator to set default options\n options = {...this.config.defaultOptions, ...options};\n\n return this.request({\n method: 'GET',\n service: 'ediscovery',\n resource: 'reports',\n qs: {offset: options.offset, size: options.size},\n timeout: options.timeoutMs\n });\n },\n\n @waitForValue('@')\n /**\n * Deletes a specified report\n * @param {UUID} reportId - Id of the report being requested for deletion\n * @param {Object} options - optional parameters for this method\n * @param {number} options.timeoutMs - connection timeout in milliseconds, defaults to 30s\n * @returns {Promise<ResponseEntity>} HttpResponse indicating if delete was successful\n */\n async deleteReport(reportId, options) {\n if (!reportId) {\n throw Error('Undefined parameter');\n }\n\n // use spread operator to set default options\n options = {...this.config.defaultOptions, ...options};\n\n return this.request({\n method: 'DELETE',\n service: 'ediscovery',\n resource: `reports/${reportId}`,\n timeout: options.timeoutMs\n });\n },\n\n @waitForValue('@')\n /**\n * Restarts a completed or cancelled report so that it begins again from scratch\n * @param {UUID} reportId - Id of the report being requested\n * @param {Object} options - optional parameters for this method\n * @param {number} options.timeoutMs - connection timeout in milliseconds, defaults to 30s\n * @returns {Promise<ResponseEntity<ReportRecord>>} Http response containing the report record\n */\n async restartReport(reportId, options) {\n if (!reportId) {\n throw Error('Undefined parameter');\n }\n\n // use spread operator to set default options\n options = {...this.config.defaultOptions, ...options};\n\n return this.request({\n method: 'PUT',\n service: 'ediscovery',\n resource: `reports/${reportId}`,\n timeout: options.timeoutMs\n });\n },\n\n @waitForValue('@')\n @oneFlight({keyFactory: (reportId, options) => createOneFlightKey(reportId, options)})\n /**\n * Retrieves content associated with a report\n * @param {UUID|string} reportId - UUID or url of the report which contains the content\n * @param {Object} options - optional parameters for this method\n * @param {number} options.offset - start position from which to retrieve records\n * @param {number} options.size - the number of records to retrieve\n * @param {number} options.timeoutMs - connection timeout in milliseconds, defaults to 30s\n * @returns {Promise<ResponseEntity<[Activity]>>} Http response containing the activities\n */\n async getContent(reportId, options) {\n if (!reportId) {\n throw Error('Undefined parameter');\n }\n\n // use spread operator to set default options\n options = {...this.config.defaultOptions, ...options};\n\n const [requestOptions] = this._createRequestOptions(reportId, '/contents');\n\n return this.request({\n method: 'GET',\n ...requestOptions,\n qs: {offset: options.offset, size: options.size},\n timeout: options.timeoutMs\n });\n },\n\n @waitForValue('@')\n @oneFlight({keyFactory: (reportId, options) => createOneFlightKey(reportId, options)})\n /**\n * Retrieves a list of content containers relevant to a specified report\n * @param {UUID|string} reportId - UUID or url of the report being requested\n * @param {Object} options - optional parameters for this method\n * @param {number} options.offset - start position from which to retrieve records\n * @param {number} options.size - the number of records to retrieve\n * @param {number} options.timeoutMs - connection timeout in milliseconds, defaults to 30s\n * @param {Set<Object>} options.types - Set of ContentContainerTypes to be retrieved\n * @returns {Promise<ResponseEntity<ContentContainer>>} Http response containing the content containers\n */\n async getContentContainer(reportId, options) {\n if (!reportId) {\n throw Error('Undefined parameter');\n }\n\n // use spread operator to set default options\n options = {...this.config.defaultOptions, ...options};\n\n const [requestOptions, reportUUID] = this._createRequestOptions(reportId, '/contents/container');\n\n const res = await this.request({\n method: 'GET',\n ...requestOptions,\n qs: {offset: options.offset, size: options.size},\n timeout: options.timeoutMs,\n types: options.types\n });\n\n await this._writeToContentContainerCache(reportUUID, res.body);\n\n return res;\n },\n\n @waitForValue('@')\n @oneFlight({keyFactory: (reportId, containerId) => String(reportId + containerId)})\n /**\n * Retrieves information for a specific content container relevant to a specified report\n * @param {UUID|string} reportId - UUID or url of the report being requested\n * @param {UUID} containerId - Id of the contenyt container being requested\n * @param {Object} options - optional parameters for this method\n * @param {number} options.timeoutMs - connection timeout in milliseconds, defaults to 30s\n * @returns {Promise<ResponseEntity<ContentContainer>>} Http response containing the specified content container\n */\n async getContentContainerByContainerId(reportId, containerId, options) {\n if (!reportId || !containerId) {\n throw Error('Undefined parameter');\n }\n\n // use spread operator to set default options\n options = {...this.config.defaultOptions, ...options};\n\n const [requestOptions, reportUUID] = this._createRequestOptions(reportId, `/contents/container/${containerId}`);\n\n // If this content container has already been cached then it can be retrieved from there instead of making a network call to ediscovery\n if (this.contentContainerCache.has(reportUUID) && this.contentContainerCache.get(reportUUID).has(containerId)) {\n return {body: this.contentContainerCache.get(reportUUID).get(containerId), statusCode: 200};\n }\n\n this.logger.warn(`Cache miss for container ${containerId} in contentContainerCache`);\n\n const res = await this.request({\n method: 'GET',\n ...requestOptions,\n qs: {offset: options.offset, size: options.size},\n timeout: options.timeoutMs\n });\n\n await this._writeToContentContainerCache(reportUUID, [res.body]);\n\n return res;\n },\n\n /**\n * The results of a getContentContainer or getContentContainerByContainerId request are written to the contentContainerCache\n * since information for a container is likely to be accessed very frequently when decrypting activities\n * @param {UUID} reportId - Id of the report which contains the relevant content summary\n * @param {Array<Object>} containers - List of the container objects to be written to the cache\n * @returns {Promise} - Promise resolution indicating operation is complete\n */\n _writeToContentContainerCache(reportId, containers) {\n if (!reportId || !containers || !containers.length) {\n return;\n }\n\n if (!this.contentContainerCache.has(reportId)) {\n this.contentContainerCache.set(reportId, new Map());\n }\n\n for (const container of containers) {\n if (container && container.containerId) {\n try {\n this.contentContainerCache.get(reportId).set(container.containerId, container);\n }\n catch (error) {\n this.logger.error(`Error adding ${container.containerId} to contentContainerCache: ${error}`);\n }\n }\n else {\n this.logger.error('Error adding undefined container to contentContainerCache');\n }\n }\n },\n\n /**\n * Wipe the cache used by eDiscovery to store the space summaries and content containers.\n * Good practice to clear it down when finished with a report to save RAM.\n * @returns {undefined}\n */\n clearCache() {\n this.contentContainerCache.clear();\n },\n\n /**\n * Retrieves a uuid string from a report url\n * @param {String} reportUrl - full destination address (including report id parameter) for the http request being sent\n * e.g. 'http://ediscovery-intb.wbx2.com/ediscovery/api/v1/reports/3b10e625-2bd5-4efa-b866-58d6c93c505c'\n * @returns {String} - uuid of the report\n */\n _getReportIdFromUrl(reportUrl) {\n if (reportUrl) {\n const uuids = reportUrl.match(/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/);\n\n if (uuids && uuids.length > 0) {\n return uuids[0];\n }\n }\n\n return '';\n },\n\n _isUrl(string) {\n // Regex found from `https://ihateregex.io/expr/url`\n return /https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&\\/\\/=]*)/g.test(string);\n },\n\n /**\n * Create the appropriate request options based on whether the reportId is a url or a uuid.\n * @param {UUID|string} reportId - May be either a url for the report or a uuid.\n * e.g. 'http://ediscovery-intb.wbx2.com/ediscovery/api/v1/reports/3b10e625-2bd5-4efa-b866-58d6c93c505c' or '3b10e625-2bd5-4efa-b866-58d6c93c505c'.\n * @param {String} resource - The resource on the remote server to request\n * @returns {[Options, uuid]} - The options to pass to `request` and the report uuid.\n */\n _createRequestOptions(reportId, resource) {\n let requestOptions;\n let reportUUID;\n const isUrl = this._isUrl(reportId);\n\n if (isUrl) {\n reportUUID = this._getReportIdFromUrl(reportId);\n\n if (!reportUUID) {\n throw Error('Report url does not contain a report id');\n }\n\n // Ensure the url is formatted to\n // https://ediscovery.intb1.ciscospark.com/ediscovery/api/v1/reports/16bf0d01-b1f7-483b-89a2-915144158fb9\n // index.js for example passes the url in as\n // https://ediscovery.intb1.ciscospark.com/ediscovery/api/v1/reports/16bf0d01-b1f7-483b-89a2-915144158fb9/contents\n const reportUrl = reportId.substring(0, reportId.lastIndexOf(reportUUID) + reportUUID.length);\n\n requestOptions = {\n url: reportUrl + resource\n };\n }\n else {\n requestOptions = {\n service: 'ediscovery',\n resource: `reports/${reportId}/${resource}`\n };\n reportUUID = reportId;\n }\n\n return [requestOptions, reportUUID];\n },\n\n @waitForValue('@')\n /**\n * Retrieves a config object from the service which can be used by the client for optimal performance, e.g. content page size\n * @param {Object} options - optional parameters for this method\n * @param {number} options.timeoutMs - connection timeout in milliseconds, defaults to 30s\n * @returns {Promise<Config>} Http response containing the config object\n */\n async getClientConfig(options) {\n // use spread operator to set default options\n options = {...this.config.defaultOptions, ...options};\n\n return this.request({\n method: 'GET',\n service: 'ediscovery',\n resource: 'reports/clientconfig',\n timeout: options.timeoutMs\n });\n },\n\n @waitForValue('@')\n /**\n * Submits an audit event to the eDiscovery service for admin use. Only expected to be used for\n * the getContentContainer API\n * @param {UUID} reportId - Id of the report to send an audit log for\n * @param {Object} options - optional parameters for this method\n * @param {number} options.timeoutMs - connection timeout in milliseconds, defaults to 30s\n * @returns {Promise<Config>} Http response containing the config object\n */\n async postAuditLog(reportId, options) {\n if (!reportId) {\n throw Error('No report ID specified');\n }\n\n // use spread operator to set default options\n options = {...this.config.defaultOptions, ...options};\n\n return this.request({\n method: 'POST',\n service: 'ediscovery',\n resource: `reports/${reportId}/audit/summary-download`,\n timeout: options.timeoutMs\n });\n }\n\n});\n\nexport default EDiscovery;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;;AACA;;AAEA;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,kBAAT,CAA4BC,QAA5B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C,cAAnB,GAAsCtB,OAAtC,CAAP;cANoC,mCAQ7B,OAAI,CAACwB,OAAL,CAAa;gBAClBC,MAAM,EAAE,MADU;gBAElBC,OAAO,EAAE,YAFS;gBAGlBC,QAAQ,oBAAa5B,QAAb,4BAHU;gBAIlB6B,OAAO,EAAE5B,OAAO,CAAC6B;cAJC,CAAb,CAR6B;;YAAA;YAAA;cAAA;UAAA;QAAA;MAAA;IAAA;EAcrC,CA7ZmC;EAAA;AAAA,CAAnB,28CAAnB;;gBAiaevB,U"}
|
package/dist/index.js
CHANGED
|
@@ -71,6 +71,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
71
71
|
/*!
|
|
72
72
|
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
73
73
|
*/
|
|
74
|
+
|
|
75
|
+
/* eslint-disable */
|
|
74
76
|
(0, _webexCore.registerInternalPlugin)('ediscovery', _ediscovery.default, {
|
|
75
77
|
config: _config.default,
|
|
76
78
|
payloadTransformer: {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["registerInternalPlugin","EDiscovery","config","payloadTransformer","predicates","name","direction","test","ctx","object","resolve","extract","transforms","fn","Transforms","decryptReportRequest","body","all","map","item","transform","encryptReportRequest","reportId","decryptReportContent","options","uri","decryptReportContentContainer"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport '@webex/internal-plugin-encryption';\nimport '@webex/internal-plugin-conversation';\n\nimport {registerInternalPlugin} from '@webex/webex-core';\nimport {has} from 'lodash';\n\nimport EDiscovery from './ediscovery';\nimport Transforms from './transforms';\nimport config from './config';\n\nregisterInternalPlugin('ediscovery', EDiscovery, {\n config,\n payloadTransformer: {\n predicates: [\n {\n name: 'decryptReportRequest',\n direction: 'inbound',\n test(ctx, object) {\n return Promise.resolve(has(object, 'body.reportRequest'));\n },\n extract(object) {\n return Promise.resolve(object);\n }
|
|
1
|
+
{"version":3,"names":["registerInternalPlugin","EDiscovery","config","payloadTransformer","predicates","name","direction","test","ctx","object","resolve","extract","transforms","fn","Transforms","decryptReportRequest","body","all","map","item","transform","encryptReportRequest","reportId","decryptReportContent","options","uri","decryptReportContentContainer"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n/* eslint-disable */\n\nimport '@webex/internal-plugin-encryption';\nimport '@webex/internal-plugin-conversation';\n\nimport {registerInternalPlugin} from '@webex/webex-core';\nimport {has} from 'lodash';\n\nimport EDiscovery from './ediscovery';\nimport Transforms from './transforms';\nimport config from './config';\n\nregisterInternalPlugin('ediscovery', EDiscovery, {\n config,\n payloadTransformer: {\n predicates: [\n {\n name: 'decryptReportRequest',\n direction: 'inbound',\n test(ctx, object) {\n return Promise.resolve(has(object, 'body.reportRequest'));\n },\n extract(object) {\n return Promise.resolve(object);\n },\n },\n {\n name: 'decryptReportRequestArray',\n direction: 'inbound',\n test(ctx, object) {\n return Promise.resolve(has(object, 'body[0].reportRequest'));\n },\n extract(object) {\n return Promise.resolve(object);\n },\n },\n {\n name: 'encryptReportRequest',\n direction: 'outbound',\n test(ctx, object) {\n return Promise.resolve(\n has(object, 'body.keywords') ||\n has(object, 'body.spaceNames') ||\n has(object, 'body.emails')\n );\n },\n extract(object) {\n return Promise.resolve(object);\n },\n },\n {\n name: 'decryptReportContent',\n direction: 'inbound',\n test(ctx, object) {\n return Promise.resolve(has(object, 'body.activityId'));\n },\n extract(object) {\n return Promise.resolve(object);\n },\n },\n {\n name: 'decryptReportContentArray',\n direction: 'inbound',\n test(ctx, object) {\n return Promise.resolve(has(object, 'body[0].activityId'));\n },\n extract(object) {\n return Promise.resolve(object);\n },\n },\n {\n name: 'decryptReportContentContainer',\n direction: 'inbound',\n test(ctx, object) {\n return Promise.resolve(has(object, 'body.containerId'));\n },\n extract(object) {\n return Promise.resolve(object);\n },\n },\n {\n name: 'decryptReportContentContainerArray',\n direction: 'inbound',\n test(ctx, object) {\n return Promise.resolve(has(object, 'body[0].containerId'));\n },\n extract(object) {\n return Promise.resolve(object);\n },\n },\n ],\n transforms: [\n {\n name: 'decryptReportRequest',\n direction: 'inbound',\n fn(ctx, object) {\n return Transforms.decryptReportRequest(ctx, object);\n },\n },\n {\n name: 'decryptReportRequestArray',\n direction: 'inbound',\n fn(ctx, object) {\n if (!object || !object.body) {\n return Promise.resolve();\n }\n\n return Promise.all(\n object.body.map((item) => ctx.transform('decryptReportRequest', {body: item}))\n );\n },\n },\n {\n name: 'encryptReportRequest',\n direction: 'outbound',\n fn(ctx, object) {\n return Transforms.encryptReportRequest(ctx, object);\n },\n },\n {\n name: 'decryptReportContent',\n direction: 'inbound',\n fn(ctx, object, reportId) {\n return Transforms.decryptReportContent(ctx, object, reportId);\n },\n },\n {\n name: 'decryptReportContentArray',\n direction: 'inbound',\n fn(ctx, object) {\n if (!object || !object.body) {\n return Promise.resolve();\n }\n\n // Always use the report url as this'll resolve correctly for remote reports\n return Promise.all(\n object.body.map((item) =>\n ctx.transform('decryptReportContent', {body: item}, object.options.uri)\n )\n );\n },\n },\n {\n name: 'decryptReportContentContainer',\n direction: 'inbound',\n fn(ctx, object) {\n return Transforms.decryptReportContentContainer(ctx, object);\n },\n },\n {\n name: 'decryptReportContentContainerArray',\n direction: 'inbound',\n fn(ctx, object) {\n if (!object || !object.body) {\n return Promise.resolve();\n }\n\n return Promise.all(\n object.body.map((item) => ctx.transform('decryptReportContentContainer', {body: item}))\n );\n },\n },\n ],\n },\n});\n\nexport default EDiscovery;\n\n// eslint-disable-next-line import/named\nexport {config} from './config';\nexport {default as ReportRequest} from './report-request';\nexport {EdiscoveryError, InvalidEmailAddressError} from './ediscovery-error';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;;AACA;;AAEA;;AAGA;;AACA;;AACA;;AAgKA;;AACA;;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OAAP,CAAeC,GAAnE,CADc;QAAA,CAAhB,CADK,CAAP;MAKD;IAdH,CAnCU,EAmDV;MACEpB,IAAI,EAAE,+BADR;MAEEC,SAAS,EAAE,SAFb;MAGEO,EAHF,cAGKL,GAHL,EAGUC,MAHV,EAGkB;QACd,OAAOK,mBAAA,CAAWY,6BAAX,CAAyClB,GAAzC,EAA8CC,MAA9C,CAAP;MACD;IALH,CAnDU,EA0DV;MACEJ,IAAI,EAAE,oCADR;MAEEC,SAAS,EAAE,SAFb;MAGEO,EAHF,cAGKL,GAHL,EAGUC,MAHV,EAGkB;QACd,IAAI,CAACA,MAAD,IAAW,CAACA,MAAM,CAACO,IAAvB,EAA6B;UAC3B,OAAO,iBAAQN,OAAR,EAAP;QACD;;QAED,OAAO,iBAAQO,GAAR,CACLR,MAAM,CAACO,IAAP,CAAYE,GAAZ,CAAgB,UAACC,IAAD;UAAA,OAAUX,GAAG,CAACY,SAAJ,CAAc,+BAAd,EAA+C;YAACJ,IAAI,EAAEG;UAAP,CAA/C,CAAV;QAAA,CAAhB,CADK,CAAP;MAGD;IAXH,CA1DU;EA7EM;AAF2B,CAAjD;eA0JelB,mB,EAEf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ReportRequest","name","description","emails","userIds","keywords","encryptionKeyUrl","spaceNames","range","startTime","endTime"],"sources":["report-request.js"],"sourcesContent":["/**\n * Creates a report request object with a specific set of search parameters\n * @param {String} name - A label to identify the report\n * @param {String} description - A textual summary of the reports purpose\n * @param {Array<String>} emails - A list of user emails relevant to the report\n * @param {Array<String>} userIds - A list of UUIDs relevant to the report\n * @param {Array<String>} keywords - A list of search terms relevant to the report\n * @param {Array<String>} spaceNames - A list of space names relevant to the report\n * @param {Object} range - Contains the start time and end time defining the search period\n * @returns {Object} ReportRequest - Contains all search parameters\n */\nclass ReportRequest {\n constructor(name = ''
|
|
1
|
+
{"version":3,"names":["ReportRequest","name","description","emails","userIds","keywords","encryptionKeyUrl","spaceNames","range","startTime","endTime"],"sources":["report-request.js"],"sourcesContent":["/**\n * Creates a report request object with a specific set of search parameters\n * @param {String} name - A label to identify the report\n * @param {String} description - A textual summary of the reports purpose\n * @param {Array<String>} emails - A list of user emails relevant to the report\n * @param {Array<String>} userIds - A list of UUIDs relevant to the report\n * @param {Array<String>} keywords - A list of search terms relevant to the report\n * @param {Array<String>} spaceNames - A list of space names relevant to the report\n * @param {Object} range - Contains the start time and end time defining the search period\n * @returns {Object} ReportRequest - Contains all search parameters\n */\nclass ReportRequest {\n constructor(\n name = '',\n description = '',\n emails = [],\n userIds = [],\n keywords = [],\n encryptionKeyUrl = '',\n spaceNames = [],\n range = {startTime: '2020-01-01T00:00:00', endTime: '2020-01-01T23:59:59'}\n ) {\n this.name = name;\n this.description = description;\n this.emails = emails;\n this.userIds = userIds;\n this.keywords = keywords;\n this.encryptionKeyUrl = encryptionKeyUrl;\n this.spaceNames = spaceNames;\n this.range = range;\n }\n}\n\nexport default ReportRequest;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACMA,a,2CACJ,yBASE;EAAA,IARAC,IAQA,uEARO,EAQP;EAAA,IAPAC,WAOA,uEAPc,EAOd;EAAA,IANAC,MAMA,uEANS,EAMT;EAAA,IALAC,OAKA,uEALU,EAKV;EAAA,IAJAC,QAIA,uEAJW,EAIX;EAAA,IAHAC,gBAGA,uEAHmB,EAGnB;EAAA,IAFAC,UAEA,uEAFa,EAEb;EAAA,IADAC,KACA,uEADQ;IAACC,SAAS,EAAE,qBAAZ;IAAmCC,OAAO,EAAE;EAA5C,CACR;EAAA;EACA,KAAKT,IAAL,GAAYA,IAAZ;EACA,KAAKC,WAAL,GAAmBA,WAAnB;EACA,KAAKC,MAAL,GAAcA,MAAd;EACA,KAAKC,OAAL,GAAeA,OAAf;EACA,KAAKC,QAAL,GAAgBA,QAAhB;EACA,KAAKC,gBAAL,GAAwBA,gBAAxB;EACA,KAAKC,UAAL,GAAkBA,UAAlB;EACA,KAAKC,KAAL,GAAaA,KAAb;AACD,C;eAGYR,a"}
|
package/dist/retry.js
CHANGED
|
@@ -33,7 +33,7 @@ function _requestWithRetries() {
|
|
|
33
33
|
case 5:
|
|
34
34
|
return _context.abrupt("return", func.apply(ctx, args).catch(function (reason) {
|
|
35
35
|
if (retryErrors.includes(reason.statusCode) && retryCount < maxRetries) {
|
|
36
|
-
retryCount += 1;
|
|
36
|
+
retryCount += 1; // eslint-disable-next-line no-shadow
|
|
37
37
|
|
|
38
38
|
var _retryIntervalInSeconds = Math.pow(retryCount + 1, 2); // 4, 9 and 16 second delays as default
|
|
39
39
|
|
package/dist/retry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["retryErrors","requestWithRetries","ctx","func","args","retryCount","retryIntervalInSeconds","maxRetries","timeout","apply","catch","reason","includes","statusCode","headers","console","error","reject","sec","resolve","setTimeout","module","exports"],"sources":["retry.js"],"sourcesContent":["const retryErrors = [429, 502, 503, 504];\n\nasync function requestWithRetries(ctx
|
|
1
|
+
{"version":3,"names":["retryErrors","requestWithRetries","ctx","func","args","retryCount","retryIntervalInSeconds","maxRetries","timeout","apply","catch","reason","includes","statusCode","headers","console","error","reject","sec","resolve","setTimeout","module","exports"],"sources":["retry.js"],"sourcesContent":["const retryErrors = [429, 502, 503, 504];\n\nasync function requestWithRetries(\n ctx,\n func,\n args,\n retryCount = 0,\n retryIntervalInSeconds = 0,\n maxRetries = 3\n) {\n await timeout(retryIntervalInSeconds);\n\n return func.apply(ctx, args).catch((reason) => {\n if (retryErrors.includes(reason.statusCode) && retryCount < maxRetries) {\n retryCount += 1;\n // eslint-disable-next-line no-shadow\n let retryIntervalInSeconds = (retryCount + 1) ** 2; // 4, 9 and 16 second delays as default\n\n if (reason.headers && reason.headers['retry-after']) {\n retryIntervalInSeconds = reason.headers['retry-after'];\n }\n console.error(\n `Request #${retryCount} error: ${reason.statusCode}. Attempting retry #${retryCount} in ${retryIntervalInSeconds} seconds`\n );\n\n return requestWithRetries(ctx, func, args, retryCount, retryIntervalInSeconds, maxRetries);\n }\n\n return Promise.reject(reason);\n });\n}\n\nfunction timeout(sec) {\n // return immediately if timeout is zero or undefined\n if (!sec) {\n return Promise.resolve();\n }\n\n return new Promise((resolve) => setTimeout(resolve, sec * 1000));\n}\n\nmodule.exports.requestWithRetries = requestWithRetries;\nmodule.exports.timeout = timeout;\n"],"mappings":";;;;;;;;;;AAAA,IAAMA,WAAW,GAAG,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,EAAgB,GAAhB,CAApB;;SAEeC,kB;;;;;gGAAf,iBACEC,GADF,EAEEC,IAFF,EAGEC,IAHF;IAAA;IAAA;IAAA;IAAA;IAAA;MAAA;QAAA;UAAA;YAIEC,UAJF,2DAIe,CAJf;YAKEC,sBALF,2DAK2B,CAL3B;YAMEC,UANF,2DAMe,CANf;YAAA;YAAA,OAQQC,OAAO,CAACF,sBAAD,CARf;;UAAA;YAAA,iCAUSH,IAAI,CAACM,KAAL,CAAWP,GAAX,EAAgBE,IAAhB,EAAsBM,KAAtB,CAA4B,UAACC,MAAD,EAAY;cAC7C,IAAIX,WAAW,CAACY,QAAZ,CAAqBD,MAAM,CAACE,UAA5B,KAA2CR,UAAU,GAAGE,UAA5D,EAAwE;gBACtEF,UAAU,IAAI,CAAd,CADsE,CAEtE;;gBACA,IAAIC,uBAAsB,YAAID,UAAU,GAAG,CAAjB,EAAuB,CAAvB,CAA1B,CAHsE,CAGlB;;;gBAEpD,IAAIM,MAAM,CAACG,OAAP,IAAkBH,MAAM,CAACG,OAAP,CAAe,aAAf,CAAtB,EAAqD;kBACnDR,uBAAsB,GAAGK,MAAM,CAACG,OAAP,CAAe,aAAf,CAAzB;gBACD;;gBACDC,OAAO,CAACC,KAAR,oBACcX,UADd,qBACmCM,MAAM,CAACE,UAD1C,iCAC2ER,UAD3E,iBAC4FC,uBAD5F;gBAIA,OAAOL,kBAAkB,CAACC,GAAD,EAAMC,IAAN,EAAYC,IAAZ,EAAkBC,UAAlB,EAA8BC,uBAA9B,EAAsDC,UAAtD,CAAzB;cACD;;cAED,OAAO,iBAAQU,MAAR,CAAeN,MAAf,CAAP;YACD,CAjBM,CAVT;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,C;;;;AA8BA,SAASH,OAAT,CAAiBU,GAAjB,EAAsB;EACpB;EACA,IAAI,CAACA,GAAL,EAAU;IACR,OAAO,iBAAQC,OAAR,EAAP;EACD;;EAED,OAAO,qBAAY,UAACA,OAAD;IAAA,OAAaC,UAAU,CAACD,OAAD,EAAUD,GAAG,GAAG,IAAhB,CAAvB;EAAA,CAAZ,CAAP;AACD;;AAEDG,MAAM,CAACC,OAAP,CAAerB,kBAAf,GAAoCA,kBAApC;AACAoB,MAAM,CAACC,OAAP,CAAed,OAAf,GAAyBA,OAAzB"}
|
package/dist/transforms.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Transforms","ctx","object","body","resolve","reportRequest","webex","internal","encryption","kms","createUnboundKeys","count","then","keys","length","encryptionKeyUrl","uri","createResource","userIds","userId","promises","name","push","encryptText","encryptedName","description","encryptedDescription","spaceNames","all","map","spaceName","encryptedSpaceNames","keywords","keyword","encryptedKeywords","emails","unencryptedEmails","email","encryptedEmails","catch","reason","logger","error","reject","reportNamePromise","decryptText","decryptedName","id","reportDescriptionPromise","decryptedDescription","spaceNamePromises","decryptedSpaceNames","keywordPromises","decryptedKeywords","emailPromises","decryptedEmails","concat","reportId","activity","ediscovery","getContentContainerByContainerId","targetId","res","container","activityId","warning","spaceWarning","containerWarning","containerName","isOneOnOne","displayNames","participants","formerParticipants","p","displayName","join","includes","verb","meeting","recording","extension","extensionType","spaceInfo","info","onBehalfOfUser","objectDisplayName","requestWithRetries","onBehalfOf","decryptedMessage","previousName","previousEncryptionKeyUrl","objectType","contentUrl","decryptedContentUrl","decryptedDisplayName","webUrl","decryptedWebUrl","previous","decryptedPreviousContentUrl","decryptedPreviousDisplayName","title","topic","shares","Array","prototype","apply","files","whiteboards","links","i","share","warn","mimeType","fileSize","url","microsoftSharedLinkInfo","driveId","decryptedDriveId","itemId","decryptedItemId","scr","sslr","decryptScr","decryptedSCR","loc","containerType","containerId","descriptionEncryptionKeyUrl","decryptedContainerDescription","decryptedContainerName"],"sources":["transforms.js"],"sourcesContent":["import {requestWithRetries} from './retry';\n\n/**\n * This class is used to encrypt/decrypt various properties on ReportRequests, Activities and Spaces as they are sent/returned to/from the eDiscovery Service\n */\nclass Transforms {\n /**\n * This function is used to encrypt sensitive properties on the ReportRequest before it is sent to the eDiscovery Service createReport API\n * @param {Object} ctx - An object containing a webex instance and a transform\n * @param {Object} object - Generic object that you want to encrypt some property on based on the type\n * @returns {Promise} - Returns a transform promise\n */\n static encryptReportRequest(ctx, object) {\n if (!object || !object.body) {\n return Promise.resolve(object);\n }\n const reportRequest = object.body;\n\n return ctx.webex.internal.encryption.kms.createUnboundKeys({count: 1})\n .then((keys) => {\n if (keys && keys.length > 0 && keys[0]) {\n reportRequest.encryptionKeyUrl = keys[0].uri;\n\n return ctx.webex.internal.encryption.kms.createResource({userIds: [keys[0].userId], keys})\n .then(() => {\n const promises = [];\n\n if (reportRequest.name) {\n promises.push(\n ctx.webex.internal.encryption.encryptText(keys[0], reportRequest.name)\n .then((encryptedName) => {\n reportRequest.name = encryptedName;\n })\n );\n }\n\n if (reportRequest.description) {\n promises.push(\n ctx.webex.internal.encryption.encryptText(keys[0], reportRequest.description)\n .then((encryptedDescription) => {\n reportRequest.description = encryptedDescription;\n })\n );\n }\n\n if (reportRequest.spaceNames) {\n promises.push(\n Promise.all(reportRequest.spaceNames.map((spaceName) => ctx.webex.internal.encryption.encryptText(keys[0], spaceName)))\n .then((encryptedSpaceNames) => {\n reportRequest.spaceNames = encryptedSpaceNames;\n })\n );\n }\n\n if (reportRequest.keywords) {\n promises.push(\n Promise.all(reportRequest.keywords.map((keyword) => ctx.webex.internal.encryption.encryptText(keys[0], keyword)))\n .then((encryptedKeywords) => {\n reportRequest.keywords = encryptedKeywords;\n })\n );\n }\n\n if (reportRequest.emails) {\n // store unencrypted emails for ediscovery service to convert to user ids\n reportRequest.unencryptedEmails = reportRequest.emails;\n promises.push(\n Promise.all(reportRequest.emails.map((email) => ctx.webex.internal.encryption.encryptText(keys[0], email)))\n .then((encryptedEmails) => {\n reportRequest.emails = encryptedEmails;\n })\n );\n }\n\n return Promise.all(promises);\n });\n }\n\n return Promise.resolve(object);\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Error while encrypting report request: ${reportRequest} : ${reason}`);\n\n return Promise.reject(reason);\n });\n }\n\n /**\n * This function is used to decrypt encrypted properties on the ReportRequest that is returned from the eDiscovery Service getReport(s) API\n * @param {Object} ctx - An object containing a webex instance and a transform\n * @param {Object} object - Generic object that you want to decrypt some property on based on the type\n * @returns {Promise} - Returns a transform promise\n */\n static decryptReportRequest(ctx, object) {\n if (!object || !object.body || !object.body.reportRequest || !object.body.reportRequest.encryptionKeyUrl) {\n return Promise.resolve(object);\n }\n const {reportRequest} = object.body;\n\n let reportNamePromise;\n\n if (reportRequest.name) {\n reportNamePromise = ctx.webex.internal.encryption.decryptText(reportRequest.encryptionKeyUrl, reportRequest.name)\n .then((decryptedName) => {\n reportRequest.name = decryptedName;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Error decrypting report name for report ${object.body.id}: ${reason}`);\n });\n }\n\n let reportDescriptionPromise;\n\n if (reportRequest.description) {\n reportDescriptionPromise = ctx.webex.internal.encryption.decryptText(reportRequest.encryptionKeyUrl, reportRequest.description)\n .then((decryptedDescription) => {\n reportRequest.description = decryptedDescription;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Error decrypting description for report ${object.body.id}: ${reason}`);\n });\n }\n\n let spaceNamePromises = [];\n\n if (reportRequest.spaceNames) {\n spaceNamePromises = Promise.all(reportRequest.spaceNames.map((spaceName) => ctx.webex.internal.encryption.decryptText(reportRequest.encryptionKeyUrl, spaceName)))\n .then((decryptedSpaceNames) => {\n reportRequest.spaceNames = decryptedSpaceNames;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Error decrypting space name for report ${object.body.id}: ${reason}`);\n });\n }\n\n let keywordPromises = [];\n\n if (reportRequest.keywords) {\n keywordPromises = Promise.all(reportRequest.keywords.map((keyword) => ctx.webex.internal.encryption.decryptText(reportRequest.encryptionKeyUrl, keyword)))\n .then((decryptedKeywords) => {\n reportRequest.keywords = decryptedKeywords;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Error decrypting keywords for report ${object.body.id}: ${reason}`);\n });\n }\n\n let emailPromises = [];\n\n if (reportRequest.emails) {\n emailPromises = Promise.all(reportRequest.emails.map((email) => ctx.webex.internal.encryption.decryptText(reportRequest.encryptionKeyUrl, email)))\n .then((decryptedEmails) => {\n reportRequest.emails = decryptedEmails;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Error decrypting emails for report ${object.body.id}: ${reason}`);\n });\n }\n\n return Promise.all([reportNamePromise, reportDescriptionPromise].concat(spaceNamePromises, keywordPromises, emailPromises));\n }\n\n /**\n * This function is used to decrypt encrypted properties on the activities that are returned from the eDiscovery Service getContent API\n * @param {Object} ctx - An object containing a webex instance and a transform\n * @param {Object} object - Generic object that you want to decrypt some property on based on the type\n * @param {String} reportId - Id of the report for which content is being retrieved\n * @returns {Promise} - Returns a transform promise\n */\n static decryptReportContent(ctx, object, reportId) {\n if (!object || !object.body || !reportId) {\n return Promise.resolve();\n }\n const activity = object.body;\n\n const promises = [];\n\n return ctx.webex.internal.ediscovery.getContentContainerByContainerId(reportId, activity.targetId)\n .then((res) => {\n const container = res.body;\n\n if (!container) {\n const reason = `Container ${activity.targetId} not found - unable to decrypt activity ${activity.activityId}`;\n\n activity.error = reason;\n ctx.webex.logger.error(reason);\n\n return Promise.resolve(object);\n }\n\n // add warning properties to the activity - these will be recorded in the downloader\n if (container.warning) {\n activity.spaceWarning = container.warning; // Remove this property once all clients are using the content container model\n activity.containerWarning = container.warning;\n }\n\n // set space name and participants on activity\n if (container.containerName) {\n activity.spaceName = container.containerName; // Remove this property once all clients are using the content container model\n activity.containerName = container.containerName;\n }\n else if (container.isOneOnOne) {\n const displayNames = (container.participants || []).concat(container.formerParticipants || []).map((p) => p.displayName).join(' & ');\n\n // One to One spaces have no space name, use participant names as 'Subject' instead\n activity.spaceName = displayNames; // Remove this property once all clients are using the content container model\n activity.containerName = displayNames;\n }\n else {\n activity.spaceName = ''; // Remove this property once all clients are using the content container model\n activity.containerName = '';\n }\n\n // post and share activities have content which needs to be decrypted\n // as do meeting, recording activities, customApp extensions, and space information updates\n if (!['post', 'share'].includes(activity.verb) && !activity.meeting && !activity.recording && !(activity.extension && activity.extension.extensionType === 'customApp') &&\n !activity.spaceInfo?.name && !activity.spaceInfo?.description) {\n return Promise.resolve(object);\n }\n\n if (!activity.encryptionKeyUrl) {\n // If the encryptionKeyUrl is empty we assume the activity is unencrypted\n ctx.webex.logger.info(`Activity ${activity.activityId} cannot be decrypted due to a missing encryption key url`);\n\n return Promise.resolve(object);\n }\n\n if (!container.onBehalfOfUser) {\n const reason = `No user available with which to decrypt activity ${activity.activityId} in container ${activity.targetId}`;\n\n ctx.webex.logger.error(reason);\n activity.error = reason;\n\n return Promise.resolve(object);\n }\n\n // Decrypt activity message if present\n if (activity.objectDisplayName) {\n promises.push(requestWithRetries(ctx.webex.internal.encryption, ctx.webex.internal.encryption.decryptText,\n [activity.encryptionKeyUrl, activity.objectDisplayName, {onBehalfOf: container.onBehalfOfUser}])\n .then((decryptedMessage) => {\n activity.objectDisplayName = decryptedMessage;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Decrypt message error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`);\n // add error property to activity - this error will be recorded in the downloader and the activity omitted from the report\n activity.error = reason;\n\n return Promise.resolve(object);\n }));\n }\n\n // If the activity is a space information update, decrypt the name and description if present\n if (activity.spaceInfo?.name) {\n promises.push(requestWithRetries(ctx.webex.internal.encryption, ctx.webex.internal.encryption.decryptText,\n [activity.encryptionKeyUrl, activity.spaceInfo.name, {onBehalfOf: container.onBehalfOfUser}])\n .then((decryptedMessage) => {\n activity.spaceInfo.name = decryptedMessage;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Decrypt activity.spaceInfo.name error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`);\n activity.error = reason;\n\n return Promise.resolve(object);\n }));\n }\n if (activity.spaceInfo?.description) {\n promises.push(requestWithRetries(ctx.webex.internal.encryption, ctx.webex.internal.encryption.decryptText,\n [activity.encryptionKeyUrl, activity.spaceInfo.description, {onBehalfOf: container.onBehalfOfUser}])\n .then((decryptedMessage) => {\n activity.spaceInfo.description = decryptedMessage;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Decrypt activity.spaceInfo.description error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`);\n activity.error = reason;\n\n return Promise.resolve(object);\n }));\n }\n if (activity.spaceInfo?.previousName && activity.spaceInfo.previousEncryptionKeyUrl) {\n promises.push(requestWithRetries(ctx.webex.internal.encryption, ctx.webex.internal.encryption.decryptText,\n [activity.spaceInfo.previousEncryptionKeyUrl, activity.spaceInfo.previousName, {onBehalfOf: container.onBehalfOfUser}])\n .then((decryptedMessage) => {\n activity.spaceInfo.previousName = decryptedMessage;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Decrypt activity.spaceInfo.previousName error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`);\n activity.error = reason;\n\n return Promise.resolve(object);\n }));\n }\n\n // Decrypt content url and display name if extension is present\n if (activity.extension && activity.extension.objectType === 'extension' && activity.extension.extensionType === 'customApp') {\n promises.push(requestWithRetries(ctx.webex.internal.encryption, ctx.webex.internal.encryption.decryptText,\n [activity.encryptionKeyUrl, activity.extension.contentUrl, {onBehalfOf: container.onBehalfOfUser}])\n .then((decryptedContentUrl) => {\n activity.extension.contentUrl = decryptedContentUrl;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Decrypt activity.extension.contentUrl error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`);\n activity.error = reason;\n\n return Promise.resolve(object);\n }));\n\n promises.push(requestWithRetries(ctx.webex.internal.encryption, ctx.webex.internal.encryption.decryptText,\n [activity.encryptionKeyUrl, activity.extension.displayName, {onBehalfOf: container.onBehalfOfUser}])\n .then((decryptedDisplayName) => {\n activity.extension.displayName = decryptedDisplayName;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Decrypt activity.extension.displayName error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`);\n activity.error = reason;\n\n return Promise.resolve(object);\n }));\n\n // Decrypt webUrl.\n if (activity.extension.webUrl) {\n promises.push(requestWithRetries(ctx.webex.internal.encryption, ctx.webex.internal.encryption.decryptText,\n [activity.encryptionKeyUrl, activity.extension.webUrl, {onBehalfOf: container.onBehalfOfUser}])\n .then((decryptedWebUrl) => {\n activity.extension.webUrl = decryptedWebUrl;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Decrypt activity.extension.webUrl error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`);\n activity.error = reason;\n\n return Promise.resolve(object);\n }));\n }\n if (activity.verb === 'update' && activity.extension.previous) {\n if (activity.extension.previous.contentUrl) {\n promises.push(requestWithRetries(ctx.webex.internal.encryption, ctx.webex.internal.encryption.decryptText,\n [activity.encryptionKeyUrl, activity.extension.previous.contentUrl, {onBehalfOf: container.onBehalfOfUser}])\n .then((decryptedPreviousContentUrl) => {\n activity.extension.previous.contentUrl = decryptedPreviousContentUrl;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Decrypt activity.extension.previous.contentUrl error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`);\n activity.error = reason;\n\n return Promise.resolve(object);\n }));\n }\n if (activity.extension.previous.displayName) {\n promises.push(requestWithRetries(ctx.webex.internal.encryption, ctx.webex.internal.encryption.decryptText,\n [activity.encryptionKeyUrl, activity.extension.previous.displayName, {onBehalfOf: container.onBehalfOfUser}])\n .then((decryptedPreviousDisplayName) => {\n activity.extension.previous.displayName = decryptedPreviousDisplayName;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Decrypt activity.extension.previous.displayName error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`);\n activity.error = reason;\n\n return Promise.resolve(object);\n }));\n }\n }\n }\n\n // Decrypt meeting title if present\n if (activity?.meeting?.title) {\n promises.push(requestWithRetries(ctx.webex.internal.encryption, ctx.webex.internal.encryption.decryptText,\n [activity.encryptionKeyUrl, activity.meeting.title, {onBehalfOf: container.onBehalfOfUser}])\n .then((decryptedMessage) => {\n activity.meeting.title = decryptedMessage;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Decrypt activity.meeting.title error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`);\n activity.error = reason;\n\n return Promise.resolve(object);\n }));\n }\n\n // Decrypt meeting recording topic if present\n if (activity?.recording?.topic) {\n promises.push(requestWithRetries(ctx.webex.internal.encryption, ctx.webex.internal.encryption.decryptText,\n [activity.encryptionKeyUrl, activity.recording.topic, {onBehalfOf: container.onBehalfOfUser}])\n .then((decryptedMessage) => {\n activity.recording.topic = decryptedMessage;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Decrypt activity.recording.topic error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`);\n activity.error = reason;\n\n return Promise.resolve(object);\n }));\n }\n\n // Decrypt shares (files, whiteboards, shared links)\n // Array.prototype.concat.apply ignores undefined\n let shares = Array.prototype.concat.apply([], activity.files);\n\n shares = Array.prototype.concat.apply(shares, activity.whiteboards);\n shares = Array.prototype.concat.apply(shares, activity.links);\n for (let i = 0; i < shares.length; i += 1) {\n const share = shares[i];\n\n // Decrypt the share's display name\n // Ignore display names for whiteboards which are unencrypted\n if (share.displayName && (!activity.whiteboards || !activity.whiteboards.includes(share))) {\n promises.push(requestWithRetries(ctx.webex.internal.encryption, ctx.webex.internal.encryption.decryptText,\n [activity.encryptionKeyUrl, share.displayName, {onBehalfOf: container.onBehalfOfUser}])\n .then((decryptedDisplayName) => {\n share.displayName = decryptedDisplayName;\n })\n .catch((reason) => {\n ctx.webex.logger.warn(`Decrypt DisplayName error for activity ${activity.activityId} in container ${activity.targetId} for share type: ${share.mimeType}, size: ${share.fileSize}, and url: ${share.url} due to error: ${reason}`);\n // add warning property to activity - this will present an indication that there was data loss on the downloader\n activity.warning = reason;\n }));\n }\n\n // Shared Links can have additional decryption fields\n if (share.microsoftSharedLinkInfo) {\n if (share.microsoftSharedLinkInfo.driveId) {\n promises.push(requestWithRetries(ctx.webex.internal.encryption, ctx.webex.internal.encryption.decryptText,\n [activity.encryptionKeyUrl, share.microsoftSharedLinkInfo.driveId, {onBehalfOf: container.onBehalfOfUser}])\n .then((decryptedDriveId) => {\n share.microsoftSharedLinkInfo.driveId = decryptedDriveId;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Decrypt share.microsoftSharedLinkInfo.driveId error for activity ${activity.activityId} in container ${activity.targetId} for share type: ${share.mimeType}, size: ${share.fileSize}, and url: ${share.url} due to error: ${reason}`);\n // add error property to activity - this error will be recorded in the downloader and the activity omitted from the report\n activity.error = reason;\n\n return Promise.resolve(object);\n }));\n }\n\n if (share.microsoftSharedLinkInfo.itemId) {\n promises.push(requestWithRetries(ctx.webex.internal.encryption, ctx.webex.internal.encryption.decryptText,\n [activity.encryptionKeyUrl, share.microsoftSharedLinkInfo.itemId, {onBehalfOf: container.onBehalfOfUser}])\n .then((decryptedItemId) => {\n share.microsoftSharedLinkInfo.itemId = decryptedItemId;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Decrypt share.microsoftSharedLinkInfo.itemId error for activity ${activity.activityId} in container ${activity.targetId} for share type: ${share.mimeType}, size: ${share.fileSize}, and url: ${share.url} due to error: ${reason}`);\n // add error property to activity - this error will be recorded in the downloader and the activity omitted from the report\n activity.error = reason;\n\n return Promise.resolve(object);\n }));\n }\n }\n\n // Decrypt the scr (Secure Content Reference) or sslr (Secure Shared Link Reference)\n // Unlike a scr the sslr contains only a loc. But decryptScr(...) is flexible and\n // leaves the tag, auth, IV, etc fields on the SCR object as undefined.\n if (share.scr || share.sslr) {\n promises.push(requestWithRetries(ctx.webex.internal.encryption, ctx.webex.internal.encryption.decryptScr,\n // A share will have an encryptionKeyUrl when it's activity uses a different encryptionKeyUrl. This can happen when old activities are edited\n // and key rotation is turn on.\n [share.encryptionKeyUrl || activity.encryptionKeyUrl, share.scr || share.sslr, {onBehalfOf: container.onBehalfOfUser}])\n .then((decryptedSCR) => {\n if (share.scr) {\n share.scr = decryptedSCR;\n }\n else {\n share.sslr = decryptedSCR.loc;\n }\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Decrypt file scr or sslr error for activity ${activity.activityId} in container ${activity.targetId} for share type: ${share.mimeType}, size: ${share.fileSize}, and url: ${share.url} due to error: ${reason}`);\n // add error property to activity - this error will be recorded in the downloader and the activity omitted from the report\n activity.error = reason;\n\n return Promise.resolve(object);\n }));\n }\n }\n\n return Promise.all(promises);\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Error retrieving content container for: ${activity.activityId} in container ${activity.targetId}: ${reason}`);\n // add error property to activity - this error will be recorded in the downloader and the activity omitted from the report\n activity.error = reason;\n\n return Promise.resolve(object);\n });\n }\n\n /**\n * This function is used to decrypt encrypted properties on the containers that are returned from the eDiscovery Service getContentContainer API\n * @param {Object} ctx - An object containing a webex instance and a transform\n * @param {Object} object - Generic object that you want to decrypt some property on based on the type\n * @returns {Promise} - Returns a transform promise\n */\n static decryptReportContentContainer(ctx, object) {\n if (!object || !object.body) {\n return Promise.resolve();\n }\n const container = object.body;\n\n if (!container.containerName) {\n return Promise.resolve(object);\n }\n\n if (!container.encryptionKeyUrl) {\n // If the encryptionKeyUrl is empty we assume the container name is unencrypted\n ctx.webex.logger.info(`${container.containerType} container ${container.containerId} cannot be decrypted due to a missing encryption key url`);\n\n return Promise.resolve(object);\n }\n\n if (!container.onBehalfOfUser) {\n const reason = `No user available with which to decrypt ${container.containerType} container ${container.containerId}`;\n\n ctx.webex.logger.error(reason);\n container.error = reason;\n\n return Promise.resolve(object);\n }\n\n // decrypt description if present with a descriptionEncryptionKeyUrl\n if (container.description && container.descriptionEncryptionKeyUrl) {\n requestWithRetries(ctx.webex.internal.encryption, ctx.webex.internal.encryption.decryptText,\n [container.descriptionEncryptionKeyUrl, container.description, {onBehalfOf: container.onBehalfOfUser}])\n .then((decryptedContainerDescription) => {\n container.description = decryptedContainerDescription;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Decrypt container description error for ${container.containerType} container ${container.containerId}: ${reason}`);\n // add warn property to container info - this warning will be recorded in the downloader\n container.warning = reason;\n // don't return, attempt to decrypt the name first\n });\n }\n\n return requestWithRetries(ctx.webex.internal.encryption, ctx.webex.internal.encryption.decryptText,\n [container.encryptionKeyUrl, container.containerName, {onBehalfOf: container.onBehalfOfUser}])\n .then((decryptedContainerName) => {\n container.containerName = decryptedContainerName;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Decrypt container name error for ${container.containerType} container ${container.containerId}: ${reason}`);\n // add warn property to container info - this warning will be recorded in the downloader\n container.warning = reason;\n\n return Promise.resolve(object);\n });\n }\n}\n\nexport default Transforms;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;AAEA;AACA;AACA;IACMA,U;;;;;;;;IACJ;AACF;AACA;AACA;AACA;AACA;IACE,8BAA4BC,GAA5B,EAAiCC,MAAjC,EAAyC;MACvC,IAAI,CAACA,MAAD,IAAW,CAACA,MAAM,CAACC,IAAvB,EAA6B;QAC3B,OAAO,iBAAQC,OAAR,CAAgBF,MAAhB,CAAP;MACD;;MACD,IAAMG,aAAa,GAAGH,MAAM,CAACC,IAA7B;MAEA,OAAOF,GAAG,CAACK,KAAJ,CAAUC,QAAV,CAAmBC,UAAnB,CAA8BC,GAA9B,CAAkCC,iBAAlC,CAAoD;QAACC,KAAK,EAAE;MAAR,CAApD,EACJC,IADI,CACC,UAACC,IAAD,EAAU;QACd,IAAIA,IAAI,IAAIA,IAAI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AAY;QACjBvC,GAAG,CAACK,KAAJ,CAAUmC,MAAV,CAAiBC,KAAjB,4CAA2DqB,SAAS,CAAC8D,aAArE,wBAAgG9D,SAAS,CAAC+D,WAA1G,eAA0HtF,MAA1H,GADiB,CAEjB;;QACAuB,SAAS,CAACE,OAAV,GAAoBzB,MAApB;QAEA,OAAO,iBAAQpC,OAAR,CAAgBF,MAAhB,CAAP;MACD,CAXI,CAAP;IAYD;;;;;eAGYF,U"}
|
|
1
|
+
{"version":3,"names":["Transforms","ctx","object","body","resolve","reportRequest","webex","internal","encryption","kms","createUnboundKeys","count","then","keys","length","encryptionKeyUrl","uri","createResource","userIds","userId","promises","name","push","encryptText","encryptedName","description","encryptedDescription","spaceNames","all","map","spaceName","encryptedSpaceNames","keywords","keyword","encryptedKeywords","emails","unencryptedEmails","email","encryptedEmails","catch","reason","logger","error","reject","reportNamePromise","decryptText","decryptedName","id","reportDescriptionPromise","decryptedDescription","spaceNamePromises","decryptedSpaceNames","keywordPromises","decryptedKeywords","emailPromises","decryptedEmails","concat","reportId","activity","ediscovery","getContentContainerByContainerId","targetId","res","container","activityId","warning","spaceWarning","containerWarning","containerName","isOneOnOne","displayNames","participants","formerParticipants","p","displayName","join","includes","verb","meeting","recording","extension","extensionType","spaceInfo","info","onBehalfOfUser","objectDisplayName","requestWithRetries","onBehalfOf","decryptedMessage","previousName","previousEncryptionKeyUrl","objectType","contentUrl","decryptedContentUrl","decryptedDisplayName","webUrl","decryptedWebUrl","previous","decryptedPreviousContentUrl","decryptedPreviousDisplayName","title","topic","shares","Array","prototype","apply","files","whiteboards","links","i","share","warn","mimeType","fileSize","url","microsoftSharedLinkInfo","driveId","decryptedDriveId","itemId","decryptedItemId","scr","sslr","decryptScr","decryptedSCR","loc","containerType","containerId","descriptionEncryptionKeyUrl","decryptedContainerDescription","decryptedContainerName"],"sources":["transforms.js"],"sourcesContent":["import {requestWithRetries} from './retry';\n\n/**\n * This class is used to encrypt/decrypt various properties on ReportRequests, Activities and Spaces as they are sent/returned to/from the eDiscovery Service\n */\nclass Transforms {\n /**\n * This function is used to encrypt sensitive properties on the ReportRequest before it is sent to the eDiscovery Service createReport API\n * @param {Object} ctx - An object containing a webex instance and a transform\n * @param {Object} object - Generic object that you want to encrypt some property on based on the type\n * @returns {Promise} - Returns a transform promise\n */\n static encryptReportRequest(ctx, object) {\n if (!object || !object.body) {\n return Promise.resolve(object);\n }\n const reportRequest = object.body;\n\n return ctx.webex.internal.encryption.kms\n .createUnboundKeys({count: 1})\n .then((keys) => {\n if (keys && keys.length > 0 && keys[0]) {\n reportRequest.encryptionKeyUrl = keys[0].uri;\n\n return ctx.webex.internal.encryption.kms\n .createResource({userIds: [keys[0].userId], keys})\n .then(() => {\n const promises = [];\n\n if (reportRequest.name) {\n promises.push(\n ctx.webex.internal.encryption\n .encryptText(keys[0], reportRequest.name)\n .then((encryptedName) => {\n reportRequest.name = encryptedName;\n })\n );\n }\n\n if (reportRequest.description) {\n promises.push(\n ctx.webex.internal.encryption\n .encryptText(keys[0], reportRequest.description)\n .then((encryptedDescription) => {\n reportRequest.description = encryptedDescription;\n })\n );\n }\n\n if (reportRequest.spaceNames) {\n promises.push(\n Promise.all(\n reportRequest.spaceNames.map((spaceName) =>\n ctx.webex.internal.encryption.encryptText(keys[0], spaceName)\n )\n ).then((encryptedSpaceNames) => {\n reportRequest.spaceNames = encryptedSpaceNames;\n })\n );\n }\n\n if (reportRequest.keywords) {\n promises.push(\n Promise.all(\n reportRequest.keywords.map((keyword) =>\n ctx.webex.internal.encryption.encryptText(keys[0], keyword)\n )\n ).then((encryptedKeywords) => {\n reportRequest.keywords = encryptedKeywords;\n })\n );\n }\n\n if (reportRequest.emails) {\n // store unencrypted emails for ediscovery service to convert to user ids\n reportRequest.unencryptedEmails = reportRequest.emails;\n promises.push(\n Promise.all(\n reportRequest.emails.map((email) =>\n ctx.webex.internal.encryption.encryptText(keys[0], email)\n )\n ).then((encryptedEmails) => {\n reportRequest.emails = encryptedEmails;\n })\n );\n }\n\n return Promise.all(promises);\n });\n }\n\n return Promise.resolve(object);\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Error while encrypting report request: ${reportRequest} : ${reason}`\n );\n\n return Promise.reject(reason);\n });\n }\n\n /**\n * This function is used to decrypt encrypted properties on the ReportRequest that is returned from the eDiscovery Service getReport(s) API\n * @param {Object} ctx - An object containing a webex instance and a transform\n * @param {Object} object - Generic object that you want to decrypt some property on based on the type\n * @returns {Promise} - Returns a transform promise\n */\n static decryptReportRequest(ctx, object) {\n if (\n !object ||\n !object.body ||\n !object.body.reportRequest ||\n !object.body.reportRequest.encryptionKeyUrl\n ) {\n return Promise.resolve(object);\n }\n const {reportRequest} = object.body;\n\n let reportNamePromise;\n\n if (reportRequest.name) {\n reportNamePromise = ctx.webex.internal.encryption\n .decryptText(reportRequest.encryptionKeyUrl, reportRequest.name)\n .then((decryptedName) => {\n reportRequest.name = decryptedName;\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Error decrypting report name for report ${object.body.id}: ${reason}`\n );\n });\n }\n\n let reportDescriptionPromise;\n\n if (reportRequest.description) {\n reportDescriptionPromise = ctx.webex.internal.encryption\n .decryptText(reportRequest.encryptionKeyUrl, reportRequest.description)\n .then((decryptedDescription) => {\n reportRequest.description = decryptedDescription;\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Error decrypting description for report ${object.body.id}: ${reason}`\n );\n });\n }\n\n let spaceNamePromises = [];\n\n if (reportRequest.spaceNames) {\n spaceNamePromises = Promise.all(\n reportRequest.spaceNames.map((spaceName) =>\n ctx.webex.internal.encryption.decryptText(reportRequest.encryptionKeyUrl, spaceName)\n )\n )\n .then((decryptedSpaceNames) => {\n reportRequest.spaceNames = decryptedSpaceNames;\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Error decrypting space name for report ${object.body.id}: ${reason}`\n );\n });\n }\n\n let keywordPromises = [];\n\n if (reportRequest.keywords) {\n keywordPromises = Promise.all(\n reportRequest.keywords.map((keyword) =>\n ctx.webex.internal.encryption.decryptText(reportRequest.encryptionKeyUrl, keyword)\n )\n )\n .then((decryptedKeywords) => {\n reportRequest.keywords = decryptedKeywords;\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Error decrypting keywords for report ${object.body.id}: ${reason}`\n );\n });\n }\n\n let emailPromises = [];\n\n if (reportRequest.emails) {\n emailPromises = Promise.all(\n reportRequest.emails.map((email) =>\n ctx.webex.internal.encryption.decryptText(reportRequest.encryptionKeyUrl, email)\n )\n )\n .then((decryptedEmails) => {\n reportRequest.emails = decryptedEmails;\n })\n .catch((reason) => {\n ctx.webex.logger.error(`Error decrypting emails for report ${object.body.id}: ${reason}`);\n });\n }\n\n return Promise.all(\n [reportNamePromise, reportDescriptionPromise].concat(\n spaceNamePromises,\n keywordPromises,\n emailPromises\n )\n );\n }\n\n /**\n * This function is used to decrypt encrypted properties on the activities that are returned from the eDiscovery Service getContent API\n * @param {Object} ctx - An object containing a webex instance and a transform\n * @param {Object} object - Generic object that you want to decrypt some property on based on the type\n * @param {String} reportId - Id of the report for which content is being retrieved\n * @returns {Promise} - Returns a transform promise\n */\n static decryptReportContent(ctx, object, reportId) {\n if (!object || !object.body || !reportId) {\n return Promise.resolve();\n }\n const activity = object.body;\n\n const promises = [];\n\n return ctx.webex.internal.ediscovery\n .getContentContainerByContainerId(reportId, activity.targetId)\n .then((res) => {\n const container = res.body;\n\n if (!container) {\n const reason = `Container ${activity.targetId} not found - unable to decrypt activity ${activity.activityId}`;\n\n activity.error = reason;\n ctx.webex.logger.error(reason);\n\n return Promise.resolve(object);\n }\n\n // add warning properties to the activity - these will be recorded in the downloader\n if (container.warning) {\n activity.spaceWarning = container.warning; // Remove this property once all clients are using the content container model\n activity.containerWarning = container.warning;\n }\n\n // set space name and participants on activity\n if (container.containerName) {\n activity.spaceName = container.containerName; // Remove this property once all clients are using the content container model\n activity.containerName = container.containerName;\n } else if (container.isOneOnOne) {\n const displayNames = (container.participants || [])\n .concat(container.formerParticipants || [])\n .map((p) => p.displayName)\n .join(' & ');\n\n // One to One spaces have no space name, use participant names as 'Subject' instead\n activity.spaceName = displayNames; // Remove this property once all clients are using the content container model\n activity.containerName = displayNames;\n } else {\n activity.spaceName = ''; // Remove this property once all clients are using the content container model\n activity.containerName = '';\n }\n\n // post and share activities have content which needs to be decrypted\n // as do meeting, recording activities, customApp extensions, and space information updates\n if (\n !['post', 'share'].includes(activity.verb) &&\n !activity.meeting &&\n !activity.recording &&\n !(activity.extension && activity.extension.extensionType === 'customApp') &&\n !activity.spaceInfo?.name &&\n !activity.spaceInfo?.description\n ) {\n return Promise.resolve(object);\n }\n\n if (!activity.encryptionKeyUrl) {\n // If the encryptionKeyUrl is empty we assume the activity is unencrypted\n ctx.webex.logger.info(\n `Activity ${activity.activityId} cannot be decrypted due to a missing encryption key url`\n );\n\n return Promise.resolve(object);\n }\n\n if (!container.onBehalfOfUser) {\n const reason = `No user available with which to decrypt activity ${activity.activityId} in container ${activity.targetId}`;\n\n ctx.webex.logger.error(reason);\n activity.error = reason;\n\n return Promise.resolve(object);\n }\n\n // Decrypt activity message if present\n if (activity.objectDisplayName) {\n promises.push(\n requestWithRetries(\n ctx.webex.internal.encryption,\n ctx.webex.internal.encryption.decryptText,\n [\n activity.encryptionKeyUrl,\n activity.objectDisplayName,\n {onBehalfOf: container.onBehalfOfUser},\n ]\n )\n .then((decryptedMessage) => {\n activity.objectDisplayName = decryptedMessage;\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Decrypt message error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`\n );\n // add error property to activity - this error will be recorded in the downloader and the activity omitted from the report\n activity.error = reason;\n\n return Promise.resolve(object);\n })\n );\n }\n\n // If the activity is a space information update, decrypt the name and description if present\n if (activity.spaceInfo?.name) {\n promises.push(\n requestWithRetries(\n ctx.webex.internal.encryption,\n ctx.webex.internal.encryption.decryptText,\n [\n activity.encryptionKeyUrl,\n activity.spaceInfo.name,\n {onBehalfOf: container.onBehalfOfUser},\n ]\n )\n .then((decryptedMessage) => {\n activity.spaceInfo.name = decryptedMessage;\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Decrypt activity.spaceInfo.name error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`\n );\n activity.error = reason;\n\n return Promise.resolve(object);\n })\n );\n }\n if (activity.spaceInfo?.description) {\n promises.push(\n requestWithRetries(\n ctx.webex.internal.encryption,\n ctx.webex.internal.encryption.decryptText,\n [\n activity.encryptionKeyUrl,\n activity.spaceInfo.description,\n {onBehalfOf: container.onBehalfOfUser},\n ]\n )\n .then((decryptedMessage) => {\n activity.spaceInfo.description = decryptedMessage;\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Decrypt activity.spaceInfo.description error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`\n );\n activity.error = reason;\n\n return Promise.resolve(object);\n })\n );\n }\n if (activity.spaceInfo?.previousName && activity.spaceInfo.previousEncryptionKeyUrl) {\n promises.push(\n requestWithRetries(\n ctx.webex.internal.encryption,\n ctx.webex.internal.encryption.decryptText,\n [\n activity.spaceInfo.previousEncryptionKeyUrl,\n activity.spaceInfo.previousName,\n {onBehalfOf: container.onBehalfOfUser},\n ]\n )\n .then((decryptedMessage) => {\n activity.spaceInfo.previousName = decryptedMessage;\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Decrypt activity.spaceInfo.previousName error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`\n );\n activity.error = reason;\n\n return Promise.resolve(object);\n })\n );\n }\n\n // Decrypt content url and display name if extension is present\n if (\n activity.extension &&\n activity.extension.objectType === 'extension' &&\n activity.extension.extensionType === 'customApp'\n ) {\n promises.push(\n requestWithRetries(\n ctx.webex.internal.encryption,\n ctx.webex.internal.encryption.decryptText,\n [\n activity.encryptionKeyUrl,\n activity.extension.contentUrl,\n {onBehalfOf: container.onBehalfOfUser},\n ]\n )\n .then((decryptedContentUrl) => {\n activity.extension.contentUrl = decryptedContentUrl;\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Decrypt activity.extension.contentUrl error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`\n );\n activity.error = reason;\n\n return Promise.resolve(object);\n })\n );\n\n promises.push(\n requestWithRetries(\n ctx.webex.internal.encryption,\n ctx.webex.internal.encryption.decryptText,\n [\n activity.encryptionKeyUrl,\n activity.extension.displayName,\n {onBehalfOf: container.onBehalfOfUser},\n ]\n )\n .then((decryptedDisplayName) => {\n activity.extension.displayName = decryptedDisplayName;\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Decrypt activity.extension.displayName error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`\n );\n activity.error = reason;\n\n return Promise.resolve(object);\n })\n );\n\n // Decrypt webUrl.\n if (activity.extension.webUrl) {\n promises.push(\n requestWithRetries(\n ctx.webex.internal.encryption,\n ctx.webex.internal.encryption.decryptText,\n [\n activity.encryptionKeyUrl,\n activity.extension.webUrl,\n {onBehalfOf: container.onBehalfOfUser},\n ]\n )\n .then((decryptedWebUrl) => {\n activity.extension.webUrl = decryptedWebUrl;\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Decrypt activity.extension.webUrl error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`\n );\n activity.error = reason;\n\n return Promise.resolve(object);\n })\n );\n }\n if (activity.verb === 'update' && activity.extension.previous) {\n if (activity.extension.previous.contentUrl) {\n promises.push(\n requestWithRetries(\n ctx.webex.internal.encryption,\n ctx.webex.internal.encryption.decryptText,\n [\n activity.encryptionKeyUrl,\n activity.extension.previous.contentUrl,\n {onBehalfOf: container.onBehalfOfUser},\n ]\n )\n .then((decryptedPreviousContentUrl) => {\n activity.extension.previous.contentUrl = decryptedPreviousContentUrl;\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Decrypt activity.extension.previous.contentUrl error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`\n );\n activity.error = reason;\n\n return Promise.resolve(object);\n })\n );\n }\n if (activity.extension.previous.displayName) {\n promises.push(\n requestWithRetries(\n ctx.webex.internal.encryption,\n ctx.webex.internal.encryption.decryptText,\n [\n activity.encryptionKeyUrl,\n activity.extension.previous.displayName,\n {onBehalfOf: container.onBehalfOfUser},\n ]\n )\n .then((decryptedPreviousDisplayName) => {\n activity.extension.previous.displayName = decryptedPreviousDisplayName;\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Decrypt activity.extension.previous.displayName error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`\n );\n activity.error = reason;\n\n return Promise.resolve(object);\n })\n );\n }\n }\n }\n\n // Decrypt meeting title if present\n if (activity?.meeting?.title) {\n promises.push(\n requestWithRetries(\n ctx.webex.internal.encryption,\n ctx.webex.internal.encryption.decryptText,\n [\n activity.encryptionKeyUrl,\n activity.meeting.title,\n {onBehalfOf: container.onBehalfOfUser},\n ]\n )\n .then((decryptedMessage) => {\n activity.meeting.title = decryptedMessage;\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Decrypt activity.meeting.title error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`\n );\n activity.error = reason;\n\n return Promise.resolve(object);\n })\n );\n }\n\n // Decrypt meeting recording topic if present\n if (activity?.recording?.topic) {\n promises.push(\n requestWithRetries(\n ctx.webex.internal.encryption,\n ctx.webex.internal.encryption.decryptText,\n [\n activity.encryptionKeyUrl,\n activity.recording.topic,\n {onBehalfOf: container.onBehalfOfUser},\n ]\n )\n .then((decryptedMessage) => {\n activity.recording.topic = decryptedMessage;\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Decrypt activity.recording.topic error for activity ${activity.activityId} in container ${activity.targetId}: ${reason}`\n );\n activity.error = reason;\n\n return Promise.resolve(object);\n })\n );\n }\n\n // Decrypt shares (files, whiteboards, shared links)\n // Array.prototype.concat.apply ignores undefined\n let shares = Array.prototype.concat.apply([], activity.files);\n\n shares = Array.prototype.concat.apply(shares, activity.whiteboards);\n shares = Array.prototype.concat.apply(shares, activity.links);\n for (let i = 0; i < shares.length; i += 1) {\n const share = shares[i];\n\n // Decrypt the share's display name\n // Ignore display names for whiteboards which are unencrypted\n if (\n share.displayName &&\n (!activity.whiteboards || !activity.whiteboards.includes(share))\n ) {\n promises.push(\n requestWithRetries(\n ctx.webex.internal.encryption,\n ctx.webex.internal.encryption.decryptText,\n [\n activity.encryptionKeyUrl,\n share.displayName,\n {onBehalfOf: container.onBehalfOfUser},\n ]\n )\n .then((decryptedDisplayName) => {\n share.displayName = decryptedDisplayName;\n })\n .catch((reason) => {\n ctx.webex.logger.warn(\n `Decrypt DisplayName error for activity ${activity.activityId} in container ${activity.targetId} for share type: ${share.mimeType}, size: ${share.fileSize}, and url: ${share.url} due to error: ${reason}`\n );\n // add warning property to activity - this will present an indication that there was data loss on the downloader\n activity.warning = reason;\n })\n );\n }\n\n // Shared Links can have additional decryption fields\n if (share.microsoftSharedLinkInfo) {\n if (share.microsoftSharedLinkInfo.driveId) {\n promises.push(\n requestWithRetries(\n ctx.webex.internal.encryption,\n ctx.webex.internal.encryption.decryptText,\n [\n activity.encryptionKeyUrl,\n share.microsoftSharedLinkInfo.driveId,\n {onBehalfOf: container.onBehalfOfUser},\n ]\n )\n .then((decryptedDriveId) => {\n share.microsoftSharedLinkInfo.driveId = decryptedDriveId;\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Decrypt share.microsoftSharedLinkInfo.driveId error for activity ${activity.activityId} in container ${activity.targetId} for share type: ${share.mimeType}, size: ${share.fileSize}, and url: ${share.url} due to error: ${reason}`\n );\n // add error property to activity - this error will be recorded in the downloader and the activity omitted from the report\n activity.error = reason;\n\n return Promise.resolve(object);\n })\n );\n }\n\n if (share.microsoftSharedLinkInfo.itemId) {\n promises.push(\n requestWithRetries(\n ctx.webex.internal.encryption,\n ctx.webex.internal.encryption.decryptText,\n [\n activity.encryptionKeyUrl,\n share.microsoftSharedLinkInfo.itemId,\n {onBehalfOf: container.onBehalfOfUser},\n ]\n )\n .then((decryptedItemId) => {\n share.microsoftSharedLinkInfo.itemId = decryptedItemId;\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Decrypt share.microsoftSharedLinkInfo.itemId error for activity ${activity.activityId} in container ${activity.targetId} for share type: ${share.mimeType}, size: ${share.fileSize}, and url: ${share.url} due to error: ${reason}`\n );\n // add error property to activity - this error will be recorded in the downloader and the activity omitted from the report\n activity.error = reason;\n\n return Promise.resolve(object);\n })\n );\n }\n }\n\n // Decrypt the scr (Secure Content Reference) or sslr (Secure Shared Link Reference)\n // Unlike a scr the sslr contains only a loc. But decryptScr(...) is flexible and\n // leaves the tag, auth, IV, etc fields on the SCR object as undefined.\n if (share.scr || share.sslr) {\n promises.push(\n requestWithRetries(\n ctx.webex.internal.encryption,\n ctx.webex.internal.encryption.decryptScr,\n // A share will have an encryptionKeyUrl when it's activity uses a different encryptionKeyUrl. This can happen when old activities are edited\n // and key rotation is turn on.\n [\n share.encryptionKeyUrl || activity.encryptionKeyUrl,\n share.scr || share.sslr,\n {onBehalfOf: container.onBehalfOfUser},\n ]\n )\n .then((decryptedSCR) => {\n if (share.scr) {\n share.scr = decryptedSCR;\n } else {\n share.sslr = decryptedSCR.loc;\n }\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Decrypt file scr or sslr error for activity ${activity.activityId} in container ${activity.targetId} for share type: ${share.mimeType}, size: ${share.fileSize}, and url: ${share.url} due to error: ${reason}`\n );\n // add error property to activity - this error will be recorded in the downloader and the activity omitted from the report\n activity.error = reason;\n\n return Promise.resolve(object);\n })\n );\n }\n }\n\n return Promise.all(promises);\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Error retrieving content container for: ${activity.activityId} in container ${activity.targetId}: ${reason}`\n );\n // add error property to activity - this error will be recorded in the downloader and the activity omitted from the report\n activity.error = reason;\n\n return Promise.resolve(object);\n });\n }\n\n /**\n * This function is used to decrypt encrypted properties on the containers that are returned from the eDiscovery Service getContentContainer API\n * @param {Object} ctx - An object containing a webex instance and a transform\n * @param {Object} object - Generic object that you want to decrypt some property on based on the type\n * @returns {Promise} - Returns a transform promise\n */\n static decryptReportContentContainer(ctx, object) {\n if (!object || !object.body) {\n return Promise.resolve();\n }\n const container = object.body;\n\n if (!container.containerName) {\n return Promise.resolve(object);\n }\n\n if (!container.encryptionKeyUrl) {\n // If the encryptionKeyUrl is empty we assume the container name is unencrypted\n ctx.webex.logger.info(\n `${container.containerType} container ${container.containerId} cannot be decrypted due to a missing encryption key url`\n );\n\n return Promise.resolve(object);\n }\n\n if (!container.onBehalfOfUser) {\n const reason = `No user available with which to decrypt ${container.containerType} container ${container.containerId}`;\n\n ctx.webex.logger.error(reason);\n container.error = reason;\n\n return Promise.resolve(object);\n }\n\n // decrypt description if present with a descriptionEncryptionKeyUrl\n if (container.description && container.descriptionEncryptionKeyUrl) {\n requestWithRetries(ctx.webex.internal.encryption, ctx.webex.internal.encryption.decryptText, [\n container.descriptionEncryptionKeyUrl,\n container.description,\n {onBehalfOf: container.onBehalfOfUser},\n ])\n .then((decryptedContainerDescription) => {\n container.description = decryptedContainerDescription;\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Decrypt container description error for ${container.containerType} container ${container.containerId}: ${reason}`\n );\n // add warn property to container info - this warning will be recorded in the downloader\n container.warning = reason;\n // don't return, attempt to decrypt the name first\n });\n }\n\n return requestWithRetries(\n ctx.webex.internal.encryption,\n ctx.webex.internal.encryption.decryptText,\n [container.encryptionKeyUrl, container.containerName, {onBehalfOf: container.onBehalfOfUser}]\n )\n .then((decryptedContainerName) => {\n container.containerName = decryptedContainerName;\n })\n .catch((reason) => {\n ctx.webex.logger.error(\n `Decrypt container name error for ${container.containerType} container ${container.containerId}: ${reason}`\n );\n // add warn property to container info - this warning will be recorded in the downloader\n container.warning = reason;\n\n return Promise.resolve(object);\n });\n }\n}\n\nexport default Transforms;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;AAEA;AACA;AACA;IACMA,U;;;;;;;;IACJ;AACF;AACA;AACA;AACA;AACA;IACE,8BAA4BC,GAA5B,EAAiCC,MAAjC,EAAyC;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D,EAAY;QACjBvC,GAAG,CAACK,KAAJ,CAAUmC,MAAV,CAAiBC,KAAjB,4CACsCqB,SAAS,CAAC8D,aADhD,wBAC2E9D,SAAS,CAAC+D,WADrF,eACqGtF,MADrG,GADiB,CAIjB;;QACAuB,SAAS,CAACE,OAAV,GAAoBzB,MAApB;QAEA,OAAO,iBAAQpC,OAAR,CAAgBF,MAAhB,CAAP;MACD,CAhBI,CAAP;IAiBD;;;;;eAGYF,U"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/internal-plugin-ediscovery",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"contributors": [
|
|
@@ -25,18 +25,18 @@
|
|
|
25
25
|
]
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@webex/test-helper-chai": "3.0.0-beta.
|
|
29
|
-
"@webex/test-helper-mock-webex": "3.0.0-beta.
|
|
30
|
-
"@webex/test-helper-test-users": "3.0.0-beta.
|
|
28
|
+
"@webex/test-helper-chai": "3.0.0-beta.15",
|
|
29
|
+
"@webex/test-helper-mock-webex": "3.0.0-beta.15",
|
|
30
|
+
"@webex/test-helper-test-users": "3.0.0-beta.15",
|
|
31
31
|
"sinon": "^9.2.4"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@webex/common": "3.0.0-beta.
|
|
35
|
-
"@webex/internal-plugin-conversation": "3.0.0-beta.
|
|
36
|
-
"@webex/internal-plugin-ediscovery": "3.0.0-beta.
|
|
37
|
-
"@webex/internal-plugin-encryption": "3.0.0-beta.
|
|
38
|
-
"@webex/internal-plugin-mercury": "3.0.0-beta.
|
|
39
|
-
"@webex/webex-core": "3.0.0-beta.
|
|
34
|
+
"@webex/common": "3.0.0-beta.15",
|
|
35
|
+
"@webex/internal-plugin-conversation": "3.0.0-beta.15",
|
|
36
|
+
"@webex/internal-plugin-ediscovery": "3.0.0-beta.15",
|
|
37
|
+
"@webex/internal-plugin-encryption": "3.0.0-beta.15",
|
|
38
|
+
"@webex/internal-plugin-mercury": "3.0.0-beta.15",
|
|
39
|
+
"@webex/webex-core": "3.0.0-beta.15",
|
|
40
40
|
"lodash": "^4.17.21",
|
|
41
41
|
"uuid": "^3.3.2"
|
|
42
42
|
}
|