From 1d0ab38f8c21e7c889dee7444aca4148905c1f3e Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Wed, 26 Oct 2022 18:25:50 -0700 Subject: [PATCH] [7.17] Puppeteer v18.1 (#143485) (#143710) * Puppeteer v18.1 * fix types & remove any * remove referencing puppeteer types * fix unwanted diff * fix unused translations * fix pretty * fix wait_for_elements implementation * remove more puppeteer references --- package.json | 2 +- .../chromium/driver/chromium_driver.ts | 78 +++++------ .../browsers/chromium/driver_factory/index.ts | 39 +++--- .../chromium/driver_factory/metrics.ts | 13 +- .../driver_factory/puppeteer_launcher.js | 35 +++++ .../screenshots/get_element_position_data.ts | 24 ++-- .../lib/screenshots/get_number_of_items.ts | 4 +- .../lib/screenshots/get_render_errors.ts | 4 +- .../server/lib/screenshots/get_time_range.ts | 4 +- .../server/lib/screenshots/inject_css.ts | 4 +- .../server/lib/screenshots/wait_for_render.ts | 17 +-- .../screenshots/wait_for_visualizations.ts | 35 ++--- .../create_mock_browserdriverfactory.ts | 3 +- .../translations/translations/ja-JP.json | 3 - .../translations/translations/zh-CN.json | 3 - yarn.lock | 121 ++++++++---------- 16 files changed, 190 insertions(+), 199 deletions(-) create mode 100644 x-pack/plugins/reporting/server/browsers/chromium/driver_factory/puppeteer_launcher.js diff --git a/package.json b/package.json index 6a8ec91ccc1ba..946e1f33b18f7 100644 --- a/package.json +++ b/package.json @@ -319,7 +319,7 @@ "prop-types": "^15.7.2", "proxy-from-env": "1.0.0", "puid": "1.0.7", - "puppeteer": "^10.2.0", + "puppeteer": "18.1.0", "query-string": "^6.13.2", "random-word-slugs": "^0.0.5", "raw-loader": "^3.1.0", diff --git a/x-pack/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts b/x-pack/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts index 1f178ea7b2ad3..afb93a1ad7664 100644 --- a/x-pack/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts +++ b/x-pack/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts @@ -8,7 +8,6 @@ import { i18n } from '@kbn/i18n'; import { map, truncate } from 'lodash'; import open from 'opn'; -import puppeteer, { ElementHandle, EvaluateFn, SerializableOrJSHandle } from 'puppeteer'; import { parse as parseUrl } from 'url'; import type { LocatorParams } from '../../../../common/types'; import { REPORTING_REDIRECT_LOCATOR_STORE_KEY } from '../../../../common/constants'; @@ -30,9 +29,9 @@ interface WaitForSelectorOpts { timeout: number; } -interface EvaluateOpts { - fn: EvaluateFn; - args: SerializableOrJSHandle[]; +interface EvaluateOpts { + fn: any; + args: unknown[]; } interface EvaluateMetaOpts { @@ -57,7 +56,7 @@ interface InterceptedRequest { const WAIT_FOR_DELAY_MS: number = 100; export class HeadlessChromiumDriver { - private readonly page: puppeteer.Page; + private readonly page: any; private readonly inspect: boolean; private readonly networkPolicy: NetworkPolicy; @@ -67,7 +66,7 @@ export class HeadlessChromiumDriver { constructor( core: ReportingCore, - page: puppeteer.Page, + page: unknown, { inspect, networkPolicy }: ChromiumDriverOptions ) { this.core = core; @@ -119,7 +118,10 @@ export class HeadlessChromiumDriver { await this.page.evaluateOnNewDocument(this.core.getEnableScreenshotMode()); if (layout) { - await this.page.evaluateOnNewDocument(this.core.getSetScreenshotLayout(), layout.id); + await this.page.evaluateOnNewDocument( + this.core.getSetScreenshotLayout() as (arg0: string) => void, + layout.id + ); } if (locator) { @@ -189,14 +191,13 @@ export class HeadlessChromiumDriver { return undefined; } - public async evaluate( - { fn, args = [] }: EvaluateOpts, + public async evaluate( + { fn, args = [] }: EvaluateOpts, meta: EvaluateMetaOpts, logger: LevelLogger - ) { + ): Promise { logger.debug(`evaluate ${meta.context}`); - const result = await this.page.evaluate(fn, ...args); - return result; + return this.page.evaluate(fn, ...args) as Promise; } public async waitForSelector( @@ -204,7 +205,7 @@ export class HeadlessChromiumDriver { opts: WaitForSelectorOpts, context: EvaluateMetaOpts, logger: LevelLogger - ): Promise> { + ): Promise { const { timeout } = opts; logger.debug(`waitForSelector ${selector}`); const resp = await this.page.waitForSelector(selector, { timeout }); // override default 30000ms @@ -217,36 +218,16 @@ export class HeadlessChromiumDriver { return resp; } - public async waitFor( - { - fn, - args, - toEqual, - timeout, - }: { - fn: EvaluateFn; - args: SerializableOrJSHandle[]; - toEqual: number; - timeout: number; - }, - context: EvaluateMetaOpts, - logger: LevelLogger - ): Promise { - const startTime = Date.now(); - - while (true) { - const result = await this.evaluate({ fn, args }, context, logger); - if (result === toEqual) { - return; - } - - if (Date.now() - startTime > timeout) { - throw new Error( - `Timed out waiting for the items selected to equal ${toEqual}. Found: ${result}. Context: ${context.context}` - ); - } - await new Promise((r) => setTimeout(r, WAIT_FOR_DELAY_MS)); - } + public async waitFor({ + fn, + args, + timeout, + }: { + fn: unknown; + args: unknown[]; + timeout: number; + }): Promise { + await this.page.waitForFunction(fn, { timeout, polling: WAIT_FOR_DELAY_MS }, ...args); } public async setViewport( @@ -271,9 +252,8 @@ export class HeadlessChromiumDriver { return; } - // @ts-ignore - // FIXME: retrieve the client in open() and pass in the client - const client = this.page._client; + // FIXME: retrieve the client in open() and pass in the client? + const client = this.page._client(); // We have to reach into the Chrome Devtools Protocol to apply headers as using // puppeteer's API will cause map tile requests to hang indefinitely: @@ -348,7 +328,7 @@ export class HeadlessChromiumDriver { // Even though 3xx redirects go through our request // handler, we should probably inspect responses just to // avoid being bamboozled by some malicious request - this.page.on('response', (interceptedResponse: puppeteer.HTTPResponse) => { + this.page.on('response', (interceptedResponse: any) => { const interceptedUrl = interceptedResponse.url(); const allowed = !interceptedUrl.startsWith('file://'); @@ -374,12 +354,12 @@ export class HeadlessChromiumDriver { // In order to get the inspector running, we have to know the page's internal ID (again, private) // in order to construct the final debugging URL. + const client = this.page._client(); const target = this.page.target(); - const client = await target.createCDPSession(); + const targetId = target._targetId; await client.send('Debugger.enable'); await client.send('Debugger.pause'); - const targetId = target._targetId; const wsEndpoint = this.page.browser().wsEndpoint(); const { port } = parseUrl(wsEndpoint); diff --git a/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/index.ts b/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/index.ts index 78325ef903710..42ca4baedc5a1 100644 --- a/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/index.ts +++ b/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/index.ts @@ -11,7 +11,6 @@ import del from 'del'; import apm from 'elastic-apm-node'; import fs from 'fs'; import path from 'path'; -import puppeteer from 'puppeteer'; import * as Rx from 'rxjs'; import { InnerSubscriber } from 'rxjs/internal/InnerSubscriber'; import { ignoreElements, map, mergeMap, tap } from 'rxjs/operators'; @@ -25,6 +24,8 @@ import { safeChildProcess } from '../../safe_child_process'; import { HeadlessChromiumDriver } from '../driver'; import { args } from './args'; import { getMetrics, Metrics } from './metrics'; +// @ts-ignore +import { launch } from './puppeteer_launcher'; interface CreatePageOptions { browserTimezone?: string; @@ -89,24 +90,20 @@ export class HeadlessChromiumDriverFactory { const chromiumArgs = this.getChromiumArgs(); logger.debug(`Chromium launch args set to: ${chromiumArgs}`); - let browser: puppeteer.Browser; - let page: puppeteer.Page; - let devTools: puppeteer.CDPSession | undefined; + let browser: any; + let page: any; + let devTools: any; let startMetrics: Metrics | undefined; try { - browser = await puppeteer.launch({ - pipe: !this.browserConfig.inspect, - userDataDir: this.userDataDir, - executablePath: this.binaryPath, - ignoreHTTPSErrors: true, - handleSIGHUP: false, - args: chromiumArgs, - defaultViewport: viewport, - env: { - TZ: browserTimezone, - }, - }); + browser = await launch( + this.browserConfig, + this.userDataDir, + this.binaryPath, + chromiumArgs, + viewport, + browserTimezone + ); page = await browser.newPage(); devTools = await page.target().createCDPSession(); @@ -209,8 +206,8 @@ export class HeadlessChromiumDriverFactory { }); } - getBrowserLogger(page: puppeteer.Page, logger: LevelLogger): Rx.Observable { - const consoleMessages$ = Rx.fromEvent(page, 'console').pipe( + getBrowserLogger(page: any, logger: LevelLogger): Rx.Observable { + const consoleMessages$ = Rx.fromEvent(page, 'console').pipe( map((line) => { const formatLine = () => `{ text: "${line.text()?.trim()}", url: ${line.location()?.url} }`; @@ -235,7 +232,7 @@ export class HeadlessChromiumDriverFactory { }) ); - const pageRequestFailed$ = Rx.fromEvent(page, 'requestfailed').pipe( + const pageRequestFailed$ = Rx.fromEvent(page, 'requestfailed').pipe( map((req) => { const failure = req.failure && req.failure(); if (failure) { @@ -249,7 +246,7 @@ export class HeadlessChromiumDriverFactory { return Rx.merge(consoleMessages$, uncaughtExceptionPageError$, pageRequestFailed$); } - getProcessLogger(browser: puppeteer.Browser, logger: LevelLogger): Rx.Observable { + getProcessLogger(browser: any, logger: LevelLogger): Rx.Observable { const childProcess = browser.process(); // NOTE: The browser driver can not observe stdout and stderr of the child process // Puppeteer doesn't give a handle to the original ChildProcess object @@ -269,7 +266,7 @@ export class HeadlessChromiumDriverFactory { return processClose$; // ideally, this would also merge with observers for stdout and stderr } - getPageExit(browser: puppeteer.Browser, page: puppeteer.Page) { + getPageExit(browser: any, page: any) { const pageError$ = Rx.fromEvent(page, 'error').pipe( mergeMap((err) => { return Rx.throwError( diff --git a/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/metrics.ts b/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/metrics.ts index 1659f28dea9b0..d868448e6323c 100644 --- a/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/metrics.ts +++ b/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/metrics.ts @@ -5,17 +5,8 @@ * 2.0. */ -import type { Metrics as PuppeteerMetrics } from 'puppeteer'; import { cpus } from 'os'; -declare module 'puppeteer' { - interface CDPSession { - send(command: 'Performance.getMetrics'): Promise; - } -} - -type RawMetrics = Metrics; - export interface Metrics { metrics: Metric[]; } @@ -25,8 +16,10 @@ interface Metric { value: unknown; } -interface NormalizedMetrics extends Required { +interface NormalizedMetrics { + Timestamp: number; ProcessTime: number; + JSHeapTotalSize: number; } interface PerformanceMetrics { diff --git a/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/puppeteer_launcher.js b/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/puppeteer_launcher.js new file mode 100644 index 0000000000000..c51680158e73a --- /dev/null +++ b/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/puppeteer_launcher.js @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import puppeteer from 'puppeteer'; + +/** + * This function exists as a JS file in order to prevent the v4.1.3 TypeScript compiler from interpreting types + * in the Puppeteer node module. + */ + +export async function launch( + browserConfig, + userDataDir, + binaryPath, + chromiumArgs, + viewport, + browserTimezone +) { + return await puppeteer.launch({ + pipe: !browserConfig.inspect, + userDataDir: userDataDir, + executablePath: binaryPath, + ignoreHTTPSErrors: true, + handleSIGHUP: false, + args: chromiumArgs, + defaultViewport: viewport, + env: { + TZ: browserTimezone, + }, + }); +} diff --git a/x-pack/plugins/reporting/server/lib/screenshots/get_element_position_data.ts b/x-pack/plugins/reporting/server/lib/screenshots/get_element_position_data.ts index 293eb692f447c..4689e68d7c6c7 100644 --- a/x-pack/plugins/reporting/server/lib/screenshots/get_element_position_data.ts +++ b/x-pack/plugins/reporting/server/lib/screenshots/get_element_position_data.ts @@ -19,11 +19,16 @@ export const getElementPositionAndAttributes = async ( ): Promise => { const endTrace = startTrace('get_element_position_data', 'read'); const { screenshot: screenshotSelector } = layout.selectors; // data-shared-items-container + const screenshotAttributes = { title: 'data-title', description: 'data-description' }; + let elementsPositionAndAttributes: ElementsPositionAndAttribute[] | null; try { - elementsPositionAndAttributes = await browser.evaluate( + elementsPositionAndAttributes = await browser.evaluate< + [typeof screenshotSelector, typeof screenshotAttributes], + ElementsPositionAndAttribute[] | null + >( { - fn: (selector, attributes) => { + fn: (selector: string, attributes: typeof screenshotAttributes) => { const elements = Array.from(document.querySelectorAll(selector)); const results: ElementsPositionAndAttribute[] = []; @@ -42,16 +47,19 @@ export const getElementPositionAndAttributes = async ( y: window.scrollY, }, }, - attributes: Object.keys(attributes).reduce((result: AttributesMap, key) => { - const attribute = attributes[key]; - result[key] = element.getAttribute(attribute); - return result; - }, {} as AttributesMap), + attributes: Object.keys(attributes).reduce( + (result: AttributesMap, key) => { + const attribute = attributes[key as keyof typeof attributes]; + result[key] = element.getAttribute(attribute); + return result; + }, + {} + ), }); } return results; }, - args: [screenshotSelector, { title: 'data-title', description: 'data-description' }], + args: [screenshotSelector, screenshotAttributes], }, { context: CONTEXT_ELEMENTATTRIBUTES }, logger diff --git a/x-pack/plugins/reporting/server/lib/screenshots/get_number_of_items.ts b/x-pack/plugins/reporting/server/lib/screenshots/get_number_of_items.ts index 9e5dfa180fd0f..97a08b847a26f 100644 --- a/x-pack/plugins/reporting/server/lib/screenshots/get_number_of_items.ts +++ b/x-pack/plugins/reporting/server/lib/screenshots/get_number_of_items.ts @@ -40,9 +40,9 @@ export const getNumberOfItems = async ( // returns the value of the `itemsCountAttribute` if it's there, otherwise // we just count the number of `itemSelector`: the number of items already rendered - itemsCount = await browser.evaluate( + itemsCount = await browser.evaluate( { - fn: (selector, countAttribute) => { + fn: (selector: string, countAttribute: string) => { const elementWithCount = document.querySelector(`[${countAttribute}]`); if (elementWithCount && elementWithCount != null) { const count = elementWithCount.getAttribute(countAttribute); diff --git a/x-pack/plugins/reporting/server/lib/screenshots/get_render_errors.ts b/x-pack/plugins/reporting/server/lib/screenshots/get_render_errors.ts index ded4ed6238872..40db01566b45c 100644 --- a/x-pack/plugins/reporting/server/lib/screenshots/get_render_errors.ts +++ b/x-pack/plugins/reporting/server/lib/screenshots/get_render_errors.ts @@ -18,9 +18,9 @@ export const getRenderErrors = async ( ): Promise => { const endTrace = startTrace('get_render_errors', 'read'); logger.debug('reading render errors'); - const errorsFound: undefined | string[] = await browser.evaluate( + const errorsFound: undefined | string[] = await browser.evaluate( { - fn: (errorSelector, errorAttribute) => { + fn: (errorSelector: string, errorAttribute: string) => { const visualizations: Element[] = Array.from(document.querySelectorAll(errorSelector)); const errors: string[] = []; diff --git a/x-pack/plugins/reporting/server/lib/screenshots/get_time_range.ts b/x-pack/plugins/reporting/server/lib/screenshots/get_time_range.ts index 111c68de62bdf..26634ee2eb7b1 100644 --- a/x-pack/plugins/reporting/server/lib/screenshots/get_time_range.ts +++ b/x-pack/plugins/reporting/server/lib/screenshots/get_time_range.ts @@ -18,9 +18,9 @@ export const getTimeRange = async ( const endTrace = startTrace('get_time_range', 'read'); logger.debug('getting timeRange'); - const timeRange = await browser.evaluate( + const timeRange = await browser.evaluate( { - fn: (durationAttribute) => { + fn: (durationAttribute: string) => { const durationElement = document.querySelector(`[${durationAttribute}]`); if (!durationElement) { diff --git a/x-pack/plugins/reporting/server/lib/screenshots/inject_css.ts b/x-pack/plugins/reporting/server/lib/screenshots/inject_css.ts index 607441e719c32..50d3c42a21926 100644 --- a/x-pack/plugins/reporting/server/lib/screenshots/inject_css.ts +++ b/x-pack/plugins/reporting/server/lib/screenshots/inject_css.ts @@ -33,9 +33,9 @@ export const injectCustomCss = async ( } const buffer = await fsp.readFile(filePath); try { - await browser.evaluate( + await browser.evaluate( { - fn: (css) => { + fn: (css: string) => { const node = document.createElement('style'); node.type = 'text/css'; node.innerHTML = css; // eslint-disable-line no-unsanitized/property diff --git a/x-pack/plugins/reporting/server/lib/screenshots/wait_for_render.ts b/x-pack/plugins/reporting/server/lib/screenshots/wait_for_render.ts index 1ac4b58b61507..bd5e1739b7904 100644 --- a/x-pack/plugins/reporting/server/lib/screenshots/wait_for_render.ts +++ b/x-pack/plugins/reporting/server/lib/screenshots/wait_for_render.ts @@ -5,7 +5,6 @@ * 2.0. */ -import { i18n } from '@kbn/i18n'; import { LevelLogger, startTrace } from '../'; import { HeadlessChromiumDriver } from '../../browsers'; import { LayoutInstance } from '../layouts'; @@ -19,16 +18,12 @@ export const waitForRenderComplete = async ( ) => { const endTrace = startTrace('wait_for_render', 'wait'); - logger.debug( - i18n.translate('xpack.reporting.screencapture.waitingForRenderComplete', { - defaultMessage: 'waiting for rendering to complete', - }) - ); + logger.debug('waiting for rendering to complete'); return await browser - .evaluate( + .evaluate<[string, number]>( { - fn: (selector, visLoadDelay) => { + fn: (selector: string, visLoadDelay: number) => { // wait for visualizations to finish loading const visualizations: NodeListOf = document.querySelectorAll(selector); const visCount = visualizations.length; @@ -73,11 +68,7 @@ export const waitForRenderComplete = async ( logger ) .then(() => { - logger.debug( - i18n.translate('xpack.reporting.screencapture.renderIsComplete', { - defaultMessage: 'rendering is complete', - }) - ); + logger.debug('rendering is complete'); endTrace(); }); diff --git a/x-pack/plugins/reporting/server/lib/screenshots/wait_for_visualizations.ts b/x-pack/plugins/reporting/server/lib/screenshots/wait_for_visualizations.ts index d4bf1db2a0c5a..f0bfb35b3ef1d 100644 --- a/x-pack/plugins/reporting/server/lib/screenshots/wait_for_visualizations.ts +++ b/x-pack/plugins/reporting/server/lib/screenshots/wait_for_visualizations.ts @@ -9,12 +9,22 @@ import { i18n } from '@kbn/i18n'; import { LevelLogger, startTrace } from '../'; import { HeadlessChromiumDriver } from '../../browsers'; import { LayoutInstance } from '../layouts'; -import { CONTEXT_WAITFORELEMENTSTOBEINDOM } from './constants'; -type SelectorArgs = Record; +interface CompletedItemsCountParameters { + count: number; + renderCompleteSelector: string; +} -const getCompletedItemsCount = ({ renderCompleteSelector }: SelectorArgs) => { - return document.querySelectorAll(renderCompleteSelector).length; +const getCompletedItemsCount = ({ + count, + renderCompleteSelector, +}: CompletedItemsCountParameters) => { + const { length } = document.querySelectorAll(renderCompleteSelector); + + // eslint-disable-next-line no-console + console.debug(`waitng for ${count} elements, got ${length}.`); + + return length >= count; }; /* @@ -32,19 +42,14 @@ export const waitForVisualizations = async ( const endTrace = startTrace('wait_for_visualizations', 'wait'); const { renderComplete: renderCompleteSelector } = layout.selectors; - logger.debug( - i18n.translate('xpack.reporting.screencapture.waitingForRenderedElements', { - defaultMessage: `waiting for {itemsCount} rendered elements to be in the DOM`, - values: { itemsCount: toEqual }, - }) - ); + logger.debug(`Waiting for ${toEqual} rendered elements to be in the DOM`); try { - await browser.waitFor( - { fn: getCompletedItemsCount, args: [{ renderCompleteSelector }], toEqual, timeout }, - { context: CONTEXT_WAITFORELEMENTSTOBEINDOM }, - logger - ); + await browser.waitFor({ + fn: getCompletedItemsCount, + args: [{ renderCompleteSelector, count: toEqual }], + timeout, + }); logger.debug(`found ${toEqual} rendered elements in the DOM`); } catch (err) { diff --git a/x-pack/plugins/reporting/server/test_helpers/create_mock_browserdriverfactory.ts b/x-pack/plugins/reporting/server/test_helpers/create_mock_browserdriverfactory.ts index 54ddfa8810822..9c6a162bf75fe 100644 --- a/x-pack/plugins/reporting/server/test_helpers/create_mock_browserdriverfactory.ts +++ b/x-pack/plugins/reporting/server/test_helpers/create_mock_browserdriverfactory.ts @@ -6,7 +6,6 @@ */ import moment from 'moment'; -import { Page } from 'puppeteer'; import * as Rx from 'rxjs'; import { ReportingCore } from '..'; import { chromium, HeadlessChromiumDriver, HeadlessChromiumDriverFactory } from '../browsers'; @@ -127,7 +126,7 @@ export const createMockBrowserDriverFactory = async ( const binaryPath = '/usr/local/share/common/secure/super_awesome_binary'; const mockBrowserDriverFactory = chromium.createDriverFactory(core, binaryPath, logger); - const mockPage = { setViewport: () => {} } as unknown as Page; + const mockPage = { setViewport: () => {} } as unknown; const mockBrowserDriver = new HeadlessChromiumDriver(core, mockPage, { inspect: true, networkPolicy: captureConfig.networkPolicy, diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 5053b78d5002d..dcb48cdc8a971 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -20720,9 +20720,6 @@ "xpack.reporting.screencapture.noElements": "ビジュアライゼーションパネルのページを読み取る間にエラーが発生しました:パネルが見つかりませんでした。", "xpack.reporting.screencapture.readVisualizationsError": "ビジュアライゼーションパネル情報のページを読み取ろうとしたときにエラーが発生しました:{error}", "xpack.reporting.screencapture.renderErrorsFound": "{count}件のエラーメッセージが見つかりました。詳細については、レポートオブジェクトを参照してください。", - "xpack.reporting.screencapture.renderIsComplete": "レンダリングが完了しました", - "xpack.reporting.screencapture.waitingForRenderComplete": "レンダリングの完了を待っています", - "xpack.reporting.screencapture.waitingForRenderedElements": "レンダリングされた {itemsCount} 個の要素が DOM に入るのを待っています", "xpack.reporting.screenCapturePanelContent.canvasLayoutHelpText": "枠線とフッターロゴを削除", "xpack.reporting.screenCapturePanelContent.canvasLayoutLabel": "全ページレイアウト", "xpack.reporting.screenCapturePanelContent.optimizeForPrintingHelpText": "複数のページを使用します。ページごとに最大2のビジュアライゼーションが表示されます", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index d3797ef12e954..d8713b16e3136 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -21020,9 +21020,6 @@ "xpack.reporting.screencapture.noElements": "读取页面以获取可视化面板时发生了错误:未找到任何面板。", "xpack.reporting.screencapture.readVisualizationsError": "尝试读取页面以获取可视化面板信息时发生错误:{error}", "xpack.reporting.screencapture.renderErrorsFound": "找到 {count} 条错误消息。请参阅报告对象了解更多信息。", - "xpack.reporting.screencapture.renderIsComplete": "渲染已完成", - "xpack.reporting.screencapture.waitingForRenderComplete": "正在等候渲染完成", - "xpack.reporting.screencapture.waitingForRenderedElements": "正在等候 {itemsCount} 个已渲染元素进入 DOM", "xpack.reporting.screenCapturePanelContent.canvasLayoutHelpText": "删除边框和页脚徽标", "xpack.reporting.screenCapturePanelContent.canvasLayoutLabel": "全页面布局", "xpack.reporting.screenCapturePanelContent.optimizeForPrintingHelpText": "使用多页,每页最多显示 2 个可视化", diff --git a/yarn.lock b/yarn.lock index 0cda939732d0c..d782a63dde8a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10307,6 +10307,13 @@ cross-env@^6.0.3: dependencies: cross-spawn "^7.0.0" +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-spawn@7.0.3, cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -11242,13 +11249,6 @@ debug@4.1.1: dependencies: ms "^2.1.1" -debug@4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" - integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== - dependencies: - ms "2.1.2" - debug@4.3.2: version "4.3.2" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" @@ -11675,16 +11675,16 @@ detective@^5.0.2, detective@^5.2.0: defined "^1.0.0" minimist "^1.1.1" +devtools-protocol@0.0.1045489: + version "0.0.1045489" + resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.1045489.tgz#f959ad560b05acd72d55644bc3fb8168a83abf28" + integrity sha512-D+PTmWulkuQW4D1NTiCRCFxF7pQPn0hgp4YyX4wAQ6xYXKOadSWPR3ENGDQ47MW/Ewc9v2rpC/UEEGahgBYpSQ== + devtools-protocol@0.0.818844: version "0.0.818844" resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.818844.tgz#d1947278ec85b53e4c8ca598f607a28fa785ba9e" integrity sha512-AD1hi7iVJ8OD0aMLQU5VK0XH9LDlA1+BcPIgrAxPfaibx2DbWucuyOhc4oyQCbnvDDO68nN6/LcKfqTP343Jjg== -devtools-protocol@0.0.901419: - version "0.0.901419" - resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.901419.tgz#79b5459c48fe7e1c5563c02bd72f8fec3e0cebcd" - integrity sha512-4INMPwNm9XRpBukhNbF7OB6fNTTCaI8pzy/fXg0xQzAy5h3zL1P8xT3QazgKqBrb/hAYwIBizqDBZ7GtJE74QQ== - dezalgo@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.3.tgz#7f742de066fc748bc8db820569dddce49bf0d456" @@ -15602,6 +15602,14 @@ https-proxy-agent@5.0.0, https-proxy-agent@^5.0.0: agent-base "6" debug "4" +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" + https-proxy-agent@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz#702b71fb5520a132a66de1f67541d9e62154d82b" @@ -20042,7 +20050,7 @@ node-emoji@^1.10.0: dependencies: lodash.toarray "^4.4.0" -node-fetch@2.6.1, node-fetch@^1.0.1, node-fetch@^2.3.0, node-fetch@^2.6.1, node-fetch@^2.6.7: +node-fetch@2.6.7, node-fetch@^1.0.1, node-fetch@^2.3.0, node-fetch@^2.6.1, 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== @@ -21475,13 +21483,6 @@ pixelmatch@^5.3.0: dependencies: pngjs "^6.0.0" -pkg-dir@4.2.0, pkg-dir@^4.1.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@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" @@ -21496,6 +21497,13 @@ pkg-dir@^3.0.0: dependencies: find-up "^3.0.0" +pkg-dir@^4.1.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@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760" @@ -22268,21 +22276,16 @@ process@^0.11.10, process@~0.11.0: resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= -progress@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.1.tgz#c9242169342b1c29d275889c95734621b1952e31" - integrity sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg== +progress@2.0.3, progress@^2.0.0, progress@^2.0.1, 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== progress@^1.1.8: version "1.1.8" resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" integrity sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74= -progress@^2.0.0, progress@^2.0.1, 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" @@ -22529,23 +22532,22 @@ pupa@^2.1.1: dependencies: escape-goat "^2.0.0" -puppeteer@^10.2.0: - version "10.4.0" - resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-10.4.0.tgz#a6465ff97fda0576c4ac29601406f67e6fea3dc7" - integrity sha512-2cP8mBoqnu5gzAVpbZ0fRaobBWZM8GEUF4I1F6WbgHrKV/rz7SX8PG2wMymZgD0wo0UBlg2FBPNxlF/xlqW6+w== +puppeteer@18.1.0: + version "18.1.0" + resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-18.1.0.tgz#7fa53b29f87dfb3192d415f38a46e35b107ec907" + integrity sha512-2RCVWIF+pZOSfksWlQU0Hh6CeUT5NYt66CDDgRyuReu6EvBAk1y+/Q7DuzYNvGChSecGMb7QPN0hkxAa3guAog== dependencies: - debug "4.3.1" - devtools-protocol "0.0.901419" + cross-fetch "3.1.5" + debug "4.3.4" + devtools-protocol "0.0.1045489" extract-zip "2.0.1" - https-proxy-agent "5.0.0" - node-fetch "2.6.1" - pkg-dir "4.2.0" - progress "2.0.1" + https-proxy-agent "5.0.1" + progress "2.0.3" proxy-from-env "1.1.0" rimraf "3.0.2" - tar-fs "2.0.0" - unbzip2-stream "1.3.3" - ws "7.4.6" + tar-fs "2.1.1" + unbzip2-stream "1.4.3" + ws "8.9.0" puppeteer@^5.3.1: version "5.5.0" @@ -26551,17 +26553,7 @@ tape@^5.0.1: string.prototype.trim "^1.2.1" through "^2.3.8" -tar-fs@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.0.0.tgz#677700fc0c8b337a78bee3623fdc235f21d7afad" - integrity sha512-vaY0obB6Om/fso8a8vakQBzwholQ7v5+uy+tF3Ozvxv1KNezmVQAiWtcNmMHFSFPqL3dJA8ha6gdtFbfX9mcxA== - dependencies: - chownr "^1.1.1" - mkdirp "^0.5.1" - pump "^3.0.0" - tar-stream "^2.0.0" - -tar-fs@^2.0.0, tar-fs@^2.1.1: +tar-fs@2.1.1, tar-fs@^2.0.0, 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== @@ -27473,15 +27465,7 @@ unbox-primitive@^1.0.1: has-symbols "^1.0.2" which-boxed-primitive "^1.0.2" -unbzip2-stream@1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.3.3.tgz#d156d205e670d8d8c393e1c02ebd506422873f6a" - integrity sha512-fUlAF7U9Ah1Q6EieQ4x4zLNejrRvDWUYmxXUpN3uziFYCHapjWFaCAnreY9bGgxzaMCFAPPpYNng57CypwJVhg== - dependencies: - buffer "^5.2.1" - through "^2.3.8" - -unbzip2-stream@^1.3.3: +unbzip2-stream@1.4.3, unbzip2-stream@^1.3.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== @@ -29322,10 +29306,10 @@ write-pkg@^4.0.0: type-fest "^0.4.1" write-json-file "^3.2.0" -ws@7.4.6, ws@^7.2.3: - version "7.4.6" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" - integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== +ws@8.9.0: + version "8.9.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.9.0.tgz#2a994bb67144be1b53fe2d23c53c028adeb7f45e" + integrity sha512-Ja7nszREasGaYUYCI2k4lCKIRTt+y7XuqVoHR44YpI49TtryyqbqvDMn5eqfW7e6HzTukDRIsXqzVHScqRcafg== ws@>=8.7.0: version "8.8.0" @@ -29339,6 +29323,11 @@ ws@^6.1.2, ws@^6.2.1: dependencies: async-limiter "~1.0.0" +ws@^7.2.3: + version "7.4.6" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" + integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== + ws@^7.4.6: version "7.5.5" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.5.tgz#8b4bc4af518cfabd0473ae4f99144287b33eb881"