From d84eda1063394a7fbfe4a936becca5d21c1e2d45 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Wed, 18 Sep 2024 16:07:29 -0400 Subject: [PATCH 1/5] [Uptime] Delete dead code (#193339) ## Summary Removes code that is unused from the Uptime plugin. --- .../uptime/common/constants/data_filters.ts | 12 ------ .../uptime/common/field_names.ts | 22 ----------- .../common/formatters/format_space_name.ts | 13 ------- .../uptime/common/formatters/index.ts | 8 ---- .../uptime/common/rules/status_rule.ts | 12 ------ .../uptime/common/utils/t_enum.ts | 38 ------------------- .../legacy_uptime/lib/helper/get_title.ts | 15 -------- .../lib/helper/spy_use_fetcher.ts | 32 ---------------- .../translations/translations/fr-FR.json | 1 - .../translations/translations/ja-JP.json | 1 - .../translations/translations/zh-CN.json | 1 - 11 files changed, 155 deletions(-) delete mode 100644 x-pack/plugins/observability_solution/uptime/common/constants/data_filters.ts delete mode 100644 x-pack/plugins/observability_solution/uptime/common/field_names.ts delete mode 100644 x-pack/plugins/observability_solution/uptime/common/formatters/format_space_name.ts delete mode 100644 x-pack/plugins/observability_solution/uptime/common/formatters/index.ts delete mode 100644 x-pack/plugins/observability_solution/uptime/common/rules/status_rule.ts delete mode 100644 x-pack/plugins/observability_solution/uptime/common/utils/t_enum.ts delete mode 100644 x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/get_title.ts delete mode 100644 x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/spy_use_fetcher.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/constants/data_filters.ts b/x-pack/plugins/observability_solution/uptime/common/constants/data_filters.ts deleted file mode 100644 index d7ca3b43376b9..0000000000000 --- a/x-pack/plugins/observability_solution/uptime/common/constants/data_filters.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * 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. - */ - -export const STEP_END_FILTER = { - terms: { - 'synthetics.type': ['step/end'], - }, -}; diff --git a/x-pack/plugins/observability_solution/uptime/common/field_names.ts b/x-pack/plugins/observability_solution/uptime/common/field_names.ts deleted file mode 100644 index 0407fad341d8a..0000000000000 --- a/x-pack/plugins/observability_solution/uptime/common/field_names.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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. - */ - -export const AGENT_NAME = 'agent.name'; -export const MONITOR_ID = 'monitor.id'; -export const MONITOR_NAME = 'monitor.name'; -export const MONITOR_TYPE = 'monitor.type'; -export const URL_FULL = 'url.full'; -export const URL_PORT = 'url.port'; -export const OBSERVER_GEO_NAME = 'observer.geo.name'; -export const ERROR_MESSAGE = 'error.message'; -export const STATE_ID = 'monitor.state.id'; - -export const CERT_COMMON_NAME = 'tls.server.x509.subject.common_name'; -export const CERT_ISSUER_NAME = 'tls.server.x509.issuer.common_name'; -export const CERT_VALID_NOT_AFTER = 'tls.server.x509.not_after'; -export const CERT_VALID_NOT_BEFORE = 'tls.server.x509.not_before'; -export const CERT_HASH_SHA256 = 'tls.server.hash.sha256'; diff --git a/x-pack/plugins/observability_solution/uptime/common/formatters/format_space_name.ts b/x-pack/plugins/observability_solution/uptime/common/formatters/format_space_name.ts deleted file mode 100644 index 88beb7cda1407..0000000000000 --- a/x-pack/plugins/observability_solution/uptime/common/formatters/format_space_name.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * 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. - */ -/* Formats kibana space id into a valid Fleet-compliant data-stream namespace */ -import { INVALID_NAMESPACE_CHARACTERS } from '@kbn/fleet-plugin/common'; - -export const formatKibanaNamespace = (spaceId: string) => { - const namespaceRegExp = new RegExp(INVALID_NAMESPACE_CHARACTERS, 'g'); - return spaceId.replace(namespaceRegExp, '_'); -}; diff --git a/x-pack/plugins/observability_solution/uptime/common/formatters/index.ts b/x-pack/plugins/observability_solution/uptime/common/formatters/index.ts deleted file mode 100644 index 17c9567043197..0000000000000 --- a/x-pack/plugins/observability_solution/uptime/common/formatters/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * 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. - */ - -export { formatKibanaNamespace } from './format_space_name'; diff --git a/x-pack/plugins/observability_solution/uptime/common/rules/status_rule.ts b/x-pack/plugins/observability_solution/uptime/common/rules/status_rule.ts deleted file mode 100644 index 375e0c0dd08c1..0000000000000 --- a/x-pack/plugins/observability_solution/uptime/common/rules/status_rule.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * 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 { schema, TypeOf } from '@kbn/config-schema'; - -export const StatusRulePramsSchema = schema.object({}); - -export type StatusRuleParams = TypeOf; diff --git a/x-pack/plugins/observability_solution/uptime/common/utils/t_enum.ts b/x-pack/plugins/observability_solution/uptime/common/utils/t_enum.ts deleted file mode 100644 index e00a51dbdf438..0000000000000 --- a/x-pack/plugins/observability_solution/uptime/common/utils/t_enum.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 * as t from 'io-ts'; - -/** - * This utility function can be used to turn a TypeScript enum into a io-ts codec. - * - * @example - * import { PathReporter } from "io-ts/lib/PathReporter"; - * - * enum Thing { - * FOO = "foo", - * BAR = "bar" - * } - * - * const ThingCodec = tEnum("Thing", Thing); - * - * console.log(PathReporter.report(ThingCodec.decode('invalidvalue'))); - * // prints [ 'Invalid value "invalidvalue" supplied to : Thing' ] - * console.log(PathReporter.report(ThingCodec.decode('foo'))); - * // prints [ 'No errors!' ] - */ -export function tEnum(enumName: string, theEnum: Record) { - const isEnumValue = (input: unknown): input is EnumType => - Object.values(theEnum).includes(input); - - return new t.Type( - enumName, - isEnumValue, - (input, context) => (isEnumValue(input) ? t.success(input) : t.failure(input, context)), - t.identity - ); -} diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/get_title.ts b/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/get_title.ts deleted file mode 100644 index d2ad0dd3296b3..0000000000000 --- a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/get_title.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * 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 { i18n } from '@kbn/i18n'; - -export const getTitle = (name?: string) => { - const appName = i18n.translate('xpack.uptime.title', { - defaultMessage: 'Uptime', - }); - return `${appName} ${name ? '| ' + name : ''} - Kibana`; -}; diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/spy_use_fetcher.ts b/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/spy_use_fetcher.ts deleted file mode 100644 index e1f43ee0b003e..0000000000000 --- a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/spy_use_fetcher.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 * as observabilitySharedPublic from '@kbn/observability-shared-plugin/public'; - -jest.mock('@kbn/observability-shared-plugin/public', () => { - const originalModule = jest.requireActual('@kbn/observability-shared-plugin/public'); - - return { - ...originalModule, - useFetcher: jest.fn().mockReturnValue({ - data: null, - status: 'success', - }), - useTrackPageview: jest.fn(), - }; -}); - -export function spyOnUseFetcher( - payload: unknown, - status = observabilitySharedPublic.FETCH_STATUS.SUCCESS -) { - return jest.spyOn(observabilitySharedPublic, 'useFetcher').mockReturnValue({ - status, - data: payload, - refetch: () => null, - }); -} diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 5a4660f362987..95879f64100d5 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -47276,7 +47276,6 @@ "xpack.uptime.synthetics.waterfallChart.labels.timings.ssl": "TLS", "xpack.uptime.synthetics.waterfallChart.labels.timings.wait": "En attente (TTFB)", "xpack.uptime.syntheticsFeatureCatalogueTitle": "Synthetics", - "xpack.uptime.title": "Uptime", "xpack.uptime.tls.ageExpression.description": "ou antérieur à (jours) : ", "xpack.uptime.tls.criteriaExpression.value": "le moniteur correspondant", "xpack.uptime.tls.expirationExpression.description": "possède un certificat expirant dans (jours) : ", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index c112b137c2e2b..887063f865d5a 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -47258,7 +47258,6 @@ "xpack.uptime.synthetics.waterfallChart.labels.timings.ssl": "TLS", "xpack.uptime.synthetics.waterfallChart.labels.timings.wait": "待機中(TTFB)", "xpack.uptime.syntheticsFeatureCatalogueTitle": "Synthetics", - "xpack.uptime.title": "アップタイム", "xpack.uptime.tls.ageExpression.description": "または次の日数を経過:", "xpack.uptime.tls.criteriaExpression.value": "一致するモニター", "xpack.uptime.tls.expirationExpression.description": "次の日数以内に有効期限切れになる証明書があります:", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 30d822480bdff..13100c9cabde1 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -47309,7 +47309,6 @@ "xpack.uptime.synthetics.waterfallChart.labels.timings.ssl": "TLS", "xpack.uptime.synthetics.waterfallChart.labels.timings.wait": "等待中 (TTFB)", "xpack.uptime.syntheticsFeatureCatalogueTitle": "Synthetics", - "xpack.uptime.title": "运行时间", "xpack.uptime.tls.ageExpression.description": "或早于以下天数:", "xpack.uptime.tls.criteriaExpression.value": "正在匹配监测", "xpack.uptime.tls.expirationExpression.description": "具有的证书将在以下天数内到期:", From 91ca8ab95c01f88ea2d79779f3670c88bf269da0 Mon Sep 17 00:00:00 2001 From: "Eyo O. Eyo" <7893459+eokoneyo@users.noreply.github.com> Date: Wed, 18 Sep 2024 22:26:44 +0200 Subject: [PATCH 2/5] [Reporting] update puppeteer to version 23.3.1 (#192345) ## Summary Update for puppeteer, the following changeset updates puppeteer to version `23.3.1`. The chromium version required for this version of puppeteer is `128.0.6613.137` from revision `1331488`, as such the chromium binary included for windows and darwin platforms either match or were the closest revision to the expectation. The linux headless binary was built from commit `fe621c5aa2d6b987e964fb1b5066833da5fb613d` of the same revision. _**N.B.**_ Puppeteer 23.0.0 is earmarked as containing breaking changes see [here](https://github.com/puppeteer/puppeteer/blob/abda5dcc9912f4fa2c5a566403108db783f48538/packages/puppeteer-core/CHANGELOG.md#2300-2024-08-07), this PR considers the outlined changes and makes relevant adjustments so reporting continues working as is. ### How to verify linux headless build - clone the following repo https://github.com/tsullivan/kibana-dev-docker - pull this particular PR - follow the steps outlined in the repo, replacing any occurrence of `kibana--SNAPSHOT-linux-aarch64.tar.gz` from the repo above's step with the output of running build on this changeset. - before running step 4, modify the `kibana.yml` file from the `kibana-dev-docker` repo and include the following so we might be able to verify the version of chromium running; ```yaml logging.loggers: - name: plugins.reporting level: debug ``` - complete the steps outlined in the README, you'll have a linux distro of kibana running on port `5601` - Attempt creating exports of PDF and PNG reports, in dashboard, canvas, and visualizations, on report creation attempt we would see a log output that prints out the chromium version exactly matching this; Screenshot 2024-09-18 at 14 50 19 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine --- package.json | 2 +- .../kbn-screenshotting-server/src/paths.ts | 34 ++++----- x-pack/build_chromium/linux/args.gn | 2 +- .../server/browsers/chromium/driver.ts | 25 +++--- .../browsers/chromium/driver_factory/index.ts | 2 +- yarn.lock | 76 ++++++++++--------- 6 files changed, 76 insertions(+), 65 deletions(-) diff --git a/package.json b/package.json index 29ac209a76651..45b75f8112d08 100644 --- a/package.json +++ b/package.json @@ -1184,7 +1184,7 @@ "pretty-ms": "6.0.0", "prop-types": "^15.8.1", "proxy-from-env": "1.0.0", - "puppeteer": "22.13.1", + "puppeteer": "23.3.1", "query-string": "^6.13.2", "rbush": "^3.0.1", "re-resizable": "^6.9.9", diff --git a/packages/kbn-screenshotting-server/src/paths.ts b/packages/kbn-screenshotting-server/src/paths.ts index f125ba1b74860..9e8200c0839ab 100644 --- a/packages/kbn-screenshotting-server/src/paths.ts +++ b/packages/kbn-screenshotting-server/src/paths.ts @@ -46,10 +46,10 @@ export class ChromiumArchivePaths { platform: 'darwin', architecture: 'x64', archiveFilename: 'chrome-mac.zip', - archiveChecksum: 'fa8004f3c8c5574c089c901e48429d1b01720bf3dd25e05ac56c41d0ab470c10', - binaryChecksum: '56f25cb6881e5c2b1aac0d8e87630517d1af8effdc9319d35f872add048df1ca', + archiveChecksum: '0a3d18efd00b3406f66139a673616b4b2b4b00323776678cb82295996f5a6733', + binaryChecksum: '8bcdaa973ee11110f6b70eaac2418fda3bb64446cf37f964fce331cdc8907a20', binaryRelativePath: 'chrome-mac/Chromium.app/Contents/MacOS/Chromium', - revision: 1300317, // 1300313 is not available for Mac_x64 + revision: 1331485, // 1331488 is not available for Mac_x64 location: 'common', archivePath: 'Mac', isPreInstalled: false, @@ -58,10 +58,10 @@ export class ChromiumArchivePaths { platform: 'darwin', architecture: 'arm64', archiveFilename: 'chrome-mac.zip', - archiveChecksum: 'bea49fd3ccd6aaccd7cdc4df38306f002a2934aaa2c044f3b5a3272b31ec77ca', - binaryChecksum: '4c55d9e47deb1179c377c9785afdcdb5f3d3f351bff62b414d43e32ff195bd55', + archiveChecksum: '426eddf16acb88b9446a91de53cc4364c7d487414248f33e30f68cf488cea0c0', + binaryChecksum: '827931739bfdd2b6790a81d5ade8886c159cd051581d79b84d1ede447293e9cf', binaryRelativePath: 'chrome-mac/Chromium.app/Contents/MacOS/Chromium', - revision: 1300314, // 1300313 is not available for Mac_Arm + revision: 1331488, location: 'common', archivePath: 'Mac_Arm', isPreInstalled: false, @@ -69,22 +69,22 @@ export class ChromiumArchivePaths { { platform: 'linux', architecture: 'x64', - archiveFilename: 'chromium-5b5d829-locales-linux_x64.zip', - archiveChecksum: '799e8fd5f47ea70b8a3972d39b2617c9cbebc7fc433a89251dae312a7c77534b', - binaryChecksum: '216b8f7ff9b41e985397342c2df54e4f8e07a01a3b8a929f39b9a10931d26ff5', + archiveFilename: 'chromium-fe621c5-locales-linux_x64.zip', + archiveChecksum: '12ce2e0eac184072dfcbc7a267328e3eb7fbe10a682997f4111c0378f2397341', + binaryChecksum: '670481cfa8db209401106cd23051009d390c03608724d0822a12c8c0a92b4c25', binaryRelativePath: 'headless_shell-linux_x64/headless_shell', - revision: 1300313, + revision: 1331488, location: 'custom', isPreInstalled: true, }, { platform: 'linux', architecture: 'arm64', - archiveFilename: 'chromium-5b5d829-locales-linux_arm64.zip', - archiveChecksum: '961e20c45c61f8e948efdc4128bb17c23217bbcb28537f270ccf5bf0826981e7', - binaryChecksum: 'fc4027fb6b1c96bef9374d5d9f791097fae2ec2ddc4e0134167075bd52d1458f', + archiveFilename: 'chromium-fe621c5-locales-linux_arm64.zip', + archiveChecksum: 'f7333eaff5235046c8775f0c1a0b7395b7ebc2e054ea638710cf511c4b6f9daf', + binaryChecksum: '8a3a3371b3d04f4b0880b137a3611c223e0d8e65a218943cb7be1ec4a91f5e35', binaryRelativePath: 'headless_shell-linux_arm64/headless_shell', - revision: 1300313, + revision: 1331488, location: 'custom', isPreInstalled: true, }, @@ -92,10 +92,10 @@ export class ChromiumArchivePaths { platform: 'win32', architecture: 'x64', archiveFilename: 'chrome-win.zip', - archiveChecksum: '27a2ed1473cefc6f48ff5665faa1fbcc69ef5be47ee21777a60e87c8379fdd93', - binaryChecksum: 'd603401a5e6f8bd734b329876e4221a4d24a1999f14df6e32eeb5e6a72520d96', + archiveChecksum: 'fa62be702f55f37e455bab4291c59ceb40e81e1922d30cf9453a4ee176b909bc', + binaryChecksum: '1345e66583bad1a1f16885f381d1173de8bf931487da9ba155e1b58bf23b2c66', binaryRelativePath: path.join('chrome-win', 'chrome.exe'), - revision: 1300320, // 1300313 is not available for win32 + revision: 1331487, // 1331488 is not available for win32 location: 'common', archivePath: 'Win', isPreInstalled: true, diff --git a/x-pack/build_chromium/linux/args.gn b/x-pack/build_chromium/linux/args.gn index 01af3bf766f7b..a7d5713b92cd0 100644 --- a/x-pack/build_chromium/linux/args.gn +++ b/x-pack/build_chromium/linux/args.gn @@ -17,7 +17,7 @@ v8_symbol_level = 0 enable_ink = false rtc_build_examples = false angle_build_tests = false -enable_screen_ai_service = false +use_fake_screen_ai = true enable_vr = false # Please, consult @elastic/kibana-security before changing/removing this option. diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/driver.ts b/x-pack/plugins/screenshotting/server/browsers/chromium/driver.ts index 02d611f9ca00f..3c199b2916b30 100644 --- a/x-pack/plugins/screenshotting/server/browsers/chromium/driver.ts +++ b/x-pack/plugins/screenshotting/server/browsers/chromium/driver.ts @@ -244,15 +244,17 @@ export class HeadlessChromiumDriver { if (error) { await this.injectScreenshottingErrorHeader(error, getPrintLayoutSelectors().screenshot); } - return this.page.pdf({ - format: 'a4', - preferCSSPageSize: true, - scale: 1, - landscape: false, - displayHeaderFooter: true, - headerTemplate: await getHeaderTemplate({ title }), - footerTemplate: await getFooterTemplate({ logo }), - }); + return Buffer.from( + await this.page.pdf({ + format: 'a4', + preferCSSPageSize: true, + scale: 1, + landscape: false, + displayHeaderFooter: true, + headerTemplate: await getHeaderTemplate({ title }), + footerTemplate: await getFooterTemplate({ logo }), + }) + ); } /* @@ -272,6 +274,7 @@ export class HeadlessChromiumDriver { } const { boundingClientRect, scroll } = elementPosition; + const screenshot = await this.page.screenshot({ clip: { x: boundingClientRect.left + scroll.x, @@ -282,8 +285,8 @@ export class HeadlessChromiumDriver { captureBeyondViewport: false, // workaround for an internal resize. See: https://github.com/puppeteer/puppeteer/issues/7043 }); - if (Buffer.isBuffer(screenshot)) { - return screenshot; + if (screenshot.byteLength) { + return Buffer.from(screenshot); } if (typeof screenshot === 'string') { diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/index.ts b/x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/index.ts index f6015c319cc0a..d8503b70ad963 100644 --- a/x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/index.ts +++ b/x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/index.ts @@ -150,7 +150,7 @@ export class HeadlessChromiumDriverFactory { pipe: !this.config.browser.chromium.inspect, userDataDir: this.userDataDir, executablePath: this.binaryPath, - ignoreHTTPSErrors: true, + acceptInsecureCerts: true, handleSIGHUP: false, args: chromiumArgs, defaultViewport: viewport, diff --git a/yarn.lock b/yarn.lock index c08c6d858a69e..52bd946a7ef13 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8365,16 +8365,16 @@ resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA= -"@puppeteer/browsers@2.2.4": - version "2.2.4" - resolved "https://registry.yarnpkg.com/@puppeteer/browsers/-/browsers-2.2.4.tgz#4307245d881aa5a79743050be66568bad0f6ffbb" - integrity sha512-BdG2qiI1dn89OTUUsx2GZSpUzW+DRffR1wlMJyKxVHYrhnKoELSDxDd+2XImUkuWPEKk76H5FcM/gPFrEK1Tfw== +"@puppeteer/browsers@2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@puppeteer/browsers/-/browsers-2.4.0.tgz#a0dd0f4e381e53f509109ae83b891db5972750f5" + integrity sha512-x8J1csfIygOwf6D6qUAZ0ASk3z63zPb7wkNeHRerCMh82qWKUrOgkuP005AJC8lDL6/evtXETGEJVcwykKT4/g== dependencies: - debug "^4.3.5" + debug "^4.3.6" extract-zip "^2.0.1" progress "^2.0.3" proxy-agent "^6.4.0" - semver "^7.6.2" + semver "^7.6.3" tar-fs "^3.0.6" unbzip2-stream "^1.4.3" yargs "^17.7.2" @@ -14254,10 +14254,10 @@ chromedriver@^128.0.1: proxy-from-env "^1.1.0" tcp-port-used "^1.0.2" -chromium-bidi@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/chromium-bidi/-/chromium-bidi-0.6.1.tgz#533612dd166b7b36a8ba8b90685ad2fa0c98d064" - integrity sha512-kSxJRj0VgtUKz6nmzc2JPfyfJGzwzt65u7PqhPHtgGQUZLF5oG+ST6l6e5ONfStUMAlhSutFCjaGKllXZa16jA== +chromium-bidi@0.6.5: + version "0.6.5" + resolved "https://registry.yarnpkg.com/chromium-bidi/-/chromium-bidi-0.6.5.tgz#31be98f9ee5c93fa99d240c680518c9293d8c6bb" + integrity sha512-RuLrmzYrxSb0s9SgpB+QN5jJucPduZQ/9SIe76MDxYJuecPW5mxMdacJ1f4EtgiV+R0p3sCkznTMvH0MPGFqjA== dependencies: mitt "3.0.1" urlpattern-polyfill "10.0.0" @@ -15818,12 +15818,12 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.9: dependencies: ms "2.0.0" -debug@4, debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@^4.3.5: - version "4.3.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.6.tgz#2ab2c38fbaffebf8aa95fdfe6d88438c7a13c52b" - integrity sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg== +debug@4, debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@^4.3.5, debug@^4.3.6, debug@^4.3.7: + version "4.3.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52" + integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== dependencies: - ms "2.1.2" + ms "^2.1.3" debug@4.3.1: version "4.3.1" @@ -16284,10 +16284,10 @@ detective@^5.0.2: defined "^1.0.0" minimist "^1.1.1" -devtools-protocol@0.0.1299070: - version "0.0.1299070" - resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.1299070.tgz#b3e4cf0b678a46f0f907ae6e07e03ad3a53c00df" - integrity sha512-+qtL3eX50qsJ7c+qVyagqi7AWMoQCBGNfoyJZMwm/NSXVqLYbuitrWEEIzxfUmTNy7//Xe8yhMmQ+elj3uAqSg== +devtools-protocol@0.0.1330662: + version "0.0.1330662" + resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.1330662.tgz#400fe703c2820d6b2d9ebdd1785934310152373e" + integrity sha512-pzh6YQ8zZfz3iKlCvgzVCu22NdpZ8hNmwU6WnQjNVquh0A9iVosPtNLWDwaWVGyrntQlltPFztTMK5Cg6lfCuw== dezalgo@^1.0.0, dezalgo@^1.0.4: version "1.0.4" @@ -26303,26 +26303,29 @@ 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@22.13.1: - version "22.13.1" - resolved "https://registry.yarnpkg.com/puppeteer-core/-/puppeteer-core-22.13.1.tgz#3ba03e5ebd98bbbd86e465864cf00314e07309de" - integrity sha512-NmhnASYp51QPRCAf9n0OPxuPMmzkKd8+2sB9Q+BjwwCG25gz6iuNc3LQDWa+cH2tyivmJppLhNNFt6Q3HmoOpw== +puppeteer-core@23.3.1: + version "23.3.1" + resolved "https://registry.yarnpkg.com/puppeteer-core/-/puppeteer-core-23.3.1.tgz#b93d825e586f5f7dc268128a31a31c62bbe378ae" + integrity sha512-m5gTpITEqqpSgAvPUI/Ch9igh5sNJV+BVVbqQMzqirRDVHDCkLGHaydEQZx2NZvSXdwCFrIV///cpSlX/uD0Sg== dependencies: - "@puppeteer/browsers" "2.2.4" - chromium-bidi "0.6.1" - debug "^4.3.5" - devtools-protocol "0.0.1299070" + "@puppeteer/browsers" "2.4.0" + chromium-bidi "0.6.5" + debug "^4.3.7" + devtools-protocol "0.0.1330662" + typed-query-selector "^2.12.0" ws "^8.18.0" -puppeteer@22.13.1: - version "22.13.1" - resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-22.13.1.tgz#f8e4217919b438f18adb754e9d8414fef58fb3de" - integrity sha512-PwXLDQK5u83Fm5A7TGMq+9BR7iHDJ8a3h21PSsh/E6VfhxiKYkU7+tvGZNSCap6k3pCNDd9oNteVBEctcBalmQ== +puppeteer@23.3.1: + version "23.3.1" + resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-23.3.1.tgz#830ac4b2c264ae4a610b79be77aff23bb13efa2c" + integrity sha512-BxkuJyCv46ZKW8KEHiVMHgHEC89jKK9FffReWjbw1IfBUmNx+6JIZyqOtaJeSwyolTdVqqb5fiPiXflKeH3dKQ== dependencies: - "@puppeteer/browsers" "2.2.4" + "@puppeteer/browsers" "2.4.0" + chromium-bidi "0.6.5" cosmiconfig "^9.0.0" - devtools-protocol "0.0.1299070" - puppeteer-core "22.13.1" + devtools-protocol "0.0.1330662" + puppeteer-core "23.3.1" + typed-query-selector "^2.12.0" pure-rand@^6.0.0: version "6.0.2" @@ -30908,6 +30911,11 @@ typed-array-length@^1.0.6: is-typed-array "^1.1.13" possible-typed-array-names "^1.0.0" +typed-query-selector@^2.12.0: + version "2.12.0" + resolved "https://registry.yarnpkg.com/typed-query-selector/-/typed-query-selector-2.12.0.tgz#92b65dbc0a42655fccf4aeb1a08b1dddce8af5f2" + integrity sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg== + typedarray-to-buffer@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" From d4ee1ca64442a46dc24578620d0ff318a9fdc7c8 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Wed, 18 Sep 2024 16:51:52 -0400 Subject: [PATCH 3/5] [Synthetics] Remove dead code (#193335) ## Summary Gets rid of unused files and some types, constants, etc. that are no longer referenced in production code. --- .../common/translations/translations.ts | 38 -------- .../components/alerts/query_bar.tsx | 85 ----------------- .../components/certificates/index.ts | 3 + .../components/common/links/view_errors.tsx | 31 ------- .../getting_started/simple_monitor_form.tsx | 7 -- .../management/monitor_list_table/tags.tsx | 47 ---------- .../empty_state/empty_state_error.tsx | 58 ------------ .../overview/overview/use_infinite_scroll.ts | 91 ------------------- .../components/not_found/not_found.tsx | 39 -------- .../step_screenshot/screenshot_link.tsx | 47 ---------- .../public/apps/synthetics/routes.tsx | 4 +- .../synthetics/utils/formatting/format.ts | 2 +- .../testing/__mocks__/screenshot_ref.mock.ts | 44 --------- .../synthetics/utils/testing/rtl_helpers.tsx | 29 ------ .../utils/testing/spy_use_fetcher.ts | 32 ------- .../utils/url_params/parse_is_paused.test.ts | 22 ----- .../utils/url_params/parse_is_paused.ts | 17 ---- .../utils/url_params/parse_url_int.test.ts | 25 ----- .../utils/url_params/parse_url_int.ts | 11 --- .../server/alert_rules/tls_rule/types.ts | 23 ----- ..._project_code.ts => unzip_project_code.ts} | 0 .../routes/monitor_cruds/inspect_monitor.ts | 2 +- .../routes/pings/journey_screenshot_blocks.ts | 4 +- .../synthetics/server/telemetry/constants.ts | 2 - .../translations/translations/fr-FR.json | 17 ---- .../translations/translations/ja-JP.json | 17 ---- .../translations/translations/zh-CN.json | 17 ---- 27 files changed, 8 insertions(+), 706 deletions(-) delete mode 100644 x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/query_bar.tsx delete mode 100644 x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/links/view_errors.tsx delete mode 100644 x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/tags.tsx delete mode 100644 x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/empty_state/empty_state_error.tsx delete mode 100644 x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/use_infinite_scroll.ts delete mode 100644 x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/not_found/not_found.tsx delete mode 100644 x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_screenshot/screenshot_link.tsx delete mode 100644 x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/__mocks__/screenshot_ref.mock.ts delete mode 100644 x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/spy_use_fetcher.ts delete mode 100644 x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/parse_is_paused.test.ts delete mode 100644 x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/parse_is_paused.ts delete mode 100644 x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/parse_url_int.test.ts delete mode 100644 x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/parse_url_int.ts delete mode 100644 x-pack/plugins/observability_solution/synthetics/server/alert_rules/tls_rule/types.ts rename x-pack/plugins/observability_solution/synthetics/server/common/{unzipt_project_code.ts => unzip_project_code.ts} (100%) diff --git a/x-pack/plugins/observability_solution/synthetics/common/translations/translations.ts b/x-pack/plugins/observability_solution/synthetics/common/translations/translations.ts index cbfa5fff3995a..d28771cf213d1 100644 --- a/x-pack/plugins/observability_solution/synthetics/common/translations/translations.ts +++ b/x-pack/plugins/observability_solution/synthetics/common/translations/translations.ts @@ -7,18 +7,6 @@ import { i18n } from '@kbn/i18n'; -export const URL_LABEL = i18n.translate('xpack.synthetics.monitorList.table.url.name', { - defaultMessage: 'Url', -}); - -export const TAGS_LABEL = i18n.translate('xpack.synthetics.monitorList.table.tags.name', { - defaultMessage: 'Tags', -}); - -export const PROJECT_LABEL = i18n.translate('xpack.synthetics.monitorList.table.project.name', { - defaultMessage: 'Project ID', -}); - export const STATUS_UP_LABEL = i18n.translate('xpack.synthetics.monitorList.statusColumn.upLabel', { defaultMessage: 'Up', }); @@ -29,29 +17,3 @@ export const STATUS_DOWN_LABEL = i18n.translate( defaultMessage: 'Down', } ); - -export const STATUS_COMPLETE_LABEL = i18n.translate( - 'xpack.synthetics.monitorList.statusColumn.completeLabel', - { - defaultMessage: 'Complete', - } -); - -export const STATUS_FAILED_LABEL = i18n.translate( - 'xpack.synthetics.monitorList.statusColumn.failedLabel', - { - defaultMessage: 'Failed', - } -); - -export const SECONDS_LABEL = i18n.translate('xpack.synthetics.seconds.label', { - defaultMessage: 'seconds', -}); - -export const SEC_LABEL = i18n.translate('xpack.synthetics.seconds.shortForm.label', { - defaultMessage: 'sec', -}); - -export const MS_LABEL = i18n.translate('xpack.synthetics.millisecond.abbreviation.label', { - defaultMessage: 'ms', -}); diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/query_bar.tsx b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/query_bar.tsx deleted file mode 100644 index f090f807a0fb8..0000000000000 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/query_bar.tsx +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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 React, { useEffect, useState } from 'react'; -import { EuiFlexItem } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { useFetcher } from '@kbn/observability-shared-plugin/public'; -import { SYNTHETICS_INDEX_PATTERN } from '../../../../../common/constants'; -import { ClientPluginsStart } from '../../../../plugin'; - -interface Props { - query: string; - onChange: (query: string) => void; -} -export const isValidKuery = (query: string) => { - if (query === '') { - return true; - } - const listOfOperators = [':', '>=', '=>', '>', '<']; - for (let i = 0; i < listOfOperators.length; i++) { - const operator = listOfOperators[i]; - const qParts = query.trim().split(operator); - if (query.includes(operator) && qParts.length > 1 && qParts[1]) { - return true; - } - } - return false; -}; - -export const AlertQueryBar = ({ query = '', onChange }: Props) => { - const { services } = useKibana(); - - const { - appName, - dataViews, - unifiedSearch: { - ui: { QueryStringInput }, - }, - } = services; - - const [inputVal, setInputVal] = useState(query); - - const { data: dataView } = useFetcher(async () => { - return await dataViews.create({ title: SYNTHETICS_INDEX_PATTERN }); - }, [dataViews]); - - useEffect(() => { - onChange(query); - setInputVal(query); - }, [onChange, query]); - - return ( - - { - setInputVal(queryN?.query as string); - if (isValidKuery(queryN?.query as string)) { - // we want to submit when user clears or paste a complete kuery - onChange(queryN.query as string); - } - }} - onSubmit={(queryN) => { - if (queryN) onChange(queryN.query as string); - }} - query={{ query: inputVal, language: 'kuery' }} - dataTestSubj="xpack.synthetics.alerts.monitorStatus.filterBar" - autoSubmit={true} - disableLanguageSwitcher={true} - isInvalid={!!(inputVal && !query)} - placeholder={i18n.translate('xpack.synthetics.alerts.searchPlaceholder.kql', { - defaultMessage: 'Filter using kql syntax', - })} - appName={appName} - /> - - ); -}; diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/index.ts b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/index.ts index 7cfbdca179d04..29d4478877fc3 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/index.ts +++ b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/index.ts @@ -5,8 +5,11 @@ * 2.0. */ +export * from './cert_refresh_btn'; export * from './cert_monitors'; export * from './cert_search'; export * from './cert_status'; +export * from './certificates'; export * from './certificates_list'; +export * from './certificate_title'; export * from './fingerprint_col'; diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/links/view_errors.tsx b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/links/view_errors.tsx deleted file mode 100644 index e41b2be1a7c11..0000000000000 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/links/view_errors.tsx +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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 { EuiButtonIcon, EuiToolTip } from '@elastic/eui'; -import React from 'react'; -import { i18n } from '@kbn/i18n'; -import { useSyntheticsSettingsContext } from '../../../contexts'; - -export const ErrorsLink = ({ disabled }: { disabled?: boolean }) => { - const { basePath } = useSyntheticsSettingsContext(); - - return ( - - - - ); -}; - -const VIEW_ERRORS = i18n.translate('xpack.synthetics.monitorSummary.viewErrors', { - defaultMessage: 'View errors', -}); diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/getting_started/simple_monitor_form.tsx b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/getting_started/simple_monitor_form.tsx index 1233bb0390c7e..4809491305cd7 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/getting_started/simple_monitor_form.tsx +++ b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/getting_started/simple_monitor_form.tsx @@ -119,13 +119,6 @@ export const WEBSITE_URL_LABEL = i18n.translate( } ); -export const WEBSITE_URL_PLACEHOLDER = i18n.translate( - 'xpack.synthetics.monitorManagement.websiteUrlPlaceholder', - { - defaultMessage: 'Enter a website URL', - } -); - export const WEBSITE_URL_HELP_TEXT = i18n.translate( 'xpack.synthetics.monitorManagement.websiteUrlHelpText', { diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/tags.tsx b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/tags.tsx deleted file mode 100644 index b50d97fcecefa..0000000000000 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/tags.tsx +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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 React, { useState } from 'react'; -import { EuiBadge, EuiBadgeGroup } from '@elastic/eui'; -import { EXPAND_TAGS_LABEL } from './labels'; - -interface Props { - tags: string[]; -} - -export const MonitorTags = ({ tags }: Props) => { - const [toDisplay, setToDisplay] = useState(5); - - const tagsToDisplay = tags.slice(0, toDisplay); - - return ( - - {tagsToDisplay.map((tag) => ( - // filtering only makes sense in monitor list, where we have summary - - {tag} - - ))} - {tags.length > toDisplay && ( - { - setToDisplay(tags.length); - }} - onClickAriaLabel={EXPAND_TAGS_LABEL} - > - +{tags.length - 5} - - )} - - ); -}; diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/empty_state/empty_state_error.tsx b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/empty_state/empty_state_error.tsx deleted file mode 100644 index 3f3a3552446f2..0000000000000 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/empty_state/empty_state_error.tsx +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 React, { Fragment } from 'react'; -import { EuiEmptyPrompt, EuiPanel, EuiTitle, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { IHttpSerializedFetchError } from '../../../../state'; - -interface EmptyStateErrorProps { - errors: IHttpSerializedFetchError[]; -} - -export const EmptyStateError = ({ errors }: EmptyStateErrorProps) => { - const unauthorized = errors.find( - (error) => error?.body?.message && error.body.message.includes('unauthorized') - ); - - return ( - - - - - {unauthorized ? ( -

- {i18n.translate('xpack.synthetics.emptyStateError.notAuthorized', { - defaultMessage: - 'You are not authorized to view Uptime data, please contact your system administrator.', - })} -

- ) : ( -

- {i18n.translate('xpack.synthetics.emptyStateError.title', { - defaultMessage: 'Error', - })} -

- )} - - } - body={ - - {!unauthorized && - errors.map((error) =>

{error.body?.message}

)} -
- } - /> -
-
-
- ); -}; diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/use_infinite_scroll.ts b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/use_infinite_scroll.ts deleted file mode 100644 index e3e1f48d4e520..0000000000000 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/use_infinite_scroll.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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 useThrottle from 'react-use/lib/useThrottle'; -import { useEffect, useState, MutableRefObject } from 'react'; -import useIntersection from 'react-use/lib/useIntersection'; -import { useSelector } from 'react-redux'; -import type { MonitorListSortField } from '../../../../../../../common/runtime_types/monitor_management/sort_field'; -import { useGetUrlParams } from '../../../../hooks'; -import { selectOverviewState } from '../../../../state'; -import { MonitorOverviewItem } from '../../../../../../../common/runtime_types'; - -export const useInfiniteScroll = ({ - intersectionRef, - monitorsSortedByStatus, -}: { - intersectionRef: MutableRefObject; - monitorsSortedByStatus: any; -}) => { - const [page, setPage] = useState(1); - const [loadNextPage, setLoadNextPage] = useState(false); - - const { statusFilter } = useGetUrlParams(); - const { - pageState: { perPage, sortField }, - data: { monitors }, - } = useSelector(selectOverviewState); - - const currentMonitors = getCurrentMonitors({ - monitors, - monitorsSortedByStatus, - perPage, - page, - sortField, - statusFilter, - }); - - const intersection = useIntersection(intersectionRef, { - root: null, - rootMargin: '640px', // Height of 4 rows of monitors, minus the gutters - threshold: 0.1, - }); - const hasIntersected = intersection && intersection.intersectionRatio > 0; - - useThrottle(() => { - if ( - hasIntersected && - currentMonitors.length === page * perPage && - currentMonitors.length !== monitors.length - ) { - setLoadNextPage(true); - } else { - setLoadNextPage(false); - } - }, 1000); - - useEffect(() => { - if (loadNextPage) { - setPage((p) => p + 1); - setLoadNextPage(false); - } - }, [loadNextPage]); - - return { currentMonitors }; -}; - -const getCurrentMonitors = ({ - sortField, - perPage, - page, - monitors, - monitorsSortedByStatus, - statusFilter, -}: { - sortField: MonitorListSortField; - perPage: number; - page: number; - monitors: MonitorOverviewItem[]; - monitorsSortedByStatus: MonitorOverviewItem[]; - statusFilter?: string; -}) => { - if (sortField === 'status' || statusFilter) { - return monitorsSortedByStatus.slice(0, perPage * page); - } else { - return monitors.slice(0, perPage * page); - } -}; diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/not_found/not_found.tsx b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/not_found/not_found.tsx deleted file mode 100644 index 2efdb43ed0b15..0000000000000 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/not_found/not_found.tsx +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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 React from 'react'; -import { EuiEmptyPrompt } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; - -const NOT_FOUND_TITLE = i18n.translate('xpack.synthetics.notFoundTitle', { - defaultMessage: 'Page not found', -}); - -const NOT_FOUND_BODY = i18n.translate('xpack.synthetics.notFoundBody', { - defaultMessage: - "Sorry, we can't find the page you're looking for. It might have been removed or renamed, or maybe it never existed.", -}); - -/** - * Renders a "Page not found" error. - * - * @deprecated This component must be moved to Kibana/Shared UX. It was created - * as a temporary solution to move #144366 forward but it should not be used. - */ -export function NotFound(): JSX.Element { - return ( - {NOT_FOUND_TITLE}} - body={

{NOT_FOUND_BODY}

} - /> - ); -} diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_screenshot/screenshot_link.tsx b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_screenshot/screenshot_link.tsx deleted file mode 100644 index 1ad619735e03d..0000000000000 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_screenshot/screenshot_link.tsx +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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 React from 'react'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; -import { ReactRouterEuiLink } from '../../common/react_router_helpers'; -import { Ping } from '../../../../../../common/runtime_types'; - -const LabelLink = euiStyled.div` - margin-bottom: ${(props) => props.theme.eui.euiSizeXS}; - font-size: ${({ theme }) => theme.eui.euiFontSizeS}; -`; - -interface Props { - lastSuccessfulCheck: Ping; -} - -export const ScreenshotLink = ({ lastSuccessfulCheck }: Props) => { - return ( - - - - - - - ), - }} - /> - - ); -}; diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/routes.tsx b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/routes.tsx index ca1d194994e8d..8f475f458deef 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/routes.tsx +++ b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/routes.tsx @@ -18,8 +18,7 @@ import { APP_WRAPPER_CLASS } from '@kbn/core/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-shared-plugin/public'; import { useInspectorContext } from '@kbn/observability-shared-plugin/public'; -import { CertificateTitle } from './components/certificates/certificate_title'; -import { CertRefreshBtn } from './components/certificates/cert_refresh_btn'; +import { CertRefreshBtn, CertificateTitle, CertificatesPage } from './components/certificates'; import { useSyntheticsPrivileges } from './hooks/use_synthetics_priviliges'; import { ClientPluginsStart } from '../../plugin'; import { getMonitorsRoute } from './components/monitors_page/route_config'; @@ -47,7 +46,6 @@ import { import { PLUGIN } from '../../../common/constants/plugin'; import { apiService } from '../../utils/api_service'; import { getErrorDetailsRouteConfig } from './components/error_details/route_config'; -import { CertificatesPage } from './components/certificates/certificates'; export type RouteProps = LazyObservabilityPageTemplateProps & { path: string; diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/formatting/format.ts b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/formatting/format.ts index 44393b034ac56..5e4c9360fcd37 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/formatting/format.ts +++ b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/formatting/format.ts @@ -18,7 +18,7 @@ const NUM_MICROSECONDS_IN_MILLISECOND = 1000; * This simply converts microseconds to milliseconds. People tend to prefer ms to us * when visualizing request duration times. */ -export const microsToMillis = (microseconds: number | null): number | null => { +const microsToMillis = (microseconds: number | null): number | null => { if (!microseconds && microseconds !== 0) return null; return Math.floor(microseconds / NUM_MICROSECONDS_IN_MILLISECOND); }; diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/__mocks__/screenshot_ref.mock.ts b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/__mocks__/screenshot_ref.mock.ts deleted file mode 100644 index f704c3309c1f9..0000000000000 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/__mocks__/screenshot_ref.mock.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 { ScreenshotRefImageData } from '../../../../../../common/runtime_types'; - -export const mockRef: ScreenshotRefImageData = { - maxSteps: 1, - stepName: 'load homepage', - ref: { - screenshotRef: { - '@timestamp': '2021-06-08T19:42:30.257Z', - synthetics: { - package_version: '1.0.0-beta.2', - step: { name: 'load homepage', index: 1 }, - type: 'step/screenshot_ref', - }, - screenshot_ref: { - blocks: [ - { - top: 0, - left: 0, - width: 160, - hash: 'd518801fc523cf02727cd520f556c4113b3098c7', - height: 90, - }, - { - top: 0, - left: 160, - width: 160, - hash: 'fa90345d5d7b05b1601e9ee645e663bc358869e0', - height: 90, - }, - ], - width: 1280, - height: 720, - }, - monitor: { check_group: 'a567cc7a-c891-11eb-bdf9-3e22fb19bf97' }, - }, - }, -}; diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/rtl_helpers.tsx b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/rtl_helpers.tsx index 9d4870b8c9154..af007700c4484 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/rtl_helpers.tsx +++ b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/rtl_helpers.tsx @@ -356,41 +356,12 @@ export const makeSyntheticsPermissionsCore = ( }; }; -// This function filters out the queried elements which appear only -// either on mobile or desktop. -// -// It does so by filtering those with the class passed as the `classWrapper`. -// For mobile, we filter classes which tell elements to be hidden on desktop. -// For desktop, we do the opposite. -// -// We have this function because EUI will manipulate the visibility of some -// elements through pure CSS, which we can't assert on tests. Therefore, -// we look for the corresponding class wrapper. -const finderWithClassWrapper = - (classWrapper: string) => - ( - getterFn: (f: MatcherFunction) => HTMLElement | null, - customAttribute?: keyof Element | keyof HTMLElement - ) => - (text: string): HTMLElement | null => - getterFn((_content: string, node: Element | null) => { - if (!node) return false; - // There are actually properties that are not in Element but which - // appear on the `node`, so we must cast the customAttribute as a keyof Element - const content = node[(customAttribute as keyof Element) ?? 'innerHTML']; - if (content === text && wrappedInClass(node, classWrapper)) return true; - return false; - }); - const wrappedInClass = (element: HTMLElement | Element, classWrapper: string): boolean => { if (element.className.includes(classWrapper)) return true; if (element.parentElement) return wrappedInClass(element.parentElement, classWrapper); return false; }; -export const forMobileOnly = finderWithClassWrapper('hideForDesktop'); -export const forDesktopOnly = finderWithClassWrapper('hideForMobile'); - export const makeUptimePermissionsCore = ( permissions: Partial<{ 'alerting:save': boolean; diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/spy_use_fetcher.ts b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/spy_use_fetcher.ts deleted file mode 100644 index e1f43ee0b003e..0000000000000 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/spy_use_fetcher.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 * as observabilitySharedPublic from '@kbn/observability-shared-plugin/public'; - -jest.mock('@kbn/observability-shared-plugin/public', () => { - const originalModule = jest.requireActual('@kbn/observability-shared-plugin/public'); - - return { - ...originalModule, - useFetcher: jest.fn().mockReturnValue({ - data: null, - status: 'success', - }), - useTrackPageview: jest.fn(), - }; -}); - -export function spyOnUseFetcher( - payload: unknown, - status = observabilitySharedPublic.FETCH_STATUS.SUCCESS -) { - return jest.spyOn(observabilitySharedPublic, 'useFetcher').mockReturnValue({ - status, - data: payload, - refetch: () => null, - }); -} diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/parse_is_paused.test.ts b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/parse_is_paused.test.ts deleted file mode 100644 index 3842c2c20dbda..0000000000000 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/parse_is_paused.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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 { parseIsPaused } from './parse_is_paused'; - -describe('parseIsPaused', () => { - it('parses correct true isPaused value', () => { - expect(parseIsPaused('true', false)).toEqual(true); - }); - - it('parses correct false isPaused value', () => { - expect(parseIsPaused('false', true)).toEqual(false); - }); - - it('uses default value for non-boolean string', () => { - expect(parseIsPaused('foo', true)).toEqual(true); - }); -}); diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/parse_is_paused.ts b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/parse_is_paused.ts deleted file mode 100644 index 82502f5290cbc..0000000000000 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/parse_is_paused.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * 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. - */ - -// TODO: add a comment explaining the purpose of this function -export const parseIsPaused = (value: string | undefined, defaultValue: boolean): boolean => { - if (value === 'true') { - return true; - } - if (value === 'false') { - return false; - } - return defaultValue; -}; diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/parse_url_int.test.ts b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/parse_url_int.test.ts deleted file mode 100644 index e8b2aea4f6f11..0000000000000 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/parse_url_int.test.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 { parseUrlInt } from './parse_url_int'; - -describe('parseUrlInt', () => { - it('parses a number', () => { - const result = parseUrlInt('23', 50); - expect(result).toBe(23); - }); - - it('returns default value for empty string', () => { - const result = parseUrlInt('', 50); - expect(result).toBe(50); - }); - - it('returns default value for non-numeric string', () => { - const result = parseUrlInt('abc', 50); - expect(result).toBe(50); - }); -}); diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/parse_url_int.ts b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/parse_url_int.ts deleted file mode 100644 index a48ded2fac9ff..0000000000000 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/parse_url_int.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* - * 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. - */ - -export const parseUrlInt = (value: string | undefined, defaultValue: number): number => { - const parsed = parseInt(value || '', 10); - return isNaN(parsed) ? defaultValue : parsed; -}; diff --git a/x-pack/plugins/observability_solution/synthetics/server/alert_rules/tls_rule/types.ts b/x-pack/plugins/observability_solution/synthetics/server/alert_rules/tls_rule/types.ts deleted file mode 100644 index 9c8cc0b9a6e36..0000000000000 --- a/x-pack/plugins/observability_solution/synthetics/server/alert_rules/tls_rule/types.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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. - */ - -export interface MonitorSummaryStatusRule { - reason: string; - status: string; - configId: string; - hostName: string; - monitorId: string; - checkedAt: string; - monitorUrl: string; - locationId: string; - monitorType: string; - monitorName: string; - locationName: string; - lastErrorMessage: string; - stateId: string | null; - monitorUrlLabel: string; -} diff --git a/x-pack/plugins/observability_solution/synthetics/server/common/unzipt_project_code.ts b/x-pack/plugins/observability_solution/synthetics/server/common/unzip_project_code.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/common/unzipt_project_code.ts rename to x-pack/plugins/observability_solution/synthetics/server/common/unzip_project_code.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/inspect_monitor.ts b/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/inspect_monitor.ts index 2c7d62f4830d4..6b4687e2bea81 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/inspect_monitor.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/inspect_monitor.ts @@ -8,7 +8,7 @@ import { v4 as uuidV4 } from 'uuid'; import { schema } from '@kbn/config-schema'; import { PrivateLocationAttributes } from '../../runtime_types/private_locations'; import { SyntheticsRestApiRouteFactory } from '../types'; -import { unzipFile } from '../../common/unzipt_project_code'; +import { unzipFile } from '../../common/unzip_project_code'; import { ConfigKey, MonitorFields, SyntheticsMonitor } from '../../../common/runtime_types'; import { SYNTHETICS_API_URLS } from '../../../common/constants'; import { DEFAULT_FIELDS } from '../../../common/constants/monitor_defaults'; diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/pings/journey_screenshot_blocks.ts b/x-pack/plugins/observability_solution/synthetics/server/routes/pings/journey_screenshot_blocks.ts index c86ccbd169c71..e155e2f320584 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/routes/pings/journey_screenshot_blocks.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/routes/pings/journey_screenshot_blocks.ts @@ -23,8 +23,8 @@ export const createJourneyScreenshotBlocksRoute: SyntheticsRestApiRouteFactory = }), }, writeAccess: false, - handler: async (routeProps) => { - return await journeyScreenshotBlocksHandler(routeProps); + handler: (routeProps) => { + return journeyScreenshotBlocksHandler(routeProps); }, }); diff --git a/x-pack/plugins/observability_solution/synthetics/server/telemetry/constants.ts b/x-pack/plugins/observability_solution/synthetics/server/telemetry/constants.ts index ebb462301dea5..021fc57713471 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/telemetry/constants.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/telemetry/constants.ts @@ -8,5 +8,3 @@ export const MONITOR_UPDATE_CHANNEL = 'synthetics-monitor-update'; export const MONITOR_CURRENT_CHANNEL = 'synthetics-monitor-current'; export const MONITOR_ERROR_EVENTS_CHANNEL = 'synthetics-monitor-error-events'; -export const MONITOR_SYNC_STATE_CHANNEL = 'synthetics-monitor-sync-state'; -export const MONITOR_SYNC_EVENTS_CHANNEL = 'synthetics-monitor-sync-events'; diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 95879f64100d5..fb6953bde31f7 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -43963,7 +43963,6 @@ "xpack.synthetics.alerts.monitorStatus.removedLocation.status": "a récupéré", "xpack.synthetics.alerts.monitorStatus.upCheck.reasonWithoutDuration": "le moniteur est de nouveau opérationnel. Il a été exécuté avec succès à {checkedAt}", "xpack.synthetics.alerts.monitorStatus.upCheck.status": "est désormais disponible", - "xpack.synthetics.alerts.searchPlaceholder.kql": "Filtrer à l'aide de la syntaxe KQL", "xpack.synthetics.alerts.settings.addConnector": "Ajouter un connecteur", "xpack.synthetics.alerts.syntheticsMonitorStatus.clientName": "Statut du moniteur", "xpack.synthetics.alerts.syntheticsMonitorStatus.defaultRecoverySubjectMessage": "\"{monitorName}\" ({locationName}) {recoveryStatus} - Elastic Synthetics", @@ -44100,8 +44099,6 @@ "xpack.synthetics.emptyState.enablement.contactAdministrator": "Seuls les administrateurs peuvent activer cette fonctionnalité.", "xpack.synthetics.emptyState.enablement.disabledDescription": "Exécutez des vérifications automatiques basées sur des simulations de navigateur réel et des pings de point de terminaison légers pour mesurer l’expérience de vos utilisateurs depuis n'importe quel endroit dans le monde.", "xpack.synthetics.emptyState.enablement.title": "Monitorer le statut de vos services et applications avec Synthetics", - "xpack.synthetics.emptyStateError.notAuthorized": "Vous n'êtes pas autorisé à afficher les données Uptime, veuillez contacter votre administrateur système.", - "xpack.synthetics.emptyStateError.title": "Erreur", "xpack.synthetics.errorDetails.errorDuration": "Erreur de durée", "xpack.synthetics.errorDetails.errorDuration.days": "{value} jours", "xpack.synthetics.errorDetails.errorDuration.hours": "{value} heures", @@ -44219,7 +44216,6 @@ "xpack.synthetics.management.noLabel": "Annuler", "xpack.synthetics.management.yesLabel": "Supprimer", "xpack.synthetics.manualTestRun.failedTest.name": "L'exécution de test manuelle a échoué pour {name}", - "xpack.synthetics.millisecond.abbreviation.label": "ms", "xpack.synthetics.monitor.duration.label": "Durée", "xpack.synthetics.monitor.result.label": "Résultat", "xpack.synthetics.monitor.result.lastSuccessful": "Dernière réussite", @@ -44496,13 +44492,8 @@ "xpack.synthetics.monitorList.redirects.openWindow": "Le lien s'ouvrira dans une nouvelle fenêtre.", "xpack.synthetics.monitorList.redirects.title": "Redirections", "xpack.synthetics.monitorList.runTest.label": "Exécuter le test", - "xpack.synthetics.monitorList.statusColumn.completeLabel": "Terminé", "xpack.synthetics.monitorList.statusColumn.downLabel": "Arrêté", - "xpack.synthetics.monitorList.statusColumn.failedLabel": "Échoué", "xpack.synthetics.monitorList.statusColumn.upLabel": "Opérationnel", - "xpack.synthetics.monitorList.table.project.name": "ID de projet", - "xpack.synthetics.monitorList.table.tags.name": "Balises", - "xpack.synthetics.monitorList.table.url.name": "Url", "xpack.synthetics.monitorList.testNow.AriaLabel": "Cliquer pour exécuter le test maintenant", "xpack.synthetics.monitorList.testNow.scheduled": "Le test est déjà programmé", "xpack.synthetics.monitorList.testRunLogs": "Logs d'exécution de test", @@ -44647,7 +44638,6 @@ "xpack.synthetics.monitorManagement.viewZeroMonitors": "{name} n'est encore utilisé dans aucun moniteur pour le moment.", "xpack.synthetics.monitorManagement.websiteUrlHelpText": "Par exemple, la page d'accueil de votre entreprise ou https://elastic.co.", "xpack.synthetics.monitorManagement.websiteUrlLabel": "URL de site web", - "xpack.synthetics.monitorManagement.websiteUrlPlaceholder": "Entrer l'URL d'un site web", "xpack.synthetics.monitorManagementRoute.title": "Synthetics Management | {baseTitle}", "xpack.synthetics.monitorNotFound.title": "Moniteur Synthetics introuvable | {baseTitle}", "xpack.synthetics.monitorOverviewTab.title": "Aperçu", @@ -44677,7 +44667,6 @@ "xpack.synthetics.monitorSummary.runTestManually": "Exécuter le test manuellement", "xpack.synthetics.monitorSummary.selectMonitor": "Sélectionner un autre moniteur pour afficher ses détails", "xpack.synthetics.monitorSummary.viewAlerts": "Afficher les alertes", - "xpack.synthetics.monitorSummary.viewErrors": "Afficher les erreurs", "xpack.synthetics.monitorSummaryRoute.monitorBreadcrumb": "Moniteurs", "xpack.synthetics.monitorTestResult.screenshotImageLabel": "\"{stepName}\", {stepNumber} sur {totalSteps}", "xpack.synthetics.namespaceValidation.error": "Espace de nom non valide : {error}", @@ -44685,8 +44674,6 @@ "xpack.synthetics.noFindingsStates.unprivileged.unprivilegedDescription": "Pour afficher les données des moniteurs Synthetics, vous devez mettre à jour les privilèges. Pour en savoir plus, contactez votre administrateur Kibana.", "xpack.synthetics.noFindingsStates.unprivileged.unprivilegedFooterMarkdown": "Privilège d'index Elasticsearch `read` requis pour les index suivants :", "xpack.synthetics.noFindingsStates.unprivileged.unprivilegedTitle": "Privilèges requis", - "xpack.synthetics.notFoundBody": "Désolé, nous ne trouvons pas la page que vous recherchez. Elle a peut-être été retirée ou renommée, ou peut-être qu'elle n'a jamais existé.", - "xpack.synthetics.notFoundTitle": "Page introuvable", "xpack.synthetics.overview.actions.cloneMonitor.name": "Cloner le moniteur", "xpack.synthetics.overview.actions.disabledSuccessLabel": "Moniteur \"{name}\" désactivé.", "xpack.synthetics.overview.actions.disabledSuccessLabel.alert": "Les alertes sont maintenant désactivées pour le moniteur \"{name}\".", @@ -44829,8 +44816,6 @@ "xpack.synthetics.rules.tls.validBeforeExpiredString": "Valide depuis le {date}, il y a {relativeDate} jours.", "xpack.synthetics.rules.tls.validBeforeExpiringString": "Non valide jusqu'au {date}, dans {relativeDate} jours.", "xpack.synthetics.runTest.failure": "Impossible d'exécuter le test manuellement", - "xpack.synthetics.seconds.label": "secondes", - "xpack.synthetics.seconds.shortForm.label": "s", "xpack.synthetics.send": "Envoyer", "xpack.synthetics.server.monitors.invalidConfigurationError": "Impossible d’enregistrer ou de mettre à jour le moniteur en raison d’une configuration non valide.", "xpack.synthetics.server.monitors.invalidPayloadError": "La charge utile n’est pas un objet moniteur valide", @@ -44942,8 +44927,6 @@ "xpack.synthetics.stepDetailsRoute.timingsBreakdown.info": "Somme de tous les délais de requêtes réseau", "xpack.synthetics.stepDetailsRoute.title": "Détails de l'étape | {baseTitle}", "xpack.synthetics.synthetics.accountBlocked": "Le compte est bloqué.", - "xpack.synthetics.synthetics.executedStep.screenshot.success": "dernière vérification réussie", - "xpack.synthetics.synthetics.executedStep.screenshot.successfulLink": "Capture d'écran de {link}", "xpack.synthetics.synthetics.markers.explore": "Explorer", "xpack.synthetics.synthetics.markers.noFieldIcon.label": "Icône indiquant que ce marqueur ne possède aucun champ associé", "xpack.synthetics.synthetics.markers.openEmbeddableButton.label": "Utilisez ce bouton icône afin d'afficher les indicateurs pour ce marqueur d'annotation.", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 887063f865d5a..0517e2df3beb4 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -43942,7 +43942,6 @@ "xpack.synthetics.alerts.monitorStatus.removedLocation.status": "回復しました", "xpack.synthetics.alerts.monitorStatus.upCheck.reasonWithoutDuration": "モニターが再起動しました。{checkedAt}に正常に実行されました。", "xpack.synthetics.alerts.monitorStatus.upCheck.status": "現在起動しています", - "xpack.synthetics.alerts.searchPlaceholder.kql": "KQL構文を使用してフィルタリング", "xpack.synthetics.alerts.settings.addConnector": "コネクターの追加", "xpack.synthetics.alerts.syntheticsMonitorStatus.clientName": "監視ステータス", "xpack.synthetics.alerts.syntheticsMonitorStatus.defaultActionMessage": "{locationName}の\"{monitorName}\"は{status}です - Elastic Synthetics\n\n詳細:\n\n- モニター名:{monitorName} \n- {monitorUrlLabel}: {monitorUrl} \n- モニタータイプ:{monitorType} \n- 確認日時:{checkedAt} \n- 開始場所:{locationName} \n- 受信したエラー:{lastErrorMessage} \n{linkMessage}", @@ -44082,8 +44081,6 @@ "xpack.synthetics.emptyState.enablement.contactAdministrator": "管理者のみがこの機能を有効化できます。", "xpack.synthetics.emptyState.enablement.disabledDescription": "実際のブラウザーシミュレーションと軽量のエンドポイントpingに基づいて自動チェックを実行し、世界中のあらゆる場所からユーザーのエクスペリエンスを測定します。", "xpack.synthetics.emptyState.enablement.title": "Syntheticsでサービスとアプリケーションのステータスを監視", - "xpack.synthetics.emptyStateError.notAuthorized": "アップタイムデータの表示が承認されていません。システム管理者にお問い合わせください。", - "xpack.synthetics.emptyStateError.title": "エラー", "xpack.synthetics.errorDetails.errorDuration": "エラー期間", "xpack.synthetics.errorDetails.errorDuration.days": "{value}日以内に期限切れになる", "xpack.synthetics.errorDetails.errorDuration.hours": "{value} 時間", @@ -44201,7 +44198,6 @@ "xpack.synthetics.management.noLabel": "キャンセル", "xpack.synthetics.management.yesLabel": "削除", "xpack.synthetics.manualTestRun.failedTest.name": "{name}の手動テスト実行が失敗しました", - "xpack.synthetics.millisecond.abbreviation.label": "ms", "xpack.synthetics.monitor.duration.label": "期間", "xpack.synthetics.monitor.result.label": "結果", "xpack.synthetics.monitor.result.lastSuccessful": "前回の成功", @@ -44478,13 +44474,8 @@ "xpack.synthetics.monitorList.redirects.openWindow": "リンクは新しいウィンドウで開きます。", "xpack.synthetics.monitorList.redirects.title": "リダイレクト", "xpack.synthetics.monitorList.runTest.label": "テストの実行", - "xpack.synthetics.monitorList.statusColumn.completeLabel": "完了", "xpack.synthetics.monitorList.statusColumn.downLabel": "ダウン", - "xpack.synthetics.monitorList.statusColumn.failedLabel": "失敗", "xpack.synthetics.monitorList.statusColumn.upLabel": "アップ", - "xpack.synthetics.monitorList.table.project.name": "プロジェクト ID", - "xpack.synthetics.monitorList.table.tags.name": "タグ", - "xpack.synthetics.monitorList.table.url.name": "Url", "xpack.synthetics.monitorList.testNow.AriaLabel": "クリックすると今すぐテストを実行します", "xpack.synthetics.monitorList.testNow.scheduled": "テストはすでにスケジュールされています", "xpack.synthetics.monitorList.testRunLogs": "テスト実行ログ", @@ -44629,7 +44620,6 @@ "xpack.synthetics.monitorManagement.viewZeroMonitors": "{name}はまだどのモニターでも使われていません。", "xpack.synthetics.monitorManagement.websiteUrlHelpText": "例:会社のホームページまたはhttps://elastic.co。", "xpack.synthetics.monitorManagement.websiteUrlLabel": "WebサイトのURL", - "xpack.synthetics.monitorManagement.websiteUrlPlaceholder": "WebサイトURLを入力", "xpack.synthetics.monitorManagementRoute.title": "シンセティック管理 | {baseTitle}", "xpack.synthetics.monitorNotFound.title": "Syntheticsモニターが見つかりません | {baseTitle}", "xpack.synthetics.monitorOverviewTab.title": "概要", @@ -44659,7 +44649,6 @@ "xpack.synthetics.monitorSummary.runTestManually": "手動でテストを実行", "xpack.synthetics.monitorSummary.selectMonitor": "詳細を表示するには、別のモニターを選択してください", "xpack.synthetics.monitorSummary.viewAlerts": "アラートを表示", - "xpack.synthetics.monitorSummary.viewErrors": "エラーを表示", "xpack.synthetics.monitorSummaryRoute.monitorBreadcrumb": "監視", "xpack.synthetics.monitorTestResult.screenshotImageLabel": "\"{stepName}\"、{stepNumber}/{totalSteps}", "xpack.synthetics.namespaceValidation.error": "無効な名前空間:{error}", @@ -44667,8 +44656,6 @@ "xpack.synthetics.noFindingsStates.unprivileged.unprivilegedDescription": "Syntheticsモニターデータを表示するには、権限を更新する必要があります。詳細については、Kibana管理者に連絡してください。", "xpack.synthetics.noFindingsStates.unprivileged.unprivilegedFooterMarkdown": "次のインデックスに必要なElasticsearchインデックス権限「読み取り」:", "xpack.synthetics.noFindingsStates.unprivileged.unprivilegedTitle": "権限が必要です", - "xpack.synthetics.notFoundBody": "申し訳ございません。お探しのページは見つかりません。削除または名前変更されたか、存在していなかった可能性があります。", - "xpack.synthetics.notFoundTitle": "ページが見つかりません", "xpack.synthetics.overview.actions.cloneMonitor.name": "モニターを複製", "xpack.synthetics.overview.actions.disabledSuccessLabel": "モニター\"{name}\"は正常に無効にされました。", "xpack.synthetics.overview.actions.disabledSuccessLabel.alert": "モニター\"{name}\"に対するアラートが無効化されました。", @@ -44813,8 +44800,6 @@ "xpack.synthetics.rules.tls.validBeforeExpiredString": "{relativeDate}日前、{date}以降有効です。", "xpack.synthetics.rules.tls.validBeforeExpiringString": "今から{relativeDate}日間、{date}まで無効です。", "xpack.synthetics.runTest.failure": "手動でテストを実行できませんでした", - "xpack.synthetics.seconds.label": "秒", - "xpack.synthetics.seconds.shortForm.label": "秒", "xpack.synthetics.send": "送信", "xpack.synthetics.server.monitors.invalidConfigurationError": "無効な設定のため、モニターを保存または更新できませんでした。", "xpack.synthetics.server.monitors.invalidPayloadError": "ペイロードは有効なモニターオブジェクトではありません", @@ -44926,8 +44911,6 @@ "xpack.synthetics.stepDetailsRoute.timingsBreakdown.info": "すべてのネットワークリクエストタイミングの合計", "xpack.synthetics.stepDetailsRoute.title": "ステップ詳細 | {baseTitle}", "xpack.synthetics.synthetics.accountBlocked": "アカウントがブロックされています。", - "xpack.synthetics.synthetics.executedStep.screenshot.success": "前回成功したチェック", - "xpack.synthetics.synthetics.executedStep.screenshot.successfulLink": "{link}からのスクリーンショット", "xpack.synthetics.synthetics.markers.explore": "探索", "xpack.synthetics.synthetics.markers.noFieldIcon.label": "このマーカーにフィールドが関連付けられていないことを示すアイコン", "xpack.synthetics.synthetics.markers.openEmbeddableButton.label": "このアイコンボタンを使用して、この注釈マーカーのメトリックを表示します。", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 13100c9cabde1..243dbfe47dcfe 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -43990,7 +43990,6 @@ "xpack.synthetics.alerts.monitorStatus.removedLocation.status": "已恢复", "xpack.synthetics.alerts.monitorStatus.upCheck.reasonWithoutDuration": "监测现已再次启动。它于 {checkedAt}成功运行", "xpack.synthetics.alerts.monitorStatus.upCheck.status": "现已打开", - "xpack.synthetics.alerts.searchPlaceholder.kql": "使用 kql 语法筛选", "xpack.synthetics.alerts.settings.addConnector": "添加连接器", "xpack.synthetics.alerts.syntheticsMonitorStatus.clientName": "监测状态", "xpack.synthetics.alerts.syntheticsMonitorStatus.defaultActionMessage": "来自 {locationName} 的“{monitorName}”为 {status}。- Elastic Synthetics\n\n详情:\n\n- 监测名称:{monitorName} \n- {monitorUrlLabel}:{monitorUrl} \n- 监测类型:{monitorType} \n- 检查时间:{checkedAt} \n- 来自:{locationName} \n- 收到错误:{lastErrorMessage} \n{linkMessage}", @@ -44130,8 +44129,6 @@ "xpack.synthetics.emptyState.enablement.contactAdministrator": "仅管理员可以启用此功能。", "xpack.synthetics.emptyState.enablement.disabledDescription": "基于真实浏览器模拟和轻量级终端 ping 运行自动检查,以从全球任何位置评估您用户的体验。", "xpack.synthetics.emptyState.enablement.title": "通过 Synthetics 监测服务和应用程序的状态", - "xpack.synthetics.emptyStateError.notAuthorized": "您无权查看 Uptime 数据,请联系系统管理员。", - "xpack.synthetics.emptyStateError.title": "错误", "xpack.synthetics.errorDetails.errorDuration": "错误持续时间", "xpack.synthetics.errorDetails.errorDuration.days": "{value} 天内过期的证书", "xpack.synthetics.errorDetails.errorDuration.hours": "{value} 小时", @@ -44249,7 +44246,6 @@ "xpack.synthetics.management.noLabel": "取消", "xpack.synthetics.management.yesLabel": "删除", "xpack.synthetics.manualTestRun.failedTest.name": "{name} 的手动测试运行失败", - "xpack.synthetics.millisecond.abbreviation.label": "ms", "xpack.synthetics.monitor.duration.label": "持续时间", "xpack.synthetics.monitor.result.label": "结果", "xpack.synthetics.monitor.result.lastSuccessful": "上次成功", @@ -44526,13 +44522,8 @@ "xpack.synthetics.monitorList.redirects.openWindow": "将在新窗口中打开链接。", "xpack.synthetics.monitorList.redirects.title": "重定向", "xpack.synthetics.monitorList.runTest.label": "运行测试", - "xpack.synthetics.monitorList.statusColumn.completeLabel": "已完成", "xpack.synthetics.monitorList.statusColumn.downLabel": "关闭", - "xpack.synthetics.monitorList.statusColumn.failedLabel": "失败", "xpack.synthetics.monitorList.statusColumn.upLabel": "运行", - "xpack.synthetics.monitorList.table.project.name": "项目 ID", - "xpack.synthetics.monitorList.table.tags.name": "标签", - "xpack.synthetics.monitorList.table.url.name": "URL", "xpack.synthetics.monitorList.testNow.AriaLabel": "单击以立即运行测试", "xpack.synthetics.monitorList.testNow.scheduled": "已计划测试", "xpack.synthetics.monitorList.testRunLogs": "测试运行日志", @@ -44677,7 +44668,6 @@ "xpack.synthetics.monitorManagement.viewZeroMonitors": "{name} 尚未用在任何监测中。", "xpack.synthetics.monitorManagement.websiteUrlHelpText": "例如,您公司的主页或 https://elastic.co。", "xpack.synthetics.monitorManagement.websiteUrlLabel": "网站 URL", - "xpack.synthetics.monitorManagement.websiteUrlPlaceholder": "输入网站 URL", "xpack.synthetics.monitorManagementRoute.title": "Synthetics 管理 | {baseTitle}", "xpack.synthetics.monitorNotFound.title": "找不到 Synthetics 监测 | {baseTitle}", "xpack.synthetics.monitorOverviewTab.title": "概览", @@ -44707,7 +44697,6 @@ "xpack.synthetics.monitorSummary.runTestManually": "手动运行测试", "xpack.synthetics.monitorSummary.selectMonitor": "选择不同监测以查看其详情", "xpack.synthetics.monitorSummary.viewAlerts": "查看告警", - "xpack.synthetics.monitorSummary.viewErrors": "查看错误", "xpack.synthetics.monitorSummaryRoute.monitorBreadcrumb": "监测", "xpack.synthetics.monitorTestResult.screenshotImageLabel": "“{stepName}”,第 {stepNumber} 步,共 {totalSteps} 步", "xpack.synthetics.namespaceValidation.error": "命名空间无效:{error}", @@ -44715,8 +44704,6 @@ "xpack.synthetics.noFindingsStates.unprivileged.unprivilegedDescription": "要查看 Synthetics 监测数据,必须更新权限。有关详细信息,请联系您的 Kibana 管理员。", "xpack.synthetics.noFindingsStates.unprivileged.unprivilegedFooterMarkdown": "以下索引所需的 Elasticsearch 索引权限 `read`:", "xpack.synthetics.noFindingsStates.unprivileged.unprivilegedTitle": "需要权限", - "xpack.synthetics.notFoundBody": "抱歉,找不到您要查找的页面。该页面可能已移除、重命名,或可能从不存在。", - "xpack.synthetics.notFoundTitle": "未找到页面", "xpack.synthetics.overview.actions.cloneMonitor.name": "克隆监测", "xpack.synthetics.overview.actions.disabledSuccessLabel": "已成功禁用监测“{name}”。", "xpack.synthetics.overview.actions.disabledSuccessLabel.alert": "现在已对监测“{name}”禁用告警。", @@ -44861,8 +44848,6 @@ "xpack.synthetics.rules.tls.validBeforeExpiredString": "自 {relativeDate} 天前,即 {date}开始生效。", "xpack.synthetics.rules.tls.validBeforeExpiringString": "从现在到 {date}的 {relativeDate} 天里无效。", "xpack.synthetics.runTest.failure": "无法手动运行测试", - "xpack.synthetics.seconds.label": "秒", - "xpack.synthetics.seconds.shortForm.label": "秒", "xpack.synthetics.send": "发送", "xpack.synthetics.server.monitors.invalidConfigurationError": "由于配置无效,无法保存或更新监测。", "xpack.synthetics.server.monitors.invalidPayloadError": "有效负载不是有效的监测对象", @@ -44974,8 +44959,6 @@ "xpack.synthetics.stepDetailsRoute.timingsBreakdown.info": "所有网络请求计时的总和", "xpack.synthetics.stepDetailsRoute.title": "步骤详情 | {baseTitle}", "xpack.synthetics.synthetics.accountBlocked": "帐户被阻止。", - "xpack.synthetics.synthetics.executedStep.screenshot.success": "上一成功检查", - "xpack.synthetics.synthetics.executedStep.screenshot.successfulLink": "来自 {link} 的屏幕截图", "xpack.synthetics.synthetics.markers.explore": "浏览", "xpack.synthetics.synthetics.markers.noFieldIcon.label": "一个图标,表示此标记没有与其关联的字段", "xpack.synthetics.synthetics.markers.openEmbeddableButton.label": "使用此图标按钮可显示该标注标记的指标。", From 798a26f93ce0501ed8fe72e6de94fd7454315d8e Mon Sep 17 00:00:00 2001 From: Steph Milovic Date: Wed, 18 Sep 2024 15:05:41 -0600 Subject: [PATCH 4/5] [Security solution] `naturalLanguageToEsql` Tool added to default assistant graph (#192042) --- x-pack/plugins/elastic_assistant/kibana.jsonc | 1 + .../server/__mocks__/request_context.ts | 2 + .../server/lib/langchain/executors/types.ts | 2 + .../graphs/default_assistant_graph/index.ts | 3 + .../elastic_assistant/server/plugin.ts | 1 + .../server/routes/attack_discovery/helpers.ts | 2 +- .../server/routes/chat/chat_complete_route.ts | 2 + .../server/routes/evaluate/post_evaluate.ts | 4 + .../server/routes/helpers.ts | 4 + .../routes/post_actions_connector_execute.ts | 2 + .../server/routes/request_context_factory.ts | 2 + .../plugins/elastic_assistant/server/types.ts | 9 +++ .../plugins/elastic_assistant/tsconfig.json | 1 + .../common/experimental_features.ts | 5 ++ .../nl_to_esql_tool.ts | 80 +++++++++++++++++++ .../server/assistant/tools/index.test.ts | 2 +- .../server/assistant/tools/index.ts | 7 +- .../security_solution/server/plugin.ts | 5 +- .../plugins/security_solution/tsconfig.json | 1 + 19 files changed, 129 insertions(+), 6 deletions(-) create mode 100644 x-pack/plugins/security_solution/server/assistant/tools/esql_language_knowledge_base/nl_to_esql_tool.ts diff --git a/x-pack/plugins/elastic_assistant/kibana.jsonc b/x-pack/plugins/elastic_assistant/kibana.jsonc index 9879ba274d209..8a3e0725c782a 100644 --- a/x-pack/plugins/elastic_assistant/kibana.jsonc +++ b/x-pack/plugins/elastic_assistant/kibana.jsonc @@ -13,6 +13,7 @@ "ml", "taskManager", "licensing", + "inference", "spaces", "security" ] diff --git a/x-pack/plugins/elastic_assistant/server/__mocks__/request_context.ts b/x-pack/plugins/elastic_assistant/server/__mocks__/request_context.ts index adface75dbced..6ae7ec9e4469b 100644 --- a/x-pack/plugins/elastic_assistant/server/__mocks__/request_context.ts +++ b/x-pack/plugins/elastic_assistant/server/__mocks__/request_context.ts @@ -45,6 +45,7 @@ export const createMockClients = () => { getAIAssistantAnonymizationFieldsDataClient: dataClientMock.create(), getSpaceId: jest.fn(), getCurrentUser: jest.fn(), + inference: jest.fn(), }, savedObjectsClient: core.savedObjects.client, @@ -130,6 +131,7 @@ const createElasticAssistantRequestContextMock = ( getCurrentUser: jest.fn(), getServerBasePath: jest.fn(), getSpaceId: jest.fn(), + inference: { getClient: jest.fn() }, core: clients.core, telemetry: clients.elasticAssistant.telemetry, }; diff --git a/x-pack/plugins/elastic_assistant/server/lib/langchain/executors/types.ts b/x-pack/plugins/elastic_assistant/server/lib/langchain/executors/types.ts index 060616d280efe..2395221ea14b3 100644 --- a/x-pack/plugins/elastic_assistant/server/lib/langchain/executors/types.ts +++ b/x-pack/plugins/elastic_assistant/server/lib/langchain/executors/types.ts @@ -14,6 +14,7 @@ import type { LangChainTracer } from '@langchain/core/tracers/tracer_langchain'; import { ExecuteConnectorRequestBody, Message, Replacements } from '@kbn/elastic-assistant-common'; import { StreamResponseWithHeaders } from '@kbn/ml-response-stream/server'; import { PublicMethodsOf } from '@kbn/utility-types'; +import type { InferenceServerStart } from '@kbn/inference-plugin/server'; import { ResponseBody } from '../types'; import type { AssistantTool } from '../../../types'; import { ElasticsearchStore } from '../elasticsearch_store/elasticsearch_store'; @@ -47,6 +48,7 @@ export interface AgentExecutorParams { langChainMessages: BaseMessage[]; llmType?: string; logger: Logger; + inference: InferenceServerStart; onNewReplacements?: (newReplacements: Replacements) => void; replacements: Replacements; isStream?: T; diff --git a/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/index.ts b/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/index.ts index 0222720d95e37..8cc676cd851a7 100644 --- a/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/index.ts +++ b/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/index.ts @@ -38,6 +38,7 @@ export const callAssistantGraph: AgentExecutor = async ({ dataClients, esClient, esStore, + inference, langChainMessages, llmType, logger: parentLogger, @@ -107,7 +108,9 @@ export const callAssistantGraph: AgentExecutor = async ({ alertsIndexPattern, anonymizationFields, chain, + connectorId, esClient, + inference, isEnabledKnowledgeBase, kbDataClient: dataClients?.kbDataClient, logger, diff --git a/x-pack/plugins/elastic_assistant/server/plugin.ts b/x-pack/plugins/elastic_assistant/server/plugin.ts index a8fc3a7de570c..4386b95c3fa7a 100755 --- a/x-pack/plugins/elastic_assistant/server/plugin.ts +++ b/x-pack/plugins/elastic_assistant/server/plugin.ts @@ -112,6 +112,7 @@ export class ElasticAssistantPlugin return { actions: plugins.actions, + inference: plugins.inference, getRegisteredFeatures: (pluginName: string) => { return appContextService.getRegisteredFeatures(pluginName); }, diff --git a/x-pack/plugins/elastic_assistant/server/routes/attack_discovery/helpers.ts b/x-pack/plugins/elastic_assistant/server/routes/attack_discovery/helpers.ts index 1de3b86e74deb..cccf37aff48e0 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/attack_discovery/helpers.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/attack_discovery/helpers.ts @@ -149,7 +149,7 @@ const formatAssistantToolParams = ({ ExecuteConnectorRequestBody | AttackDiscoveryPostRequestBody >; size: number; -}): AssistantToolParams => ({ +}): Omit => ({ alertsIndexPattern, anonymizationFields: [...(anonymizationFields ?? []), ...REQUIRED_FOR_ATTACK_DISCOVERY], isEnabledKnowledgeBase: false, // not required for attack discovery diff --git a/x-pack/plugins/elastic_assistant/server/routes/chat/chat_complete_route.ts b/x-pack/plugins/elastic_assistant/server/routes/chat/chat_complete_route.ts index b8f75e2376863..dd90241809015 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/chat/chat_complete_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/chat/chat_complete_route.ts @@ -66,6 +66,7 @@ export const chatCompleteRoute = ( const ctx = await context.resolve(['core', 'elasticAssistant', 'licensing']); const logger: Logger = ctx.elasticAssistant.logger; telemetry = ctx.elasticAssistant.telemetry; + const inference = ctx.elasticAssistant.inference; // Perform license and authenticated user checks const checkResponse = performChecks({ @@ -195,6 +196,7 @@ export const chatCompleteRoute = ( context: ctx, getElser, logger, + inference, messages: messages ?? [], onLlmResponse, onNewReplacements, diff --git a/x-pack/plugins/elastic_assistant/server/routes/evaluate/post_evaluate.ts b/x-pack/plugins/elastic_assistant/server/routes/evaluate/post_evaluate.ts index 6cc8853d119dd..27ea4eea46d45 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/evaluate/post_evaluate.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/evaluate/post_evaluate.ts @@ -150,6 +150,8 @@ export const postEvaluateRoute = ( // Default ELSER model const elserId = await getElser(); + const inference = ctx.elasticAssistant.inference; + // Data clients const anonymizationFieldsDataClient = (await assistantContext.getAIAssistantAnonymizationFieldsDataClient()) ?? undefined; @@ -260,6 +262,8 @@ export const postEvaluateRoute = ( alertsIndexPattern, // onNewReplacements, replacements, + inference, + connectorId: connector.id, size, }; diff --git a/x-pack/plugins/elastic_assistant/server/routes/helpers.ts b/x-pack/plugins/elastic_assistant/server/routes/helpers.ts index d457f9c88bf69..1e8acf4bee885 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/helpers.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/helpers.ts @@ -28,6 +28,7 @@ import { AwaitedProperties, PublicMethodsOf } from '@kbn/utility-types'; import { ActionsClient } from '@kbn/actions-plugin/server'; import { AssistantFeatureKey } from '@kbn/elastic-assistant-common/impl/capabilities'; import { getLangSmithTracer } from '@kbn/langchain/server/tracers/langsmith'; +import type { InferenceServerStart } from '@kbn/inference-plugin/server'; import { AIAssistantKnowledgeBaseDataClient } from '../ai_assistant_data_clients/knowledge_base'; import { FindResponse } from '../ai_assistant_data_clients/find'; import { EsPromptsSchema } from '../ai_assistant_data_clients/prompts/types'; @@ -321,6 +322,7 @@ export interface LangChainExecuteParams { telemetry: AnalyticsServiceSetup; actionTypeId: string; connectorId: string; + inference: InferenceServerStart; conversationId?: string; context: AwaitedProperties< Pick @@ -349,6 +351,7 @@ export const langChainExecute = async ({ connectorId, context, actionsClient, + inference, request, logger, conversationId, @@ -418,6 +421,7 @@ export const langChainExecute = async ({ connectorId, esClient, esStore, + inference, isStream, llmType: getLlmType(actionTypeId), langChainMessages, diff --git a/x-pack/plugins/elastic_assistant/server/routes/post_actions_connector_execute.ts b/x-pack/plugins/elastic_assistant/server/routes/post_actions_connector_execute.ts index 0988d9e5f8973..97ff073ecd5cc 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/post_actions_connector_execute.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/post_actions_connector_execute.ts @@ -92,6 +92,7 @@ export const postActionsConnectorExecuteRoute = ( // get the actions plugin start contract from the request context: const actions = ctx.elasticAssistant.actions; + const inference = ctx.elasticAssistant.inference; const actionsClient = await actions.getActionsClientWithRequest(request); const conversationsDataClient = @@ -132,6 +133,7 @@ export const postActionsConnectorExecuteRoute = ( context: ctx, getElser, logger, + inference, messages: (newMessage ? [newMessage] : messages) ?? [], onLlmResponse, onNewReplacements, diff --git a/x-pack/plugins/elastic_assistant/server/routes/request_context_factory.ts b/x-pack/plugins/elastic_assistant/server/routes/request_context_factory.ts index 3d004994b3236..e861fa6ffe279 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/request_context_factory.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/request_context_factory.ts @@ -79,6 +79,8 @@ export class RequestContextFactory implements IRequestContextFactory { return appContextService.getRegisteredFeatures(pluginName); }, + inference: startPlugins.inference, + telemetry: core.analytics, // Note: Due to plugin lifecycle and feature flag registration timing, we need to pass in the feature flag here diff --git a/x-pack/plugins/elastic_assistant/server/types.ts b/x-pack/plugins/elastic_assistant/server/types.ts index 6885b07a42c30..ca0010ae1e6b8 100755 --- a/x-pack/plugins/elastic_assistant/server/types.ts +++ b/x-pack/plugins/elastic_assistant/server/types.ts @@ -45,6 +45,7 @@ import { ActionsClientSimpleChatModel, } from '@kbn/langchain/server'; +import type { InferenceServerStart } from '@kbn/inference-plugin/server'; import { AttackDiscoveryDataClient } from './ai_assistant_data_clients/attack_discovery'; import { AIAssistantConversationsDataClient } from './ai_assistant_data_clients/conversations'; import type { GetRegisteredFeatures, GetRegisteredTools } from './services/app_context'; @@ -64,6 +65,10 @@ export interface ElasticAssistantPluginStart { * Actions plugin start contract. */ actions: ActionsPluginStart; + /** + * Inference plugin start contract. + */ + inference: InferenceServerStart; /** * Register features to be used by the elastic assistant. * @@ -104,6 +109,7 @@ export interface ElasticAssistantPluginSetupDependencies { } export interface ElasticAssistantPluginStartDependencies { actions: ActionsPluginStart; + inference: InferenceServerStart; spaces?: SpacesPluginStart; security: SecurityServiceStart; licensing: LicensingPluginStart; @@ -125,6 +131,7 @@ export interface ElasticAssistantApiRequestHandlerContext { getAttackDiscoveryDataClient: () => Promise; getAIAssistantPromptsDataClient: () => Promise; getAIAssistantAnonymizationFieldsDataClient: () => Promise; + inference: InferenceServerStart; telemetry: AnalyticsServiceSetup; } /** @@ -228,7 +235,9 @@ export type AssistantToolLlm = export interface AssistantToolParams { alertsIndexPattern?: string; anonymizationFields?: AnonymizationFieldResponse[]; + inference?: InferenceServerStart; isEnabledKnowledgeBase: boolean; + connectorId?: string; chain?: RetrievalQAChain; esClient: ElasticsearchClient; kbDataClient?: AIAssistantKnowledgeBaseDataClient; diff --git a/x-pack/plugins/elastic_assistant/tsconfig.json b/x-pack/plugins/elastic_assistant/tsconfig.json index c210253af04a4..747a58ed930d3 100644 --- a/x-pack/plugins/elastic_assistant/tsconfig.json +++ b/x-pack/plugins/elastic_assistant/tsconfig.json @@ -48,6 +48,7 @@ "@kbn/apm-utils", "@kbn/std", "@kbn/zod", + "@kbn/inference-plugin" ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/security_solution/common/experimental_features.ts b/x-pack/plugins/security_solution/common/experimental_features.ts index 121c8d6a97a1a..4147404e940c1 100644 --- a/x-pack/plugins/security_solution/common/experimental_features.ts +++ b/x-pack/plugins/security_solution/common/experimental_features.ts @@ -113,6 +113,11 @@ export const allowedExperimentalValues = Object.freeze({ */ assistantBedrockChat: true, + /** + * Enables the NaturalLanguageESQLTool and disables the ESQLKnowledgeBaseTool, introduced in `8.16.0`. + */ + assistantNaturalLanguageESQLTool: false, + /** * Enables the Managed User section inside the new user details flyout. */ diff --git a/x-pack/plugins/security_solution/server/assistant/tools/esql_language_knowledge_base/nl_to_esql_tool.ts b/x-pack/plugins/security_solution/server/assistant/tools/esql_language_knowledge_base/nl_to_esql_tool.ts new file mode 100644 index 0000000000000..b5dc209043d5d --- /dev/null +++ b/x-pack/plugins/security_solution/server/assistant/tools/esql_language_knowledge_base/nl_to_esql_tool.ts @@ -0,0 +1,80 @@ +/* + * 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 { DynamicStructuredTool } from '@langchain/core/tools'; +import { z } from '@kbn/zod'; +import type { AssistantTool, AssistantToolParams } from '@kbn/elastic-assistant-plugin/server'; +import { lastValueFrom } from 'rxjs'; +import { naturalLanguageToEsql } from '@kbn/inference-plugin/server'; +import { APP_UI_ID } from '../../../../common'; + +export type ESQLToolParams = AssistantToolParams; + +const TOOL_NAME = 'NaturalLanguageESQLTool'; + +const toolDetails = { + id: 'nl-to-esql-tool', + name: TOOL_NAME, + description: `You MUST use the "${TOOL_NAME}" function when the user wants to: + - run any arbitrary query + - breakdown or filter ES|QL queries that are displayed on the current page + - convert queries from another language to ES|QL + - asks general questions about ES|QL + + DO NOT UNDER ANY CIRCUMSTANCES generate ES|QL queries or explain anything about the ES|QL query language yourself. + DO NOT UNDER ANY CIRCUMSTANCES try to correct an ES|QL query yourself - always use the "${TOOL_NAME}" function for this. + + Even if the "${TOOL_NAME}" function was used before that, follow it up with the "${TOOL_NAME}" function. If a query fails, do not attempt to correct it yourself. Again you should call the "${TOOL_NAME}" function, + even if it has been called before.`, +}; + +export const NL_TO_ESQL_TOOL: AssistantTool = { + ...toolDetails, + sourceRegister: APP_UI_ID, + isSupported: (params: ESQLToolParams): params is ESQLToolParams => { + const { chain, isEnabledKnowledgeBase, modelExists } = params; + return isEnabledKnowledgeBase && modelExists && chain != null; + }, + getTool(params: ESQLToolParams) { + if (!this.isSupported(params)) return null; + + const { connectorId, inference, logger, request } = params as ESQLToolParams; + if (inference == null || connectorId == null) return null; + + const callNaturalLanguageToEsql = async (question: string) => { + return lastValueFrom( + naturalLanguageToEsql({ + client: inference.getClient({ request }), + connectorId, + input: question, + logger: { + debug: (source) => { + logger.debug(typeof source === 'function' ? source() : source); + }, + }, + }) + ); + }; + + return new DynamicStructuredTool({ + name: toolDetails.name, + description: toolDetails.description, + schema: z.object({ + question: z.string().describe(`The user's exact question about ESQL`), + }), + func: async (input) => { + const generateEvent = await callNaturalLanguageToEsql(input.question); + const answer = generateEvent.content ?? 'An error occurred in the tool'; + + logger.debug(`Received response from NL to ESQL tool: ${answer}`); + return answer; + }, + tags: ['esql', 'query-generation', 'knowledge-base'], + // TODO: Remove after ZodAny is fixed https://github.com/langchain-ai/langchainjs/blob/main/langchain-core/src/tools.ts + }) as unknown as DynamicStructuredTool; + }, +}; diff --git a/x-pack/plugins/security_solution/server/assistant/tools/index.test.ts b/x-pack/plugins/security_solution/server/assistant/tools/index.test.ts index 047c84ceddf3b..b64f34e4b6ee9 100644 --- a/x-pack/plugins/security_solution/server/assistant/tools/index.test.ts +++ b/x-pack/plugins/security_solution/server/assistant/tools/index.test.ts @@ -13,7 +13,7 @@ describe('getAssistantTools', () => { }); it('should return an array of applicable tools', () => { - const tools = getAssistantTools(); + const tools = getAssistantTools(true); const minExpectedTools = 3; // 3 tools are currently implemented diff --git a/x-pack/plugins/security_solution/server/assistant/tools/index.ts b/x-pack/plugins/security_solution/server/assistant/tools/index.ts index 0e5ea3a8f69d1..181e55353adc7 100644 --- a/x-pack/plugins/security_solution/server/assistant/tools/index.ts +++ b/x-pack/plugins/security_solution/server/assistant/tools/index.ts @@ -7,17 +7,18 @@ import type { AssistantTool } from '@kbn/elastic-assistant-plugin/server'; -import { ALERT_COUNTS_TOOL } from './alert_counts/alert_counts_tool'; import { ESQL_KNOWLEDGE_BASE_TOOL } from './esql_language_knowledge_base/esql_language_knowledge_base_tool'; +import { NL_TO_ESQL_TOOL } from './esql_language_knowledge_base/nl_to_esql_tool'; +import { ALERT_COUNTS_TOOL } from './alert_counts/alert_counts_tool'; import { OPEN_AND_ACKNOWLEDGED_ALERTS_TOOL } from './open_and_acknowledged_alerts/open_and_acknowledged_alerts_tool'; import { ATTACK_DISCOVERY_TOOL } from './attack_discovery/attack_discovery_tool'; import { KNOWLEDGE_BASE_RETRIEVAL_TOOL } from './knowledge_base/knowledge_base_retrieval_tool'; import { KNOWLEDGE_BASE_WRITE_TOOL } from './knowledge_base/knowledge_base_write_tool'; -export const getAssistantTools = (): AssistantTool[] => [ +export const getAssistantTools = (naturalLanguageESQLToolEnabled: boolean): AssistantTool[] => [ ALERT_COUNTS_TOOL, ATTACK_DISCOVERY_TOOL, - ESQL_KNOWLEDGE_BASE_TOOL, + naturalLanguageESQLToolEnabled ? NL_TO_ESQL_TOOL : ESQL_KNOWLEDGE_BASE_TOOL, KNOWLEDGE_BASE_RETRIEVAL_TOOL, KNOWLEDGE_BASE_WRITE_TOOL, OPEN_AND_ACKNOWLEDGED_ALERTS_TOOL, diff --git a/x-pack/plugins/security_solution/server/plugin.ts b/x-pack/plugins/security_solution/server/plugin.ts index a46863c78c25e..17f31718070b3 100644 --- a/x-pack/plugins/security_solution/server/plugin.ts +++ b/x-pack/plugins/security_solution/server/plugin.ts @@ -550,7 +550,10 @@ export class Plugin implements ISecuritySolutionPlugin { this.licensing$ = plugins.licensing.license$; // Assistant Tool and Feature Registration - plugins.elasticAssistant.registerTools(APP_UI_ID, getAssistantTools()); + plugins.elasticAssistant.registerTools( + APP_UI_ID, + getAssistantTools(config.experimentalFeatures.assistantNaturalLanguageESQLTool) + ); plugins.elasticAssistant.registerFeatures(APP_UI_ID, { assistantBedrockChat: config.experimentalFeatures.assistantBedrockChat, assistantKnowledgeBaseByDefault: config.experimentalFeatures.assistantKnowledgeBaseByDefault, diff --git a/x-pack/plugins/security_solution/tsconfig.json b/x-pack/plugins/security_solution/tsconfig.json index e6ec61c44d89e..e33ecb852b5b1 100644 --- a/x-pack/plugins/security_solution/tsconfig.json +++ b/x-pack/plugins/security_solution/tsconfig.json @@ -225,5 +225,6 @@ "@kbn/presentation-publishing", "@kbn/entityManager-plugin", "@kbn/entities-schema", + "@kbn/inference-plugin", ] } From 4c51c00b8a1afa9d15e4f273cac4a9705dfc1daa Mon Sep 17 00:00:00 2001 From: "elastic-renovate-prod[bot]" <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 16:10:45 -0500 Subject: [PATCH 5/5] Update dependency msw to ^2.4.4 (main) (#192955) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | Pending | |---|---|---|---|---| | [msw](https://mswjs.io) ([source](https://togithub.com/mswjs/msw)) | devDependencies | patch | [`^2.4.2` -> `^2.4.4`](https://renovatebot.com/diffs/npm/msw/2.4.2/2.4.4) | `2.4.8` (+3) | --- ### Release Notes
mswjs/msw (msw) ### [`v2.4.4`](https://togithub.com/mswjs/msw/releases/tag/v2.4.4) [Compare Source](https://togithub.com/mswjs/msw/compare/v2.4.3...v2.4.4) #### v2.4.4 (2024-09-08) ##### Bug Fixes - **fetch:** follow mocked redirect responses ([#​2268](https://togithub.com/mswjs/msw/issues/2268)) ([`f5785bf`](https://togithub.com/mswjs/msw/commit/f5785bfba1a026075feca4f74cadfcb636ffc257)) [@​kettanaito](https://togithub.com/kettanaito) - Adopts a new, Socket-based request interception algorithm. ### [`v2.4.3`](https://togithub.com/mswjs/msw/releases/tag/v2.4.3) [Compare Source](https://togithub.com/mswjs/msw/compare/v2.4.2...v2.4.3) #### v2.4.3 (2024-09-07) ##### Bug Fixes - revert "graphql" as optional peer dependency ([#​2267](https://togithub.com/mswjs/msw/issues/2267)) ([`7cd39e7`](https://togithub.com/mswjs/msw/commit/7cd39e787aa9766eef914bce3d65daec1ce16635)) [@​kettanaito](https://togithub.com/kettanaito)
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 31 ++++++++++++++++--------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 45b75f8112d08..901743f1f5cae 100644 --- a/package.json +++ b/package.json @@ -1759,7 +1759,7 @@ "mochawesome-merge": "^4.3.0", "mock-fs": "^5.1.2", "ms-chromium-edge-driver": "^0.5.1", - "msw": "^2.4.2", + "msw": "^2.4.4", "multistream": "^4.1.0", "mutation-observer": "^1.0.3", "native-hdr-histogram": "^1.0.0", diff --git a/yarn.lock b/yarn.lock index 52bd946a7ef13..3fe0e4cf5cdcb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7701,16 +7701,16 @@ express "^4.18.2" strict-event-emitter "^0.5.1" -"@mswjs/interceptors@^0.29.0": - version "0.29.1" - resolved "https://registry.yarnpkg.com/@mswjs/interceptors/-/interceptors-0.29.1.tgz#e77fc58b5188569041d0440b25c9e9ebb1ccd60a" - integrity sha512-3rDakgJZ77+RiQUuSK69t1F0m8BQKA8Vh5DCS5V0DWvNY67zob2JhhQrhCO0AKLGINTRSFd1tBaHcJTkhefoSw== +"@mswjs/interceptors@^0.35.3": + version "0.35.4" + resolved "https://registry.yarnpkg.com/@mswjs/interceptors/-/interceptors-0.35.4.tgz#5ce555762ef3d65420f39c7a58767692fb3dad38" + integrity sha512-PRAZobhu5Kfp4iLOmxjhkfnjiRE8hMUbEjEy0gQJDVcQNJHgx6hZgOisyHnq41oQ5Bp40BQDHPi4BoC/wJXEeQ== dependencies: "@open-draft/deferred-promise" "^2.2.0" "@open-draft/logger" "^0.3.0" "@open-draft/until" "^2.0.0" is-node-process "^1.2.0" - outvariant "^1.2.1" + outvariant "^1.4.3" strict-event-emitter "^0.5.1" "@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3": @@ -19239,7 +19239,7 @@ graphql-tag@^2.12.6: dependencies: tslib "^2.1.0" -graphql@^16.6.0: +graphql@^16.6.0, graphql@^16.8.1: version "16.8.1" resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.8.1.tgz#1930a965bef1170603702acdb68aedd3f3cf6f07" integrity sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw== @@ -23825,20 +23825,21 @@ msgpackr@^1.9.9: optionalDependencies: msgpackr-extract "^3.0.2" -msw@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/msw/-/msw-2.4.2.tgz#df8040975b2bf92ebc0a16d1c9e9f138c3c8765c" - integrity sha512-GImSQGhn19czhVpxPdiUDK8CMZ6jbBcvOhzfJd8KFErjEER2wDKWs1UYaetJs2GSNlAqt6heZYm7g3eLatTcog== +msw@^2.4.4: + version "2.4.6" + resolved "https://registry.yarnpkg.com/msw/-/msw-2.4.6.tgz#b1cf163faed2d9fe10df2bef660926df8a4c0adc" + integrity sha512-flx3DIP3+a81vvEY1lCmZVFKVYVcDiizNHg6mHYc2+F2xU+4LmZ6P2eYZUGEFoJWqA3yRWS70pJa0riFVTb5FQ== dependencies: "@bundled-es-modules/cookie" "^2.0.0" "@bundled-es-modules/statuses" "^1.0.1" "@bundled-es-modules/tough-cookie" "^0.1.6" "@inquirer/confirm" "^3.0.0" - "@mswjs/interceptors" "^0.29.0" + "@mswjs/interceptors" "^0.35.3" "@open-draft/until" "^2.1.0" "@types/cookie" "^0.6.0" "@types/statuses" "^2.0.4" chalk "^4.1.2" + graphql "^16.8.1" headers-polyfill "^4.0.2" is-node-process "^1.2.0" outvariant "^1.4.2" @@ -24835,10 +24836,10 @@ ospath@^1.2.2: resolved "https://registry.yarnpkg.com/ospath/-/ospath-1.2.2.tgz#1276639774a3f8ef2572f7fe4280e0ea4550c07b" integrity sha1-EnZjl3Sj+O8lcvf+QoDg6kVQwHs= -outvariant@^1.2.1, outvariant@^1.4.0, outvariant@^1.4.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/outvariant/-/outvariant-1.4.2.tgz#f54f19240eeb7f15b28263d5147405752d8e2066" - integrity sha512-Ou3dJ6bA/UJ5GVHxah4LnqDwZRwAmWxrG3wtrHrbGnP4RnLCtA64A4F+ae7Y8ww660JaddSoArUR5HjipWSHAQ== +outvariant@^1.4.0, outvariant@^1.4.2, outvariant@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/outvariant/-/outvariant-1.4.3.tgz#221c1bfc093e8fec7075497e7799fdbf43d14873" + integrity sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA== p-all@^2.1.0: version "2.1.0"