diff --git a/.github/workflows/dashboards-reports-test-and-build-workflow.yml b/.github/workflows/dashboards-reports-test-and-build-workflow.yml index 89dc4e44..d9feb37b 100644 --- a/.github/workflows/dashboards-reports-test-and-build-workflow.yml +++ b/.github/workflows/dashboards-reports-test-and-build-workflow.yml @@ -30,15 +30,6 @@ jobs: - name: Move Dashboards Reports to Plugins Dir run: mv dashboards-reports ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} - - name: Add Chromium Binary to Reporting for Testing - run: | - sudo apt update - sudo apt install -y libnss3-dev fonts-liberation libfontconfig1 - cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} - wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux-x64.zip - unzip chromium-linux-x64.zip - rm chromium-linux-x64.zip - - name: OpenSearch Dashboards Plugin Bootstrap uses: nick-invision/retry@v1 with: @@ -64,48 +55,10 @@ jobs: run: | cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} yarn build - - cd build - mkdir -p ./{linux-x64,linux-arm64,windows-x64}/opensearch-dashboards/${{ env.PLUGIN_NAME }} - cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-x64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-x64.zip - cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-arm64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-arm64.zip - mv ./${{ env.PLUGIN_NAME }}-*.zip ./windows-x64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-windows-x64.zip - - cd linux-x64 - wget https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-linux-x64.zip - unzip chromium-linux-x64.zip -d ./opensearch-dashboards/${{ env.PLUGIN_NAME }} - zip -ur ./${{ env.ARTIFACT_NAME }}-*.zip ./opensearch-dashboards - mv ./${{ env.ARTIFACT_NAME }}-*.zip .. - cd .. - - cd linux-arm64 - wget https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-linux-arm64.zip - unzip chromium-linux-arm64.zip -d ./opensearch-dashboards/${{ env.PLUGIN_NAME }} - zip -ur ./${{ env.ARTIFACT_NAME }}-*.zip ./opensearch-dashboards - mv ./${{ env.ARTIFACT_NAME }}-*.zip .. - cd .. - - cd windows-x64 - wget https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-windows-x64.zip - unzip chromium-windows-x64.zip -d ./opensearch-dashboards/${{ env.PLUGIN_NAME }} - zip -ur ./${{ env.ARTIFACT_NAME }}-*.zip ./opensearch-dashboards - mv ./${{ env.ARTIFACT_NAME }}-*.zip .. - cd .. + mv ./build/*.zip ./build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip - name: Upload Artifact For Linux x64 uses: actions/upload-artifact@v1 with: name: dashboards-reports-linux-x64 - path: ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-x64.zip - - - name: Upload Artifact For Linux arm64 - uses: actions/upload-artifact@v1 - with: - name: dashboards-reports-linux-arm64 - path: ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-arm64.zip - - - name: Upload Artifact For Windows - uses: actions/upload-artifact@v1 - with: - name: dashboards-reports-windows-x64 - path: ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-windows-x64.zip + path: ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip diff --git a/README.md b/README.md index 64d9b54c..5276b9d8 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ - [Contributing](#contributing) - [Setup](#setup-&-build) - [Notifications Integration](#notifications-integration) -- [Troubleshooting](#troubleshooting) - [Code of Conduct](#code-of-conduct) - [Security](#security) - [License](#license) @@ -35,6 +34,7 @@ Complete OpenSearch Dashboards Report feature is composed of 2 plugins. OpenSearch Dashboards Reports integration with [Notifications](https://github.com/opensearch-project/notifications) is currently in progress. Tracking [here](https://github.com/opensearch-project/dashboards-reports/issues/72) +<<<<<<< HEAD ## Troubleshooting ### Fail to launch Chromium @@ -66,6 +66,8 @@ If you are using a Ubuntu/Debian system, install the following packages: The installation command for both systems can be found [here](./dashboards-reports/rendering-engine/headless-chrome/README.md). +======= +>>>>>>> 71d843a... Use front-end report generation instead of chromium (#586) ## Code of Conduct This project has adopted the [Amazon Open Source Code of Conduct](CODE_OF_CONDUCT.md). For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq), or contact [opensource-codeofconduct@amazon.com](mailto:opensource-codeofconduct@amazon.com) with any additional questions or comments. @@ -80,4 +82,3 @@ See the [LICENSE](./LICENSE) file for our project's licensing. We will ask you t ## Copyright -Copyright OpenSearch Contributors. See [NOTICE](NOTICE.txt) for details. diff --git a/dashboards-reports/.gitignore b/dashboards-reports/.gitignore index 9e1fedcc..16b7cd30 100644 --- a/dashboards-reports/.gitignore +++ b/dashboards-reports/.gitignore @@ -10,4 +10,3 @@ yarn-error.log .eslintcache package-lock.json /target/ -.chromium/ \ No newline at end of file diff --git a/dashboards-reports/.opensearch_dashboards-plugin-helpers.json b/dashboards-reports/.opensearch_dashboards-plugin-helpers.json index 05b7d7e4..eee5a7ea 100644 --- a/dashboards-reports/.opensearch_dashboards-plugin-helpers.json +++ b/dashboards-reports/.opensearch_dashboards-plugin-helpers.json @@ -5,6 +5,7 @@ "yarn.lock", ".i18nrc.json", "common/**/*", + "scripts/**/*", "public/**/*", "server/**/*", "translations/**/*" diff --git a/dashboards-reports/package.json b/dashboards-reports/package.json index 8cf97e8c..99953f85 100644 --- a/dashboards-reports/package.json +++ b/dashboards-reports/package.json @@ -17,20 +17,21 @@ "test": "../../node_modules/.bin/jest --config ./test/jest.config.js", "cypress:run": "cypress run", "cypress:open": "cypress open", - "plugin_helpers": "node ../../scripts/plugin_helpers" + "plugin_helpers": "node ../../scripts/plugin_helpers", + "postinstall": "node ./scripts/patch-html2canvas.js" }, "dependencies": { - "async-mutex": "^0.2.6", "babel-polyfill": "^6.26.0", "cron-validator": "^1.1.1", - "dompurify": "^2.3.8", + "dompurify": "^2.4.1", "elastic-builder": "^2.7.1", "enzyme-adapter-react-16": "^1.15.2", + "html2canvas": "1.4.1", "jest-fetch-mock": "^3.0.3", "jquery": "^3.5.0", "jsdom": "13.1.0", "json-2-csv": "^3.7.6", - "puppeteer-core": "^13.7.0", + "jspdf": "^2.5.1", "react-addons-test-utils": "^15.6.2", "react-id-generator": "^3.0.1", "react-markdown": "^4.3.1", @@ -42,6 +43,7 @@ "react-toast-notifications": "^2.4.0", "set-interval-async": "1.0.33", "showdown": "^1.9.1", + "svg-pathdata": "^5.0.5", "ws": "^7.4.6" }, "devDependencies": { @@ -49,7 +51,6 @@ "@types/dompurify": "^2.3.3", "@types/enzyme-adapter-react-16": "^1.0.6", "@types/jsdom": "^16.2.3", - "@types/puppeteer-core": "^5.4.0", "@types/react": "^16.9.36", "@types/react-addons-test-utils": "^0.14.25", "@types/react-dom": "^16.9.8", @@ -65,6 +66,7 @@ "identity-obj-proxy": "^3.0.0", "jest-dom": "^4.0.0", "react-test-renderer": "^16.12.0", + "replace-in-file": "^5.0.2", "ts-jest": "^26.1.0" }, "resolutions": { diff --git a/dashboards-reports/public/components/context_menu/context_menu.js b/dashboards-reports/public/components/context_menu/context_menu.js index a66560c8..5f14a9ec 100644 --- a/dashboards-reports/public/components/context_menu/context_menu.js +++ b/dashboards-reports/public/components/context_menu/context_menu.js @@ -4,27 +4,30 @@ */ /* eslint-disable no-restricted-globals */ -import $ from 'jquery'; -import dateMath from '@elastic/datemath'; +//@ts-check import { i18n } from '@osd/i18n'; +import $ from 'jquery'; +import { parse } from 'url'; import { readStreamToFile } from '../main/main_utils'; +import { uiSettingsService } from '../utils/settings_service'; +import { + GENERATE_REPORT_PARAM, + GENERATE_REPORT_PARAM_REGEX, +} from '../visual_report/constants'; +import { generateReport } from '../visual_report/generate_report'; import { - contextMenuCreateReportDefinition, - getTimeFieldsFromUrl, - displayLoadingModal, addSuccessOrFailureToast, + contextMenuCreateReportDefinition, contextMenuViewReports, + displayLoadingModal, + getTimeFieldsFromUrl, replaceQueryURL, } from './context_menu_helpers'; import { + getMenuItem, popoverMenu, popoverMenuDiscover, - getMenuItem, } from './context_menu_ui'; -import { timeRangeMatcher } from '../utils/utils'; -import { parse } from 'url'; -import { unhashUrl } from '../../../../../src/plugins/opensearch_dashboards_utils/public'; -import { uiSettingsService } from '../utils/settings_service'; const generateInContextReport = async ( timeRanges, @@ -105,23 +108,28 @@ const generateInContextReport = async ( credentials: 'include', } ) - .then((response) => { - if (response.status === 200) { - $('#reportGenerationProgressModal').remove(); - addSuccessOrFailureToast('success'); - } else { - if (response.status === 403) { + .then(async (response) => [response.status, await response.json()]) + .then(async ([status, data]) => { + if (status !== 200) { + if (status === 403) { addSuccessOrFailureToast('permissionsFailure'); - } else if (response.status === 503) { + } else if (status === 503) { addSuccessOrFailureToast('timeoutFailure', reportSource); } else { addSuccessOrFailureToast('failure'); } + } else if (fileFormat === 'pdf' || fileFormat === 'png') { + try { + await generateReport(data.reportId); + addSuccessOrFailureToast('success'); + } catch (error) { + console.error(error); + addSuccessOrFailureToast('failure'); + } + } else if (data.data) { + await readStreamToFile(data.data, fileFormat, data.filename); } - return response.json(); - }) - .then(async (data) => { - await readStreamToFile(data.data, fileFormat, data.filename); + $('#reportGenerationProgressModal').remove(); }); }; @@ -218,9 +226,34 @@ $(function () { }); }); + checkURLParams(); locationHashChanged(); }); +/* generate a report if flagged in URL params */ +const checkURLParams = async () => { + const [hash, query] = location.href.split('#')[1].split('?'); + const params = new URLSearchParams(query); + const id = params.get(GENERATE_REPORT_PARAM); + if (!id) return; + await new Promise((resolve) => setTimeout(resolve, 1000)); + displayLoadingModal(); + try { + await generateReport(id, 30000); + window.history.replaceState( + {}, + '', + `#${hash}?${query.replace(GENERATE_REPORT_PARAM_REGEX, '')}` + ); + addSuccessOrFailureToast('success'); + } catch (error) { + console.error(error); + addSuccessOrFailureToast('failure'); + } finally { + $('#reportGenerationProgressModal').remove(); + } +}; + const isDiscoverNavMenu = (navMenu) => { return ( navMenu[0].children.length === 5 && diff --git a/dashboards-reports/public/components/context_menu/context_menu_ui.js b/dashboards-reports/public/components/context_menu/context_menu_ui.js index 0c99641f..119b7bae 100644 --- a/dashboards-reports/public/components/context_menu/context_menu_ui.js +++ b/dashboards-reports/public/components/context_menu/context_menu_ui.js @@ -246,7 +246,7 @@ export const popoverMenuDiscover = (savedObjectAvailable) => { export const permissionsMissingOnGeneration = () => { return ` -
+

${i18n.translate( 'opensearch.reports.menu.newNotificationAppears', { defaultMessage: 'A new notification appears' } @@ -277,7 +277,7 @@ export const permissionsMissingOnGeneration = () => { export const reportGenerationSuccess = () => { return ` -

+

A new notification appears

@@ -319,7 +319,7 @@ export const reportGenerationFailure = ( }) ) => { return ` -
+

A new notification appears

@@ -346,7 +346,7 @@ export const reportGenerationFailure = ( export const reportGenerationInProgressModal = () => { return ` -
+
@@ -377,7 +377,7 @@ export const reportGenerationInProgressModal = () => { 'opensearch.reports.menu.progress.youCanClose', { defaultMessage: - 'You can close this dialog while we continue in the background.', + 'Please keep this dialog open while report is being generated.', } )}
@@ -385,9 +385,6 @@ export const reportGenerationInProgressModal = () => {
-
-
-
diff --git a/dashboards-reports/public/components/main/loading_modal/loading_modal.tsx b/dashboards-reports/public/components/main/loading_modal/loading_modal.tsx index ff3f70c2..61c53968 100644 --- a/dashboards-reports/public/components/main/loading_modal/loading_modal.tsx +++ b/dashboards-reports/public/components/main/loading_modal/loading_modal.tsx @@ -59,7 +59,7 @@ export function GenerateReportLoadingModal(props: { setShowLoading: any }) { {i18n.translate('opensearch.reports.loading.youCanClose', { defaultMessage: - 'You can close this dialog while we continue in the background.', + 'Please keep this dialog open while report is being generated.', })} @@ -72,15 +72,6 @@ export function GenerateReportLoadingModal(props: { setShowLoading: any }) { - - - - {i18n.translate('opensearch.reports.loading.close', { - defaultMessage: 'Close', - })} - - - diff --git a/dashboards-reports/public/components/main/main_utils.tsx b/dashboards-reports/public/components/main/main_utils.tsx index 44066c02..f4b32bbf 100644 --- a/dashboards-reports/public/components/main/main_utils.tsx +++ b/dashboards-reports/public/components/main/main_utils.tsx @@ -3,10 +3,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -import 'babel-polyfill'; import { i18n } from '@osd/i18n'; -import { HttpFetchOptions, HttpSetup } from '../../../../../src/core/public'; +import 'babel-polyfill'; +import { HttpSetup } from '../../../../../src/core/public'; import { uiSettingsService } from '../utils/settings_service'; +import { GENERATE_REPORT_PARAM } from '../visual_report/constants'; export const getAvailableNotificationsChannels = (configList: any) => { let availableChannels = []; @@ -14,16 +15,16 @@ export const getAvailableNotificationsChannels = (configList: any) => { let channelEntry = {}; channelEntry = { label: configList[i].config.name, - id: configList[i].config_id - } + id: configList[i].config_id, + }; availableChannels.push(channelEntry); } return availableChannels; -} +}; type fileFormatsOptions = { - [key: string]: string -} + [key: string]: string; +}; export const fileFormatsUpper: fileFormatsOptions = { csv: 'CSV', @@ -164,11 +165,23 @@ export const generateReportFromDefinitionId = async ( }) .then(async (response: any) => { // for emailing a report, this API response doesn't have response body - if (response) { - const fileFormat = extractFileFormat(response['filename']); - const fileName = response['filename']; + if (!response) return; + const fileFormat = extractFileFormat(response['filename']); + const fileName = response['filename']; + if (fileFormat === 'csv') { await readStreamToFile(await response['data'], fileFormat, fileName); + status = true; + return; } + + // generate reports in browser is memory intensive, do it in a new process by removing referrer + const a = document.createElement('a'); + a.href = + window.location.origin + + `${response.queryUrl}&${GENERATE_REPORT_PARAM}=${response.reportId}`; + a.target = '_blank'; + a.rel = 'noreferrer'; + a.click(); status = true; }) .catch((error) => { @@ -199,9 +212,20 @@ export const generateReportById = async ( //TODO: duplicate code, extract to be a function that can reuse. e.g. handleResponse(response) const fileFormat = extractFileFormat(response['filename']); const fileName = response['filename']; - await readStreamToFile(await response['data'], fileFormat, fileName); - handleSuccessToast(); - return response; + if (fileFormat === 'csv') { + await readStreamToFile(await response['data'], fileFormat, fileName); + handleSuccessToast(); + return response; + } + + // generate reports in browser is memory intensive, do it in a new process by removing referrer + const a = document.createElement('a'); + a.href = + window.location.origin + + `${response.queryUrl}&${GENERATE_REPORT_PARAM}=${reportId}`; + a.target = '_blank'; + a.rel = 'noreferrer'; + a.click(); }) .catch((error) => { console.log('error on generating report by id:', error); diff --git a/dashboards-reports/public/components/utils/settings_service.ts b/dashboards-reports/public/components/utils/settings_service.ts index 197e5e4e..a95b3303 100644 --- a/dashboards-reports/public/components/utils/settings_service.ts +++ b/dashboards-reports/public/components/utils/settings_service.ts @@ -3,13 +3,15 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { IUiSettingsClient } from '../../../../../src/core/public'; +import { HttpStart, IUiSettingsClient } from '../../../../../src/core/public'; let uiSettings: IUiSettingsClient; +let http: HttpStart; export const uiSettingsService = { - init: (client: IUiSettingsClient) => { - uiSettings = client; + init: (uiSettingsClient: IUiSettingsClient, httpClient: HttpStart) => { + uiSettings = uiSettingsClient; + http = httpClient; }, get: (key: string, defaultOverride?: any) => { return uiSettings?.get(key, defaultOverride) || ''; @@ -28,4 +30,5 @@ export const uiSettingsService = { csvSeparator, }; }, + getHttpClient: () => http, }; diff --git a/dashboards-reports/server/routes/utils/visual_report/style.css b/dashboards-reports/public/components/visual_report/assets/report_styles.ts similarity index 97% rename from dashboards-reports/server/routes/utils/visual_report/style.css rename to dashboards-reports/public/components/visual_report/assets/report_styles.ts index c329e281..a78ee8a8 100644 --- a/dashboards-reports/server/routes/utils/visual_report/style.css +++ b/dashboards-reports/public/components/visual_report/assets/report_styles.ts @@ -1,3 +1,9 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +export const reportingStyle = ` html, body { margin: 0; @@ -213,3 +219,4 @@ iframe, embed, object { padding: 6px 13px; border: 1px solid #c8ccd0; } +`; diff --git a/dashboards-reports/public/components/visual_report/constants.ts b/dashboards-reports/public/components/visual_report/constants.ts new file mode 100644 index 00000000..c0e6a6d0 --- /dev/null +++ b/dashboards-reports/public/components/visual_report/constants.ts @@ -0,0 +1,34 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import Showdown from 'showdown'; + +// search param key name to trigger report generation, value is a report ID +export const GENERATE_REPORT_PARAM = 'visualReportId'; +export const GENERATE_REPORT_PARAM_REGEX = new RegExp( + '[&?]' + GENERATE_REPORT_PARAM + '=[^&]+', + '' +); + +export enum VISUAL_REPORT_TYPE { + dashboard = 'Dashboard', + visualization = 'Visualization', + notebook = 'Notebook', +} +export enum SELECTOR { + dashboard = '#dashboardViewport', + visualization = '.visEditor__content', + notebook = '.euiPageBody', +} + +export const DEFAULT_REPORT_HEADER = '

OpenSearch Dashboards Reports

'; + +export const converter = new Showdown.Converter({ + tables: true, + simplifiedAutoLink: true, + strikethrough: true, + tasklists: true, + noHeaderId: true, +}); diff --git a/dashboards-reports/public/components/visual_report/generate_report.ts b/dashboards-reports/public/components/visual_report/generate_report.ts new file mode 100644 index 00000000..52e82121 --- /dev/null +++ b/dashboards-reports/public/components/visual_report/generate_report.ts @@ -0,0 +1,207 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import createDOMPurify from 'dompurify'; +import html2canvas from 'html2canvas'; +import jsPDF from 'jspdf'; +import { v1 as uuidv1 } from 'uuid'; +import { ReportSchemaType } from '../../../server/model'; +import { uiSettingsService } from '../utils/settings_service'; +import { reportingStyle } from './assets/report_styles'; +import { + converter, + DEFAULT_REPORT_HEADER, + SELECTOR, + VISUAL_REPORT_TYPE, +} from './constants'; + +const waitForSelector = (selector: string, timeout = 30000) => { + return Promise.race([ + new Promise((resolve) => { + if (document.querySelector(selector)) { + return resolve(document.querySelector(selector)); + } + const observer = new MutationObserver((mutations) => { + if (document.querySelector(selector)) { + resolve(document.querySelector(selector)); + observer.disconnect(); + } + }); + observer.observe(document.body, { + childList: true, + subtree: true, + }); + }), + new Promise((resolve, reject) => + setTimeout( + () => + reject( + 'Timed out waiting for selector ' + + selector + + ' while generating report.' + ), + timeout + ) + ), + ]); +}; + +const timeout = (ms: number) => { + return new Promise((resolve) => setTimeout(resolve, ms)); +}; + +const removeNonReportElements = ( + doc: Document, + reportSource: VISUAL_REPORT_TYPE +) => { + // remove buttons + doc.querySelectorAll("[class^='euiButton']").forEach((e) => e.remove()); + // remove top navBar + doc.querySelectorAll("[class^='euiHeader']").forEach((e) => e.remove()); + // remove visualization editor + if (reportSource === VISUAL_REPORT_TYPE.visualization) { + doc.querySelector('[data-test-subj="splitPanelResizer"]')?.remove(); + doc.querySelector('.visEditor__collapsibleSidebar')?.remove(); + } + doc.body.style.paddingTop = '0px'; +}; + +const addReportHeader = (doc: Document, header: string) => { + const headerHtml = `
+
+
${header}
+
+
`; + const headerContainer = document.createElement('div'); + headerContainer.className = 'reportWrapper'; + headerContainer.innerHTML = headerHtml; + const body = doc.getElementsByTagName('body')[0]; + body.insertBefore(headerContainer, body.children[0]); +}; + +const addReportFooter = (doc: Document, footer: string) => { + const footerHtml = `
+
+
${footer}
+
+
`; + const footerContainer = document.createElement('div'); + footerContainer.className = 'reportWrapper'; + footerContainer.innerHTML = footerHtml; + const body = doc.getElementsByTagName('body')[0]; + body.appendChild(footerContainer); +}; + +const addReportStyle = (doc: Document, style: string) => { + const styleElement = document.createElement('style'); + styleElement.innerHTML = style; + doc.getElementsByTagName('head')[0].appendChild(styleElement); +}; + +const computeHeight = (height: number, header: string, footer: string) => { + let computedHeight = height; + const headerLines = header.split('\n').length; + const footerLines = footer.split('\n').length; + if (headerLines) { + computedHeight += 24 * headerLines; + } + if (footerLines) { + computedHeight += 50 + 24 * footerLines; + } + return computedHeight; +}; + +export const generateReport = async (id: string, forceDelay = 15000) => { + const http = uiSettingsService.getHttpClient(); + const DOMPurify = createDOMPurify(window); + + const report = await http.get( + '../api/reporting/reports/' + id + ); + const format = + report.report_definition.report_params.core_params.report_format; + const reportSource = report.report_definition.report_params + .report_source as unknown as VISUAL_REPORT_TYPE; + const headerInput = report.report_definition.report_params.core_params.header; + const footerInput = report.report_definition.report_params.core_params.footer; + const header = headerInput + ? DOMPurify.sanitize(converter.makeHtml(headerInput)) + : DEFAULT_REPORT_HEADER; + const footer = footerInput + ? DOMPurify.sanitize(converter.makeHtml(footerInput)) + : ''; + const fileName = + report.report_definition.report_params.report_name + + `_${new Date().toISOString()}_${uuidv1()}.${format}`; + + await timeout(1000); + switch (reportSource) { + case VISUAL_REPORT_TYPE.dashboard: + await waitForSelector(SELECTOR.dashboard); + break; + case VISUAL_REPORT_TYPE.visualization: + await waitForSelector(SELECTOR.visualization); + break; + case VISUAL_REPORT_TYPE.notebook: + await waitForSelector(SELECTOR.notebook); + break; + default: + throw Error( + `report source can only be one of [Dashboard, Visualization, Notebook]` + ); + } + await timeout(forceDelay); + + const width = document.documentElement.scrollWidth; + const height = computeHeight( + document.documentElement.scrollHeight, + header, + footer + ); + return html2canvas(document.body, { + windowWidth: width, + windowHeight: height, + width, + height, + imageTimeout: 30000, + useCORS: true, + removeContainer: false, + onclone: function (documentClone) { + removeNonReportElements(documentClone, reportSource); + addReportHeader(documentClone, header); + addReportFooter(documentClone, footer); + addReportStyle(documentClone, reportingStyle); + }, + }).then(function (canvas) { + // TODO remove this and 'removeContainer: false' when https://github.com/niklasvh/html2canvas/pull/2949 is merged + document + .querySelectorAll('.html2canvas-container') + .forEach((e) => { + const iframe = e.contentWindow; + if (e) { + e.src = 'about:blank'; + if (iframe) { + iframe.document.write(''); + iframe.document.clear(); + iframe.close(); + } + e.remove(); + } + }); + + if (format === 'png') { + const link = document.createElement('a'); + link.download = fileName; + link.href = canvas.toDataURL(); + link.click(); + } else { + const orient = canvas.width > canvas.height ? 'landscape' : 'portrait'; + const pdf = new jsPDF(orient, 'px', [canvas.width, canvas.height]); + pdf.addImage(canvas, 'JPEG', 0, 0, canvas.width, canvas.height); + pdf.save(fileName); + } + return true; + }); +}; diff --git a/dashboards-reports/public/plugin.ts b/dashboards-reports/public/plugin.ts index 2c26eb6c..b91b6be1 100644 --- a/dashboards-reports/public/plugin.ts +++ b/dashboards-reports/public/plugin.ts @@ -23,7 +23,7 @@ export class ReportsDashboardsPlugin implements Plugin { public setup(core: CoreSetup): ReportsDashboardsPluginSetup { - uiSettingsService.init(core.uiSettings); + uiSettingsService.init(core.uiSettings, core.http); // Register an application into the side navigation menu core.application.register({ id: PLUGIN_ID, diff --git a/dashboards-reports/rendering-engine/headless-chrome/README.md b/dashboards-reports/rendering-engine/headless-chrome/README.md deleted file mode 100644 index 21cf34a5..00000000 --- a/dashboards-reports/rendering-engine/headless-chrome/README.md +++ /dev/null @@ -1,56 +0,0 @@ -## Chrome Binaries for OpenSearch Dashboards Reports used by Puppeteer -Headless Chrome for Linux and Mac are chrome binaries which are significantly smaller than the standard binaries shipped by Google and Puppeteer. -Chrome binary can be built from shell script build_headless_chrome.sh for Mac, Linux x64 and Linux arm64, -output of script is called headless_shell. - -## Puppeteer's Chrome version - -Find the puppeteer version used in OpenSearch Dashboards node_modules.json and get the associated chrome SHA to build from crrev.com and puppeteer repositories. Puppeteer 1.9 uses rev 674921 with commit sha as 312d84c8ce62810976feda0d3457108a6dfff9e6) - -## headless Chrome folder structure --chromium - |-chromium - |-chromium - |-src - |-out - |-headless - |-headless_shell # output of scripts - -## How to generate the headless_chrome -This is a shell script to set environment variable, download the source code and build the executable. - -## Commands to create headless_chrome -Run below command to create headless_shell for each platform - -headless-chrome.sh chrome-version-SHA (arch_name (arm64)) -. Mac x64: ./build_headless_chrome.sh -. Linux x64: ./build_headless_chrome.sh -. Linux arm64: ./build_headless_chrome.sh arm64 - -# How to call in Command line: -. PNG report: ./headless_shell --headless --disable-gpu --screenshot=test.png https://opensearch.org/docs/ -. PDF report: ./headless_shell --headless --disable-gpu --print-to-pdf=test.pdf https://opensearch.org/docs/ - -## Headless Chromium for MAC -# Files: - headless_shell - libswiftshader_libGLESv2.dylib - -## Headless Chromium for Linux (arm64 and x64) -# Files: - headless_shell - swiftshader - |-libEGL.so - |-libEGL.so.TOC - |-libGLESv2.so - |-libGLESv2.so.TOC -# Additional libaries: -- Ubuntu needs additional dependencies to run chromium -``` -sudo apt install -y libnss3-dev fonts-liberation libfontconfig1 -``` -- RedHat/CentOS/Amazon Linux 2 needs additional dependencies to run chromium -``` -sudo yum install -y libnss3.so xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-utils xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 xorg-x11-fonts-misc fontconfig freetype ipa-gothic-fonts -``` - diff --git a/dashboards-reports/rendering-engine/headless-chrome/build_headless_chrome.sh b/dashboards-reports/rendering-engine/headless-chrome/build_headless_chrome.sh deleted file mode 100644 index 219ba8e8..00000000 --- a/dashboards-reports/rendering-engine/headless-chrome/build_headless_chrome.sh +++ /dev/null @@ -1,176 +0,0 @@ -#!/bin/bash - -# Initializes a Linux environment. This need only be done once per -# machine. The OS needs to be a flavor that supports apt get, such as Ubuntu. - -function generateArgs { -if [ $1 == 'linux' ]; then - echo 'import("//build/args/headless.gn") -is_component_build = false -remove_webcore_debug_symbols = true -enable_nacl = false -is_debug = false -symbol_level = 0 -use_kerberos = false' > args.gn -elif [ $1 == 'darwin' ]; then - echo '#args configuration - -icu_use_data_file = false -v8_use_external_startup_data = false -remove_webcore_debug_symbols = true -use_kerberos = false -use_libpci = false -use_pulseaudio = false -use_udev = false -is_debug = false -symbol_level = 0 -is_component_build = false -enable_nacl = false -enable_print_preview = false -enable_basic_printing = false -enable_remoting = false -use_alsa = false -use_cups = false -use_dbus = false -use_gio = false -' > args.gn -fi -} - -ARGC=("$#") - -if [ $ARGC -lt 1 ]; -then - echo "format: build_headless_chrome.sh {chrome_source_version} (arch_name)" - echo "Mac x64: ./build_headless_chrome.sh 312d84c8ce62810976feda0d3457108a6dfff9e6" - echo "Linux x64: ./build_headless_chrome.sh 312d84c8ce62810976feda0d3457108a6dfff9e6" - echo "Linux arm64: ./build_headless_chrome.sh 312d84c8ce62810976feda0d3457108a6dfff9e6 arm64" - exit -fi - -source_version=$1 - -if [ $ARGC -lt 2 ]; -then - arch_name="x64" -else - arch_name=$2 -fi - -if ! [ -x "$(command -v python)" ]; then - echo "Python is not found, please install python or setup python environment properly" - exit -fi - -# Launch the cross-platform init script using a relative path -# from this script's location. -mkdir -p ~/chromium - -if [ "$#" -eq 2 ]; then - arch_name=$2 -fi - -current_folder=$(pwd) - -# find the current platform -platform_name='unknown' -if [[ "$OSTYPE" == "linux-gnu"* ]]; then - platform_name='linux' -elif [[ "$OSTYPE" == "darwin"* ]]; then - platform_name='darwin' -elif [[ "$OSTYPE" == "win32" ]]; then - platform_name='windows' -fi - -if [[ "$platform_name" == "unknown" ]]; then - echo "platform is" $platform_name - exit -fi - -echo "source_version = " $source_version -echo "platform_name = " $platform_name -echo "arch_name = " $arch_name -generateArgs $platform_name - -# Configure git -git config --global core.autocrlf false -git config --global core.filemode false -git config --global branch.autosetuprebase always -cd chromium - -# Grab Chromium's custom build tools, if they aren't already installed -# (On Windows, they are installed before this Python script is run) -if ! [ -d "depot_tools" ] -then - git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git -fi - -# Put depot_tools on the path so we can properly run the fetch command -export PATH="$PATH:${HOME}/chromium/depot_tools" -echo ${HOME}/chromium/depot_tools - -# Fetch the Chromium source code - -if [ -d 'chromium' ]; then - echo "chromium src aready exists, please delete it and retry..." - exit -fi - -mkdir -p chromium -cd chromium -pwd - -# Build Linux deps -echo "fetching chromium..." -fetch chromium - - -# Build Linux deps - -cd src -if [[ arch_name -eq "arm64" ]]; then - ./build/linux/sysroot_scripts/install-sysroot.py --arch=$arch_name -fi - -if [[ platform_name -eq "linux" ]]; then - ./build/install-build-deps.sh -fi - - -# Set to "arm" to build for ARM on Linux -echo 'Building Chromium ' $source_version ' for ' $arch_name - -# Sync the codebase to the correct version, syncing master first -# to ensure that we actually have all the versions we may refer to -echo 'Syncing source code' - - -git checkout -f master -git fetch -f origin -gclient sync --with_branch_heads --with_tags --jobs 16 -git checkout $source_version -gclient sync --with_branch_heads --with_tags --jobs 16 -gclient runhooks -echo "current_folder :" $current_folder - -platform_build_args=$current_folder'/args.gn' -#platform_build_args=$current_folder/chromium/build_chromium/$platform_name/args.gn - -outputDir='headless' -mkdir -p 'out/headless' - -echo "platform_build_args :" $platform_build_args - -cp $platform_build_args 'out/headless/args.gn' -echo "platform_build_args :" $platform_build_args -echo 'target_cpu = '\"$arch_name\" >> 'out/headless/args.gn' - -gn gen out/headless - -autoninja -C out/headless headless_shell - -if [[ ($platform_name != "Windows" && $arch_name != 'arm64') ]]; then - echo 'Optimizing headless_shell' - mv out/headless/headless_shell out/headless/headless_shell_raw - strip -o out/headless/headless_shell out/headless/headless_shell_raw -fi diff --git a/dashboards-reports/scripts/patch-html2canvas.js b/dashboards-reports/scripts/patch-html2canvas.js new file mode 100644 index 00000000..c01f5bf4 --- /dev/null +++ b/dashboards-reports/scripts/patch-html2canvas.js @@ -0,0 +1,33 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +// @ts-check +// workaround for Safari support before https://github.com/niklasvh/html2canvas/pull/2911 is merged +const replace = require('replace-in-file'); + +const options = { + files: [ + __dirname + '/../node_modules/html2canvas/**/*.js', + __dirname + '/../node_modules/html2canvas/**/*.js.map', + ], + from: 'if (image.width === width && image.height === height) {', + to: 'if (false && image.width === width && image.height === height) {', +}; + +try { + const changedFiles = replace.sync(options); + console.log( + 'Modified files for html2canvas Safari support:\n', + changedFiles + .filter((file) => file.hasChanged) + .map((file) => file.file) + .join('\n') + ); +} catch (error) { + console.error( + 'Error occurred when modifiying files for html2canvas Safari support:', + error + ); +} diff --git a/dashboards-reports/server/plugin.ts b/dashboards-reports/server/plugin.ts index 429a74a4..d035d71c 100644 --- a/dashboards-reports/server/plugin.ts +++ b/dashboards-reports/server/plugin.ts @@ -11,8 +11,6 @@ import { Logger, ILegacyClusterClient, } from '../../../src/core/server'; -import { setIntervalAsync } from 'set-interval-async/dynamic'; -import { Semaphore, SemaphoreInterface, withTimeout } from 'async-mutex'; import opensearchReportsPlugin from './backend/opensearch-reports-plugin'; import { ReportsDashboardsPluginSetup, @@ -40,7 +38,6 @@ export class ReportsDashboardsPlugin implements Plugin { private readonly logger: Logger; - private readonly semaphore: SemaphoreInterface; private readonly initializerContext: PluginInitializerContext< ReportingConfigType >; @@ -49,9 +46,6 @@ export class ReportsDashboardsPlugin constructor(context: PluginInitializerContext) { this.logger = context.logger.get(); this.initializerContext = context; - const timeoutError = new Error('Server busy'); - timeoutError.statusCode = 503; - this.semaphore = withTimeout(new Semaphore(1), 300000, timeoutError); } public async setup(core: CoreSetup) { @@ -102,7 +96,6 @@ export class ReportsDashboardsPlugin (context, request) => { return { logger: this.logger, - semaphore: this.semaphore, opensearchReportsClient, notificationsClient, }; diff --git a/dashboards-reports/server/routes/lib/createReport.ts b/dashboards-reports/server/routes/lib/createReport.ts index 40a073e2..fed182ce 100644 --- a/dashboards-reports/server/routes/lib/createReport.ts +++ b/dashboards-reports/server/routes/lib/createReport.ts @@ -18,15 +18,12 @@ import { RequestHandlerContext, } from '../../../../../src/core/server'; import { createSavedSearchReport } from '../utils/savedSearchReportHelper'; -import { ReportSchemaType } from '../../model'; +import { ReportSchemaType, VisualReportSchemaType } from '../../model'; import { CreateReportResultType } from '../utils/types'; -import { createVisualReport } from '../utils/visual_report/visualReportHelper'; -import { SetCookie, Headers } from 'puppeteer-core'; -import { updateReportState } from './updateReportState'; import { saveReport } from './saveReport'; -import { SemaphoreInterface } from 'async-mutex'; import { ReportingConfig } from 'server'; import _ from 'lodash'; +import { getFileName } from '../utils/helpers'; export const createReport = async ( request: OpenSearchDashboardsRequest, @@ -38,8 +35,6 @@ export const createReport = async ( const isScheduledTask = false; //@ts-ignore const logger: Logger = context.reporting_plugin.logger; - //@ts-ignore - const semaphore: SemaphoreInterface = context.reporting_plugin.semaphore; // @ts-ignore const opensearchReportsClient: ILegacyScopedClusterClient = context.reporting_plugin.opensearchReportsClient.asScoped( request @@ -92,18 +87,24 @@ export const createReport = async ( const completeQueryUrl = `${protocol}://${hostname}:${port}${relativeUrl}`; const extraHeaders = _.pick(request.headers, EXTRA_HEADERS); - const [value, release] = await semaphore.acquire(); - try { - createReportResult = await createVisualReport( - reportParams, - completeQueryUrl, - logger, - extraHeaders, - timezone - ); - } finally { - release(); - } + const { + core_params, + report_name: reportName, + report_source: reportSource, + } = reportParams; + const coreParams = core_params as VisualReportSchemaType; + const { + header, + footer, + window_height: windowHeight, + window_width: windowWidth, + report_format: reportFormat, + } = coreParams; + const curTime = new Date(); + const timeCreated = curTime.valueOf(); + const fileName = `${getFileName(reportName, curTime)}.${reportFormat}`; + + return { timeCreated, dataUrl: '', fileName, reportId, queryUrl: relativeUrl }; } // update report state to "created" // TODO: temporarily remove the following diff --git a/dashboards-reports/server/routes/report.ts b/dashboards-reports/server/routes/report.ts index 4c443a57..8bf7614b 100644 --- a/dashboards-reports/server/routes/report.ts +++ b/dashboards-reports/server/routes/report.ts @@ -74,6 +74,8 @@ export default function (router: IRouter, config: ReportingConfig) { body: { data: reportData.dataUrl, filename: reportData.fileName, + reportId: reportData.reportId, + queryUrl: reportData.queryUrl, }, }); } catch (error) { @@ -141,6 +143,8 @@ export default function (router: IRouter, config: ReportingConfig) { body: { data: reportData.dataUrl, filename: reportData.fileName, + reportId: reportData.reportId, + queryUrl: reportData.queryUrl, }, }); } catch (error) { @@ -212,6 +216,8 @@ export default function (router: IRouter, config: ReportingConfig) { body: { data: reportData.dataUrl, filename: reportData.fileName, + reportId: reportData.reportId, + queryUrl: reportData.queryUrl, }, }); } catch (error) { diff --git a/dashboards-reports/server/routes/utils/__tests__/visualReportHelper.test.ts b/dashboards-reports/server/routes/utils/__tests__/visualReportHelper.test.ts deleted file mode 100644 index 4bf3cd0b..00000000 --- a/dashboards-reports/server/routes/utils/__tests__/visualReportHelper.test.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import 'regenerator-runtime/runtime'; -import { createVisualReport } from '../visual_report/visualReportHelper'; -import { Logger } from '../../../../../../src/core/server'; -import { ReportParamsSchemaType, reportSchema } from '../../../model'; -import { mockLogger } from '../../../../test/__mocks__/loggerMock'; - -const mockHeader = { mockKey: 'mockValue' }; -const input = { - query_url: '/app/dashboards#/view/7adfa750-4c81-11e8-b3d7-01146121b73d', - time_from: 1343576635300, - time_to: 1596037435301, - report_definition: { - report_params: { - report_name: 'test visual report', - report_source: 'Dashboard', - description: 'Hi this is your Dashboard on demand', - core_params: { - base_url: '/app/dashboards#/view/7adfa750-4c81-11e8-b3d7-01146121b73d', - window_width: 1300, - window_height: 900, - report_format: 'png', - time_duration: 'PT5M', - origin: 'http://localhost:5601', - }, - }, - delivery: { - configIds: [], - title: 'title', - textDescription: 'text description', - htmlDescription: 'html description', - }, - trigger: { - trigger_type: 'On demand', - }, - }, -}; - -const mockHtmlPath = `file://${__dirname}/demo_dashboard.html`; - -describe('test create visual report', () => { - test('create report with valid input', async () => { - // Check if the assumption of input is up-to-date - reportSchema.validate(input); - }, 20000); - - test('create png report', async () => { - expect.assertions(3); - const reportParams = input.report_definition.report_params; - const { dataUrl, fileName } = await createVisualReport( - reportParams as ReportParamsSchemaType, - mockHtmlPath, - mockLogger, - mockHeader, - undefined, - /^(data:image|file:\/\/)/ - ); - expect(fileName).toContain(`${reportParams.report_name}`); - expect(fileName).toContain('.png'); - expect(dataUrl).toBeDefined(); - }, 60000); - - test('create pdf report', async () => { - expect.assertions(3); - const reportParams = input.report_definition.report_params; - reportParams.core_params.report_format = 'pdf'; - - const { dataUrl, fileName } = await createVisualReport( - reportParams as ReportParamsSchemaType, - mockHtmlPath, - mockLogger, - mockHeader, - undefined, - /^(data:image|file:\/\/)/ - ); - expect(fileName).toContain(`${reportParams.report_name}`); - expect(fileName).toContain('.pdf'); - expect(dataUrl).toBeDefined(); - }, 60000); -}); diff --git a/dashboards-reports/server/routes/utils/constants.ts b/dashboards-reports/server/routes/utils/constants.ts index 6af81fd2..b8b970d6 100644 --- a/dashboards-reports/server/routes/utils/constants.ts +++ b/dashboards-reports/server/routes/utils/constants.ts @@ -57,17 +57,9 @@ export enum DELIVERY_TYPE { channel = 'Channel', } -export enum SELECTOR { - dashboard = '#dashboardViewport', - visualization = '.visEditor__content', - notebook = '.euiPageBody', -} - // https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search-request-from-size.html export const DEFAULT_MAX_SIZE = 10000; -export const DEFAULT_REPORT_HEADER = '

OpenSearch Dashboards Reports

'; - export const SECURITY_CONSTANTS = { TENANT_LOCAL_STORAGE_KEY: 'opendistro::security::tenant::show_popup', }; @@ -79,14 +71,6 @@ export const EXTRA_HEADERS = [ 'x-forwarded-for', ]; -export const converter = new Showdown.Converter({ - tables: true, - simplifiedAutoLink: true, - strikethrough: true, - tasklists: true, - noHeaderId: true, -}); - const BLOCKED_KEYWORD = 'BLOCKED_KEYWORD'; const ipv4Regex = /(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?):([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])/g const ipv6Regex = /(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/g; @@ -107,8 +91,6 @@ export const replaceBlockedKeywords = (htmlString: string) => { return htmlString; } -export const CHROMIUM_PATH = `${__dirname}/../../../.chromium/headless_shell`; - /** * Metric constants diff --git a/dashboards-reports/server/routes/utils/types.ts b/dashboards-reports/server/routes/utils/types.ts index 3c589466..3f0f21b9 100644 --- a/dashboards-reports/server/routes/utils/types.ts +++ b/dashboards-reports/server/routes/utils/types.ts @@ -7,6 +7,8 @@ export interface CreateReportResultType { timeCreated: number; dataUrl: string; fileName: string; + reportId: string; + queryUrl: string; } type ReportSourceType = 'dashboard' | 'visualization' | 'saved_search' | 'notebook'; diff --git a/dashboards-reports/server/routes/utils/visual_report/footer_template.html b/dashboards-reports/server/routes/utils/visual_report/footer_template.html deleted file mode 100644 index 6fc56f8c..00000000 --- a/dashboards-reports/server/routes/utils/visual_report/footer_template.html +++ /dev/null @@ -1,5 +0,0 @@ -
-
-
-
-
diff --git a/dashboards-reports/server/routes/utils/visual_report/header_template.html b/dashboards-reports/server/routes/utils/visual_report/header_template.html deleted file mode 100644 index 9796c499..00000000 --- a/dashboards-reports/server/routes/utils/visual_report/header_template.html +++ /dev/null @@ -1,5 +0,0 @@ -
-
-
-
-
diff --git a/dashboards-reports/server/routes/utils/visual_report/visualReportHelper.ts b/dashboards-reports/server/routes/utils/visual_report/visualReportHelper.ts deleted file mode 100644 index ad836b8f..00000000 --- a/dashboards-reports/server/routes/utils/visual_report/visualReportHelper.ts +++ /dev/null @@ -1,332 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import puppeteer, { Headers } from 'puppeteer-core'; -import createDOMPurify from 'dompurify'; -import { JSDOM } from 'jsdom'; -import { Logger } from '../../../../../../src/core/server'; -import { - DEFAULT_REPORT_HEADER, - REPORT_TYPE, - FORMAT, - SELECTOR, - CHROMIUM_PATH, - SECURITY_CONSTANTS, - ALLOWED_HOSTS, -} from '../constants'; -import { getFileName } from '../helpers'; -import { CreateReportResultType } from '../types'; -import { ReportParamsSchemaType, VisualReportSchemaType } from 'server/model'; -import { converter, replaceBlockedKeywords } from '../constants'; -import fs from 'fs'; -import _ from 'lodash'; - -export const createVisualReport = async ( - reportParams: ReportParamsSchemaType, - queryUrl: string, - logger: Logger, - extraHeaders: Headers, - timezone?: string, - validRequestProtocol = /^(data:image)/, -): Promise => { - const { - core_params, - report_name: reportName, - report_source: reportSource, - } = reportParams; - const coreParams = core_params as VisualReportSchemaType; - const { - header, - footer, - window_height: windowHeight, - window_width: windowWidth, - report_format: reportFormat, - } = coreParams; - - const window = new JSDOM('').window; - const DOMPurify = createDOMPurify(window); - - let keywordFilteredHeader = header - ? converter.makeHtml(header) - : DEFAULT_REPORT_HEADER; - let keywordFilteredFooter = footer ? converter.makeHtml(footer) : ''; - - keywordFilteredHeader = DOMPurify.sanitize(keywordFilteredHeader); - keywordFilteredFooter = DOMPurify.sanitize(keywordFilteredFooter); - - // filter blocked keywords in header and footer - if (keywordFilteredHeader !== '') { - keywordFilteredHeader = replaceBlockedKeywords(keywordFilteredHeader); - } - if (keywordFilteredFooter !== '') { - keywordFilteredFooter = replaceBlockedKeywords(keywordFilteredFooter); - } - - // set up puppeteer - const browser = await puppeteer.launch({ - headless: true, - /** - * TODO: temp fix to disable sandbox when launching chromium on Linux instance - * https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#setting-up-chrome-linux-sandbox - */ - args: [ - '--no-sandbox', - '--disable-setuid-sandbox', - '--disable-gpu', - '--no-zygote', - '--font-render-hinting=none', - '--js-flags="--jitless --no-opt"', - '--disable-features=V8OptimizeJavascript', - ], - executablePath: CHROMIUM_PATH, - ignoreHTTPSErrors: true, - env: { - TZ: timezone || 'UTC', - }, - pipe: true, - }); - const page = await browser.newPage(); - - await page.setRequestInterception(true); - let localStorageAvailable = true; - page.on('request', (req) => { - // disallow non-allowlisted connections. urls with valid protocols do not need ALLOWED_HOSTS check - if ( - !validRequestProtocol.test(req.url()) && - !ALLOWED_HOSTS.test(new URL(req.url()).hostname) - ) { - if (req.isNavigationRequest() && req.redirectChain().length > 0) { - localStorageAvailable = false; - logger.error( - 'Reporting does not allow redirections to outside of localhost, aborting. URL received: ' + - req.url() - ); - } else { - logger.warn( - 'Disabled connection to non-allowlist domains: ' + req.url() - ); - } - req.abort(); - } else { - req.continue(); - } - }); - - page.setDefaultNavigationTimeout(0); - page.setDefaultTimeout(300000); // use 300s timeout instead of default 30s - // Set extra headers that are needed - if (!_.isEmpty(extraHeaders)) { - await page.setExtraHTTPHeaders(extraHeaders); - } - logger.info(`original queryUrl ${queryUrl}`); - await page.goto(queryUrl, { waitUntil: 'networkidle0' }); - // should add to local storage after page.goto, then access the page again - browser must have an url to register local storage item on it - try { - await page.evaluate( - /* istanbul ignore next */ - (key) => { - try { - if ( - localStorageAvailable && - typeof localStorage !== 'undefined' && - localStorage !== null - ) { - localStorage.setItem(key, 'false'); - } - } catch (err) {} - }, - SECURITY_CONSTANTS.TENANT_LOCAL_STORAGE_KEY - ); - } catch (err) { - logger.error(err); - } - await page.goto(queryUrl, { waitUntil: 'networkidle0' }); - logger.info(`page url ${page.url()}`); - - await page.setViewport({ - width: windowWidth, - height: windowHeight, - }); - - let buffer: Buffer; - // remove unwanted elements - await page.evaluate( - /* istanbul ignore next */ - (reportSource, REPORT_TYPE) => { - // remove buttons - document - .querySelectorAll("[class^='euiButton']") - .forEach((e) => e.remove()); - // remove top navBar - document - .querySelectorAll("[class^='euiHeader']") - .forEach((e) => e.remove()); - // remove visualization editor - if (reportSource === REPORT_TYPE.visualization) { - document - .querySelector('[data-test-subj="splitPanelResizer"]') - ?.remove(); - document.querySelector('.visEditor__collapsibleSidebar')?.remove(); - } - document.body.style.paddingTop = '0px'; - }, - reportSource, - REPORT_TYPE - ); - - // force wait for any resize to load after the above DOM modification - await new Promise(resolve => setTimeout(resolve, 1000)); - // crop content - switch (reportSource) { - case REPORT_TYPE.dashboard: - await page.waitForSelector(SELECTOR.dashboard, { - visible: true, - }); - break; - case REPORT_TYPE.visualization: - await page.waitForSelector(SELECTOR.visualization, { - visible: true, - }); - break; - case REPORT_TYPE.notebook: - await page.waitForSelector(SELECTOR.notebook, { - visible: true, - }); - break; - default: - throw Error( - `report source can only be one of [Dashboard, Visualization]` - ); - } - - // wait for dynamic page content to render - await waitForDynamicContent(page); - - await addReportHeader(page, keywordFilteredHeader); - await addReportFooter(page, keywordFilteredFooter); - await addReportStyle(page); - - // this causes UT to fail in github CI but works locally - try { - const numDisallowedTags = await page.evaluate( - () => - document.getElementsByTagName('iframe').length + - document.getElementsByTagName('embed').length + - document.getElementsByTagName('object').length - ); - if (numDisallowedTags > 0) { - throw Error('Reporting does not support "iframe", "embed", or "object" tags, aborting'); - } - } catch (error) { - logger.error(error); - } - - // create pdf or png accordingly - if (reportFormat === FORMAT.pdf) { - const scrollHeight = await page.evaluate( - /* istanbul ignore next */ - () => document.documentElement.scrollHeight - ); - - buffer = await page.pdf({ - margin: undefined, - width: windowWidth, - height: scrollHeight + 'px', - printBackground: true, - pageRanges: '1', - }); - } else if (reportFormat === FORMAT.png) { - buffer = await page.screenshot({ - fullPage: true, - }); - } - - const curTime = new Date(); - const timeCreated = curTime.valueOf(); - const fileName = `${getFileName(reportName, curTime)}.${reportFormat}`; - await browser.close(); - - return { timeCreated, dataUrl: buffer.toString('base64'), fileName }; -}; - -const addReportStyle = async (page: puppeteer.Page) => { - const css = fs.readFileSync(`${__dirname}/style.css`).toString(); - - await page.evaluate( - /* istanbul ignore next */ - (style: string) => { - const styleElement = document.createElement('style'); - styleElement.innerHTML = style; - document.getElementsByTagName('head')[0].appendChild(styleElement); - }, - css - ); -}; - -const addReportHeader = async (page: puppeteer.Page, header: string) => { - const headerHtml = fs - .readFileSync(`${__dirname}/header_template.html`) - .toString() - .replace('', header); - - await page.evaluate( - /* istanbul ignore next */ - (headerHtml: string) => { - const content = document.body.firstChild; - const headerContainer = document.createElement('div'); - headerContainer.className = 'reportWrapper'; - headerContainer.innerHTML = headerHtml; - content?.parentNode?.insertBefore(headerContainer, content); - }, - headerHtml - ); -}; - -const addReportFooter = async (page: puppeteer.Page, footer: string) => { - const headerHtml = fs - .readFileSync(`${__dirname}/footer_template.html`) - .toString() - .replace('', footer); - - await page.evaluate( - /* istanbul ignore next */ - (headerHtml: string) => { - const content = document.body.firstChild; - const headerContainer = document.createElement('div'); - headerContainer.className = 'reportWrapper'; - headerContainer.innerHTML = headerHtml; - content?.parentNode?.insertBefore(headerContainer, null); - }, - headerHtml - ); -}; - -// add waitForDynamicContent function -const waitForDynamicContent = async ( - page, - timeout = 30000, - interval = 1000, - checks = 5 -) => { - const maxChecks = timeout / interval; - let passedChecks = 0; - let previousLength = 0; - - let i = 0; - while (i++ <= maxChecks) { - let pageContent = await page.content(); - let currentLength = pageContent.length; - - previousLength === 0 || previousLength != currentLength - ? (passedChecks = 0) - : passedChecks++; - if (passedChecks >= checks) { - break; - } - - previousLength = currentLength; - await new Promise(resolve => setTimeout(resolve, interval)); - } -}; diff --git a/dashboards-reports/translations/pl.json b/dashboards-reports/translations/pl.json index 6f377e5a..f2d770f0 100644 --- a/dashboards-reports/translations/pl.json +++ b/dashboards-reports/translations/pl.json @@ -124,7 +124,7 @@ "opensearch.reports.loading.close": "Zamknij", "opensearch.reports.loading.generatingReport": "Generowanie raportu.", "opensearch.reports.loading.preparingYourFile": "Przygotowanie pliku do pobrania.", - "opensearch.reports.loading.youCanClose": "Możesz zamknąć to okno dialogowe, raport jest generowany w tle.", + "opensearch.reports.loading.youCanClose": "Nie zamykaj tego okna dialogowego podczas generowania raportu.", "opensearch.reports.main.errorDownloadingReport": "Błąd przy pobieraniu raportu", "opensearch.reports.main.errorGeneratingReportDefinitionsTable.": "Błąd generowania listy definicji raportów.", "opensearch.reports.main.errorGeneratingReportsTable.": "Błąd generowania listy raportów.", @@ -154,7 +154,7 @@ "opensearch.reports.menu.newNotificationAppears": "Pojawiło się nowe powiadomienie", "opensearch.reports.menu.progress.generatingReport": "Generowanie raportu", "opensearch.reports.menu.progress.preparingYourFile": "Przygotowanie pliku do pobrania", - "opensearch.reports.menu.progress.youCanClose": "Możesz zamknąć to okno dialogowe, raport jest generowany w tle.", + "opensearch.reports.menu.progress.youCanClose": "Nie zamykaj tego okna dialogowego podczas generowania raportu.", "opensearch.reports.menu.scheduleAndShare": "Wygeneruj i udostępnij", "opensearch.reports.menu.successfullyGenerated": "Pomyślnie wygenerowano raport.", "opensearch.reports.menu.visual.createReportDefinition": "Utwórz definicję raportu.", diff --git a/dashboards-reports/yarn.lock b/dashboards-reports/yarn.lock index 6a95b3d2..723cf1c8 100644 --- a/dashboards-reports/yarn.lock +++ b/dashboards-reports/yarn.lock @@ -254,6 +254,13 @@ dependencies: regenerator-runtime "^0.13.4" +"@babel/runtime@^7.12.5", "@babel/runtime@^7.14.0": + version "7.20.6" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.6.tgz#facf4879bfed9b5326326273a64220f099b0fce3" + integrity sha512-Q+8MqP7TiHMWzSfwiJwXCjyf4GYA4Dgw3emg/7xmwsdLJOZUp+nMqcOwOzzYheuM1rhDu8FSj2l0aoMygEuXuA== + dependencies: + regenerator-runtime "^0.13.11" + "@babel/template@^7.10.4", "@babel/template@^7.3.3": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.10.4.tgz#3251996c4200ebc71d1a8fc405fba940f36ba278" @@ -661,19 +668,10 @@ resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== -"@types/puppeteer-core@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@types/puppeteer-core/-/puppeteer-core-5.4.0.tgz#880a7917b4ede95cbfe2d5e81a558cfcb072c0fb" - integrity sha512-yqRPuv4EFcSkTyin6Yy17pN6Qz2vwVwTCJIDYMXbE3j8vTPhv0nCQlZOl5xfi0WHUkqvQsjAR8hAfjeMCoetwg== - dependencies: - "@types/puppeteer" "*" - -"@types/puppeteer@*": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@types/puppeteer/-/puppeteer-5.4.0.tgz#1ef860bd7a9dcf0c4633aac8c0ec21f75b431868" - integrity sha512-zTYDLjnHjgzokrwKt7N0rgn7oZPYo1J0m8Ghu+gXqzLCEn8RWbELa2uprE2UFJ0jU/Sk0x9jXXdOH/5QQLFHhQ== - dependencies: - "@types/node" "*" +"@types/raf@^3.4.0": + version "3.4.0" + resolved "https://registry.yarnpkg.com/@types/raf/-/raf-3.4.0.tgz#2b72cbd55405e071f1c4d29992638e022b20acc2" + integrity sha512-taW5/WYqo36N7V39oYyHP9Ipfd5pNFvGTIQsNGj86xV88YQ7GnI30/yMfKDF7Zgin0m3e+ikX88FvImnK4RjGw== "@types/react-addons-test-utils@^0.14.25": version "0.14.25" @@ -746,13 +744,6 @@ dependencies: "@types/yargs-parser" "*" -"@types/yauzl@^2.9.1": - version "2.10.0" - resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.10.0.tgz#b3248295276cf8c6f153ebe6a9aba0c988cb2599" - integrity sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw== - dependencies: - "@types/node" "*" - "@webassemblyjs/ast@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964" @@ -931,13 +922,6 @@ acorn@^6.0.1, acorn@^6.0.4, acorn@^6.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== -agent-base@6: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - airbnb-prop-types@^2.16.0: version "2.16.0" resolved "https://registry.yarnpkg.com/airbnb-prop-types/-/airbnb-prop-types-2.16.0.tgz#b96274cefa1abb14f623f804173ee97c13971dc2" @@ -1132,13 +1116,6 @@ async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== -async-mutex@^0.2.6: - version "0.2.6" - resolved "https://registry.yarnpkg.com/async-mutex/-/async-mutex-0.2.6.tgz#0d7a3deb978bc2b984d5908a2038e1ae2e54ff40" - integrity sha512-Hs4R+4SPgamu6rSGW8C7cV9gaWUKEHykfzCCvIRuaVv636Ju10ZdeUbvb4TBEW0INuq2DHZqXbK4Nd3yG4RaRw== - dependencies: - tslib "^2.0.0" - async@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/async/-/async-3.2.0.tgz#b3a2685c5ebb641d3de02d161002c60fc9f85720" @@ -1287,7 +1264,12 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= -base64-js@^1.0.2, base64-js@^1.3.1: +base64-arraybuffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz#1c37589a7c4b0746e34bd1feb951da2df01c1bdc" + integrity sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ== + +base64-js@^1.0.2: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== @@ -1334,15 +1316,6 @@ bindings@^1.5.0: dependencies: file-uri-to-path "1.0.0" -bl@^4.0.3: - version "4.1.0" - resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" - integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== - dependencies: - buffer "^5.5.0" - inherits "^2.0.4" - readable-stream "^3.4.0" - blob-util@2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/blob-util/-/blob-util-2.0.2.tgz#3b4e3c281111bb7f11128518006cdc60b403a1eb" @@ -1479,6 +1452,11 @@ bser@2.1.1: dependencies: node-int64 "^0.4.0" +btoa@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/btoa/-/btoa-1.2.1.tgz#01a9909f8b2c93f6bf680ba26131eb30f7fa3d73" + integrity sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g== + buffer-crc32@~0.2.3: version "0.2.13" resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" @@ -1503,14 +1481,6 @@ buffer@^4.3.0: ieee754 "^1.1.4" isarray "^1.0.0" -buffer@^5.2.1, buffer@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" @@ -1575,6 +1545,20 @@ camelcase@^5.0.0, camelcase@^5.3.1: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== +canvg@^3.0.6: + version "3.0.10" + resolved "https://registry.yarnpkg.com/canvg/-/canvg-3.0.10.tgz#8e52a2d088b6ffa23ac78970b2a9eebfae0ef4b3" + integrity sha512-qwR2FRNO9NlzTeKIPIKpnTY6fqwuYSequ8Ru8c0YkYU7U0oW+hLUvWadLvAu1Rl72OMNiFhoLu4f8eUjQ7l/+Q== + dependencies: + "@babel/runtime" "^7.12.5" + "@types/raf" "^3.4.0" + core-js "^3.8.3" + raf "^3.4.1" + regenerator-runtime "^0.13.7" + rgbcolor "^1.0.1" + stackblur-canvas "^2.0.0" + svg-pathdata "^6.0.3" + capture-exit@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" @@ -1893,6 +1877,11 @@ core-js@^2.4.0, core-js@^2.5.0: resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c" integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg== +core-js@^3.6.0, core-js@^3.8.3: + version "3.26.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.26.1.tgz#7a9816dabd9ee846c1c0fe0e8fcad68f3709134e" + integrity sha512-21491RRQVzUn0GGM9Z1Jrpr6PNPxPi+Za8OM9q4tksTSnlbXXGKK1nXNg/QvwFYettXvSX6zWKCtHHfjN4puyA== + core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -1945,13 +1934,6 @@ cron-validator@^1.1.1: resolved "https://registry.yarnpkg.com/cron-validator/-/cron-validator-1.1.1.tgz#0a27bb75508c7bc03c8b840d2d9f170eeacb5615" integrity sha512-vfZb05w/wezuwPZBDvdIBmJp2BvuJExHeyKRa5oBqD2ZDXR61hb3QgPc/3ZhBEQJlAy8Jlnn5XC/JCT3IDqxwg== -cross-fetch@3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" - integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== - dependencies: - node-fetch "2.6.7" - cross-fetch@^3.0.4: version "3.0.6" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.6.tgz#3a4040bc8941e653e0e9cf17f29ebcd177d3365c" @@ -1996,6 +1978,13 @@ crypto-browserify@^3.11.0: randombytes "^2.0.0" randomfill "^1.0.3" +css-line-break@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/css-line-break/-/css-line-break-2.1.0.tgz#bfef660dfa6f5397ea54116bb3cb4873edbc4fa0" + integrity sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w== + dependencies: + utrie "^1.0.2" + css-what@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/css-what/-/css-what-5.0.1.tgz#3efa820131f4669a8ac2408f9c32e7c7de9f4cad" @@ -2093,13 +2082,6 @@ date-fns@^1.27.2: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== -debug@4, debug@4.3.4: - version "4.3.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -2190,11 +2172,6 @@ des.js@^1.0.0: inherits "^2.0.1" minimalistic-assert "^1.0.0" -devtools-protocol@0.0.981744: - version "0.0.981744" - resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.981744.tgz#9960da0370284577d46c28979a0b32651022bacf" - integrity sha512-0cuGS8+jhR67Fy7qG3i3Pc7Aw494sb9yG9QgpG97SFVWwolgYjlhJg7n+UaHxOQT30d1TYu/EYe9k01ivLErIg== - diff-sequences@^25.2.6: version "25.2.6" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-25.2.6.tgz#5f467c00edd35352b7bca46d7927d60e687a76dd" @@ -2255,10 +2232,10 @@ domhandler@^3.0, domhandler@^3.0.0: dependencies: domelementtype "^2.0.1" -dompurify@^2.3.8: - version "2.3.8" - resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.3.8.tgz#224fe9ae57d7ebd9a1ae1ac18c1c1ca3f532226f" - integrity sha512-eVhaWoVibIzqdGYjwsBWodIQIaXFSB+cKDf4cfxLMsK0xiud6SE+/WCVx/Xw/UwQsa4cS3T2eITcdtmTg2UKcw== +dompurify@^2.2.0, dompurify@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.4.1.tgz#f9cb1a275fde9af6f2d0a2644ef648dd6847b631" + integrity sha512-ewwFzHzrrneRjxzmK6oVz/rZn9VWspGFRDb4/rRtIsM1n36t9AKma/ye8syCpcw+XJ25kOK/hOG7t1j2I2yBqA== domutils@^2.0.0: version "2.2.0" @@ -2335,7 +2312,7 @@ emojis-list@^3.0.0: resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== -end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: +end-of-stream@^1.0.0, end-of-stream@^1.1.0: version "1.4.4" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== @@ -2683,17 +2660,6 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" -extract-zip@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-2.0.1.tgz#663dca56fe46df890d5f131ef4a06d22bb8ba13a" - integrity sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg== - dependencies: - debug "^4.1.1" - get-stream "^5.1.0" - yauzl "^2.10.0" - optionalDependencies: - "@types/yauzl" "^2.9.1" - extract-zip@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.7.0.tgz#556cc3ae9df7f452c493a0cfb51cc30277940927" @@ -2743,6 +2709,11 @@ fd-slicer@~1.1.0: dependencies: pend "~1.2.0" +fflate@^0.4.8: + version "0.4.8" + resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.4.8.tgz#f90b82aefbd8ac174213abb338bd7ef848f0f5ae" + integrity sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA== + figgy-pudding@^3.5.1: version "3.5.2" resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e" @@ -2806,7 +2777,7 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" -find-up@^4.0.0, find-up@^4.1.0: +find-up@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== @@ -2856,11 +2827,6 @@ from2@^2.1.0: inherits "^2.0.1" readable-stream "^2.0.0" -fs-constants@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" - integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== - fs-extra@^9.0.1: version "9.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" @@ -2954,7 +2920,7 @@ get-stream@^4.0.0: dependencies: pump "^3.0.0" -get-stream@^5.0.0, get-stream@^5.1.0: +get-stream@^5.0.0: version "5.2.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== @@ -3007,15 +2973,15 @@ glob@^7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.1.3, glob@^7.1.4: - version "7.1.6" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== +glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" - minimatch "^3.0.4" + minimatch "^3.1.1" once "^1.3.0" path-is-absolute "^1.0.0" @@ -3191,6 +3157,14 @@ html-to-react@^1.3.4: lodash.camelcase "^4.3.0" ramda "^0.27" +html2canvas@1.4.1, html2canvas@^1.0.0-rc.5: + version "1.4.1" + resolved "https://registry.yarnpkg.com/html2canvas/-/html2canvas-1.4.1.tgz#7cef1888311b5011d507794a066041b14669a543" + integrity sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA== + dependencies: + css-line-break "^2.1.0" + text-segmentation "^1.0.3" + htmlparser2@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-4.1.0.tgz#9a4ef161f2e4625ebf7dfbe6c0a2f52d18a59e78" @@ -3215,14 +3189,6 @@ https-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= -https-proxy-agent@5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" - integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== - dependencies: - agent-base "6" - debug "4" - human-signals@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" @@ -3247,7 +3213,7 @@ identity-obj-proxy@^3.0.0: dependencies: harmony-reflect "^1.4.6" -ieee754@^1.1.13, ieee754@^1.1.4: +ieee754@^1.1.4: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== @@ -3851,6 +3817,21 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" +jspdf@^2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/jspdf/-/jspdf-2.5.1.tgz#00c85250abf5447a05f3b32ab9935ab4a56592cc" + integrity sha512-hXObxz7ZqoyhxET78+XR34Xu2qFGrJJ2I2bE5w4SM8eFaFEkW2xcGRVUss360fYelwRSid/jT078kbNvmoW0QA== + dependencies: + "@babel/runtime" "^7.14.0" + atob "^2.1.2" + btoa "^1.2.1" + fflate "^0.4.8" + optionalDependencies: + canvg "^3.0.6" + core-js "^3.6.0" + dompurify "^2.2.0" + html2canvas "^1.0.0-rc.5" + jsprim@^1.2.2: version "1.4.1" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" @@ -4240,10 +4221,10 @@ minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== +minimatch@^3.0.4, minimatch@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: brace-expansion "^1.1.7" @@ -4276,11 +4257,6 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp-classic@^0.5.2: - version "0.5.3" - resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" - integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== - mkdirp@1.x: version "1.0.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" @@ -4357,13 +4333,6 @@ node-fetch@2.6.1: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== -node-fetch@2.6.7: - version "2.6.7" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== - dependencies: - whatwg-url "^5.0.0" - node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" @@ -4782,13 +4751,6 @@ pirates@^4.0.1: dependencies: node-modules-regexp "^1.0.0" -pkg-dir@4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" - integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== - dependencies: - find-up "^4.0.0" - pkg-dir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" @@ -4836,11 +4798,6 @@ process@^0.11.10: resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= -progress@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - promise-inflight@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" @@ -4869,11 +4826,6 @@ prop-types@^15.6.2, prop-types@^15.7.2: object-assign "^4.1.1" react-is "^16.8.1" -proxy-from-env@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" - integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== - prr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" @@ -4941,24 +4893,6 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -puppeteer-core@^13.7.0: - version "13.7.0" - resolved "https://registry.yarnpkg.com/puppeteer-core/-/puppeteer-core-13.7.0.tgz#3344bee3994163f49120a55ddcd144a40575ba5b" - integrity sha512-rXja4vcnAzFAP1OVLq/5dWNfwBGuzcOARJ6qGV7oAZhnLmVRU8G5MsdeQEAOy332ZhkIOnn9jp15R89LKHyp2Q== - dependencies: - cross-fetch "3.1.5" - debug "4.3.4" - devtools-protocol "0.0.981744" - extract-zip "2.0.1" - https-proxy-agent "5.0.1" - pkg-dir "4.2.0" - progress "2.0.3" - proxy-from-env "1.1.0" - rimraf "3.0.2" - tar-fs "2.1.1" - unbzip2-stream "1.4.3" - ws "8.5.0" - qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" @@ -4983,6 +4917,13 @@ querystring@0.2.0: resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= +raf@^3.4.1: + version "3.4.1" + resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39" + integrity sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA== + dependencies: + performance-now "^2.1.0" + ramda@^0.27: version "0.27.1" resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.1.tgz#66fc2df3ef873874ffc2da6aa8984658abacf5c9" @@ -5139,7 +5080,7 @@ react-transition-group@^4.3.0: string_decoder "~1.1.1" util-deprecate "~1.0.1" -readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0: +readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -5179,6 +5120,11 @@ regenerator-runtime@^0.11.0: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== +regenerator-runtime@^0.13.11, regenerator-runtime@^0.13.7: + version "0.13.11" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" + integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== + regenerator-runtime@^0.13.2, regenerator-runtime@^0.13.4: version "0.13.7" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" @@ -5233,6 +5179,15 @@ replace-ext@1.0.0: resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" integrity sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs= +replace-in-file@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/replace-in-file/-/replace-in-file-5.0.2.tgz#bd26203b66dfb5b8112ae36a2d2cf928ea4cfe12" + integrity sha512-1Vc7Sbr/rTuHgU1PZuBb7tGsFx3D4NKdhV4BpEF2MuN/6+SoXcFtx+dZ1Zz+5Dq4k5x9js87Y+gXQYPTQ9ppkA== + dependencies: + chalk "^3.0.0" + glob "^7.1.6" + yargs "^15.0.2" + request-progress@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/request-progress/-/request-progress-3.0.0.tgz#4ca754081c7fec63f505e4faa825aa06cd669dbe" @@ -5356,12 +5311,10 @@ ret@~0.1.10: resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== -rimraf@3.0.2, rimraf@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" +rgbcolor@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/rgbcolor/-/rgbcolor-1.0.1.tgz#d6505ecdb304a6595da26fa4b43307306775945d" + integrity sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw== rimraf@^2.5.4, rimraf@^2.6.3: version "2.7.1" @@ -5370,6 +5323,13 @@ rimraf@^2.5.4, rimraf@^2.6.3: dependencies: glob "^7.1.3" +rimraf@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" @@ -5669,6 +5629,11 @@ ssri@^6.0.1: dependencies: figgy-pudding "^3.5.1" +stackblur-canvas@^2.0.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/stackblur-canvas/-/stackblur-canvas-2.5.0.tgz#aa87bbed1560fdcd3138fff344fc6a1c413ebac4" + integrity sha512-EeNzTVfj+1In7aSLPKDD03F/ly4RxEuF/EX0YcOG0cKoPXs+SLZxDawQbexQDBzwROs4VKLWTOaZQlZkGBFEIQ== + state-toggle@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.3.tgz#e123b16a88e143139b09c6852221bc9815917dfe" @@ -5862,6 +5827,16 @@ supports-color@^7.0.0, supports-color@^7.1.0, supports-color@^7.2.0: dependencies: has-flag "^4.0.0" +svg-pathdata@^5.0.5: + version "5.0.5" + resolved "https://registry.yarnpkg.com/svg-pathdata/-/svg-pathdata-5.0.5.tgz#65e8d765642ba15fe15434444087d082bc526b29" + integrity sha512-TAAvLNSE3fEhyl/Da19JWfMAdhSXTYeviXsLSoDT1UM76ADj5ndwAPX1FKQEgB/gFMPavOy6tOqfalXKUiXrow== + +svg-pathdata@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/svg-pathdata/-/svg-pathdata-6.0.3.tgz#80b0e0283b652ccbafb69ad4f8f73e8d3fbf2cac" + integrity sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw== + symbol-observable@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" @@ -5882,27 +5857,6 @@ tapable@^1.0.0, tapable@^1.1.3: resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== -tar-fs@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.1.1.tgz#489a15ab85f1f0befabb370b7de4f9eb5cbe8784" - integrity sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng== - dependencies: - chownr "^1.1.1" - mkdirp-classic "^0.5.2" - pump "^3.0.0" - tar-stream "^2.1.4" - -tar-stream@^2.1.4: - version "2.2.0" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287" - integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ== - dependencies: - bl "^4.0.3" - end-of-stream "^1.4.1" - fs-constants "^1.0.0" - inherits "^2.0.3" - readable-stream "^3.1.1" - terser-webpack-plugin@^1.4.3: version "1.4.5" resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz#a217aefaea330e734ffacb6120ec1fa312d6040b" @@ -5936,6 +5890,13 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" +text-segmentation@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/text-segmentation/-/text-segmentation-1.0.3.tgz#52a388159efffe746b24a63ba311b6ac9f2d7943" + integrity sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw== + dependencies: + utrie "^1.0.2" + throttleit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c" @@ -5949,11 +5910,6 @@ through2@^2.0.0: readable-stream "~2.3.6" xtend "~4.0.1" -through@^2.3.8: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== - timers-browserify@^2.0.4: version "2.0.12" resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.12.tgz#44a45c11fbf407f34f97bccd1577c652361b00ee" @@ -6040,11 +5996,6 @@ tr46@^1.0.1: dependencies: punycode "^2.1.0" -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== - trim-trailing-lines@^1.0.0: version "1.1.3" resolved "https://registry.yarnpkg.com/trim-trailing-lines/-/trim-trailing-lines-1.1.3.tgz#7f0739881ff76657b7776e10874128004b625a94" @@ -6082,11 +6033,6 @@ tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c" - integrity sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ== - tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" @@ -6123,14 +6069,6 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -unbzip2-stream@1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz#b0da04c4371311df771cdc215e87f2130991ace7" - integrity sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg== - dependencies: - buffer "^5.2.1" - through "^2.3.8" - unherit@^1.0.4: version "1.1.3" resolved "https://registry.yarnpkg.com/unherit/-/unherit-1.1.3.tgz#6c9b503f2b41b262330c80e91c8614abdaa69c22" @@ -6278,6 +6216,13 @@ util@^0.11.0: dependencies: inherits "2.0.3" +utrie@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/utrie/-/utrie-1.0.2.tgz#d42fe44de9bc0119c25de7f564a6ed1b2c87a645" + integrity sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw== + dependencies: + base64-arraybuffer "^1.0.2" + uuid@^3.3.2: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" @@ -6365,11 +6310,6 @@ watchpack@^1.7.4: chokidar "^3.4.1" watchpack-chokidar2 "^2.0.1" -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== - webidl-conversions@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" @@ -6424,14 +6364,6 @@ whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0: resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - whatwg-url@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06" @@ -6513,15 +6445,10 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" -ws@8.5.0: - version "8.5.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.5.0.tgz#bfb4be96600757fe5382de12c670dab984a1ed4f" - integrity sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg== - ws@^6.1.2: - version "6.2.1" - resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb" - integrity sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA== + version "6.2.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.2.tgz#dd5cdbd57a9979916097652d78f1cc5faea0c32e" + integrity sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw== dependencies: async-limiter "~1.0.0" @@ -6603,7 +6530,7 @@ yargs@^14.2: y18n "^4.0.0" yargs-parser "^15.0.1" -yargs@^15.3.1: +yargs@^15.0.2, yargs@^15.3.1: version "15.4.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==