diff --git a/.buildkite/pipelines/purge_cloud_deployment.yml b/.buildkite/pipelines/purge_cloud_deployment.yml new file mode 100644 index 0000000000000..34f074658e547 --- /dev/null +++ b/.buildkite/pipelines/purge_cloud_deployment.yml @@ -0,0 +1,13 @@ +steps: + - block: "Purge deployment" + prompt: "Fill out the details to shutdown a PR deployment" + fields: + - text: "Pull Request Number" + key: "kibana-pull-request" + if: "build.env('KIBANA_PULL_REQUEST') == null || build.env('KIBANA_PULL_REQUEST') == ''" + + - command: .buildkite/scripts/steps/cloud/purge_deployment.sh + label: Purge a cloud deployment + timeout_in_minutes: 10 + agents: + queue: kibana-default diff --git a/.buildkite/pipelines/purge_cloud_deployments.yml b/.buildkite/pipelines/purge_cloud_deployments.yml index 9567f67a047f8..203e74ca63c80 100644 --- a/.buildkite/pipelines/purge_cloud_deployments.yml +++ b/.buildkite/pipelines/purge_cloud_deployments.yml @@ -1,5 +1,5 @@ steps: - - command: .buildkite/scripts/steps/cloud/purge.sh + - command: .buildkite/scripts/steps/cloud/purge_deployments.sh label: Purge old cloud deployments timeout_in_minutes: 10 agents: diff --git a/.buildkite/scripts/steps/cloud/purge.sh b/.buildkite/scripts/steps/cloud/purge.sh deleted file mode 100755 index a23d837f83294..0000000000000 --- a/.buildkite/scripts/steps/cloud/purge.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -ts-node .buildkite/scripts/steps/cloud/purge.ts diff --git a/.buildkite/scripts/steps/cloud/purge_deployment.sh b/.buildkite/scripts/steps/cloud/purge_deployment.sh new file mode 100755 index 0000000000000..b2f7d8cbfc94c --- /dev/null +++ b/.buildkite/scripts/steps/cloud/purge_deployment.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -euo pipefail + +ts-node .buildkite/scripts/steps/cloud/purge_deployment.ts diff --git a/.buildkite/scripts/steps/cloud/purge_deployment.ts b/.buildkite/scripts/steps/cloud/purge_deployment.ts new file mode 100644 index 0000000000000..4ec00373541c9 --- /dev/null +++ b/.buildkite/scripts/steps/cloud/purge_deployment.ts @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { execSync } from 'child_process'; + +const deploymentsListJson = execSync('ecctl deployment list --output json').toString(); +const { deployments } = JSON.parse(deploymentsListJson); + +const prNumber = parseInt( + process.env.KIBANA_PULL_REQUEST || + execSync('buildkite-agent meta-data get kibana-pull-request').toString(), + 10 +); +const deploymentName = `kibana-pr-${prNumber}`; +const deployment = deployments.find((d: any) => d.name === deploymentName); + +if (!prNumber || !deployment) { + console.error(`${deploymentName} not found`); + process.exit(1); +} + +console.log(`Scheduling deployment for deletion: ${deployment.name} / ${deployment.id}`); +try { + execSync(`ecctl deployment shutdown --force '${deployment.id}'`, { stdio: 'inherit' }); + execSync(`vault delete secret/kibana-issues/dev/cloud-deploy/${deployment.name}`, { + stdio: 'inherit', + }); +} catch (ex) { + console.error(ex.toString()); +} diff --git a/.buildkite/scripts/steps/cloud/purge_deployments.sh b/.buildkite/scripts/steps/cloud/purge_deployments.sh new file mode 100755 index 0000000000000..7f50257c0303b --- /dev/null +++ b/.buildkite/scripts/steps/cloud/purge_deployments.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -euo pipefail + +ts-node .buildkite/scripts/steps/cloud/purge_deployments.ts diff --git a/.buildkite/scripts/steps/cloud/purge.ts b/.buildkite/scripts/steps/cloud/purge_deployments.ts similarity index 100% rename from .buildkite/scripts/steps/cloud/purge.ts rename to .buildkite/scripts/steps/cloud/purge_deployments.ts diff --git a/.eslintrc.js b/.eslintrc.js index 385d241e52fff..8b3ccafe37f6f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -979,7 +979,7 @@ module.exports = { 'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks 'react-hooks/exhaustive-deps': [ 'error', - { additionalHooks: '^(useFetcher|useProgressiveFetcher)$' }, + { additionalHooks: '^(useFetcher|useProgressiveFetcher|useBreadcrumb)$' }, ], }, }, diff --git a/.stylelintrc b/.stylelintrc index bc0e4a6c6c04c..ee81ff13f2706 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -1,8 +1,8 @@ plugins: - stylelint-scss +customSyntax: postcss-scss rules: color-no-invalid-hex: true - function-calc-no-invalid: true string-no-newline: true unit-no-unknown: true property-no-unknown: diff --git a/api_docs/actions.mdx b/api_docs/actions.mdx index c6ff23e43ec4d..ddaefd73d9610 100644 --- a/api_docs/actions.mdx +++ b/api_docs/actions.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/actions title: "actions" image: https://source.unsplash.com/400x175/?github summary: API docs for the actions plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/advanced_settings.mdx b/api_docs/advanced_settings.mdx index 00096cdc4c263..ba797c480d7d2 100644 --- a/api_docs/advanced_settings.mdx +++ b/api_docs/advanced_settings.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/advancedSettings title: "advancedSettings" image: https://source.unsplash.com/400x175/?github summary: API docs for the advancedSettings plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/aiops.mdx b/api_docs/aiops.mdx index 8ceae5c0816e9..21147bb932d8e 100644 --- a/api_docs/aiops.mdx +++ b/api_docs/aiops.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/aiops title: "aiops" image: https://source.unsplash.com/400x175/?github summary: API docs for the aiops plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiops'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/alerting.mdx b/api_docs/alerting.mdx index a42c89467b166..2bd0e72e60a71 100644 --- a/api_docs/alerting.mdx +++ b/api_docs/alerting.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/alerting title: "alerting" image: https://source.unsplash.com/400x175/?github summary: API docs for the alerting plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/apm.mdx b/api_docs/apm.mdx index efbd19bd97e47..a897de724a61a 100644 --- a/api_docs/apm.mdx +++ b/api_docs/apm.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/apm title: "apm" image: https://source.unsplash.com/400x175/?github summary: API docs for the apm plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apm'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/banners.mdx b/api_docs/banners.mdx index 1e905124ff29c..1098b7e9128a8 100644 --- a/api_docs/banners.mdx +++ b/api_docs/banners.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/banners title: "banners" image: https://source.unsplash.com/400x175/?github summary: API docs for the banners plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'banners'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/bfetch.mdx b/api_docs/bfetch.mdx index 259836aea3ee3..51707411e4a75 100644 --- a/api_docs/bfetch.mdx +++ b/api_docs/bfetch.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/bfetch title: "bfetch" image: https://source.unsplash.com/400x175/?github summary: API docs for the bfetch plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'bfetch'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/canvas.mdx b/api_docs/canvas.mdx index 4b0deb7719b2b..437d6b528adb7 100644 --- a/api_docs/canvas.mdx +++ b/api_docs/canvas.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/canvas title: "canvas" image: https://source.unsplash.com/400x175/?github summary: API docs for the canvas plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'canvas'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/cases.mdx b/api_docs/cases.mdx index 8d744d811cc7b..1a948652ee7fd 100644 --- a/api_docs/cases.mdx +++ b/api_docs/cases.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/cases title: "cases" image: https://source.unsplash.com/400x175/?github summary: API docs for the cases plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cases'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/charts.mdx b/api_docs/charts.mdx index f81c1d9769b9f..d7473dab06bba 100644 --- a/api_docs/charts.mdx +++ b/api_docs/charts.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/charts title: "charts" image: https://source.unsplash.com/400x175/?github summary: API docs for the charts plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'charts'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/cloud.mdx b/api_docs/cloud.mdx index ebd6429bc76af..6f8a35078abe5 100644 --- a/api_docs/cloud.mdx +++ b/api_docs/cloud.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/cloud title: "cloud" image: https://source.unsplash.com/400x175/?github summary: API docs for the cloud plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloud'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/cloud_security_posture.mdx b/api_docs/cloud_security_posture.mdx index 711445be81fc6..54d35e45def45 100644 --- a/api_docs/cloud_security_posture.mdx +++ b/api_docs/cloud_security_posture.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/cloudSecurityPosture title: "cloudSecurityPosture" image: https://source.unsplash.com/400x175/?github summary: API docs for the cloudSecurityPosture plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudSecurityPosture'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/console.mdx b/api_docs/console.mdx index 6b3080cb2d48a..7ea5b3bdcff93 100644 --- a/api_docs/console.mdx +++ b/api_docs/console.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/console title: "console" image: https://source.unsplash.com/400x175/?github summary: API docs for the console plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'console'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/controls.mdx b/api_docs/controls.mdx index f0da420ccc477..ec30188443d86 100644 --- a/api_docs/controls.mdx +++ b/api_docs/controls.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/controls title: "controls" image: https://source.unsplash.com/400x175/?github summary: API docs for the controls plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'controls'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/core.devdocs.json b/api_docs/core.devdocs.json index f64b62adc4a8c..685eb20cf0799 100644 --- a/api_docs/core.devdocs.json +++ b/api_docs/core.devdocs.json @@ -8921,14 +8921,14 @@ { "parentPluginId": "core", "id": "def-public.UiSettingsParams.options", - "type": "Array", + "type": "CompoundType", "tags": [], "label": "options", "description": [ "array of permitted values for this setting" ], "signature": [ - "string[] | undefined" + "number[] | string[] | undefined" ], "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", "deprecated": false @@ -9624,7 +9624,7 @@ "signature": [ "{ metric?: { type: string; name: string; } | undefined; type?: ", "UiSettingsType", - " | undefined; name?: string | undefined; order?: number | undefined; value?: unknown; description?: string | undefined; options?: string[] | undefined; category?: string[] | undefined; optionLabels?: Record | undefined; requiresPageReload?: boolean | undefined; readonly?: boolean | undefined; sensitive?: boolean | undefined; deprecation?: ", + " | undefined; name?: string | undefined; order?: number | undefined; value?: unknown; description?: string | undefined; options?: number[] | string[] | undefined; category?: string[] | undefined; optionLabels?: Record | undefined; requiresPageReload?: boolean | undefined; readonly?: boolean | undefined; sensitive?: boolean | undefined; deprecation?: ", "DeprecationSettings", " | undefined; }" ], @@ -27509,14 +27509,14 @@ { "parentPluginId": "core", "id": "def-server.UiSettingsParams.options", - "type": "Array", + "type": "CompoundType", "tags": [], "label": "options", "description": [ "array of permitted values for this setting" ], "signature": [ - "string[] | undefined" + "number[] | string[] | undefined" ], "path": "node_modules/@types/kbn__core-ui-settings-common/index.d.ts", "deprecated": false @@ -31315,7 +31315,7 @@ "signature": [ "{ metric?: { type: string; name: string; } | undefined; type?: ", "UiSettingsType", - " | undefined; name?: string | undefined; order?: number | undefined; value?: unknown; description?: string | undefined; options?: string[] | undefined; category?: string[] | undefined; optionLabels?: Record | undefined; requiresPageReload?: boolean | undefined; readonly?: boolean | undefined; sensitive?: boolean | undefined; deprecation?: ", + " | undefined; name?: string | undefined; order?: number | undefined; value?: unknown; description?: string | undefined; options?: number[] | string[] | undefined; category?: string[] | undefined; optionLabels?: Record | undefined; requiresPageReload?: boolean | undefined; readonly?: boolean | undefined; sensitive?: boolean | undefined; deprecation?: ", "DeprecationSettings", " | undefined; }" ], diff --git a/api_docs/core.mdx b/api_docs/core.mdx index 52b0d90a93de0..f5b07956ee799 100644 --- a/api_docs/core.mdx +++ b/api_docs/core.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/core title: "core" image: https://source.unsplash.com/400x175/?github summary: API docs for the core plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/core_application.mdx b/api_docs/core_application.mdx index 16aef8e808b1e..568345edb99dd 100644 --- a/api_docs/core_application.mdx +++ b/api_docs/core_application.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/core-application title: "core.application" image: https://source.unsplash.com/400x175/?github summary: API docs for the core.application plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core.application'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/core_chrome.mdx b/api_docs/core_chrome.mdx index 9003019bbc317..a6c3a60f962a5 100644 --- a/api_docs/core_chrome.mdx +++ b/api_docs/core_chrome.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/core-chrome title: "core.chrome" image: https://source.unsplash.com/400x175/?github summary: API docs for the core.chrome plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core.chrome'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/core_saved_objects.mdx b/api_docs/core_saved_objects.mdx index dffebe0db38be..7105e1a5581a0 100644 --- a/api_docs/core_saved_objects.mdx +++ b/api_docs/core_saved_objects.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/core-savedObjects title: "core.savedObjects" image: https://source.unsplash.com/400x175/?github summary: API docs for the core.savedObjects plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core.savedObjects'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/custom_integrations.mdx b/api_docs/custom_integrations.mdx index 3cca19bfefbe6..71ba46d589c17 100644 --- a/api_docs/custom_integrations.mdx +++ b/api_docs/custom_integrations.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/customIntegrations title: "customIntegrations" image: https://source.unsplash.com/400x175/?github summary: API docs for the customIntegrations plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'customIntegrations'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/dashboard.mdx b/api_docs/dashboard.mdx index e3fe62741c62c..f8fb190ebd93f 100644 --- a/api_docs/dashboard.mdx +++ b/api_docs/dashboard.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dashboard title: "dashboard" image: https://source.unsplash.com/400x175/?github summary: API docs for the dashboard plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboard'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/dashboard_enhanced.mdx b/api_docs/dashboard_enhanced.mdx index af4f2c4df6cb3..cb4a1eb386007 100644 --- a/api_docs/dashboard_enhanced.mdx +++ b/api_docs/dashboard_enhanced.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dashboardEnhanced title: "dashboardEnhanced" image: https://source.unsplash.com/400x175/?github summary: API docs for the dashboardEnhanced plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboardEnhanced'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/data.devdocs.json b/api_docs/data.devdocs.json index 47efc1924311c..6b142a4d26846 100644 --- a/api_docs/data.devdocs.json +++ b/api_docs/data.devdocs.json @@ -11571,7 +11571,17 @@ "\nMap of field formats by field name" ], "signature": [ - "{ [x: string]: any; }" + "{ [x: string]: ", + { + "pluginId": "fieldFormats", + "scope": "common", + "docId": "kibFieldFormatsPluginApi", + "section": "def-common.SerializedFieldFormat", + "text": "SerializedFieldFormat" + }, + "<{}, ", + "SerializableRecord", + ">; }" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false @@ -11668,7 +11678,7 @@ "label": "flattenHit", "description": [], "signature": [ - "(hit: Record, deep?: boolean | undefined) => Record" + "(hit: Record, deep?: boolean | undefined) => Record" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, @@ -11696,7 +11706,7 @@ "label": "hit", "description": [], "signature": [ - "{ [x: string]: any; }" + "{ [x: string]: unknown[]; }" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false @@ -13397,7 +13407,13 @@ "() => Promise<", "SavedObject", "<", - "DataViewSavedObjectAttrs", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewSavedObjectAttrs", + "text": "DataViewSavedObjectAttrs" + }, ">[] | null | undefined>" ], "path": "src/plugins/data_views/common/data_views/data_views.ts", @@ -14522,7 +14538,16 @@ "\nGet rollup job capabilities" ], "signature": [ - "(indices: Record) => { [key: string]: any; }" + "(indices: ", + "RollupGetRollupIndexCapsResponse", + ") => ", + { + "pluginId": "dataViews", + "scope": "server", + "docId": "kibDataViewsPluginApi", + "section": "def-server.RollupIndexCapability", + "text": "RollupIndexCapability" + } ], "path": "src/plugins/data_views/server/fetcher/lib/map_capabilities.ts", "deprecated": false, @@ -14537,7 +14562,7 @@ "rollup job index capabilites" ], "signature": [ - "Record" + "RollupGetRollupIndexCapsResponse" ], "path": "src/plugins/data_views/server/fetcher/lib/map_capabilities.ts", "deprecated": false, @@ -18026,7 +18051,17 @@ "\nMap of field formats by field name" ], "signature": [ - "{ [x: string]: any; }" + "{ [x: string]: ", + { + "pluginId": "fieldFormats", + "scope": "common", + "docId": "kibFieldFormatsPluginApi", + "section": "def-common.SerializedFieldFormat", + "text": "SerializedFieldFormat" + }, + "<{}, ", + "SerializableRecord", + ">; }" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false @@ -18123,7 +18158,7 @@ "label": "flattenHit", "description": [], "signature": [ - "(hit: Record, deep?: boolean | undefined) => Record" + "(hit: Record, deep?: boolean | undefined) => Record" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, @@ -18151,7 +18186,7 @@ "label": "hit", "description": [], "signature": [ - "{ [x: string]: any; }" + "{ [x: string]: unknown[]; }" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false @@ -20559,7 +20594,13 @@ "() => Promise<", "SavedObject", "<", - "DataViewSavedObjectAttrs", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewSavedObjectAttrs", + "text": "DataViewSavedObjectAttrs" + }, ">[] | null | undefined>" ], "path": "src/plugins/data_views/common/data_views/data_views.ts", @@ -22596,7 +22637,15 @@ "section": "def-common.GetFieldsOptions", "text": "GetFieldsOptions" }, - ") => Promise" + ") => Promise<", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + "[]>" ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -22996,7 +23045,7 @@ "\nGet a setting value" ], "signature": [ - "(key: string) => Promise" + "(key: string) => Promise" ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -23047,7 +23096,7 @@ "\nSet a setting value" ], "signature": [ - "(key: string, value: T) => Promise" + "(key: string, value: T) => Promise" ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -23302,7 +23351,13 @@ "[]>; clearCache: () => void; clearInstanceCache: (id?: string | undefined) => void; getCache: () => Promise<", "SavedObject", "<", - "DataViewSavedObjectAttrs", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewSavedObjectAttrs", + "text": "DataViewSavedObjectAttrs" + }, ">[] | null | undefined>; getDefault: () => Promise<", { "pluginId": "dataViews", @@ -23826,7 +23881,7 @@ "tags": [], "label": "DEFAULT_ASSETS_TO_IGNORE", "description": [ - "\nUsed to determine if the instance has any user created index patterns by filtering index patterns\nthat are created and backed only by Fleet server data\nShould be revised after https://github.com/elastic/kibana/issues/82851 is fixed\nFor more background see: https://github.com/elastic/kibana/issues/107020" + "\nUsed to determine if the instance has some user created index patterns by filtering index patterns\nthat are created and backed only by Fleet server data\nShould be revised after https://github.com/elastic/kibana/issues/82851 is fixed\nFor more background see: https://github.com/elastic/kibana/issues/107020" ], "path": "src/plugins/data_views/common/constants.ts", "deprecated": false, diff --git a/api_docs/data.mdx b/api_docs/data.mdx index 8142f3145aa15..b2e9da3e8ab89 100644 --- a/api_docs/data.mdx +++ b/api_docs/data.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/data title: "data" image: https://source.unsplash.com/400x175/?github summary: API docs for the data plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3084 | 34 | 2411 | 21 | +| 3086 | 34 | 2413 | 21 | ## Client diff --git a/api_docs/data_query.mdx b/api_docs/data_query.mdx index 5b5824f11b8cc..00f73a7ac4852 100644 --- a/api_docs/data_query.mdx +++ b/api_docs/data_query.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/data-query title: "data.query" image: https://source.unsplash.com/400x175/?github summary: API docs for the data.query plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.query'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3084 | 34 | 2411 | 21 | +| 3086 | 34 | 2413 | 21 | ## Client diff --git a/api_docs/data_search.devdocs.json b/api_docs/data_search.devdocs.json index 82219fe681998..d8983f1621c05 100644 --- a/api_docs/data_search.devdocs.json +++ b/api_docs/data_search.devdocs.json @@ -20681,12 +20681,12 @@ { "parentPluginId": "data", "id": "def-common.AggParamsTerms.exclude", - "type": "string", + "type": "CompoundType", "tags": [], "label": "exclude", "description": [], "signature": [ - "string | undefined" + "number[] | string[] | undefined" ], "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", "deprecated": false @@ -20694,12 +20694,38 @@ { "parentPluginId": "data", "id": "def-common.AggParamsTerms.include", - "type": "string", + "type": "CompoundType", "tags": [], "label": "include", "description": [], "signature": [ - "string | undefined" + "number[] | string[] | undefined" + ], + "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.AggParamsTerms.includeIsRegex", + "type": "CompoundType", + "tags": [], + "label": "includeIsRegex", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.AggParamsTerms.excludeIsRegex", + "type": "CompoundType", + "tags": [], + "label": "excludeIsRegex", + "description": [], + "signature": [ + "boolean | undefined" ], "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", "deprecated": false diff --git a/api_docs/data_search.mdx b/api_docs/data_search.mdx index d81d7e826f866..118f29ebf2274 100644 --- a/api_docs/data_search.mdx +++ b/api_docs/data_search.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/data-search title: "data.search" image: https://source.unsplash.com/400x175/?github summary: API docs for the data.search plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.search'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3084 | 34 | 2411 | 21 | +| 3086 | 34 | 2413 | 21 | ## Client diff --git a/api_docs/data_view_editor.mdx b/api_docs/data_view_editor.mdx index 3afc79d490af8..0bb4aa802aeac 100644 --- a/api_docs/data_view_editor.mdx +++ b/api_docs/data_view_editor.mdx @@ -4,13 +4,13 @@ slug: /kibana-dev-docs/api/dataViewEditor title: "dataViewEditor" image: https://source.unsplash.com/400x175/?github summary: API docs for the dataViewEditor plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewEditor'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- import dataViewEditorObj from './data_view_editor.devdocs.json'; -This plugin provides the ability to create data views via a modal flyout from any kibana app +This plugin provides the ability to create data views via a modal flyout inside Kibana apps Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) for questions regarding this plugin. diff --git a/api_docs/data_view_field_editor.mdx b/api_docs/data_view_field_editor.mdx index 6d6d2ce3fa5d8..fa8ffab9a17ee 100644 --- a/api_docs/data_view_field_editor.mdx +++ b/api_docs/data_view_field_editor.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dataViewFieldEditor title: "dataViewFieldEditor" image: https://source.unsplash.com/400x175/?github summary: API docs for the dataViewFieldEditor plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewFieldEditor'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/data_view_management.mdx b/api_docs/data_view_management.mdx index 59f73b2afe36b..a69b717cb5e8d 100644 --- a/api_docs/data_view_management.mdx +++ b/api_docs/data_view_management.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dataViewManagement title: "dataViewManagement" image: https://source.unsplash.com/400x175/?github summary: API docs for the dataViewManagement plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewManagement'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/data_views.devdocs.json b/api_docs/data_views.devdocs.json index 1bfe6c6015ca7..67d2a65cd5a19 100644 --- a/api_docs/data_views.devdocs.json +++ b/api_docs/data_views.devdocs.json @@ -62,7 +62,17 @@ "\nMap of field formats by field name" ], "signature": [ - "{ [x: string]: any; }" + "{ [x: string]: ", + { + "pluginId": "fieldFormats", + "scope": "common", + "docId": "kibFieldFormatsPluginApi", + "section": "def-common.SerializedFieldFormat", + "text": "SerializedFieldFormat" + }, + "<{}, ", + "SerializableRecord", + ">; }" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false @@ -159,7 +169,7 @@ "label": "flattenHit", "description": [], "signature": [ - "(hit: Record, deep?: boolean | undefined) => Record" + "(hit: Record, deep?: boolean | undefined) => Record" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, @@ -183,7 +193,7 @@ "label": "hit", "description": [], "signature": [ - "{ [x: string]: any; }" + "{ [x: string]: unknown[]; }" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false @@ -2268,7 +2278,15 @@ "section": "def-common.GetFieldsOptions", "text": "GetFieldsOptions" }, - ") => Promise" + ") => Promise<", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + "[]>" ], "path": "src/plugins/data_views/public/data_views/data_views_api_client.ts", "deprecated": false, @@ -2947,7 +2965,13 @@ "() => Promise<", "SavedObject", "<", - "DataViewSavedObjectAttrs", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewSavedObjectAttrs", + "text": "DataViewSavedObjectAttrs" + }, ">[] | null | undefined>" ], "path": "src/plugins/data_views/common/data_views/data_views.ts", @@ -4101,7 +4125,23 @@ "label": "update", "description": [], "signature": [ - "(type: string, id: string, attributes: Record, options: Record) => Promise<", + "(type: string, id: string, attributes: ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + }, + ", options: ", + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-public.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, + ") => Promise<", "SavedObject", ">" ], @@ -4144,7 +4184,13 @@ "label": "attributes", "description": [], "signature": [ - "Record" + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + } ], "path": "src/plugins/data_views/public/saved_objects_client_wrapper.ts", "deprecated": false, @@ -4158,7 +4204,14 @@ "label": "options", "description": [], "signature": [ - "Record" + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-public.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, + "" ], "path": "src/plugins/data_views/public/saved_objects_client_wrapper.ts", "deprecated": false, @@ -4175,7 +4228,23 @@ "label": "create", "description": [], "signature": [ - "(type: string, attributes: Record, options: Record) => Promise<", + "(type: string, attributes: ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + }, + ", options?: ", + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-public.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, + " | undefined) => Promise<", "SavedObject", ">" ], @@ -4204,7 +4273,13 @@ "label": "attributes", "description": [], "signature": [ - "Record" + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + } ], "path": "src/plugins/data_views/public/saved_objects_client_wrapper.ts", "deprecated": false, @@ -4218,11 +4293,18 @@ "label": "options", "description": [], "signature": [ - "Record" + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-public.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, + " | undefined" ], "path": "src/plugins/data_views/public/saved_objects_client_wrapper.ts", "deprecated": false, - "isRequired": true + "isRequired": false } ], "returnComment": [] @@ -4339,7 +4421,7 @@ "label": "get", "description": [], "signature": [ - "(key: string) => Promise" + "(key: string) => Promise" ], "path": "src/plugins/data_views/public/ui_settings_wrapper.ts", "deprecated": false, @@ -4369,11 +4451,11 @@ "label": "getAll", "description": [], "signature": [ - "() => Promise() => Promise>>" + ") | undefined>>" ], "path": "src/plugins/data_views/public/ui_settings_wrapper.ts", "deprecated": false, @@ -4388,7 +4470,7 @@ "label": "set", "description": [], "signature": [ - "(key: string, value: any) => Promise" + "(key: string, value: unknown) => Promise" ], "path": "src/plugins/data_views/public/ui_settings_wrapper.ts", "deprecated": false, @@ -4410,12 +4492,12 @@ { "parentPluginId": "dataViews", "id": "def-public.UiSettingsPublicToCommon.set.$2", - "type": "Any", + "type": "Unknown", "tags": [], "label": "value", "description": [], "signature": [ - "any" + "unknown" ], "path": "src/plugins/data_views/public/ui_settings_wrapper.ts", "deprecated": false, @@ -5625,7 +5707,23 @@ "\nUpdate a saved object by id" ], "signature": [ - "(type: string, id: string, attributes: Record, options: Record) => Promise<", + "(type: string, id: string, attributes: ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + }, + ", options: ", + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-public.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, + ") => Promise<", "SavedObject", ">" ], @@ -5674,7 +5772,13 @@ "- attributes to update" ], "signature": [ - "Record" + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + } ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -5690,7 +5794,14 @@ "- client options" ], "signature": [ - "Record" + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-public.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, + "" ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -5709,7 +5820,23 @@ "\nCreate a saved object" ], "signature": [ - "(type: string, attributes: Record, options: Record) => Promise<", + "(type: string, attributes: ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + }, + ", options: ", + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-public.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, + ") => Promise<", "SavedObject", ">" ], @@ -5742,7 +5869,13 @@ "- attributes to set" ], "signature": [ - "Record" + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + } ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -5758,7 +5891,13 @@ "- client options" ], "signature": [ - "Record" + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-public.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + } ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -6175,7 +6314,17 @@ "\nMap of field formats by field name" ], "signature": [ - "{ [x: string]: any; }" + "{ [x: string]: ", + { + "pluginId": "fieldFormats", + "scope": "common", + "docId": "kibFieldFormatsPluginApi", + "section": "def-common.SerializedFieldFormat", + "text": "SerializedFieldFormat" + }, + "<{}, ", + "SerializableRecord", + ">; }" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false @@ -6272,7 +6421,7 @@ "label": "flattenHit", "description": [], "signature": [ - "(hit: Record, deep?: boolean | undefined) => Record" + "(hit: Record, deep?: boolean | undefined) => Record" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, @@ -6296,7 +6445,7 @@ "label": "hit", "description": [], "signature": [ - "{ [x: string]: any; }" + "{ [x: string]: unknown[]; }" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false @@ -8271,7 +8420,13 @@ "() => Promise<", "SavedObject", "<", - "DataViewSavedObjectAttrs", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewSavedObjectAttrs", + "text": "DataViewSavedObjectAttrs" + }, ">[] | null | undefined>" ], "path": "src/plugins/data_views/common/data_views/data_views.ts", @@ -9546,7 +9701,16 @@ "\nGet rollup job capabilities" ], "signature": [ - "(indices: Record) => { [key: string]: any; }" + "(indices: ", + "RollupGetRollupIndexCapsResponse", + ") => ", + { + "pluginId": "dataViews", + "scope": "server", + "docId": "kibDataViewsPluginApi", + "section": "def-server.RollupIndexCapability", + "text": "RollupIndexCapability" + } ], "path": "src/plugins/data_views/server/fetcher/lib/map_capabilities.ts", "deprecated": false, @@ -9561,7 +9725,7 @@ "rollup job index capabilites" ], "signature": [ - "Record" + "RollupGetRollupIndexCapsResponse" ], "path": "src/plugins/data_views/server/fetcher/lib/map_capabilities.ts", "deprecated": false, @@ -9897,6 +10061,44 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "dataViews", + "id": "def-server.RollupIndexCapability", + "type": "Interface", + "tags": [], + "label": "RollupIndexCapability", + "description": [ + "\nA record of capabilities (aggregations) for index rollup jobs" + ], + "path": "src/plugins/data_views/server/fetcher/lib/map_capabilities.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "dataViews", + "id": "def-server.RollupIndexCapability.Unnamed", + "type": "IndexSignature", + "tags": [], + "label": "[index: string]: { aggs?: Dictionary | undefined; error?: string | undefined; }", + "description": [ + "\nA record of capabilities (aggregations) for an index rollup job" + ], + "signature": [ + "[index: string]: { aggs?: _.Dictionary<", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.AggregationRestrictions", + "text": "AggregationRestrictions" + }, + "> | undefined; error?: string | undefined; }" + ], + "path": "src/plugins/data_views/server/fetcher/lib/map_capabilities.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "dataViews", "id": "def-server.SavedObjectsClientCommon", @@ -10021,7 +10223,23 @@ "\nUpdate a saved object by id" ], "signature": [ - "(type: string, id: string, attributes: Record, options: Record) => Promise<", + "(type: string, id: string, attributes: ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + }, + ", options: ", + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-public.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, + ") => Promise<", "SavedObject", ">" ], @@ -10070,7 +10288,13 @@ "- attributes to update" ], "signature": [ - "Record" + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + } ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -10086,7 +10310,14 @@ "- client options" ], "signature": [ - "Record" + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-public.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, + "" ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -10105,7 +10336,23 @@ "\nCreate a saved object" ], "signature": [ - "(type: string, attributes: Record, options: Record) => Promise<", + "(type: string, attributes: ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + }, + ", options: ", + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-public.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, + ") => Promise<", "SavedObject", ">" ], @@ -10138,7 +10385,13 @@ "- attributes to set" ], "signature": [ - "Record" + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + } ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -10154,7 +10407,13 @@ "- client options" ], "signature": [ - "Record" + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-public.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + } ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -12195,7 +12454,17 @@ "\nMap of field formats by field name" ], "signature": [ - "{ [x: string]: any; }" + "{ [x: string]: ", + { + "pluginId": "fieldFormats", + "scope": "common", + "docId": "kibFieldFormatsPluginApi", + "section": "def-common.SerializedFieldFormat", + "text": "SerializedFieldFormat" + }, + "<{}, ", + "SerializableRecord", + ">; }" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false @@ -12292,7 +12561,7 @@ "label": "flattenHit", "description": [], "signature": [ - "(hit: Record, deep?: boolean | undefined) => Record" + "(hit: Record, deep?: boolean | undefined) => Record" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, @@ -12316,7 +12585,7 @@ "label": "hit", "description": [], "signature": [ - "{ [x: string]: any; }" + "{ [x: string]: unknown[]; }" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false @@ -14739,7 +15008,13 @@ "() => Promise<", "SavedObject", "<", - "DataViewSavedObjectAttrs", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewSavedObjectAttrs", + "text": "DataViewSavedObjectAttrs" + }, ">[] | null | undefined>" ], "path": "src/plugins/data_views/common/data_views/data_views.ts", @@ -17165,7 +17440,13 @@ "() => Promise<", "SavedObject", "<", - "DataViewSavedObjectAttrs", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewSavedObjectAttrs", + "text": "DataViewSavedObjectAttrs" + }, ">[] | null | undefined>" ], "path": "src/plugins/data_views/common/data_views/data_views.ts", @@ -18047,7 +18328,15 @@ "section": "def-common.GetFieldsOptions", "text": "GetFieldsOptions" }, - ") => Promise" + ") => Promise<", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + "[]>" ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -19025,7 +19314,23 @@ "\nUpdate a saved object by id" ], "signature": [ - "(type: string, id: string, attributes: Record, options: Record) => Promise<", + "(type: string, id: string, attributes: ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + }, + ", options: ", + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-public.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, + ") => Promise<", "SavedObject", ">" ], @@ -19074,7 +19379,13 @@ "- attributes to update" ], "signature": [ - "Record" + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + } ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -19090,7 +19401,14 @@ "- client options" ], "signature": [ - "Record" + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-public.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, + "" ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -19109,7 +19427,23 @@ "\nCreate a saved object" ], "signature": [ - "(type: string, attributes: Record, options: Record) => Promise<", + "(type: string, attributes: ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + }, + ", options: ", + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-public.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, + ") => Promise<", "SavedObject", ">" ], @@ -19142,7 +19476,13 @@ "- attributes to set" ], "signature": [ - "Record" + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + } ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -19158,7 +19498,13 @@ "- client options" ], "signature": [ - "Record" + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-public.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + } ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -19454,7 +19800,7 @@ "\nGet a setting value" ], "signature": [ - "(key: string) => Promise" + "(key: string) => Promise" ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -19505,7 +19851,7 @@ "\nSet a setting value" ], "signature": [ - "(key: string, value: T) => Promise" + "(key: string, value: T) => Promise" ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -19651,6 +19997,20 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "dataViews", + "id": "def-common.DataViewSavedObjectAttrs", + "type": "Type", + "tags": [], + "label": "DataViewSavedObjectAttrs", + "description": [], + "signature": [ + "{ type?: string | undefined; name?: string | undefined; title: string; typeMeta?: string | undefined; }" + ], + "path": "src/plugins/data_views/common/data_views/data_views.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "dataViews", "id": "def-common.DataViewsContract", @@ -19704,7 +20064,13 @@ "[]>; clearCache: () => void; clearInstanceCache: (id?: string | undefined) => void; getCache: () => Promise<", "SavedObject", "<", - "DataViewSavedObjectAttrs", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewSavedObjectAttrs", + "text": "DataViewSavedObjectAttrs" + }, ">[] | null | undefined>; getDefault: () => Promise<", { "pluginId": "dataViews", @@ -20611,7 +20977,7 @@ "tags": [], "label": "DEFAULT_ASSETS_TO_IGNORE", "description": [ - "\nUsed to determine if the instance has any user created index patterns by filtering index patterns\nthat are created and backed only by Fleet server data\nShould be revised after https://github.com/elastic/kibana/issues/82851 is fixed\nFor more background see: https://github.com/elastic/kibana/issues/107020" + "\nUsed to determine if the instance has some user created index patterns by filtering index patterns\nthat are created and backed only by Fleet server data\nShould be revised after https://github.com/elastic/kibana/issues/82851 is fixed\nFor more background see: https://github.com/elastic/kibana/issues/107020" ], "path": "src/plugins/data_views/common/constants.ts", "deprecated": false, diff --git a/api_docs/data_views.mdx b/api_docs/data_views.mdx index 9741565392548..f20f2382bfca4 100644 --- a/api_docs/data_views.mdx +++ b/api_docs/data_views.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dataViews title: "dataViews" image: https://source.unsplash.com/400x175/?github summary: API docs for the dataViews plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViews'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 942 | 1 | 202 | 1 | +| 945 | 0 | 203 | 0 | ## Client diff --git a/api_docs/data_visualizer.mdx b/api_docs/data_visualizer.mdx index 485c79e9c4869..37c627cf80451 100644 --- a/api_docs/data_visualizer.mdx +++ b/api_docs/data_visualizer.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dataVisualizer title: "dataVisualizer" image: https://source.unsplash.com/400x175/?github summary: API docs for the dataVisualizer plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataVisualizer'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/deprecations_by_api.mdx b/api_docs/deprecations_by_api.mdx index 69723b1ca7c4f..499ad4334793c 100644 --- a/api_docs/deprecations_by_api.mdx +++ b/api_docs/deprecations_by_api.mdx @@ -3,7 +3,7 @@ id: kibDevDocsDeprecationsByApi slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-api title: Deprecated API usage by API summary: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. --- diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index 3a291feac49fc..6a1ea57aea28c 100644 --- a/api_docs/deprecations_by_plugin.mdx +++ b/api_docs/deprecations_by_plugin.mdx @@ -3,7 +3,7 @@ id: kibDevDocsDeprecationsByPlugin slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-plugin title: Deprecated API usage by plugin summary: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. --- diff --git a/api_docs/deprecations_by_team.mdx b/api_docs/deprecations_by_team.mdx index 87d23e5091ddc..8868f93ec8e00 100644 --- a/api_docs/deprecations_by_team.mdx +++ b/api_docs/deprecations_by_team.mdx @@ -3,7 +3,7 @@ id: kibDevDocsDeprecationsDueByTeam slug: /kibana-dev-docs/api-meta/deprecations-due-by-team title: Deprecated APIs due to be removed, by team summary: Lists the teams that are referencing deprecated APIs with a remove by date. -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. --- diff --git a/api_docs/dev_tools.mdx b/api_docs/dev_tools.mdx index acc0aa8ba7eff..20ebfc84291fc 100644 --- a/api_docs/dev_tools.mdx +++ b/api_docs/dev_tools.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/devTools title: "devTools" image: https://source.unsplash.com/400x175/?github summary: API docs for the devTools plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'devTools'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/discover.devdocs.json b/api_docs/discover.devdocs.json index 75e40b7995159..558ae3d9d0452 100644 --- a/api_docs/discover.devdocs.json +++ b/api_docs/discover.devdocs.json @@ -930,6 +930,19 @@ ], "path": "src/plugins/discover/public/services/saved_searches/types.ts", "deprecated": false + }, + { + "parentPluginId": "discover", + "id": "def-public.SavedSearch.rowsPerPage", + "type": "number", + "tags": [], + "label": "rowsPerPage", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "src/plugins/discover/public/services/saved_searches/types.ts", + "deprecated": false } ], "initialIsOpen": false @@ -1054,6 +1067,19 @@ ], "path": "src/plugins/discover/public/embeddable/types.ts", "deprecated": false + }, + { + "parentPluginId": "discover", + "id": "def-public.SearchInput.rowsPerPage", + "type": "number", + "tags": [], + "label": "rowsPerPage", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "src/plugins/discover/public/embeddable/types.ts", + "deprecated": false } ], "initialIsOpen": false @@ -1406,6 +1432,20 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "discover", + "id": "def-common.SAMPLE_ROWS_PER_PAGE_SETTING", + "type": "string", + "tags": [], + "label": "SAMPLE_ROWS_PER_PAGE_SETTING", + "description": [], + "signature": [ + "\"discover:sampleRowsPerPage\"" + ], + "path": "src/plugins/discover/common/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "discover", "id": "def-common.SAMPLE_SIZE_SETTING", diff --git a/api_docs/discover.mdx b/api_docs/discover.mdx index d9e7f42b4b070..43a0e0b59482b 100644 --- a/api_docs/discover.mdx +++ b/api_docs/discover.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/discover title: "discover" image: https://source.unsplash.com/400x175/?github summary: API docs for the discover plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discover'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-disco | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 79 | 0 | 63 | 7 | +| 82 | 0 | 66 | 7 | ## Client diff --git a/api_docs/discover_enhanced.mdx b/api_docs/discover_enhanced.mdx index 2bae3fe8f0b8c..669edb3032b44 100644 --- a/api_docs/discover_enhanced.mdx +++ b/api_docs/discover_enhanced.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/discoverEnhanced title: "discoverEnhanced" image: https://source.unsplash.com/400x175/?github summary: API docs for the discoverEnhanced plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discoverEnhanced'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/elastic_apm_synthtrace.mdx b/api_docs/elastic_apm_synthtrace.mdx index 45d6e3bd130f4..fcab3e14cc589 100644 --- a/api_docs/elastic_apm_synthtrace.mdx +++ b/api_docs/elastic_apm_synthtrace.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/elastic-apm-synthtrace title: "@elastic/apm-synthtrace" image: https://source.unsplash.com/400x175/?github summary: API docs for the @elastic/apm-synthtrace plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@elastic/apm-synthtrace'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/embeddable.mdx b/api_docs/embeddable.mdx index e45491d9ac373..47dae44dedae4 100644 --- a/api_docs/embeddable.mdx +++ b/api_docs/embeddable.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/embeddable title: "embeddable" image: https://source.unsplash.com/400x175/?github summary: API docs for the embeddable plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddable'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/embeddable_enhanced.mdx b/api_docs/embeddable_enhanced.mdx index 4616a8d9220d2..78567c41c1b8c 100644 --- a/api_docs/embeddable_enhanced.mdx +++ b/api_docs/embeddable_enhanced.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/embeddableEnhanced title: "embeddableEnhanced" image: https://source.unsplash.com/400x175/?github summary: API docs for the embeddableEnhanced plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddableEnhanced'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/encrypted_saved_objects.mdx b/api_docs/encrypted_saved_objects.mdx index 4e2e1a1a8e281..3d295e6f68ae2 100644 --- a/api_docs/encrypted_saved_objects.mdx +++ b/api_docs/encrypted_saved_objects.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/encryptedSavedObjects title: "encryptedSavedObjects" image: https://source.unsplash.com/400x175/?github summary: API docs for the encryptedSavedObjects plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'encryptedSavedObjects'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/enterprise_search.mdx b/api_docs/enterprise_search.mdx index c854d50582d25..d6dcec886d4ab 100644 --- a/api_docs/enterprise_search.mdx +++ b/api_docs/enterprise_search.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/enterpriseSearch title: "enterpriseSearch" image: https://source.unsplash.com/400x175/?github summary: API docs for the enterpriseSearch plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'enterpriseSearch'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/es_ui_shared.mdx b/api_docs/es_ui_shared.mdx index c5ce56d97b062..03ccb6764b485 100644 --- a/api_docs/es_ui_shared.mdx +++ b/api_docs/es_ui_shared.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/esUiShared title: "esUiShared" image: https://source.unsplash.com/400x175/?github summary: API docs for the esUiShared plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esUiShared'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/event_annotation.mdx b/api_docs/event_annotation.mdx index a237ca7b191cb..7c3e5e9d553a4 100644 --- a/api_docs/event_annotation.mdx +++ b/api_docs/event_annotation.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/eventAnnotation title: "eventAnnotation" image: https://source.unsplash.com/400x175/?github summary: API docs for the eventAnnotation plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventAnnotation'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/event_log.mdx b/api_docs/event_log.mdx index 18ed511cb44b4..aa5a58256ea79 100644 --- a/api_docs/event_log.mdx +++ b/api_docs/event_log.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/eventLog title: "eventLog" image: https://source.unsplash.com/400x175/?github summary: API docs for the eventLog plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventLog'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_error.mdx b/api_docs/expression_error.mdx index be1f893ddbff2..747834024a674 100644 --- a/api_docs/expression_error.mdx +++ b/api_docs/expression_error.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionError title: "expressionError" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionError plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionError'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_gauge.mdx b/api_docs/expression_gauge.mdx index 378e1ac923e90..72cb6d8d24c81 100644 --- a/api_docs/expression_gauge.mdx +++ b/api_docs/expression_gauge.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionGauge title: "expressionGauge" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionGauge plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionGauge'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_heatmap.mdx b/api_docs/expression_heatmap.mdx index 40788f8749649..9a56ab94fe45a 100644 --- a/api_docs/expression_heatmap.mdx +++ b/api_docs/expression_heatmap.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionHeatmap title: "expressionHeatmap" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionHeatmap plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionHeatmap'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_image.mdx b/api_docs/expression_image.mdx index 8ca88594eee96..79abbd1ce1241 100644 --- a/api_docs/expression_image.mdx +++ b/api_docs/expression_image.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionImage title: "expressionImage" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionImage plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionImage'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_legacy_metric_vis.mdx b/api_docs/expression_legacy_metric_vis.mdx index 87302eb4be7f7..e7b20028907e0 100644 --- a/api_docs/expression_legacy_metric_vis.mdx +++ b/api_docs/expression_legacy_metric_vis.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionLegacyMetricVis title: "expressionLegacyMetricVis" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionLegacyMetricVis plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionLegacyMetricVis'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_metric.mdx b/api_docs/expression_metric.mdx index 9bdbdb4130edc..bb38f4cb4c2ab 100644 --- a/api_docs/expression_metric.mdx +++ b/api_docs/expression_metric.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionMetric title: "expressionMetric" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionMetric plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetric'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_metric_vis.mdx b/api_docs/expression_metric_vis.mdx index af2c5d7e0fbb9..22251646e207a 100644 --- a/api_docs/expression_metric_vis.mdx +++ b/api_docs/expression_metric_vis.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionMetricVis title: "expressionMetricVis" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionMetricVis plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetricVis'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_partition_vis.mdx b/api_docs/expression_partition_vis.mdx index bfb71a59f72e8..da0ad82e4a3f7 100644 --- a/api_docs/expression_partition_vis.mdx +++ b/api_docs/expression_partition_vis.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionPartitionVis title: "expressionPartitionVis" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionPartitionVis plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionPartitionVis'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_repeat_image.mdx b/api_docs/expression_repeat_image.mdx index 67e63d9582a1d..7313355ebdf57 100644 --- a/api_docs/expression_repeat_image.mdx +++ b/api_docs/expression_repeat_image.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionRepeatImage title: "expressionRepeatImage" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionRepeatImage plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRepeatImage'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_reveal_image.mdx b/api_docs/expression_reveal_image.mdx index b2406997c58a8..6b149d4df94b2 100644 --- a/api_docs/expression_reveal_image.mdx +++ b/api_docs/expression_reveal_image.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionRevealImage title: "expressionRevealImage" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionRevealImage plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRevealImage'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_shape.mdx b/api_docs/expression_shape.mdx index c5b94361d61d2..e3a58f66ad9a9 100644 --- a/api_docs/expression_shape.mdx +++ b/api_docs/expression_shape.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionShape title: "expressionShape" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionShape plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionShape'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_tagcloud.mdx b/api_docs/expression_tagcloud.mdx index aa057ab60ee13..8d00e64570f61 100644 --- a/api_docs/expression_tagcloud.mdx +++ b/api_docs/expression_tagcloud.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionTagcloud title: "expressionTagcloud" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionTagcloud plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionTagcloud'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_x_y.mdx b/api_docs/expression_x_y.mdx index ecb7c7680c25b..85fba6795c797 100644 --- a/api_docs/expression_x_y.mdx +++ b/api_docs/expression_x_y.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionXY title: "expressionXY" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionXY plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionXY'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expressions.mdx b/api_docs/expressions.mdx index 273f86782c69e..5da9289aaf7ca 100644 --- a/api_docs/expressions.mdx +++ b/api_docs/expressions.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressions title: "expressions" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressions plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressions'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/features.mdx b/api_docs/features.mdx index 3e8a35f5d2d06..635bf2b76c598 100644 --- a/api_docs/features.mdx +++ b/api_docs/features.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/features title: "features" image: https://source.unsplash.com/400x175/?github summary: API docs for the features plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'features'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/field_formats.mdx b/api_docs/field_formats.mdx index 4335ba03db064..91231a1bcd6b2 100644 --- a/api_docs/field_formats.mdx +++ b/api_docs/field_formats.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/fieldFormats title: "fieldFormats" image: https://source.unsplash.com/400x175/?github summary: API docs for the fieldFormats plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fieldFormats'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/file_upload.mdx b/api_docs/file_upload.mdx index 9d023ad6391b8..687d40d352579 100644 --- a/api_docs/file_upload.mdx +++ b/api_docs/file_upload.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/fileUpload title: "fileUpload" image: https://source.unsplash.com/400x175/?github summary: API docs for the fileUpload plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fileUpload'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/fleet.mdx b/api_docs/fleet.mdx index 29367fcb6a257..173c7d7087e8d 100644 --- a/api_docs/fleet.mdx +++ b/api_docs/fleet.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/fleet title: "fleet" image: https://source.unsplash.com/400x175/?github summary: API docs for the fleet plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fleet'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/global_search.mdx b/api_docs/global_search.mdx index 9c0752a04be87..7b4af1f64ea80 100644 --- a/api_docs/global_search.mdx +++ b/api_docs/global_search.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/globalSearch title: "globalSearch" image: https://source.unsplash.com/400x175/?github summary: API docs for the globalSearch plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'globalSearch'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/home.mdx b/api_docs/home.mdx index 3dc7563ba9bfc..fc9a532f228c5 100644 --- a/api_docs/home.mdx +++ b/api_docs/home.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/home title: "home" image: https://source.unsplash.com/400x175/?github summary: API docs for the home plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'home'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/index_lifecycle_management.mdx b/api_docs/index_lifecycle_management.mdx index a8fc6fe04ea5a..540a4144787b1 100644 --- a/api_docs/index_lifecycle_management.mdx +++ b/api_docs/index_lifecycle_management.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/indexLifecycleManagement title: "indexLifecycleManagement" image: https://source.unsplash.com/400x175/?github summary: API docs for the indexLifecycleManagement plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexLifecycleManagement'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/index_management.mdx b/api_docs/index_management.mdx index a6ac43de97662..f74c86686a518 100644 --- a/api_docs/index_management.mdx +++ b/api_docs/index_management.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/indexManagement title: "indexManagement" image: https://source.unsplash.com/400x175/?github summary: API docs for the indexManagement plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexManagement'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/infra.mdx b/api_docs/infra.mdx index 7ba4659f6348f..c3e0f954b035c 100644 --- a/api_docs/infra.mdx +++ b/api_docs/infra.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/infra title: "infra" image: https://source.unsplash.com/400x175/?github summary: API docs for the infra plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'infra'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/inspector.mdx b/api_docs/inspector.mdx index 584e6abb1630a..7738387eff1e9 100644 --- a/api_docs/inspector.mdx +++ b/api_docs/inspector.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/inspector title: "inspector" image: https://source.unsplash.com/400x175/?github summary: API docs for the inspector plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inspector'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/interactive_setup.mdx b/api_docs/interactive_setup.mdx index 12171e9aea8c6..c95ffdae90684 100644 --- a/api_docs/interactive_setup.mdx +++ b/api_docs/interactive_setup.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/interactiveSetup title: "interactiveSetup" image: https://source.unsplash.com/400x175/?github summary: API docs for the interactiveSetup plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'interactiveSetup'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_ace.mdx b/api_docs/kbn_ace.mdx index f7a5aa1ba34c4..ef960589645a8 100644 --- a/api_docs/kbn_ace.mdx +++ b/api_docs/kbn_ace.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-ace title: "@kbn/ace" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/ace plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ace'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_aiops_components.mdx b/api_docs/kbn_aiops_components.mdx index 7fe6879fc0a98..0572d77684963 100644 --- a/api_docs/kbn_aiops_components.mdx +++ b/api_docs/kbn_aiops_components.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-components title: "@kbn/aiops-components" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/aiops-components plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-components'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_aiops_utils.mdx b/api_docs/kbn_aiops_utils.mdx index d588c875be891..7b2b9d344cf1c 100644 --- a/api_docs/kbn_aiops_utils.mdx +++ b/api_docs/kbn_aiops_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-utils title: "@kbn/aiops-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/aiops-utils plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_alerts.mdx b/api_docs/kbn_alerts.mdx index 4151966898afd..63cb779d3a03f 100644 --- a/api_docs/kbn_alerts.mdx +++ b/api_docs/kbn_alerts.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-alerts title: "@kbn/alerts" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/alerts plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_analytics.mdx b/api_docs/kbn_analytics.mdx index abf2c56f63660..6c8c0f22196de 100644 --- a/api_docs/kbn_analytics.mdx +++ b/api_docs/kbn_analytics.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-analytics title: "@kbn/analytics" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/analytics plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_analytics_client.mdx b/api_docs/kbn_analytics_client.mdx index f0075b2f34a97..d15dc47508f77 100644 --- a/api_docs/kbn_analytics_client.mdx +++ b/api_docs/kbn_analytics_client.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-client title: "@kbn/analytics-client" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/analytics-client plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-client'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx index 0c5262d9d7e76..7460b971c8cae 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-browser title: "@kbn/analytics-shippers-elastic-v3-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/analytics-shippers-elastic-v3-browser plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx index e51cb6154e245..4ad68d4ebd6fb 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-common title: "@kbn/analytics-shippers-elastic-v3-common" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/analytics-shippers-elastic-v3-common plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-common'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx index d62d0583095ff..23c5a7d23f6da 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-server title: "@kbn/analytics-shippers-elastic-v3-server" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/analytics-shippers-elastic-v3-server plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-server'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_analytics_shippers_fullstory.mdx b/api_docs/kbn_analytics_shippers_fullstory.mdx index 3565559e153ed..829237324321b 100644 --- a/api_docs/kbn_analytics_shippers_fullstory.mdx +++ b/api_docs/kbn_analytics_shippers_fullstory.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-fullstory title: "@kbn/analytics-shippers-fullstory" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/analytics-shippers-fullstory plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-fullstory'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_apm_config_loader.mdx b/api_docs/kbn_apm_config_loader.mdx index 48c3ae21913e0..e2687083fae4d 100644 --- a/api_docs/kbn_apm_config_loader.mdx +++ b/api_docs/kbn_apm_config_loader.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-apm-config-loader title: "@kbn/apm-config-loader" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/apm-config-loader plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-config-loader'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_apm_utils.mdx b/api_docs/kbn_apm_utils.mdx index caac0144f37f8..abfa679dce22c 100644 --- a/api_docs/kbn_apm_utils.mdx +++ b/api_docs/kbn_apm_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-apm-utils title: "@kbn/apm-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/apm-utils plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_axe_config.mdx b/api_docs/kbn_axe_config.mdx index 69a1c45f3ebdb..3f36177e31549 100644 --- a/api_docs/kbn_axe_config.mdx +++ b/api_docs/kbn_axe_config.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-axe-config title: "@kbn/axe-config" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/axe-config plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/axe-config'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_bazel_packages.mdx b/api_docs/kbn_bazel_packages.mdx index f8c88614c9a7d..1c122e82c79d5 100644 --- a/api_docs/kbn_bazel_packages.mdx +++ b/api_docs/kbn_bazel_packages.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-bazel-packages title: "@kbn/bazel-packages" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/bazel-packages plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/bazel-packages'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_ci_stats_core.mdx b/api_docs/kbn_ci_stats_core.mdx index c567060edef42..ecbfb1cb81fa5 100644 --- a/api_docs/kbn_ci_stats_core.mdx +++ b/api_docs/kbn_ci_stats_core.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-core title: "@kbn/ci-stats-core" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/ci-stats-core plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-core'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_ci_stats_performance_metrics.mdx b/api_docs/kbn_ci_stats_performance_metrics.mdx index 7c3d0dfd6342e..a7064763b3931 100644 --- a/api_docs/kbn_ci_stats_performance_metrics.mdx +++ b/api_docs/kbn_ci_stats_performance_metrics.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-performance-metrics title: "@kbn/ci-stats-performance-metrics" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/ci-stats-performance-metrics plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-performance-metrics'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_ci_stats_reporter.mdx b/api_docs/kbn_ci_stats_reporter.mdx index 3c270dac58e26..1c8c9ddbaa462 100644 --- a/api_docs/kbn_ci_stats_reporter.mdx +++ b/api_docs/kbn_ci_stats_reporter.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-reporter title: "@kbn/ci-stats-reporter" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/ci-stats-reporter plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-reporter'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_cli_dev_mode.mdx b/api_docs/kbn_cli_dev_mode.mdx index 74a7946b8e5b4..e5bd7823a8849 100644 --- a/api_docs/kbn_cli_dev_mode.mdx +++ b/api_docs/kbn_cli_dev_mode.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-cli-dev-mode title: "@kbn/cli-dev-mode" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/cli-dev-mode plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cli-dev-mode'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_coloring.mdx b/api_docs/kbn_coloring.mdx index 4e3eb8213df8a..301262c1ced72 100644 --- a/api_docs/kbn_coloring.mdx +++ b/api_docs/kbn_coloring.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-coloring title: "@kbn/coloring" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/coloring plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/coloring'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_config.mdx b/api_docs/kbn_config.mdx index 060135c1cdf7a..d85444d67a9d8 100644 --- a/api_docs/kbn_config.mdx +++ b/api_docs/kbn_config.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-config title: "@kbn/config" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/config plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_config_mocks.mdx b/api_docs/kbn_config_mocks.mdx index 4c6fb53784157..3d56e33cf097d 100644 --- a/api_docs/kbn_config_mocks.mdx +++ b/api_docs/kbn_config_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-config-mocks title: "@kbn/config-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/config-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_config_schema.mdx b/api_docs/kbn_config_schema.mdx index 72944fcc693d8..6b45074568517 100644 --- a/api_docs/kbn_config_schema.mdx +++ b/api_docs/kbn_config_schema.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-config-schema title: "@kbn/config-schema" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/config-schema plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-schema'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_analytics_browser.mdx b/api_docs/kbn_core_analytics_browser.mdx index 3631526a5698e..16134781e94bd 100644 --- a/api_docs/kbn_core_analytics_browser.mdx +++ b/api_docs/kbn_core_analytics_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser title: "@kbn/core-analytics-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-analytics-browser plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_analytics_browser_internal.mdx b/api_docs/kbn_core_analytics_browser_internal.mdx index af12ffe836dcf..648599326f054 100644 --- a/api_docs/kbn_core_analytics_browser_internal.mdx +++ b/api_docs/kbn_core_analytics_browser_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-internal title: "@kbn/core-analytics-browser-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-analytics-browser-internal plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_analytics_browser_mocks.mdx b/api_docs/kbn_core_analytics_browser_mocks.mdx index 140384dff9b49..3ba311545f75f 100644 --- a/api_docs/kbn_core_analytics_browser_mocks.mdx +++ b/api_docs/kbn_core_analytics_browser_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-mocks title: "@kbn/core-analytics-browser-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-analytics-browser-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_analytics_server.mdx b/api_docs/kbn_core_analytics_server.mdx index 096a553060e2c..0580413b0bcb0 100644 --- a/api_docs/kbn_core_analytics_server.mdx +++ b/api_docs/kbn_core_analytics_server.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server title: "@kbn/core-analytics-server" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-analytics-server plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_analytics_server_internal.mdx b/api_docs/kbn_core_analytics_server_internal.mdx index 82bc96747dd24..01a1485314ea9 100644 --- a/api_docs/kbn_core_analytics_server_internal.mdx +++ b/api_docs/kbn_core_analytics_server_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-internal title: "@kbn/core-analytics-server-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-analytics-server-internal plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_analytics_server_mocks.mdx b/api_docs/kbn_core_analytics_server_mocks.mdx index e3b252f78ab86..e82026d3e9566 100644 --- a/api_docs/kbn_core_analytics_server_mocks.mdx +++ b/api_docs/kbn_core_analytics_server_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-mocks title: "@kbn/core-analytics-server-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-analytics-server-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_base_browser_mocks.mdx b/api_docs/kbn_core_base_browser_mocks.mdx index ff46d36fa700f..a1be66687aa24 100644 --- a/api_docs/kbn_core_base_browser_mocks.mdx +++ b/api_docs/kbn_core_base_browser_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-browser-mocks title: "@kbn/core-base-browser-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-base-browser-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-browser-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_base_common.mdx b/api_docs/kbn_core_base_common.mdx index e0420c1ac4b2c..d780e7f6b4e97 100644 --- a/api_docs/kbn_core_base_common.mdx +++ b/api_docs/kbn_core_base_common.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-common title: "@kbn/core-base-common" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-base-common plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-common'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_base_server_internal.mdx b/api_docs/kbn_core_base_server_internal.mdx index c06fcee9b1f3e..ea8eb03b79a17 100644 --- a/api_docs/kbn_core_base_server_internal.mdx +++ b/api_docs/kbn_core_base_server_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-internal title: "@kbn/core-base-server-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-base-server-internal plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_base_server_mocks.mdx b/api_docs/kbn_core_base_server_mocks.mdx index f6a527f3a2368..f7c002d5050c5 100644 --- a/api_docs/kbn_core_base_server_mocks.mdx +++ b/api_docs/kbn_core_base_server_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-mocks title: "@kbn/core-base-server-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-base-server-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_config_server_internal.mdx b/api_docs/kbn_core_config_server_internal.mdx index 3c4007bf26a3d..82ff587cbf502 100644 --- a/api_docs/kbn_core_config_server_internal.mdx +++ b/api_docs/kbn_core_config_server_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-config-server-internal title: "@kbn/core-config-server-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-config-server-internal plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-config-server-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_deprecations_browser.mdx b/api_docs/kbn_core_deprecations_browser.mdx index 708b2b0eb50ad..438ecc8cfc90a 100644 --- a/api_docs/kbn_core_deprecations_browser.mdx +++ b/api_docs/kbn_core_deprecations_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser title: "@kbn/core-deprecations-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-deprecations-browser plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_deprecations_browser_internal.mdx b/api_docs/kbn_core_deprecations_browser_internal.mdx index 8b7e47b6072d3..04ff7ecfe37e0 100644 --- a/api_docs/kbn_core_deprecations_browser_internal.mdx +++ b/api_docs/kbn_core_deprecations_browser_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser-internal title: "@kbn/core-deprecations-browser-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-deprecations-browser-internal plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_deprecations_browser_mocks.mdx b/api_docs/kbn_core_deprecations_browser_mocks.mdx index aa54a541b78d3..e44e75865b2b3 100644 --- a/api_docs/kbn_core_deprecations_browser_mocks.mdx +++ b/api_docs/kbn_core_deprecations_browser_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser-mocks title: "@kbn/core-deprecations-browser-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-deprecations-browser-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_deprecations_common.mdx b/api_docs/kbn_core_deprecations_common.mdx index 69699efc1f281..1b3f5d0f9c6ae 100644 --- a/api_docs/kbn_core_deprecations_common.mdx +++ b/api_docs/kbn_core_deprecations_common.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-common title: "@kbn/core-deprecations-common" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-deprecations-common plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-common'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_doc_links_browser.mdx b/api_docs/kbn_core_doc_links_browser.mdx index 7a0dcfd7098a6..0a8ef656c2048 100644 --- a/api_docs/kbn_core_doc_links_browser.mdx +++ b/api_docs/kbn_core_doc_links_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser title: "@kbn/core-doc-links-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-doc-links-browser plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_doc_links_browser_mocks.mdx b/api_docs/kbn_core_doc_links_browser_mocks.mdx index 6a494350fa13b..2f29ad08c4262 100644 --- a/api_docs/kbn_core_doc_links_browser_mocks.mdx +++ b/api_docs/kbn_core_doc_links_browser_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser-mocks title: "@kbn/core-doc-links-browser-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-doc-links-browser-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-browser-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_doc_links_server.mdx b/api_docs/kbn_core_doc_links_server.mdx index 4176d5e6cb53a..5b916f3e93da2 100644 --- a/api_docs/kbn_core_doc_links_server.mdx +++ b/api_docs/kbn_core_doc_links_server.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server title: "@kbn/core-doc-links-server" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-doc-links-server plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-server'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_doc_links_server_mocks.mdx b/api_docs/kbn_core_doc_links_server_mocks.mdx index 5b9bb42c327eb..f948b3195d968 100644 --- a/api_docs/kbn_core_doc_links_server_mocks.mdx +++ b/api_docs/kbn_core_doc_links_server_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server-mocks title: "@kbn/core-doc-links-server-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-doc-links-server-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-server-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_environment_server_internal.mdx b/api_docs/kbn_core_environment_server_internal.mdx index b3b73d8609515..52d5c3e9b6ef5 100644 --- a/api_docs/kbn_core_environment_server_internal.mdx +++ b/api_docs/kbn_core_environment_server_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-internal title: "@kbn/core-environment-server-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-environment-server-internal plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_environment_server_mocks.mdx b/api_docs/kbn_core_environment_server_mocks.mdx index 375349a5731ab..fee94559fdc6c 100644 --- a/api_docs/kbn_core_environment_server_mocks.mdx +++ b/api_docs/kbn_core_environment_server_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-mocks title: "@kbn/core-environment-server-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-environment-server-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_execution_context_browser.mdx b/api_docs/kbn_core_execution_context_browser.mdx index e715b3e7b210e..f212a9c5f60b1 100644 --- a/api_docs/kbn_core_execution_context_browser.mdx +++ b/api_docs/kbn_core_execution_context_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser title: "@kbn/core-execution-context-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-execution-context-browser plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_execution_context_browser_internal.mdx b/api_docs/kbn_core_execution_context_browser_internal.mdx index 9d8d3bbd39238..0bb070f0ad9bc 100644 --- a/api_docs/kbn_core_execution_context_browser_internal.mdx +++ b/api_docs/kbn_core_execution_context_browser_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser-internal title: "@kbn/core-execution-context-browser-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-execution-context-browser-internal plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_execution_context_browser_mocks.mdx b/api_docs/kbn_core_execution_context_browser_mocks.mdx index 111e36e0f8c01..b43c59f31e615 100644 --- a/api_docs/kbn_core_execution_context_browser_mocks.mdx +++ b/api_docs/kbn_core_execution_context_browser_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser-mocks title: "@kbn/core-execution-context-browser-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-execution-context-browser-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_execution_context_common.mdx b/api_docs/kbn_core_execution_context_common.mdx index bc39602716256..d61dbf7ededa6 100644 --- a/api_docs/kbn_core_execution_context_common.mdx +++ b/api_docs/kbn_core_execution_context_common.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-common title: "@kbn/core-execution-context-common" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-execution-context-common plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-common'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_execution_context_server.mdx b/api_docs/kbn_core_execution_context_server.mdx index f27e9a4f2ce8b..fc7f2351ea388 100644 --- a/api_docs/kbn_core_execution_context_server.mdx +++ b/api_docs/kbn_core_execution_context_server.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server title: "@kbn/core-execution-context-server" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-execution-context-server plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_execution_context_server_internal.mdx b/api_docs/kbn_core_execution_context_server_internal.mdx index 0f51c63032e17..06feed61c0065 100644 --- a/api_docs/kbn_core_execution_context_server_internal.mdx +++ b/api_docs/kbn_core_execution_context_server_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server-internal title: "@kbn/core-execution-context-server-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-execution-context-server-internal plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_execution_context_server_mocks.mdx b/api_docs/kbn_core_execution_context_server_mocks.mdx index 6d572fa0fb5c6..771350a3463bc 100644 --- a/api_docs/kbn_core_execution_context_server_mocks.mdx +++ b/api_docs/kbn_core_execution_context_server_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server-mocks title: "@kbn/core-execution-context-server-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-execution-context-server-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_fatal_errors_browser.mdx b/api_docs/kbn_core_fatal_errors_browser.mdx index 336478758ca5b..5fda7f16c2092 100644 --- a/api_docs/kbn_core_fatal_errors_browser.mdx +++ b/api_docs/kbn_core_fatal_errors_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser title: "@kbn/core-fatal-errors-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-fatal-errors-browser plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx index 474b7cca45b37..d9dbb59b3ba5c 100644 --- a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx +++ b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser-mocks title: "@kbn/core-fatal-errors-browser-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-fatal-errors-browser-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_http_browser.mdx b/api_docs/kbn_core_http_browser.mdx index de98e28829160..f329eedf3402b 100644 --- a/api_docs/kbn_core_http_browser.mdx +++ b/api_docs/kbn_core_http_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser title: "@kbn/core-http-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-http-browser plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_http_browser_internal.mdx b/api_docs/kbn_core_http_browser_internal.mdx index 4f219a19d8a32..21e89ca0f1c3e 100644 --- a/api_docs/kbn_core_http_browser_internal.mdx +++ b/api_docs/kbn_core_http_browser_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-internal title: "@kbn/core-http-browser-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-http-browser-internal plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_http_browser_mocks.mdx b/api_docs/kbn_core_http_browser_mocks.mdx index 52d2182b2b1ed..88e5263f5e95b 100644 --- a/api_docs/kbn_core_http_browser_mocks.mdx +++ b/api_docs/kbn_core_http_browser_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-mocks title: "@kbn/core-http-browser-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-http-browser-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_http_common.mdx b/api_docs/kbn_core_http_common.mdx index 7196f83f9efb9..c030acdcab337 100644 --- a/api_docs/kbn_core_http_common.mdx +++ b/api_docs/kbn_core_http_common.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-common title: "@kbn/core-http-common" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-http-common plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-common'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_http_context_server_mocks.mdx b/api_docs/kbn_core_http_context_server_mocks.mdx index 8fadf5dcb3b2f..5b4d8a757d2a4 100644 --- a/api_docs/kbn_core_http_context_server_mocks.mdx +++ b/api_docs/kbn_core_http_context_server_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-context-server-mocks title: "@kbn/core-http-context-server-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-http-context-server-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-context-server-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_http_router_server_internal.mdx b/api_docs/kbn_core_http_router_server_internal.mdx index 58425920bfe8b..7f699f2183c1c 100644 --- a/api_docs/kbn_core_http_router_server_internal.mdx +++ b/api_docs/kbn_core_http_router_server_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-router-server-internal title: "@kbn/core-http-router-server-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-http-router-server-internal plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-router-server-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_http_router_server_mocks.mdx b/api_docs/kbn_core_http_router_server_mocks.mdx index 3e67192557cb8..0b702ece79b24 100644 --- a/api_docs/kbn_core_http_router_server_mocks.mdx +++ b/api_docs/kbn_core_http_router_server_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-router-server-mocks title: "@kbn/core-http-router-server-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-http-router-server-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-router-server-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_http_server.mdx b/api_docs/kbn_core_http_server.mdx index ccb9d8d5d8097..e44485fd4cb8e 100644 --- a/api_docs/kbn_core_http_server.mdx +++ b/api_docs/kbn_core_http_server.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server title: "@kbn/core-http-server" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-http-server plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_http_server_internal.mdx b/api_docs/kbn_core_http_server_internal.mdx index 2ff416435bbe6..ab917281d972f 100644 --- a/api_docs/kbn_core_http_server_internal.mdx +++ b/api_docs/kbn_core_http_server_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-internal title: "@kbn/core-http-server-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-http-server-internal plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_http_server_mocks.mdx b/api_docs/kbn_core_http_server_mocks.mdx index edaffc6dc3ad5..f19eb4aa08d8c 100644 --- a/api_docs/kbn_core_http_server_mocks.mdx +++ b/api_docs/kbn_core_http_server_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-mocks title: "@kbn/core-http-server-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-http-server-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_i18n_browser.mdx b/api_docs/kbn_core_i18n_browser.mdx index 54c60f23376a6..6ed3f1bdc03a0 100644 --- a/api_docs/kbn_core_i18n_browser.mdx +++ b/api_docs/kbn_core_i18n_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser title: "@kbn/core-i18n-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-i18n-browser plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_i18n_browser_mocks.mdx b/api_docs/kbn_core_i18n_browser_mocks.mdx index 437c05d74d861..b19f99d3547f9 100644 --- a/api_docs/kbn_core_i18n_browser_mocks.mdx +++ b/api_docs/kbn_core_i18n_browser_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser-mocks title: "@kbn/core-i18n-browser-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-i18n-browser-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_injected_metadata_browser.mdx b/api_docs/kbn_core_injected_metadata_browser.mdx index 24aa49e4f316a..e1d2592bdfa4c 100644 --- a/api_docs/kbn_core_injected_metadata_browser.mdx +++ b/api_docs/kbn_core_injected_metadata_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-injected-metadata-browser title: "@kbn/core-injected-metadata-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-injected-metadata-browser plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-injected-metadata-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx index 8ab6a2b010bcf..31afe966a00f0 100644 --- a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx +++ b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-injected-metadata-browser-mocks title: "@kbn/core-injected-metadata-browser-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-injected-metadata-browser-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-injected-metadata-browser-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_integrations_browser_internal.devdocs.json b/api_docs/kbn_core_integrations_browser_internal.devdocs.json new file mode 100644 index 0000000000000..c80088c04b03b --- /dev/null +++ b/api_docs/kbn_core_integrations_browser_internal.devdocs.json @@ -0,0 +1,54 @@ +{ + "id": "@kbn/core-integrations-browser-internal", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [ + { + "parentPluginId": "@kbn/core-integrations-browser-internal", + "id": "def-common.IntegrationsServiceSetupDeps", + "type": "Interface", + "tags": [], + "label": "IntegrationsServiceSetupDeps", + "description": [], + "path": "packages/core/integrations/core-integrations-browser-internal/src/integrations_service.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/core-integrations-browser-internal", + "id": "def-common.IntegrationsServiceSetupDeps.uiSettings", + "type": "Object", + "tags": [], + "label": "uiSettings", + "description": [], + "signature": [ + "IUiSettingsClient" + ], + "path": "packages/core/integrations/core-integrations-browser-internal/src/integrations_service.ts", + "deprecated": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_core_integrations_browser_internal.mdx b/api_docs/kbn_core_integrations_browser_internal.mdx new file mode 100644 index 0000000000000..ba3d097c02e14 --- /dev/null +++ b/api_docs/kbn_core_integrations_browser_internal.mdx @@ -0,0 +1,27 @@ +--- +id: kibKbnCoreIntegrationsBrowserInternalPluginApi +slug: /kibana-dev-docs/api/kbn-core-integrations-browser-internal +title: "@kbn/core-integrations-browser-internal" +image: https://source.unsplash.com/400x175/?github +summary: API docs for the @kbn/core-integrations-browser-internal plugin +date: 2022-07-20 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-integrations-browser-internal'] +warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. +--- +import kbnCoreIntegrationsBrowserInternalObj from './kbn_core_integrations_browser_internal.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 2 | 0 | 2 | 0 | + +## Common + +### Interfaces + + diff --git a/api_docs/kbn_core_integrations_browser_mocks.devdocs.json b/api_docs/kbn_core_integrations_browser_mocks.devdocs.json new file mode 100644 index 0000000000000..98bd9b1a37568 --- /dev/null +++ b/api_docs/kbn_core_integrations_browser_mocks.devdocs.json @@ -0,0 +1,103 @@ +{ + "id": "@kbn/core-integrations-browser-mocks", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/core-integrations-browser-mocks", + "id": "def-common.IntegrationsServiceContract", + "type": "Type", + "tags": [], + "label": "IntegrationsServiceContract", + "description": [], + "signature": [ + "{ setup: () => Promise; start: ({ uiSettings }: ", + "IntegrationsServiceSetupDeps", + ") => Promise; stop: () => Promise; }" + ], + "path": "packages/core/integrations/core-integrations-browser-mocks/src/integrations_service.mock.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-integrations-browser-mocks", + "id": "def-common.IntegrationsServiceMock", + "type": "Type", + "tags": [], + "label": "IntegrationsServiceMock", + "description": [], + "signature": [ + "{ setup: jest.MockInstance, []>; start: jest.MockInstance, [", + "IntegrationsServiceSetupDeps", + "]>; stop: jest.MockInstance, []>; } & ", + { + "pluginId": "@kbn/core-integrations-browser-mocks", + "scope": "common", + "docId": "kibKbnCoreIntegrationsBrowserMocksPluginApi", + "section": "def-common.IntegrationsServiceContract", + "text": "IntegrationsServiceContract" + } + ], + "path": "packages/core/integrations/core-integrations-browser-mocks/src/integrations_service.mock.ts", + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [ + { + "parentPluginId": "@kbn/core-integrations-browser-mocks", + "id": "def-common.integrationsServiceMock", + "type": "Object", + "tags": [], + "label": "integrationsServiceMock", + "description": [], + "path": "packages/core/integrations/core-integrations-browser-mocks/src/integrations_service.mock.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/core-integrations-browser-mocks", + "id": "def-common.integrationsServiceMock.create", + "type": "Function", + "tags": [], + "label": "create", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "@kbn/core-integrations-browser-mocks", + "scope": "common", + "docId": "kibKbnCoreIntegrationsBrowserMocksPluginApi", + "section": "def-common.IntegrationsServiceMock", + "text": "IntegrationsServiceMock" + } + ], + "path": "packages/core/integrations/core-integrations-browser-mocks/src/integrations_service.mock.ts", + "deprecated": false, + "returnComment": [], + "children": [] + } + ], + "initialIsOpen": false + } + ] + } +} \ No newline at end of file diff --git a/api_docs/kbn_core_integrations_browser_mocks.mdx b/api_docs/kbn_core_integrations_browser_mocks.mdx new file mode 100644 index 0000000000000..14263edb1082d --- /dev/null +++ b/api_docs/kbn_core_integrations_browser_mocks.mdx @@ -0,0 +1,30 @@ +--- +id: kibKbnCoreIntegrationsBrowserMocksPluginApi +slug: /kibana-dev-docs/api/kbn-core-integrations-browser-mocks +title: "@kbn/core-integrations-browser-mocks" +image: https://source.unsplash.com/400x175/?github +summary: API docs for the @kbn/core-integrations-browser-mocks plugin +date: 2022-07-20 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-integrations-browser-mocks'] +warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. +--- +import kbnCoreIntegrationsBrowserMocksObj from './kbn_core_integrations_browser_mocks.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 4 | 0 | 4 | 0 | + +## Common + +### Objects + + +### Consts, variables and types + + diff --git a/api_docs/kbn_core_logging_server.mdx b/api_docs/kbn_core_logging_server.mdx index a98b97af8e9aa..8562ea9e85768 100644 --- a/api_docs/kbn_core_logging_server.mdx +++ b/api_docs/kbn_core_logging_server.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server title: "@kbn/core-logging-server" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-logging-server plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_logging_server_internal.mdx b/api_docs/kbn_core_logging_server_internal.mdx index ffd2a31b3892b..c62b3f494f1ab 100644 --- a/api_docs/kbn_core_logging_server_internal.mdx +++ b/api_docs/kbn_core_logging_server_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-internal title: "@kbn/core-logging-server-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-logging-server-internal plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_logging_server_mocks.mdx b/api_docs/kbn_core_logging_server_mocks.mdx index f19319b94159f..e6b5d870c5a88 100644 --- a/api_docs/kbn_core_logging_server_mocks.mdx +++ b/api_docs/kbn_core_logging_server_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-mocks title: "@kbn/core-logging-server-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-logging-server-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_node_server.mdx b/api_docs/kbn_core_node_server.mdx index 8476a1d53a83d..01eebb0405ba9 100644 --- a/api_docs/kbn_core_node_server.mdx +++ b/api_docs/kbn_core_node_server.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server title: "@kbn/core-node-server" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-node-server plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_node_server_internal.mdx b/api_docs/kbn_core_node_server_internal.mdx index 7116954f2dd13..7180227c5be61 100644 --- a/api_docs/kbn_core_node_server_internal.mdx +++ b/api_docs/kbn_core_node_server_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-internal title: "@kbn/core-node-server-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-node-server-internal plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_node_server_mocks.mdx b/api_docs/kbn_core_node_server_mocks.mdx index 3b17ced717751..b9ec8199d125c 100644 --- a/api_docs/kbn_core_node_server_mocks.mdx +++ b/api_docs/kbn_core_node_server_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-mocks title: "@kbn/core-node-server-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-node-server-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_preboot_server.mdx b/api_docs/kbn_core_preboot_server.mdx index 4c273caac2979..1c7a908b8f480 100644 --- a/api_docs/kbn_core_preboot_server.mdx +++ b/api_docs/kbn_core_preboot_server.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server title: "@kbn/core-preboot-server" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-preboot-server plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_preboot_server_mocks.mdx b/api_docs/kbn_core_preboot_server_mocks.mdx index 54e34857d5477..5aaaa210831b8 100644 --- a/api_docs/kbn_core_preboot_server_mocks.mdx +++ b/api_docs/kbn_core_preboot_server_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server-mocks title: "@kbn/core-preboot-server-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-preboot-server-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_test_helpers_http_setup_browser.mdx b/api_docs/kbn_core_test_helpers_http_setup_browser.mdx index 614f625acc0b3..90cf668572199 100644 --- a/api_docs/kbn_core_test_helpers_http_setup_browser.mdx +++ b/api_docs/kbn_core_test_helpers_http_setup_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-http-setup-browser title: "@kbn/core-test-helpers-http-setup-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-test-helpers-http-setup-browser plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-http-setup-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_theme_browser.mdx b/api_docs/kbn_core_theme_browser.mdx index 04596179b0860..9d31a29898c13 100644 --- a/api_docs/kbn_core_theme_browser.mdx +++ b/api_docs/kbn_core_theme_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser title: "@kbn/core-theme-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-theme-browser plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_theme_browser_internal.mdx b/api_docs/kbn_core_theme_browser_internal.mdx index 00c5ec336de4e..902f76fe234de 100644 --- a/api_docs/kbn_core_theme_browser_internal.mdx +++ b/api_docs/kbn_core_theme_browser_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser-internal title: "@kbn/core-theme-browser-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-theme-browser-internal plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_theme_browser_mocks.mdx b/api_docs/kbn_core_theme_browser_mocks.mdx index c80d97174ddbb..151cbaa77a070 100644 --- a/api_docs/kbn_core_theme_browser_mocks.mdx +++ b/api_docs/kbn_core_theme_browser_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser-mocks title: "@kbn/core-theme-browser-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-theme-browser-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_ui_settings_browser.mdx b/api_docs/kbn_core_ui_settings_browser.mdx index f3fccf7df0384..d09badd6058c3 100644 --- a/api_docs/kbn_core_ui_settings_browser.mdx +++ b/api_docs/kbn_core_ui_settings_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser title: "@kbn/core-ui-settings-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-ui-settings-browser plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_ui_settings_browser_internal.mdx b/api_docs/kbn_core_ui_settings_browser_internal.mdx index 799b23810a3ff..0634e8c7d1a10 100644 --- a/api_docs/kbn_core_ui_settings_browser_internal.mdx +++ b/api_docs/kbn_core_ui_settings_browser_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser-internal title: "@kbn/core-ui-settings-browser-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-ui-settings-browser-internal plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_ui_settings_browser_mocks.mdx b/api_docs/kbn_core_ui_settings_browser_mocks.mdx index 65e00817b0bc4..49ec53ef565ed 100644 --- a/api_docs/kbn_core_ui_settings_browser_mocks.mdx +++ b/api_docs/kbn_core_ui_settings_browser_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser-mocks title: "@kbn/core-ui-settings-browser-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-ui-settings-browser-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_ui_settings_common.devdocs.json b/api_docs/kbn_core_ui_settings_common.devdocs.json index 21aed9b1e1f86..439a926b8f4e0 100644 --- a/api_docs/kbn_core_ui_settings_common.devdocs.json +++ b/api_docs/kbn_core_ui_settings_common.devdocs.json @@ -144,14 +144,14 @@ { "parentPluginId": "@kbn/core-ui-settings-common", "id": "def-common.UiSettingsParams.options", - "type": "Array", + "type": "CompoundType", "tags": [], "label": "options", "description": [ "array of permitted values for this setting" ], "signature": [ - "string[] | undefined" + "number[] | string[] | undefined" ], "path": "packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts", "deprecated": false @@ -382,7 +382,7 @@ "section": "def-common.UiSettingsType", "text": "UiSettingsType" }, - " | undefined; name?: string | undefined; order?: number | undefined; value?: unknown; description?: string | undefined; options?: string[] | undefined; category?: string[] | undefined; optionLabels?: Record | undefined; requiresPageReload?: boolean | undefined; readonly?: boolean | undefined; sensitive?: boolean | undefined; deprecation?: ", + " | undefined; name?: string | undefined; order?: number | undefined; value?: unknown; description?: string | undefined; options?: number[] | string[] | undefined; category?: string[] | undefined; optionLabels?: Record | undefined; requiresPageReload?: boolean | undefined; readonly?: boolean | undefined; sensitive?: boolean | undefined; deprecation?: ", { "pluginId": "@kbn/core-ui-settings-common", "scope": "common", diff --git a/api_docs/kbn_core_ui_settings_common.mdx b/api_docs/kbn_core_ui_settings_common.mdx index 602249e144392..bf64ec5b55a09 100644 --- a/api_docs/kbn_core_ui_settings_common.mdx +++ b/api_docs/kbn_core_ui_settings_common.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-common title: "@kbn/core-ui-settings-common" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-ui-settings-common plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-common'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_crypto.mdx b/api_docs/kbn_crypto.mdx index 9117b37029160..d26469aa1883a 100644 --- a/api_docs/kbn_crypto.mdx +++ b/api_docs/kbn_crypto.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-crypto title: "@kbn/crypto" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/crypto plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_crypto_browser.mdx b/api_docs/kbn_crypto_browser.mdx index 3fc6168a3f654..d239eaad3b72c 100644 --- a/api_docs/kbn_crypto_browser.mdx +++ b/api_docs/kbn_crypto_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-crypto-browser title: "@kbn/crypto-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/crypto-browser plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_datemath.mdx b/api_docs/kbn_datemath.mdx index 249f8116e32ff..7924e93e694a4 100644 --- a/api_docs/kbn_datemath.mdx +++ b/api_docs/kbn_datemath.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-datemath title: "@kbn/datemath" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/datemath plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/datemath'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_dev_cli_errors.mdx b/api_docs/kbn_dev_cli_errors.mdx index 25d515b9b110b..2eeb00cd1080e 100644 --- a/api_docs/kbn_dev_cli_errors.mdx +++ b/api_docs/kbn_dev_cli_errors.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-errors title: "@kbn/dev-cli-errors" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/dev-cli-errors plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-errors'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_dev_cli_runner.mdx b/api_docs/kbn_dev_cli_runner.mdx index 216fa77c98a72..599dd1e475df3 100644 --- a/api_docs/kbn_dev_cli_runner.mdx +++ b/api_docs/kbn_dev_cli_runner.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-runner title: "@kbn/dev-cli-runner" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/dev-cli-runner plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-runner'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_dev_proc_runner.mdx b/api_docs/kbn_dev_proc_runner.mdx index 6a7e2126c4511..146da034cf3cd 100644 --- a/api_docs/kbn_dev_proc_runner.mdx +++ b/api_docs/kbn_dev_proc_runner.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-dev-proc-runner title: "@kbn/dev-proc-runner" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/dev-proc-runner plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-proc-runner'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_dev_utils.mdx b/api_docs/kbn_dev_utils.mdx index 2d7f28481f006..412a527779e0c 100644 --- a/api_docs/kbn_dev_utils.mdx +++ b/api_docs/kbn_dev_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-dev-utils title: "@kbn/dev-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/dev-utils plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_doc_links.mdx b/api_docs/kbn_doc_links.mdx index 86a4ee7be2550..b27a1901964e0 100644 --- a/api_docs/kbn_doc_links.mdx +++ b/api_docs/kbn_doc_links.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-doc-links title: "@kbn/doc-links" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/doc-links plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/doc-links'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_docs_utils.mdx b/api_docs/kbn_docs_utils.mdx index d049419d506a3..21226f4136e88 100644 --- a/api_docs/kbn_docs_utils.mdx +++ b/api_docs/kbn_docs_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-docs-utils title: "@kbn/docs-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/docs-utils plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/docs-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_es_archiver.mdx b/api_docs/kbn_es_archiver.mdx index 9b040970aa806..86e7ede6b3b2e 100644 --- a/api_docs/kbn_es_archiver.mdx +++ b/api_docs/kbn_es_archiver.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-es-archiver title: "@kbn/es-archiver" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/es-archiver plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-archiver'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_es_errors.mdx b/api_docs/kbn_es_errors.mdx index 84fcdb3d55868..c9b31cb916817 100644 --- a/api_docs/kbn_es_errors.mdx +++ b/api_docs/kbn_es_errors.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-es-errors title: "@kbn/es-errors" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/es-errors plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-errors'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_es_query.mdx b/api_docs/kbn_es_query.mdx index ef299c578cb4d..130ba43e80985 100644 --- a/api_docs/kbn_es_query.mdx +++ b/api_docs/kbn_es_query.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-es-query title: "@kbn/es-query" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/es-query plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-query'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_eslint_plugin_imports.mdx b/api_docs/kbn_eslint_plugin_imports.mdx index 0669984ac2b37..db407730b5ed6 100644 --- a/api_docs/kbn_eslint_plugin_imports.mdx +++ b/api_docs/kbn_eslint_plugin_imports.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-eslint-plugin-imports title: "@kbn/eslint-plugin-imports" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/eslint-plugin-imports plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/eslint-plugin-imports'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_field_types.mdx b/api_docs/kbn_field_types.mdx index ac16fa0f1e03e..8ef8335fdb414 100644 --- a/api_docs/kbn_field_types.mdx +++ b/api_docs/kbn_field_types.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-field-types title: "@kbn/field-types" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/field-types plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/field-types'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_find_used_node_modules.mdx b/api_docs/kbn_find_used_node_modules.mdx index b0ddc83d622fc..29ef335900170 100644 --- a/api_docs/kbn_find_used_node_modules.mdx +++ b/api_docs/kbn_find_used_node_modules.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-find-used-node-modules title: "@kbn/find-used-node-modules" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/find-used-node-modules plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/find-used-node-modules'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_generate.mdx b/api_docs/kbn_generate.mdx index 485f286597a7a..14b76190ca733 100644 --- a/api_docs/kbn_generate.mdx +++ b/api_docs/kbn_generate.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-generate title: "@kbn/generate" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/generate plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_handlebars.mdx b/api_docs/kbn_handlebars.mdx index 054a9abb7c6b9..f3891381a3c76 100644 --- a/api_docs/kbn_handlebars.mdx +++ b/api_docs/kbn_handlebars.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-handlebars title: "@kbn/handlebars" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/handlebars plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/handlebars'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_hapi_mocks.mdx b/api_docs/kbn_hapi_mocks.mdx index eb51ea78fdf65..ebb3681cf1ec8 100644 --- a/api_docs/kbn_hapi_mocks.mdx +++ b/api_docs/kbn_hapi_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-hapi-mocks title: "@kbn/hapi-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/hapi-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/hapi-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_home_sample_data_cards.mdx b/api_docs/kbn_home_sample_data_cards.mdx index a743e2185bae5..30ce274ed6401 100644 --- a/api_docs/kbn_home_sample_data_cards.mdx +++ b/api_docs/kbn_home_sample_data_cards.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-home-sample-data-cards title: "@kbn/home-sample-data-cards" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/home-sample-data-cards plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/home-sample-data-cards'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_i18n.mdx b/api_docs/kbn_i18n.mdx index 598bf5ceba0f1..e22687f8ee1a2 100644 --- a/api_docs/kbn_i18n.mdx +++ b/api_docs/kbn_i18n.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-i18n title: "@kbn/i18n" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/i18n plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_import_resolver.mdx b/api_docs/kbn_import_resolver.mdx index 8e243fbe24dcc..974380d8eea54 100644 --- a/api_docs/kbn_import_resolver.mdx +++ b/api_docs/kbn_import_resolver.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-import-resolver title: "@kbn/import-resolver" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/import-resolver plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/import-resolver'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_interpreter.mdx b/api_docs/kbn_interpreter.mdx index 8c178e9b7069b..67db70b1ea867 100644 --- a/api_docs/kbn_interpreter.mdx +++ b/api_docs/kbn_interpreter.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-interpreter title: "@kbn/interpreter" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/interpreter plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/interpreter'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_io_ts_utils.mdx b/api_docs/kbn_io_ts_utils.mdx index c375f05c6551e..8c04c941faff0 100644 --- a/api_docs/kbn_io_ts_utils.mdx +++ b/api_docs/kbn_io_ts_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-io-ts-utils title: "@kbn/io-ts-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/io-ts-utils plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/io-ts-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_jest_serializers.mdx b/api_docs/kbn_jest_serializers.mdx index d6cf6b4a9b959..57faa3e290f65 100644 --- a/api_docs/kbn_jest_serializers.mdx +++ b/api_docs/kbn_jest_serializers.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-jest-serializers title: "@kbn/jest-serializers" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/jest-serializers plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/jest-serializers'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_kibana_json_schema.mdx b/api_docs/kbn_kibana_json_schema.mdx index 39f430a8cefb9..baef6b815d048 100644 --- a/api_docs/kbn_kibana_json_schema.mdx +++ b/api_docs/kbn_kibana_json_schema.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-kibana-json-schema title: "@kbn/kibana-json-schema" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/kibana-json-schema plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/kibana-json-schema'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_logging.mdx b/api_docs/kbn_logging.mdx index a59b5a6acd821..2d88d354bd89e 100644 --- a/api_docs/kbn_logging.mdx +++ b/api_docs/kbn_logging.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-logging title: "@kbn/logging" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/logging plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_logging_mocks.mdx b/api_docs/kbn_logging_mocks.mdx index 0a544fda18b8a..10d88bb7ea9a2 100644 --- a/api_docs/kbn_logging_mocks.mdx +++ b/api_docs/kbn_logging_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-logging-mocks title: "@kbn/logging-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/logging-mocks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_mapbox_gl.mdx b/api_docs/kbn_mapbox_gl.mdx index 67adcf2bf1dea..9a5c201f5b271 100644 --- a/api_docs/kbn_mapbox_gl.mdx +++ b/api_docs/kbn_mapbox_gl.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-mapbox-gl title: "@kbn/mapbox-gl" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/mapbox-gl plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/mapbox-gl'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_ml_agg_utils.mdx b/api_docs/kbn_ml_agg_utils.mdx index 7275770ee27db..a66db45784df8 100644 --- a/api_docs/kbn_ml_agg_utils.mdx +++ b/api_docs/kbn_ml_agg_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-ml-agg-utils title: "@kbn/ml-agg-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/ml-agg-utils plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-agg-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_ml_is_populated_object.mdx b/api_docs/kbn_ml_is_populated_object.mdx index 68dd6fbe240f4..3c0b1b44a6ed5 100644 --- a/api_docs/kbn_ml_is_populated_object.mdx +++ b/api_docs/kbn_ml_is_populated_object.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-ml-is-populated-object title: "@kbn/ml-is-populated-object" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/ml-is-populated-object plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-is-populated-object'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_ml_string_hash.mdx b/api_docs/kbn_ml_string_hash.mdx index fef897cbcdf83..4393fa0b171e9 100644 --- a/api_docs/kbn_ml_string_hash.mdx +++ b/api_docs/kbn_ml_string_hash.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-ml-string-hash title: "@kbn/ml-string-hash" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/ml-string-hash plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-string-hash'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_monaco.mdx b/api_docs/kbn_monaco.mdx index 67fd06f1b49bd..36b2f84479e93 100644 --- a/api_docs/kbn_monaco.mdx +++ b/api_docs/kbn_monaco.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-monaco title: "@kbn/monaco" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/monaco plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/monaco'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_optimizer.mdx b/api_docs/kbn_optimizer.mdx index dd0d700160414..932ae24584a4e 100644 --- a/api_docs/kbn_optimizer.mdx +++ b/api_docs/kbn_optimizer.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer title: "@kbn/optimizer" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/optimizer plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_optimizer_webpack_helpers.mdx b/api_docs/kbn_optimizer_webpack_helpers.mdx index b8003c24d854e..3737c732f91b6 100644 --- a/api_docs/kbn_optimizer_webpack_helpers.mdx +++ b/api_docs/kbn_optimizer_webpack_helpers.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer-webpack-helpers title: "@kbn/optimizer-webpack-helpers" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/optimizer-webpack-helpers plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer-webpack-helpers'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_performance_testing_dataset_extractor.mdx b/api_docs/kbn_performance_testing_dataset_extractor.mdx index 548cb09150880..a160e8a042fe8 100644 --- a/api_docs/kbn_performance_testing_dataset_extractor.mdx +++ b/api_docs/kbn_performance_testing_dataset_extractor.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-performance-testing-dataset-extractor title: "@kbn/performance-testing-dataset-extractor" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/performance-testing-dataset-extractor plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/performance-testing-dataset-extractor'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_plugin_generator.mdx b/api_docs/kbn_plugin_generator.mdx index ecc7ec22a0427..8687dfa99c744 100644 --- a/api_docs/kbn_plugin_generator.mdx +++ b/api_docs/kbn_plugin_generator.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-generator title: "@kbn/plugin-generator" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/plugin-generator plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-generator'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_plugin_helpers.mdx b/api_docs/kbn_plugin_helpers.mdx index d2e93b687064a..97d7af56d27bc 100644 --- a/api_docs/kbn_plugin_helpers.mdx +++ b/api_docs/kbn_plugin_helpers.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-helpers title: "@kbn/plugin-helpers" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/plugin-helpers plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-helpers'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_react_field.mdx b/api_docs/kbn_react_field.mdx index 9fd605bba8f85..a9ab814f89ecc 100644 --- a/api_docs/kbn_react_field.mdx +++ b/api_docs/kbn_react_field.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-react-field title: "@kbn/react-field" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/react-field plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-field'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_rule_data_utils.mdx b/api_docs/kbn_rule_data_utils.mdx index 432a80332f214..a315a711f36a1 100644 --- a/api_docs/kbn_rule_data_utils.mdx +++ b/api_docs/kbn_rule_data_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-rule-data-utils title: "@kbn/rule-data-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/rule-data-utils plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rule-data-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_scalability_simulation_generator.mdx b/api_docs/kbn_scalability_simulation_generator.mdx index 4f183d7dbfc21..60986b7befb32 100644 --- a/api_docs/kbn_scalability_simulation_generator.mdx +++ b/api_docs/kbn_scalability_simulation_generator.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-scalability-simulation-generator title: "@kbn/scalability-simulation-generator" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/scalability-simulation-generator plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/scalability-simulation-generator'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_autocomplete.mdx b/api_docs/kbn_securitysolution_autocomplete.mdx index b5853cea3eb06..c8e2f64adad07 100644 --- a/api_docs/kbn_securitysolution_autocomplete.mdx +++ b/api_docs/kbn_securitysolution_autocomplete.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-autocomplete title: "@kbn/securitysolution-autocomplete" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-autocomplete plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-autocomplete'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_es_utils.mdx b/api_docs/kbn_securitysolution_es_utils.mdx index e499dd7b6d01b..d5b3c3170d091 100644 --- a/api_docs/kbn_securitysolution_es_utils.mdx +++ b/api_docs/kbn_securitysolution_es_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-es-utils title: "@kbn/securitysolution-es-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-es-utils plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-es-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_hook_utils.mdx b/api_docs/kbn_securitysolution_hook_utils.mdx index c10921de20e28..2b4cafe425e4e 100644 --- a/api_docs/kbn_securitysolution_hook_utils.mdx +++ b/api_docs/kbn_securitysolution_hook_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-hook-utils title: "@kbn/securitysolution-hook-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-hook-utils plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-hook-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx index 092252026023b..c6651f265f552 100644 --- a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-alerting-types title: "@kbn/securitysolution-io-ts-alerting-types" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-io-ts-alerting-types plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-alerting-types'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_io_ts_list_types.mdx b/api_docs/kbn_securitysolution_io_ts_list_types.mdx index 35402a5f1fda7..014885622b406 100644 --- a/api_docs/kbn_securitysolution_io_ts_list_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_list_types.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-list-types title: "@kbn/securitysolution-io-ts-list-types" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-io-ts-list-types plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-list-types'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_io_ts_types.mdx b/api_docs/kbn_securitysolution_io_ts_types.mdx index ba3f33397050c..b4ecae32431ca 100644 --- a/api_docs/kbn_securitysolution_io_ts_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_types.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-types title: "@kbn/securitysolution-io-ts-types" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-io-ts-types plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-types'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_io_ts_utils.mdx b/api_docs/kbn_securitysolution_io_ts_utils.mdx index e323ed5c10d1b..4d7ab64d3f03d 100644 --- a/api_docs/kbn_securitysolution_io_ts_utils.mdx +++ b/api_docs/kbn_securitysolution_io_ts_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-utils title: "@kbn/securitysolution-io-ts-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-io-ts-utils plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_list_api.mdx b/api_docs/kbn_securitysolution_list_api.mdx index c2ddb244f439e..51cf9ada7e7e6 100644 --- a/api_docs/kbn_securitysolution_list_api.mdx +++ b/api_docs/kbn_securitysolution_list_api.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-api title: "@kbn/securitysolution-list-api" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-list-api plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-api'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_list_constants.mdx b/api_docs/kbn_securitysolution_list_constants.mdx index 42adc60caa02d..5593d2357604f 100644 --- a/api_docs/kbn_securitysolution_list_constants.mdx +++ b/api_docs/kbn_securitysolution_list_constants.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-constants title: "@kbn/securitysolution-list-constants" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-list-constants plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-constants'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_list_hooks.mdx b/api_docs/kbn_securitysolution_list_hooks.mdx index a6685545b7344..a9ba178736c02 100644 --- a/api_docs/kbn_securitysolution_list_hooks.mdx +++ b/api_docs/kbn_securitysolution_list_hooks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-hooks title: "@kbn/securitysolution-list-hooks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-list-hooks plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-hooks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_list_utils.devdocs.json b/api_docs/kbn_securitysolution_list_utils.devdocs.json index a4f2801c9499e..557c90c7812a6 100644 --- a/api_docs/kbn_securitysolution_list_utils.devdocs.json +++ b/api_docs/kbn_securitysolution_list_utils.devdocs.json @@ -413,6 +413,44 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/securitysolution-list-utils", + "id": "def-common.buildMatchWildcardClause", + "type": "Function", + "tags": [], + "label": "buildMatchWildcardClause", + "description": [], + "signature": [ + "(entry: { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; }) => ", + { + "pluginId": "@kbn/securitysolution-list-utils", + "scope": "common", + "docId": "kibKbnSecuritysolutionListUtilsPluginApi", + "section": "def-common.BooleanFilter", + "text": "BooleanFilter" + } + ], + "path": "packages/kbn-securitysolution-list-utils/src/build_exception_filter/index.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/securitysolution-list-utils", + "id": "def-common.buildMatchWildcardClause.$1", + "type": "Object", + "tags": [], + "label": "entry", + "description": [], + "signature": [ + "{ field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; }" + ], + "path": "packages/kbn-securitysolution-list-utils/src/build_exception_filter/index.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/securitysolution-list-utils", "id": "def-common.buildNestedClause", @@ -3162,6 +3200,27 @@ ], "enums": [], "misc": [ + { + "parentPluginId": "@kbn/securitysolution-list-utils", + "id": "def-common.ALL_OPERATORS", + "type": "Array", + "tags": [], + "label": "ALL_OPERATORS", + "description": [], + "signature": [ + { + "pluginId": "@kbn/securitysolution-list-utils", + "scope": "common", + "docId": "kibKbnSecuritysolutionListUtilsPluginApi", + "section": "def-common.OperatorOption", + "text": "OperatorOption" + }, + "[]" + ], + "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/securitysolution-list-utils", "id": "def-common.BuilderEntry", @@ -3245,10 +3304,10 @@ }, { "parentPluginId": "@kbn/securitysolution-list-utils", - "id": "def-common.EVENT_FILTERS_OPERATORS", + "id": "def-common.DETECTION_ENGINE_EXCEPTION_OPERATORS", "type": "Array", "tags": [], - "label": "EVENT_FILTERS_OPERATORS", + "label": "DETECTION_ENGINE_EXCEPTION_OPERATORS", "description": [], "signature": [ { @@ -3266,10 +3325,10 @@ }, { "parentPluginId": "@kbn/securitysolution-list-utils", - "id": "def-common.EXCEPTION_OPERATORS", + "id": "def-common.EVENT_FILTERS_OPERATORS", "type": "Array", "tags": [], - "label": "EXCEPTION_OPERATORS", + "label": "EVENT_FILTERS_OPERATORS", "description": [], "signature": [ { @@ -3496,6 +3555,67 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/securitysolution-list-utils", + "id": "def-common.doesNotMatchOperator", + "type": "Object", + "tags": [], + "label": "doesNotMatchOperator", + "description": [], + "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/securitysolution-list-utils", + "id": "def-common.doesNotMatchOperator.message", + "type": "string", + "tags": [], + "label": "message", + "description": [], + "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/securitysolution-list-utils", + "id": "def-common.doesNotMatchOperator.operator", + "type": "string", + "tags": [], + "label": "operator", + "description": [], + "signature": [ + "ListOperatorEnum", + ".EXCLUDED" + ], + "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/securitysolution-list-utils", + "id": "def-common.doesNotMatchOperator.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "ListOperatorTypeEnum", + ".WILDCARD" + ], + "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/securitysolution-list-utils", + "id": "def-common.doesNotMatchOperator.value", + "type": "string", + "tags": [], + "label": "value", + "description": [], + "path": "packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/securitysolution-list-utils", "id": "def-common.existsOperator", diff --git a/api_docs/kbn_securitysolution_list_utils.mdx b/api_docs/kbn_securitysolution_list_utils.mdx index 0fb31ee53baa9..5d4441c311fd1 100644 --- a/api_docs/kbn_securitysolution_list_utils.mdx +++ b/api_docs/kbn_securitysolution_list_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-utils title: "@kbn/securitysolution-list-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-list-utils plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 227 | 0 | 179 | 0 | +| 235 | 0 | 187 | 0 | ## Common diff --git a/api_docs/kbn_securitysolution_rules.mdx b/api_docs/kbn_securitysolution_rules.mdx index 14e6d971810fd..aa58ab8ba58d5 100644 --- a/api_docs/kbn_securitysolution_rules.mdx +++ b/api_docs/kbn_securitysolution_rules.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-rules title: "@kbn/securitysolution-rules" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-rules plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-rules'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_t_grid.mdx b/api_docs/kbn_securitysolution_t_grid.mdx index f5170b432ceb6..aa7a01d41d592 100644 --- a/api_docs/kbn_securitysolution_t_grid.mdx +++ b/api_docs/kbn_securitysolution_t_grid.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-t-grid title: "@kbn/securitysolution-t-grid" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-t-grid plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-t-grid'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_utils.mdx b/api_docs/kbn_securitysolution_utils.mdx index bf9da078fcfbf..99da23bde1fd2 100644 --- a/api_docs/kbn_securitysolution_utils.mdx +++ b/api_docs/kbn_securitysolution_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-utils title: "@kbn/securitysolution-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-utils plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_server_http_tools.mdx b/api_docs/kbn_server_http_tools.mdx index 7bc205d1510fa..4c821d8e0ff20 100644 --- a/api_docs/kbn_server_http_tools.mdx +++ b/api_docs/kbn_server_http_tools.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-server-http-tools title: "@kbn/server-http-tools" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/server-http-tools plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-http-tools'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_server_route_repository.mdx b/api_docs/kbn_server_route_repository.mdx index 1b9d37a103a9d..eadadee9a6dee 100644 --- a/api_docs/kbn_server_route_repository.mdx +++ b/api_docs/kbn_server_route_repository.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-server-route-repository title: "@kbn/server-route-repository" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/server-route-repository plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_shared_ux_button_toolbar.mdx b/api_docs/kbn_shared_ux_button_toolbar.mdx index bceb8050cbf94..e5bf475175d4f 100644 --- a/api_docs/kbn_shared_ux_button_toolbar.mdx +++ b/api_docs/kbn_shared_ux_button_toolbar.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-toolbar title: "@kbn/shared-ux-button-toolbar" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/shared-ux-button-toolbar plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-toolbar'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_shared_ux_card_no_data.mdx b/api_docs/kbn_shared_ux_card_no_data.mdx index b2787d6a0e76f..cfaa02e38a065 100644 --- a/api_docs/kbn_shared_ux_card_no_data.mdx +++ b/api_docs/kbn_shared_ux_card_no_data.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-card-no-data title: "@kbn/shared-ux-card-no-data" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/shared-ux-card-no-data plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_shared_ux_components.mdx b/api_docs/kbn_shared_ux_components.mdx index 7e7ac0c2b76b7..ea5ca5a0543c6 100644 --- a/api_docs/kbn_shared_ux_components.mdx +++ b/api_docs/kbn_shared_ux_components.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-components title: "@kbn/shared-ux-components" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/shared-ux-components plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-components'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx index e8a62cf3020aa..7d5af7c06142b 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-analytics-no-data title: "@kbn/shared-ux-page-analytics-no-data" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/shared-ux-page-analytics-no-data plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx index a6935a1291bf8..65633e2d106c5 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-no-data title: "@kbn/shared-ux-page-kibana-no-data" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/shared-ux-page-kibana-no-data plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-no-data'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_shared_ux_page_solution_nav.mdx b/api_docs/kbn_shared_ux_page_solution_nav.mdx index 287664021c38f..0c99e09aeabf5 100644 --- a/api_docs/kbn_shared_ux_page_solution_nav.mdx +++ b/api_docs/kbn_shared_ux_page_solution_nav.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-solution-nav title: "@kbn/shared-ux-page-solution-nav" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/shared-ux-page-solution-nav plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-solution-nav'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx index 2ad3bc2d48936..0776d0627d405 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx +++ b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-no-data-views title: "@kbn/shared-ux-prompt-no-data-views" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/shared-ux-prompt-no-data-views plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_shared_ux_services.mdx b/api_docs/kbn_shared_ux_services.mdx index 8c82114cd765a..9ec9a8ad046f4 100644 --- a/api_docs/kbn_shared_ux_services.mdx +++ b/api_docs/kbn_shared_ux_services.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-services title: "@kbn/shared-ux-services" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/shared-ux-services plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-services'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_shared_ux_storybook.mdx b/api_docs/kbn_shared_ux_storybook.mdx index 0eadbbde2444c..c624ddcb7dd98 100644 --- a/api_docs/kbn_shared_ux_storybook.mdx +++ b/api_docs/kbn_shared_ux_storybook.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-storybook title: "@kbn/shared-ux-storybook" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/shared-ux-storybook plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_shared_ux_utility.mdx b/api_docs/kbn_shared_ux_utility.mdx index 6d748c4893918..2051ac153c097 100644 --- a/api_docs/kbn_shared_ux_utility.mdx +++ b/api_docs/kbn_shared_ux_utility.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-utility title: "@kbn/shared-ux-utility" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/shared-ux-utility plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-utility'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_some_dev_log.mdx b/api_docs/kbn_some_dev_log.mdx index 58817b04defd5..46c8855d5c547 100644 --- a/api_docs/kbn_some_dev_log.mdx +++ b/api_docs/kbn_some_dev_log.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-some-dev-log title: "@kbn/some-dev-log" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/some-dev-log plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/some-dev-log'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_sort_package_json.mdx b/api_docs/kbn_sort_package_json.mdx index 40896f86bdd17..20e11746a6cb7 100644 --- a/api_docs/kbn_sort_package_json.mdx +++ b/api_docs/kbn_sort_package_json.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-sort-package-json title: "@kbn/sort-package-json" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/sort-package-json plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/sort-package-json'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_std.mdx b/api_docs/kbn_std.mdx index 527df24d29e21..42b98501ed760 100644 --- a/api_docs/kbn_std.mdx +++ b/api_docs/kbn_std.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-std title: "@kbn/std" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/std plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/std'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_stdio_dev_helpers.mdx b/api_docs/kbn_stdio_dev_helpers.mdx index ce0bfb59f929c..cd693a01fbf8c 100644 --- a/api_docs/kbn_stdio_dev_helpers.mdx +++ b/api_docs/kbn_stdio_dev_helpers.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-stdio-dev-helpers title: "@kbn/stdio-dev-helpers" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/stdio-dev-helpers plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/stdio-dev-helpers'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_storybook.mdx b/api_docs/kbn_storybook.mdx index 3bed8d3bd000f..33ca20869da9d 100644 --- a/api_docs/kbn_storybook.mdx +++ b/api_docs/kbn_storybook.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-storybook title: "@kbn/storybook" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/storybook plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/storybook'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_telemetry_tools.mdx b/api_docs/kbn_telemetry_tools.mdx index bffa67a16d967..2a4917308c8b4 100644 --- a/api_docs/kbn_telemetry_tools.mdx +++ b/api_docs/kbn_telemetry_tools.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-telemetry-tools title: "@kbn/telemetry-tools" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/telemetry-tools plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/telemetry-tools'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_test.mdx b/api_docs/kbn_test.mdx index 9a64ed35109c2..d26b265440ed6 100644 --- a/api_docs/kbn_test.mdx +++ b/api_docs/kbn_test.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-test title: "@kbn/test" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/test plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_test_jest_helpers.mdx b/api_docs/kbn_test_jest_helpers.mdx index 1d4de451d21c1..4fb4e83c4fa2c 100644 --- a/api_docs/kbn_test_jest_helpers.mdx +++ b/api_docs/kbn_test_jest_helpers.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-test-jest-helpers title: "@kbn/test-jest-helpers" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/test-jest-helpers plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-jest-helpers'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_tooling_log.mdx b/api_docs/kbn_tooling_log.mdx index 06c577ba20af3..ec55c535ebe7b 100644 --- a/api_docs/kbn_tooling_log.mdx +++ b/api_docs/kbn_tooling_log.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-tooling-log title: "@kbn/tooling-log" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/tooling-log plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/tooling-log'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_type_summarizer.mdx b/api_docs/kbn_type_summarizer.mdx index 245ef492ecc22..1aec96470a67f 100644 --- a/api_docs/kbn_type_summarizer.mdx +++ b/api_docs/kbn_type_summarizer.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-type-summarizer title: "@kbn/type-summarizer" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/type-summarizer plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/type-summarizer'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_type_summarizer_core.mdx b/api_docs/kbn_type_summarizer_core.mdx index e7964502f6e55..1077f92e604e7 100644 --- a/api_docs/kbn_type_summarizer_core.mdx +++ b/api_docs/kbn_type_summarizer_core.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-type-summarizer-core title: "@kbn/type-summarizer-core" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/type-summarizer-core plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/type-summarizer-core'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_typed_react_router_config.mdx b/api_docs/kbn_typed_react_router_config.mdx index f9c6113cdf3fd..4256b2b093517 100644 --- a/api_docs/kbn_typed_react_router_config.mdx +++ b/api_docs/kbn_typed_react_router_config.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-typed-react-router-config title: "@kbn/typed-react-router-config" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/typed-react-router-config plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/typed-react-router-config'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_ui_theme.mdx b/api_docs/kbn_ui_theme.mdx index 87dd69738aac0..590ac83265510 100644 --- a/api_docs/kbn_ui_theme.mdx +++ b/api_docs/kbn_ui_theme.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-ui-theme title: "@kbn/ui-theme" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/ui-theme plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-theme'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_utility_types.mdx b/api_docs/kbn_utility_types.mdx index 70a2b95d81ccb..8e94b170084fc 100644 --- a/api_docs/kbn_utility_types.mdx +++ b/api_docs/kbn_utility_types.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types title: "@kbn/utility-types" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/utility-types plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_utility_types_jest.mdx b/api_docs/kbn_utility_types_jest.mdx index aa0dbb789e033..dfff5f692d03c 100644 --- a/api_docs/kbn_utility_types_jest.mdx +++ b/api_docs/kbn_utility_types_jest.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types-jest title: "@kbn/utility-types-jest" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/utility-types-jest plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types-jest'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_utils.mdx b/api_docs/kbn_utils.mdx index fe3a8627a7d3f..635517a8b54cf 100644 --- a/api_docs/kbn_utils.mdx +++ b/api_docs/kbn_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-utils title: "@kbn/utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/utils plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_yarn_lock_validator.mdx b/api_docs/kbn_yarn_lock_validator.mdx index c526dc96bc653..8d5b0ff324848 100644 --- a/api_docs/kbn_yarn_lock_validator.mdx +++ b/api_docs/kbn_yarn_lock_validator.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-yarn-lock-validator title: "@kbn/yarn-lock-validator" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/yarn-lock-validator plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/yarn-lock-validator'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kibana_overview.mdx b/api_docs/kibana_overview.mdx index 90521779db2af..727ccdf9ab44d 100644 --- a/api_docs/kibana_overview.mdx +++ b/api_docs/kibana_overview.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kibanaOverview title: "kibanaOverview" image: https://source.unsplash.com/400x175/?github summary: API docs for the kibanaOverview plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaOverview'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kibana_react.mdx b/api_docs/kibana_react.mdx index ffeaf9dc02add..336a4f6e5ec9d 100644 --- a/api_docs/kibana_react.mdx +++ b/api_docs/kibana_react.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kibanaReact title: "kibanaReact" image: https://source.unsplash.com/400x175/?github summary: API docs for the kibanaReact plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaReact'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kibana_utils.mdx b/api_docs/kibana_utils.mdx index 86da2bc7b0997..196f00ad17401 100644 --- a/api_docs/kibana_utils.mdx +++ b/api_docs/kibana_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kibanaUtils title: "kibanaUtils" image: https://source.unsplash.com/400x175/?github summary: API docs for the kibanaUtils plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaUtils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kubernetes_security.mdx b/api_docs/kubernetes_security.mdx index 9ecb36ce5d136..93ed01eb4775a 100644 --- a/api_docs/kubernetes_security.mdx +++ b/api_docs/kubernetes_security.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kubernetesSecurity title: "kubernetesSecurity" image: https://source.unsplash.com/400x175/?github summary: API docs for the kubernetesSecurity plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kubernetesSecurity'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/lens.devdocs.json b/api_docs/lens.devdocs.json index c27ba2c0d9b0d..a0cb2134f3ed9 100644 --- a/api_docs/lens.devdocs.json +++ b/api_docs/lens.devdocs.json @@ -3681,7 +3681,7 @@ "label": "params", "description": [], "signature": [ - "{ size: number; accuracyMode?: boolean | undefined; orderBy: { type: \"alphabetical\"; fallback?: boolean | undefined; } | { type: \"rare\"; maxDocCount: number; } | { type: \"column\"; columnId: string; } | { type: \"custom\"; }; orderAgg?: ", + "{ size: number; accuracyMode?: boolean | undefined; include?: number[] | string[] | undefined; exclude?: number[] | string[] | undefined; includeIsRegex?: boolean | undefined; excludeIsRegex?: boolean | undefined; orderBy: { type: \"alphabetical\"; fallback?: boolean | undefined; } | { type: \"rare\"; maxDocCount: number; } | { type: \"column\"; columnId: string; } | { type: \"custom\"; }; orderAgg?: ", { "pluginId": "lens", "scope": "public", diff --git a/api_docs/lens.mdx b/api_docs/lens.mdx index 3395d1867a74a..73598e8c87319 100644 --- a/api_docs/lens.mdx +++ b/api_docs/lens.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/lens title: "lens" image: https://source.unsplash.com/400x175/?github summary: API docs for the lens plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lens'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/license_api_guard.mdx b/api_docs/license_api_guard.mdx index dc20106fe7393..91a4a4f920574 100644 --- a/api_docs/license_api_guard.mdx +++ b/api_docs/license_api_guard.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/licenseApiGuard title: "licenseApiGuard" image: https://source.unsplash.com/400x175/?github summary: API docs for the licenseApiGuard plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseApiGuard'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/license_management.mdx b/api_docs/license_management.mdx index 448d9a07ce834..a4aa33117a19d 100644 --- a/api_docs/license_management.mdx +++ b/api_docs/license_management.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/licenseManagement title: "licenseManagement" image: https://source.unsplash.com/400x175/?github summary: API docs for the licenseManagement plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseManagement'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/licensing.mdx b/api_docs/licensing.mdx index dc14e8c4b94d6..52322508e15c3 100644 --- a/api_docs/licensing.mdx +++ b/api_docs/licensing.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/licensing title: "licensing" image: https://source.unsplash.com/400x175/?github summary: API docs for the licensing plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licensing'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/lists.mdx b/api_docs/lists.mdx index a8f68bbbc9e15..5e57784c6888b 100644 --- a/api_docs/lists.mdx +++ b/api_docs/lists.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/lists title: "lists" image: https://source.unsplash.com/400x175/?github summary: API docs for the lists plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lists'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/management.mdx b/api_docs/management.mdx index 9c7987c4e4e2a..15873c6df7d93 100644 --- a/api_docs/management.mdx +++ b/api_docs/management.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/management title: "management" image: https://source.unsplash.com/400x175/?github summary: API docs for the management plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'management'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/maps.mdx b/api_docs/maps.mdx index c7f3f54193eba..59f44f0bee696 100644 --- a/api_docs/maps.mdx +++ b/api_docs/maps.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/maps title: "maps" image: https://source.unsplash.com/400x175/?github summary: API docs for the maps plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'maps'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/maps_ems.mdx b/api_docs/maps_ems.mdx index e863937b16e32..6a73b57230c88 100644 --- a/api_docs/maps_ems.mdx +++ b/api_docs/maps_ems.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/mapsEms title: "mapsEms" image: https://source.unsplash.com/400x175/?github summary: API docs for the mapsEms plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mapsEms'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/ml.mdx b/api_docs/ml.mdx index 7913c8c0095f9..7655841db6be3 100644 --- a/api_docs/ml.mdx +++ b/api_docs/ml.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/ml title: "ml" image: https://source.unsplash.com/400x175/?github summary: API docs for the ml plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ml'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/monitoring.mdx b/api_docs/monitoring.mdx index b1271eb2aff16..7544f3af5044a 100644 --- a/api_docs/monitoring.mdx +++ b/api_docs/monitoring.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/monitoring title: "monitoring" image: https://source.unsplash.com/400x175/?github summary: API docs for the monitoring plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoring'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/monitoring_collection.mdx b/api_docs/monitoring_collection.mdx index 4e30cc5d8f117..ac9d0908b48d6 100644 --- a/api_docs/monitoring_collection.mdx +++ b/api_docs/monitoring_collection.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/monitoringCollection title: "monitoringCollection" image: https://source.unsplash.com/400x175/?github summary: API docs for the monitoringCollection plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoringCollection'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/navigation.mdx b/api_docs/navigation.mdx index bd355adf4fb92..fb9f2d616cf2e 100644 --- a/api_docs/navigation.mdx +++ b/api_docs/navigation.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/navigation title: "navigation" image: https://source.unsplash.com/400x175/?github summary: API docs for the navigation plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'navigation'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/newsfeed.mdx b/api_docs/newsfeed.mdx index 0653f350edcfd..abb84788d032d 100644 --- a/api_docs/newsfeed.mdx +++ b/api_docs/newsfeed.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/newsfeed title: "newsfeed" image: https://source.unsplash.com/400x175/?github summary: API docs for the newsfeed plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'newsfeed'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/observability.devdocs.json b/api_docs/observability.devdocs.json index 1cfc27d1f94fe..8a5367d371726 100644 --- a/api_docs/observability.devdocs.json +++ b/api_docs/observability.devdocs.json @@ -4563,6 +4563,20 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "observability", + "id": "def-public.apmServiceGroupMaxNumberOfServices", + "type": "string", + "tags": [], + "label": "apmServiceGroupMaxNumberOfServices", + "description": [], + "signature": [ + "\"observability:apmServiceGroupMaxNumberOfServices\"" + ], + "path": "x-pack/plugins/observability/common/ui_settings_keys.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "observability", "id": "def-public.DragHandleProps", @@ -7469,6 +7483,20 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "observability", + "id": "def-common.apmServiceGroupMaxNumberOfServices", + "type": "string", + "tags": [], + "label": "apmServiceGroupMaxNumberOfServices", + "description": [], + "signature": [ + "\"observability:apmServiceGroupMaxNumberOfServices\"" + ], + "path": "x-pack/plugins/observability/common/ui_settings_keys.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "observability", "id": "def-common.apmServiceInventoryOptimizedSorting", diff --git a/api_docs/observability.mdx b/api_docs/observability.mdx index f832aeff8be3c..56d58a20d5434 100644 --- a/api_docs/observability.mdx +++ b/api_docs/observability.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/observability title: "observability" image: https://source.unsplash.com/400x175/?github summary: API docs for the observability plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observability'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Observability UI](https://github.com/orgs/elastic/teams/observability-u | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 386 | 2 | 383 | 31 | +| 388 | 2 | 385 | 31 | ## Client diff --git a/api_docs/osquery.mdx b/api_docs/osquery.mdx index b8df0644604d0..92d3e79e57a03 100644 --- a/api_docs/osquery.mdx +++ b/api_docs/osquery.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/osquery title: "osquery" image: https://source.unsplash.com/400x175/?github summary: API docs for the osquery plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'osquery'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/plugin_directory.mdx b/api_docs/plugin_directory.mdx index b94a0db84f2e4..7a107870aa158 100644 --- a/api_docs/plugin_directory.mdx +++ b/api_docs/plugin_directory.mdx @@ -3,7 +3,7 @@ id: kibDevDocsPluginDirectory slug: /kibana-dev-docs/api-meta/plugin-api-directory title: Directory summary: Directory of public APIs available through plugins or packages. -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -12,13 +12,13 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Count | Plugins or Packages with a
public API | Number of teams | |--------------|----------|------------------------| -| 343 | 289 | 36 | +| 346 | 291 | 36 | ### Public API health stats | API Count | Any Count | Missing comments | Missing exports | |--------------|----------|-----------------|--------| -| 27645 | 175 | 19669 | 879 | +| 27685 | 174 | 19707 | 877 | ## Plugin Directory @@ -43,14 +43,14 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Fleet](https://github.com/orgs/elastic/teams/fleet) | Add custom data integrations so they can be displayed in the Fleet integrations app | 102 | 0 | 83 | 1 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds the Dashboard app to Kibana | 143 | 0 | 141 | 12 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 52 | 0 | 51 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 3084 | 34 | 2411 | 21 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | This plugin provides the ability to create data views via a modal flyout from any kibana app | 15 | 0 | 7 | 0 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 3086 | 34 | 2413 | 21 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | This plugin provides the ability to create data views via a modal flyout inside Kibana apps | 15 | 0 | 7 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Reusable data view field editor across Kibana | 41 | 0 | 36 | 3 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data view management app | 2 | 0 | 2 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 942 | 1 | 202 | 1 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 945 | 0 | 203 | 0 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | The Data Visualizer tools help you understand your data, by analyzing the metrics and fields in a log file or an existing Elasticsearch index. | 28 | 3 | 24 | 1 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 10 | 0 | 8 | 2 | -| | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the Discover application and the saved search embeddable. | 79 | 0 | 63 | 7 | +| | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the Discover application and the saved search embeddable. | 82 | 0 | 66 | 7 | | | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 37 | 0 | 35 | 2 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds embeddables service to Kibana | 505 | 0 | 413 | 3 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Extends embeddable plugin with more functionality | 14 | 0 | 14 | 0 | @@ -109,7 +109,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Stack Monitoring](https://github.com/orgs/elastic/teams/stack-monitoring-ui) | - | 9 | 0 | 9 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 34 | 0 | 34 | 2 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 17 | 0 | 17 | 0 | -| | [Observability UI](https://github.com/orgs/elastic/teams/observability-ui) | - | 386 | 2 | 383 | 31 | +| | [Observability UI](https://github.com/orgs/elastic/teams/observability-ui) | - | 388 | 2 | 385 | 31 | | | [Security asset management](https://github.com/orgs/elastic/teams/security-asset-management) | - | 13 | 0 | 13 | 0 | | painlessLab | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Presentation Utility Plugin is a set of common, shared components and toolkits for solutions within the Presentation space, (e.g. Dashboards, Canvas). | 231 | 2 | 180 | 11 | @@ -142,7 +142,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Security solution](https://github.com/orgs/elastic/teams/security-solution) | - | 447 | 1 | 342 | 32 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the transforms features provided by Elastic. Transforms enable you to convert existing Elasticsearch indices into summarized indices, which provide opportunities for new insights and analytics. | 4 | 0 | 4 | 1 | | translations | [Kibana Localization](https://github.com/orgs/elastic/teams/kibana-localization) | - | 0 | 0 | 0 | 0 | -| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 407 | 0 | 386 | 42 | +| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 423 | 0 | 402 | 41 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds UI Actions service to Kibana | 130 | 0 | 91 | 11 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Extends UI Actions plugin with more functionality | 205 | 0 | 142 | 9 | | | [Unified Search](https://github.com/orgs/elastic/teams/kibana-app-services) | Contains all the key functionality of Kibana's unified search experience.Contains all the key functionality of Kibana's unified search experience. | 84 | 2 | 80 | 13 | @@ -238,6 +238,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Owner missing] | - | 3 | 0 | 3 | 0 | | | [Owner missing] | - | 8 | 2 | 6 | 0 | | | [Owner missing] | - | 4 | 0 | 4 | 0 | +| | [Owner missing] | - | 2 | 0 | 2 | 0 | +| | [Owner missing] | - | 4 | 0 | 4 | 0 | | | [Owner missing] | - | 56 | 0 | 30 | 0 | | | [Owner missing] | - | 9 | 0 | 5 | 1 | | | [Owner missing] | - | 13 | 0 | 12 | 0 | @@ -304,7 +306,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Owner missing] | security solution list REST API | 59 | 0 | 58 | 0 | | | [Owner missing] | security solution list constants to use across plugins such lists, security_solution, cases, etc... | 26 | 0 | 12 | 0 | | | [Owner missing] | Security solution list ReactJS hooks | 56 | 0 | 44 | 0 | -| | [Owner missing] | security solution list utilities | 227 | 0 | 179 | 0 | +| | [Owner missing] | security solution list utilities | 235 | 0 | 187 | 0 | | | [Owner missing] | security solution rule utilities to use across plugins | 24 | 0 | 21 | 0 | | | [Owner missing] | security solution t-grid packages will allow sharing components between timelines and security_solution plugin until we transfer all functionality to timelines plugin | 120 | 0 | 116 | 0 | | | [Owner missing] | security solution utilities to use across plugins such lists, security_solution, cases, etc... | 31 | 0 | 29 | 0 | diff --git a/api_docs/presentation_util.mdx b/api_docs/presentation_util.mdx index 89f6191ced27b..d7c9adf44233a 100644 --- a/api_docs/presentation_util.mdx +++ b/api_docs/presentation_util.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/presentationUtil title: "presentationUtil" image: https://source.unsplash.com/400x175/?github summary: API docs for the presentationUtil plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'presentationUtil'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/remote_clusters.mdx b/api_docs/remote_clusters.mdx index 15a45dfaf196c..50d1bd6501ed5 100644 --- a/api_docs/remote_clusters.mdx +++ b/api_docs/remote_clusters.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/remoteClusters title: "remoteClusters" image: https://source.unsplash.com/400x175/?github summary: API docs for the remoteClusters plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'remoteClusters'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/reporting.mdx b/api_docs/reporting.mdx index 0cb59e661a454..e8cb5155cd056 100644 --- a/api_docs/reporting.mdx +++ b/api_docs/reporting.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/reporting title: "reporting" image: https://source.unsplash.com/400x175/?github summary: API docs for the reporting plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'reporting'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/rollup.mdx b/api_docs/rollup.mdx index ff2cecb8cbf94..95999d8abc341 100644 --- a/api_docs/rollup.mdx +++ b/api_docs/rollup.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/rollup title: "rollup" image: https://source.unsplash.com/400x175/?github summary: API docs for the rollup plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'rollup'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/rule_registry.mdx b/api_docs/rule_registry.mdx index f84c233dfe09d..c320d99c567fe 100644 --- a/api_docs/rule_registry.mdx +++ b/api_docs/rule_registry.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/ruleRegistry title: "ruleRegistry" image: https://source.unsplash.com/400x175/?github summary: API docs for the ruleRegistry plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ruleRegistry'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/runtime_fields.mdx b/api_docs/runtime_fields.mdx index 403864a08cf52..8ee9718178d6d 100644 --- a/api_docs/runtime_fields.mdx +++ b/api_docs/runtime_fields.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/runtimeFields title: "runtimeFields" image: https://source.unsplash.com/400x175/?github summary: API docs for the runtimeFields plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'runtimeFields'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/saved_objects.mdx b/api_docs/saved_objects.mdx index 14064d5487851..0e55dbb89931a 100644 --- a/api_docs/saved_objects.mdx +++ b/api_docs/saved_objects.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/savedObjects title: "savedObjects" image: https://source.unsplash.com/400x175/?github summary: API docs for the savedObjects plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjects'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/saved_objects_management.mdx b/api_docs/saved_objects_management.mdx index 92da839a2c09f..5380d4bc20a92 100644 --- a/api_docs/saved_objects_management.mdx +++ b/api_docs/saved_objects_management.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/savedObjectsManagement title: "savedObjectsManagement" image: https://source.unsplash.com/400x175/?github summary: API docs for the savedObjectsManagement plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsManagement'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/saved_objects_tagging.mdx b/api_docs/saved_objects_tagging.mdx index 78adb741c6ef4..a667fc54a41b3 100644 --- a/api_docs/saved_objects_tagging.mdx +++ b/api_docs/saved_objects_tagging.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/savedObjectsTagging title: "savedObjectsTagging" image: https://source.unsplash.com/400x175/?github summary: API docs for the savedObjectsTagging plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTagging'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/saved_objects_tagging_oss.mdx b/api_docs/saved_objects_tagging_oss.mdx index ca27430c19adf..890f3c00ed98a 100644 --- a/api_docs/saved_objects_tagging_oss.mdx +++ b/api_docs/saved_objects_tagging_oss.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/savedObjectsTaggingOss title: "savedObjectsTaggingOss" image: https://source.unsplash.com/400x175/?github summary: API docs for the savedObjectsTaggingOss plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTaggingOss'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/screenshot_mode.mdx b/api_docs/screenshot_mode.mdx index 11c3ea32ed9f3..23e1f76617428 100644 --- a/api_docs/screenshot_mode.mdx +++ b/api_docs/screenshot_mode.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/screenshotMode title: "screenshotMode" image: https://source.unsplash.com/400x175/?github summary: API docs for the screenshotMode plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotMode'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/screenshotting.mdx b/api_docs/screenshotting.mdx index 7f20e56cf8968..d8f6a26967e74 100644 --- a/api_docs/screenshotting.mdx +++ b/api_docs/screenshotting.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/screenshotting title: "screenshotting" image: https://source.unsplash.com/400x175/?github summary: API docs for the screenshotting plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotting'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/security.mdx b/api_docs/security.mdx index 09edf1de6e3a3..0a37e14b57600 100644 --- a/api_docs/security.mdx +++ b/api_docs/security.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/security title: "security" image: https://source.unsplash.com/400x175/?github summary: API docs for the security plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'security'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/security_solution.mdx b/api_docs/security_solution.mdx index dfc4c7dce7a34..5afe8b4a4901e 100644 --- a/api_docs/security_solution.mdx +++ b/api_docs/security_solution.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/securitySolution title: "securitySolution" image: https://source.unsplash.com/400x175/?github summary: API docs for the securitySolution plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolution'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/session_view.mdx b/api_docs/session_view.mdx index 7348d7a12ae8b..dcdb96a76305a 100644 --- a/api_docs/session_view.mdx +++ b/api_docs/session_view.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/sessionView title: "sessionView" image: https://source.unsplash.com/400x175/?github summary: API docs for the sessionView plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'sessionView'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/share.mdx b/api_docs/share.mdx index 6174ef2caaa15..eb48289037039 100644 --- a/api_docs/share.mdx +++ b/api_docs/share.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/share title: "share" image: https://source.unsplash.com/400x175/?github summary: API docs for the share plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'share'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/shared_u_x.mdx b/api_docs/shared_u_x.mdx index 64d74a7c8cbb3..baa409a49032c 100644 --- a/api_docs/shared_u_x.mdx +++ b/api_docs/shared_u_x.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/sharedUX title: "sharedUX" image: https://source.unsplash.com/400x175/?github summary: API docs for the sharedUX plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'sharedUX'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/snapshot_restore.mdx b/api_docs/snapshot_restore.mdx index 00696c4667ccc..c6ff87caf6fd0 100644 --- a/api_docs/snapshot_restore.mdx +++ b/api_docs/snapshot_restore.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/snapshotRestore title: "snapshotRestore" image: https://source.unsplash.com/400x175/?github summary: API docs for the snapshotRestore plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'snapshotRestore'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/spaces.mdx b/api_docs/spaces.mdx index 5832f87675589..97b5c709e3bac 100644 --- a/api_docs/spaces.mdx +++ b/api_docs/spaces.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/spaces title: "spaces" image: https://source.unsplash.com/400x175/?github summary: API docs for the spaces plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'spaces'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/stack_alerts.mdx b/api_docs/stack_alerts.mdx index 8fe5658e7f13d..459dfcfa79ae9 100644 --- a/api_docs/stack_alerts.mdx +++ b/api_docs/stack_alerts.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/stackAlerts title: "stackAlerts" image: https://source.unsplash.com/400x175/?github summary: API docs for the stackAlerts plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackAlerts'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/task_manager.mdx b/api_docs/task_manager.mdx index 2607da05c09d6..4830977f02c82 100644 --- a/api_docs/task_manager.mdx +++ b/api_docs/task_manager.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/taskManager title: "taskManager" image: https://source.unsplash.com/400x175/?github summary: API docs for the taskManager plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'taskManager'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/telemetry.mdx b/api_docs/telemetry.mdx index 5eb77011a95ad..3c884cad78a7b 100644 --- a/api_docs/telemetry.mdx +++ b/api_docs/telemetry.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/telemetry title: "telemetry" image: https://source.unsplash.com/400x175/?github summary: API docs for the telemetry plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetry'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/telemetry_collection_manager.mdx b/api_docs/telemetry_collection_manager.mdx index 96c09a02b0bea..000ee4ee69d5e 100644 --- a/api_docs/telemetry_collection_manager.mdx +++ b/api_docs/telemetry_collection_manager.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionManager title: "telemetryCollectionManager" image: https://source.unsplash.com/400x175/?github summary: API docs for the telemetryCollectionManager plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionManager'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/telemetry_collection_xpack.mdx b/api_docs/telemetry_collection_xpack.mdx index 32552ffa1b34b..afe83d7860f11 100644 --- a/api_docs/telemetry_collection_xpack.mdx +++ b/api_docs/telemetry_collection_xpack.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionXpack title: "telemetryCollectionXpack" image: https://source.unsplash.com/400x175/?github summary: API docs for the telemetryCollectionXpack plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionXpack'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/telemetry_management_section.mdx b/api_docs/telemetry_management_section.mdx index 3d61837cf1d7a..6d2d1bc193bd0 100644 --- a/api_docs/telemetry_management_section.mdx +++ b/api_docs/telemetry_management_section.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/telemetryManagementSection title: "telemetryManagementSection" image: https://source.unsplash.com/400x175/?github summary: API docs for the telemetryManagementSection plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryManagementSection'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/timelines.mdx b/api_docs/timelines.mdx index 2e9bcd5172d62..c25cb9b2cf675 100644 --- a/api_docs/timelines.mdx +++ b/api_docs/timelines.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/timelines title: "timelines" image: https://source.unsplash.com/400x175/?github summary: API docs for the timelines plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'timelines'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/transform.mdx b/api_docs/transform.mdx index e6d7d7c9a57f2..bdeff902775fc 100644 --- a/api_docs/transform.mdx +++ b/api_docs/transform.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/transform title: "transform" image: https://source.unsplash.com/400x175/?github summary: API docs for the transform plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'transform'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/triggers_actions_ui.devdocs.json b/api_docs/triggers_actions_ui.devdocs.json index 27434abbbb903..ac1678a3d0b61 100644 --- a/api_docs/triggers_actions_ui.devdocs.json +++ b/api_docs/triggers_actions_ui.devdocs.json @@ -54,7 +54,7 @@ "label": "experimentalFeatures", "description": [], "signature": [ - "{ readonly rulesListDatagrid: boolean; readonly internalAlertsTable: boolean; readonly internalShareableComponentsSandbox: boolean; readonly ruleTagFilter: boolean; readonly ruleStatusFilter: boolean; readonly rulesDetailLogs: boolean; }" + "{ readonly rulesListDatagrid: boolean; readonly internalAlertsTable: boolean; readonly ruleTagFilter: boolean; readonly ruleStatusFilter: boolean; readonly rulesDetailLogs: boolean; }" ], "path": "x-pack/plugins/triggers_actions_ui/public/plugin.ts", "deprecated": false @@ -2917,6 +2917,269 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "triggersActionsUi", + "id": "def-public.RuleStatusFilterProps", + "type": "Interface", + "tags": [], + "label": "RuleStatusFilterProps", + "description": [], + "path": "x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_filter.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "triggersActionsUi", + "id": "def-public.RuleStatusFilterProps.selectedStatuses", + "type": "Array", + "tags": [], + "label": "selectedStatuses", + "description": [], + "signature": [ + { + "pluginId": "triggersActionsUi", + "scope": "public", + "docId": "kibTriggersActionsUiPluginApi", + "section": "def-public.RuleStatus", + "text": "RuleStatus" + }, + "[]" + ], + "path": "x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_filter.tsx", + "deprecated": false + }, + { + "parentPluginId": "triggersActionsUi", + "id": "def-public.RuleStatusFilterProps.dataTestSubj", + "type": "string", + "tags": [], + "label": "dataTestSubj", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_filter.tsx", + "deprecated": false + }, + { + "parentPluginId": "triggersActionsUi", + "id": "def-public.RuleStatusFilterProps.selectDataTestSubj", + "type": "string", + "tags": [], + "label": "selectDataTestSubj", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_filter.tsx", + "deprecated": false + }, + { + "parentPluginId": "triggersActionsUi", + "id": "def-public.RuleStatusFilterProps.buttonDataTestSubj", + "type": "string", + "tags": [], + "label": "buttonDataTestSubj", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_filter.tsx", + "deprecated": false + }, + { + "parentPluginId": "triggersActionsUi", + "id": "def-public.RuleStatusFilterProps.optionDataTestSubj", + "type": "Function", + "tags": [], + "label": "optionDataTestSubj", + "description": [], + "signature": [ + "((status: ", + { + "pluginId": "triggersActionsUi", + "scope": "public", + "docId": "kibTriggersActionsUiPluginApi", + "section": "def-public.RuleStatus", + "text": "RuleStatus" + }, + ") => string) | undefined" + ], + "path": "x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_filter.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "triggersActionsUi", + "id": "def-public.RuleStatusFilterProps.optionDataTestSubj.$1", + "type": "CompoundType", + "tags": [], + "label": "status", + "description": [], + "signature": [ + { + "pluginId": "triggersActionsUi", + "scope": "public", + "docId": "kibTriggersActionsUiPluginApi", + "section": "def-public.RuleStatus", + "text": "RuleStatus" + } + ], + "path": "x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_filter.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "triggersActionsUi", + "id": "def-public.RuleStatusFilterProps.onChange", + "type": "Function", + "tags": [], + "label": "onChange", + "description": [], + "signature": [ + "(selectedStatuses: ", + { + "pluginId": "triggersActionsUi", + "scope": "public", + "docId": "kibTriggersActionsUiPluginApi", + "section": "def-public.RuleStatus", + "text": "RuleStatus" + }, + "[]) => void" + ], + "path": "x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_filter.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "triggersActionsUi", + "id": "def-public.RuleStatusFilterProps.onChange.$1", + "type": "Array", + "tags": [], + "label": "selectedStatuses", + "description": [], + "signature": [ + { + "pluginId": "triggersActionsUi", + "scope": "public", + "docId": "kibTriggersActionsUiPluginApi", + "section": "def-public.RuleStatus", + "text": "RuleStatus" + }, + "[]" + ], + "path": "x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_filter.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "triggersActionsUi", + "id": "def-public.RuleTableItem", + "type": "Interface", + "tags": [], + "label": "RuleTableItem", + "description": [], + "signature": [ + { + "pluginId": "triggersActionsUi", + "scope": "public", + "docId": "kibTriggersActionsUiPluginApi", + "section": "def-public.RuleTableItem", + "text": "RuleTableItem" + }, + " extends ", + { + "pluginId": "triggersActionsUi", + "scope": "public", + "docId": "kibTriggersActionsUiPluginApi", + "section": "def-public.Rule", + "text": "Rule" + }, + "<", + { + "pluginId": "alerting", + "scope": "common", + "docId": "kibAlertingPluginApi", + "section": "def-common.RuleTypeParams", + "text": "RuleTypeParams" + }, + ">" + ], + "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "triggersActionsUi", + "id": "def-public.RuleTableItem.ruleType", + "type": "string", + "tags": [], + "label": "ruleType", + "description": [], + "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", + "deprecated": false + }, + { + "parentPluginId": "triggersActionsUi", + "id": "def-public.RuleTableItem.index", + "type": "number", + "tags": [], + "label": "index", + "description": [], + "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", + "deprecated": false + }, + { + "parentPluginId": "triggersActionsUi", + "id": "def-public.RuleTableItem.actionsCount", + "type": "number", + "tags": [], + "label": "actionsCount", + "description": [], + "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", + "deprecated": false + }, + { + "parentPluginId": "triggersActionsUi", + "id": "def-public.RuleTableItem.isEditable", + "type": "boolean", + "tags": [], + "label": "isEditable", + "description": [], + "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", + "deprecated": false + }, + { + "parentPluginId": "triggersActionsUi", + "id": "def-public.RuleTableItem.enabledInLicense", + "type": "boolean", + "tags": [], + "label": "enabledInLicense", + "description": [], + "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", + "deprecated": false + }, + { + "parentPluginId": "triggersActionsUi", + "id": "def-public.RuleTableItem.showIntervalWarning", + "type": "CompoundType", + "tags": [], + "label": "showIntervalWarning", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "triggersActionsUi", "id": "def-public.RuleType", @@ -5553,9 +5816,21 @@ "description": [], "signature": [ "(props: ", - "RuleStatusFilterProps", + { + "pluginId": "triggersActionsUi", + "scope": "public", + "docId": "kibTriggersActionsUiPluginApi", + "section": "def-public.RuleStatusFilterProps", + "text": "RuleStatusFilterProps" + }, ") => React.ReactElement<", - "RuleStatusFilterProps", + { + "pluginId": "triggersActionsUi", + "scope": "public", + "docId": "kibTriggersActionsUiPluginApi", + "section": "def-public.RuleStatusFilterProps", + "text": "RuleStatusFilterProps" + }, ", string | React.JSXElementConstructor>" ], "path": "x-pack/plugins/triggers_actions_ui/public/plugin.ts", @@ -5569,7 +5844,13 @@ "label": "props", "description": [], "signature": [ - "RuleStatusFilterProps" + { + "pluginId": "triggersActionsUi", + "scope": "public", + "docId": "kibTriggersActionsUiPluginApi", + "section": "def-public.RuleStatusFilterProps", + "text": "RuleStatusFilterProps" + } ], "path": "x-pack/plugins/triggers_actions_ui/public/plugin.ts", "deprecated": false, @@ -6223,7 +6504,7 @@ "\nParses the string value used in `xpack.trigger_actions_ui.enableExperimental` kibana configuration,\nwhich should be a string of values delimited by a comma (`,`)\n" ], "signature": [ - "(configValue: string[]) => Readonly<{ rulesListDatagrid: boolean; internalAlertsTable: boolean; internalShareableComponentsSandbox: boolean; ruleTagFilter: boolean; ruleStatusFilter: boolean; rulesDetailLogs: boolean; }>" + "(configValue: string[]) => Readonly<{ rulesListDatagrid: boolean; internalAlertsTable: boolean; ruleTagFilter: boolean; ruleStatusFilter: boolean; rulesDetailLogs: boolean; }>" ], "path": "x-pack/plugins/triggers_actions_ui/common/experimental_features.ts", "deprecated": false, @@ -6380,7 +6661,7 @@ "label": "ExperimentalFeatures", "description": [], "signature": [ - "{ readonly rulesListDatagrid: boolean; readonly internalAlertsTable: boolean; readonly internalShareableComponentsSandbox: boolean; readonly ruleTagFilter: boolean; readonly ruleStatusFilter: boolean; readonly rulesDetailLogs: boolean; }" + "{ readonly rulesListDatagrid: boolean; readonly internalAlertsTable: boolean; readonly ruleTagFilter: boolean; readonly ruleStatusFilter: boolean; readonly rulesDetailLogs: boolean; }" ], "path": "x-pack/plugins/triggers_actions_ui/common/experimental_features.ts", "deprecated": false, @@ -6412,7 +6693,7 @@ "\nA list of allowed values that can be used in `xpack.trigger_actions_ui.enableExperimental`.\nThis object is then used to validate and parse the value entered." ], "signature": [ - "{ readonly rulesListDatagrid: boolean; readonly internalAlertsTable: boolean; readonly internalShareableComponentsSandbox: boolean; readonly ruleTagFilter: boolean; readonly ruleStatusFilter: boolean; readonly rulesDetailLogs: boolean; }" + "{ readonly rulesListDatagrid: boolean; readonly internalAlertsTable: boolean; readonly ruleTagFilter: boolean; readonly ruleStatusFilter: boolean; readonly rulesDetailLogs: boolean; }" ], "path": "x-pack/plugins/triggers_actions_ui/common/experimental_features.ts", "deprecated": false, diff --git a/api_docs/triggers_actions_ui.mdx b/api_docs/triggers_actions_ui.mdx index 92267bb0410ae..88d619e397eba 100644 --- a/api_docs/triggers_actions_ui.mdx +++ b/api_docs/triggers_actions_ui.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/triggersActionsUi title: "triggersActionsUi" image: https://source.unsplash.com/400x175/?github summary: API docs for the triggersActionsUi plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'triggersActionsUi'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Response Ops](https://github.com/orgs/elastic/teams/response-ops) for q | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 407 | 0 | 386 | 42 | +| 423 | 0 | 402 | 41 | ## Client diff --git a/api_docs/ui_actions.mdx b/api_docs/ui_actions.mdx index 0c38057ac5ee8..5809b8368c9df 100644 --- a/api_docs/ui_actions.mdx +++ b/api_docs/ui_actions.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/uiActions title: "uiActions" image: https://source.unsplash.com/400x175/?github summary: API docs for the uiActions plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActions'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/ui_actions_enhanced.mdx b/api_docs/ui_actions_enhanced.mdx index 20e9047eeb8c1..cd5e91c45f732 100644 --- a/api_docs/ui_actions_enhanced.mdx +++ b/api_docs/ui_actions_enhanced.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/uiActionsEnhanced title: "uiActionsEnhanced" image: https://source.unsplash.com/400x175/?github summary: API docs for the uiActionsEnhanced plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActionsEnhanced'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/unified_search.mdx b/api_docs/unified_search.mdx index b8933713c46d5..8fd78613bed8a 100644 --- a/api_docs/unified_search.mdx +++ b/api_docs/unified_search.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/unifiedSearch title: "unifiedSearch" image: https://source.unsplash.com/400x175/?github summary: API docs for the unifiedSearch plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/unified_search_autocomplete.mdx b/api_docs/unified_search_autocomplete.mdx index 51c8014e13c78..5b3f15a4f3fdb 100644 --- a/api_docs/unified_search_autocomplete.mdx +++ b/api_docs/unified_search_autocomplete.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/unifiedSearch-autocomplete title: "unifiedSearch.autocomplete" image: https://source.unsplash.com/400x175/?github summary: API docs for the unifiedSearch.autocomplete plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch.autocomplete'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/url_forwarding.mdx b/api_docs/url_forwarding.mdx index c5a9e268e5224..3252dc99360b3 100644 --- a/api_docs/url_forwarding.mdx +++ b/api_docs/url_forwarding.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/urlForwarding title: "urlForwarding" image: https://source.unsplash.com/400x175/?github summary: API docs for the urlForwarding plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'urlForwarding'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/usage_collection.mdx b/api_docs/usage_collection.mdx index e255536cf7723..8cb53f58999fd 100644 --- a/api_docs/usage_collection.mdx +++ b/api_docs/usage_collection.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/usageCollection title: "usageCollection" image: https://source.unsplash.com/400x175/?github summary: API docs for the usageCollection plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'usageCollection'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/ux.mdx b/api_docs/ux.mdx index b085966ea8ecd..ec97960575ffa 100644 --- a/api_docs/ux.mdx +++ b/api_docs/ux.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/ux title: "ux" image: https://source.unsplash.com/400x175/?github summary: API docs for the ux plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ux'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_default_editor.mdx b/api_docs/vis_default_editor.mdx index 0b0a9c4e4b10b..bb30dcfc843f5 100644 --- a/api_docs/vis_default_editor.mdx +++ b/api_docs/vis_default_editor.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visDefaultEditor title: "visDefaultEditor" image: https://source.unsplash.com/400x175/?github summary: API docs for the visDefaultEditor plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visDefaultEditor'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_gauge.mdx b/api_docs/vis_type_gauge.mdx index 1f0993a3f353a..5897ea11308be 100644 --- a/api_docs/vis_type_gauge.mdx +++ b/api_docs/vis_type_gauge.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeGauge title: "visTypeGauge" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeGauge plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeGauge'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_heatmap.mdx b/api_docs/vis_type_heatmap.mdx index cf0bb5a228cb1..a0b0a56f833b8 100644 --- a/api_docs/vis_type_heatmap.mdx +++ b/api_docs/vis_type_heatmap.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeHeatmap title: "visTypeHeatmap" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeHeatmap plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeHeatmap'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_pie.mdx b/api_docs/vis_type_pie.mdx index 76f0b4da24ad0..a0985a9ef4186 100644 --- a/api_docs/vis_type_pie.mdx +++ b/api_docs/vis_type_pie.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypePie title: "visTypePie" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypePie plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypePie'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_table.mdx b/api_docs/vis_type_table.mdx index 52b3b7fa8466e..83e54c1bdbba0 100644 --- a/api_docs/vis_type_table.mdx +++ b/api_docs/vis_type_table.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeTable title: "visTypeTable" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeTable plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTable'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_timelion.mdx b/api_docs/vis_type_timelion.mdx index d92dc4a718aea..9134ca9a800f8 100644 --- a/api_docs/vis_type_timelion.mdx +++ b/api_docs/vis_type_timelion.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeTimelion title: "visTypeTimelion" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeTimelion plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimelion'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_timeseries.mdx b/api_docs/vis_type_timeseries.mdx index f1279aaea966a..2542b1d9f3ec8 100644 --- a/api_docs/vis_type_timeseries.mdx +++ b/api_docs/vis_type_timeseries.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeTimeseries title: "visTypeTimeseries" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeTimeseries plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimeseries'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_vega.mdx b/api_docs/vis_type_vega.mdx index c6acd41243312..3cf0d0ad5129c 100644 --- a/api_docs/vis_type_vega.mdx +++ b/api_docs/vis_type_vega.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeVega title: "visTypeVega" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeVega plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVega'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_vislib.mdx b/api_docs/vis_type_vislib.mdx index 5e94aef34cbec..51a469d6675e4 100644 --- a/api_docs/vis_type_vislib.mdx +++ b/api_docs/vis_type_vislib.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeVislib title: "visTypeVislib" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeVislib plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVislib'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_xy.mdx b/api_docs/vis_type_xy.mdx index 8f24fdc0a15e9..f645d26ebe9f9 100644 --- a/api_docs/vis_type_xy.mdx +++ b/api_docs/vis_type_xy.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeXy title: "visTypeXy" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeXy plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeXy'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/visualizations.mdx b/api_docs/visualizations.mdx index 20e579c1f994f..498f3cb74c07b 100644 --- a/api_docs/visualizations.mdx +++ b/api_docs/visualizations.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visualizations title: "visualizations" image: https://source.unsplash.com/400x175/?github summary: API docs for the visualizations plugin -date: 2022-07-19 +date: 2022-07-20 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visualizations'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/dev_docs/getting_started/setting_up_a_development_env.mdx b/dev_docs/getting_started/setting_up_a_development_env.mdx index 0cb0d109d1829..461f3c38c2225 100644 --- a/dev_docs/getting_started/setting_up_a_development_env.mdx +++ b/dev_docs/getting_started/setting_up_a_development_env.mdx @@ -46,6 +46,14 @@ Then, install the latest version of yarn using: npm install -g yarn ``` +If you have Yarn installed, make sure you are using 1.22.19 or later. 2.0 and later are unsupported. + +. If you are using an unsupported Yarn version, run: ++ +```sh +yarn set version 1.22.19 +``` + Finally, bootstrap Kibana and install all of the remaining dependencies: ```sh diff --git a/docs/user/security/api-keys/index.asciidoc b/docs/user/security/api-keys/index.asciidoc index bc277609d43e4..3011f17ee08c8 100644 --- a/docs/user/security/api-keys/index.asciidoc +++ b/docs/user/security/api-keys/index.asciidoc @@ -45,6 +45,11 @@ curl --location --request GET 'http://localhost:5601/api/security/role' \ --header 'kbn-xsrf: true' \ --header 'Authorization: ApiKey aVZlLUMzSUJuYndxdDJvN0k1bU46aGxlYUpNS2lTa2FKeVZua1FnY1VEdw==' \ +[IMPORTANT] +============================================================================ +API keys are intended for programatic access to {kib} and {es). Do not use API keys to authenticate access via a web browser. +============================================================================ + [float] [[view-api-keys]] === View and delete API keys diff --git a/docs/user/security/authentication/index.asciidoc b/docs/user/security/authentication/index.asciidoc index 007d1af017df3..9b3d4b0f831f8 100644 --- a/docs/user/security/authentication/index.asciidoc +++ b/docs/user/security/authentication/index.asciidoc @@ -394,6 +394,12 @@ HTTP protocol provides a simple authentication framework that can be used by a c This type of authentication is usually useful for machine-to-machine interaction that requires authentication and where human intervention is not desired or just infeasible. There are a number of use cases when HTTP authentication support comes in handy for {kib} users as well. +[IMPORTANT] +============================================================================ +API keys are intended for programatic access to {kib} and {es). Do not use API keys to authenticate access via a web browser. +============================================================================ + + By default {kib} supports <> authentication scheme _and_ any scheme supported by the currently enabled authentication provider. For example, `Basic` authentication scheme is automatically supported when basic authentication provider is enabled, or `Bearer` scheme when any of the token based authentication providers is enabled (Token, SAML, OpenID Connect, PKI or Kerberos). But it's also possible to add support for any other authentication scheme in the `kibana.yml` configuration file, as follows: NOTE: Don't forget to explicitly specify the default `apikey` and `bearer` schemes when you just want to add a new one to the list. diff --git a/package.json b/package.json index aa0c9cf68622f..b11f91e432262 100644 --- a/package.json +++ b/package.json @@ -169,6 +169,12 @@ "@kbn/core-doc-links-server": "link:bazel-bin/packages/core/doc-links/core-doc-links-server", "@kbn/core-doc-links-server-internal": "link:bazel-bin/packages/core/doc-links/core-doc-links-server-internal", "@kbn/core-doc-links-server-mocks": "link:bazel-bin/packages/core/doc-links/core-doc-links-server-mocks", + "@kbn/core-elasticsearch-client-server": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server", + "@kbn/core-elasticsearch-client-server-internal": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server-internal", + "@kbn/core-elasticsearch-client-server-mocks": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server-mocks", + "@kbn/core-elasticsearch-server": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server", + "@kbn/core-elasticsearch-server-internal": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server-internal", + "@kbn/core-elasticsearch-server-mocks": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server-mocks", "@kbn/core-environment-server-internal": "link:bazel-bin/packages/core/environment/core-environment-server-internal", "@kbn/core-environment-server-mocks": "link:bazel-bin/packages/core/environment/core-environment-server-mocks", "@kbn/core-execution-context-browser": "link:bazel-bin/packages/core/execution-context/core-execution-context-browser", @@ -350,7 +356,7 @@ "deep-freeze-strict": "^1.1.1", "deepmerge": "^4.2.2", "del": "^5.1.0", - "elastic-apm-node": "^3.36.0", + "elastic-apm-node": "^3.37.0", "email-addresses": "^5.0.0", "execa": "^4.0.2", "expiry-js": "0.1.7", @@ -434,7 +440,7 @@ "papaparse": "^5.2.0", "pbf": "3.2.1", "pdfjs-dist": "^2.13.216", - "pdfmake": "^0.2.4", + "pdfmake": "^0.2.5", "pluralize": "3.1.0", "polished": "^3.7.2", "pretty-ms": "6.0.0", @@ -505,7 +511,6 @@ "source-map-support": "^0.5.19", "stats-lite": "^2.2.0", "strip-ansi": "^6.0.0", - "style-it": "^2.1.3", "styled-components": "^5.1.0", "suricata-sid-db": "^1.0.2", "symbol-observable": "^1.2.0", @@ -759,6 +764,12 @@ "@types/kbn__core-doc-links-server": "link:bazel-bin/packages/core/doc-links/core-doc-links-server/npm_module_types", "@types/kbn__core-doc-links-server-internal": "link:bazel-bin/packages/core/doc-links/core-doc-links-server-internal/npm_module_types", "@types/kbn__core-doc-links-server-mocks": "link:bazel-bin/packages/core/doc-links/core-doc-links-server-mocks/npm_module_types", + "@types/kbn__core-elasticsearch-client-server": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server/npm_module_types", + "@types/kbn__core-elasticsearch-client-server-internal": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server-internal/npm_module_types", + "@types/kbn__core-elasticsearch-client-server-mocks": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/npm_module_types", + "@types/kbn__core-elasticsearch-server": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server/npm_module_types", + "@types/kbn__core-elasticsearch-server-internal": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server-internal/npm_module_types", + "@types/kbn__core-elasticsearch-server-mocks": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server-mocks/npm_module_types", "@types/kbn__core-environment-server-internal": "link:bazel-bin/packages/core/environment/core-environment-server-internal/npm_module_types", "@types/kbn__core-environment-server-mocks": "link:bazel-bin/packages/core/environment/core-environment-server-mocks/npm_module_types", "@types/kbn__core-execution-context-browser": "link:bazel-bin/packages/core/execution-context/core-execution-context-browser/npm_module_types", @@ -934,7 +945,7 @@ "@types/ora": "^1.3.5", "@types/papaparse": "^5.0.3", "@types/pbf": "3.0.2", - "@types/pdfmake": "^0.1.19", + "@types/pdfmake": "^0.2.0", "@types/pegjs": "^0.10.1", "@types/pngjs": "^3.4.0", "@types/prettier": "^2.3.2", @@ -1002,7 +1013,7 @@ "apidoc": "^0.29.0", "apidoc-markdown": "^6.0.0", "argsplit": "^1.0.5", - "autoprefixer": "^9.7.4", + "autoprefixer": "^10.4.7", "axe-core": "^4.0.2", "babel-jest": "^26.6.3", "babel-loader": "^8.2.2", @@ -1072,7 +1083,7 @@ "gulp-babel": "^8.0.0", "gulp-brotli": "^3.0.0", "gulp-gzip": "^1.4.2", - "gulp-postcss": "^8.0.0", + "gulp-postcss": "^9.0.1", "gulp-sourcemaps": "2.6.5", "gulp-terser": "^2.1.0", "gulp-zip": "^5.0.2", @@ -1128,9 +1139,10 @@ "pirates": "^4.0.1", "playwright": "^1.17.1", "pngjs": "^3.4.0", - "postcss": "^7.0.32", - "postcss-loader": "^3.0.0", - "postcss-prefix-selector": "^1.7.2", + "postcss": "^8.4.14", + "postcss-loader": "^4.2.0", + "postcss-prefix-selector": "^1.16.0", + "postcss-scss": "^4.0.4", "prettier": "^2.7.1", "pretty-format": "^27.5.1", "q": "^1.5.1", @@ -1147,8 +1159,8 @@ "source-map": "^0.7.3", "string-replace-loader": "^2.2.0", "style-loader": "^1.1.3", - "stylelint": "13.8.0", - "stylelint-scss": "^3.18.0", + "stylelint": "^14.9.1", + "stylelint-scss": "^4.3.0", "superagent": "^3.8.2", "supertest": "^3.1.0", "supports-color": "^7.0.0", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index 50ec703919bc0..7b2e92f63b8c1 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -37,6 +37,11 @@ filegroup( "//packages/core/doc-links/core-doc-links-server-internal:build", "//packages/core/doc-links/core-doc-links-server-mocks:build", "//packages/core/doc-links/core-doc-links-server:build", + "//packages/core/elasticsearch/core-elasticsearch-client-server-internal:build", + "//packages/core/elasticsearch/core-elasticsearch-client-server-mocks:build", + "//packages/core/elasticsearch/core-elasticsearch-server-internal:build", + "//packages/core/elasticsearch/core-elasticsearch-server-mocks:build", + "//packages/core/elasticsearch/core-elasticsearch-server:build", "//packages/core/environment/core-environment-server-internal:build", "//packages/core/environment/core-environment-server-mocks:build", "//packages/core/execution-context/core-execution-context-browser-internal:build", @@ -249,6 +254,11 @@ filegroup( "//packages/core/doc-links/core-doc-links-server-internal:build_types", "//packages/core/doc-links/core-doc-links-server-mocks:build_types", "//packages/core/doc-links/core-doc-links-server:build_types", + "//packages/core/elasticsearch/core-elasticsearch-client-server-internal:build_types", + "//packages/core/elasticsearch/core-elasticsearch-client-server-mocks:build_types", + "//packages/core/elasticsearch/core-elasticsearch-server-internal:build_types", + "//packages/core/elasticsearch/core-elasticsearch-server-mocks:build_types", + "//packages/core/elasticsearch/core-elasticsearch-server:build_types", "//packages/core/environment/core-environment-server-internal:build_types", "//packages/core/environment/core-environment-server-mocks:build_types", "//packages/core/execution-context/core-execution-context-browser-internal:build_types", diff --git a/packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts b/packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts index cdd5a27ee9500..0e36d82eaaf51 100644 --- a/packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts +++ b/packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.ts @@ -38,9 +38,9 @@ describe('AnalyticsService', () => { await expect( firstValueFrom(analyticsClientMock.registerContextProvider.mock.calls[2][0].context$) ).resolves.toEqual({ - preferred_language: 'en-US', - preferred_languages: ['en-US', 'en'], - user_agent: expect.any(String), + preferredLanguage: 'en-US', + preferredLanguages: ['en-US', 'en'], + userAgent: expect.any(String), }); }); @@ -226,9 +226,9 @@ describe('AnalyticsService', () => { firstValueFrom(analyticsClientMock.registerContextProvider.mock.calls[3][0].context$) ).resolves.toMatchInlineSnapshot(` Object { - "cluster_name": "cluster_name", - "cluster_uuid": "cluster_uuid", - "cluster_version": "version", + "clusterName": "cluster_name", + "clusterUuid": "cluster_uuid", + "clusterVersion": "version", } `); }); diff --git a/packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts b/packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts index 84eb75df04098..f728020c6793c 100644 --- a/packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts +++ b/packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts @@ -77,10 +77,10 @@ export class AnalyticsService { */ private registerSessionIdContext() { this.analyticsClient.registerContextProvider({ - name: 'session-id', - context$: of({ session_id: getSessionId() }), + name: 'session id', + context$: of({ sessionId: getSessionId() }), schema: { - session_id: { + sessionId: { type: 'keyword', _meta: { description: 'Unique session ID for every browser session' }, }, @@ -132,20 +132,20 @@ export class AnalyticsService { this.analyticsClient.registerContextProvider({ name: 'browser info', context$: of({ - user_agent: navigator.userAgent, - preferred_language: navigator.language, - preferred_languages: navigator.languages, + userAgent: navigator.userAgent, + preferredLanguage: navigator.language, + preferredLanguages: navigator.languages, }), schema: { - user_agent: { + userAgent: { type: 'keyword', _meta: { description: 'User agent of the browser.' }, }, - preferred_language: { + preferredLanguage: { type: 'keyword', _meta: { description: 'Preferred language of the browser.' }, }, - preferred_languages: { + preferredLanguages: { type: 'array', items: { type: 'keyword', @@ -166,15 +166,15 @@ export class AnalyticsService { name: 'elasticsearch info', context$: of(injectedMetadata.getElasticsearchInfo()), schema: { - cluster_name: { + clusterName: { type: 'keyword', _meta: { description: 'The Cluster Name', optional: true }, }, - cluster_uuid: { + clusterUuid: { type: 'keyword', _meta: { description: 'The Cluster UUID', optional: true }, }, - cluster_version: { + clusterVersion: { type: 'keyword', _meta: { description: 'The Cluster version', optional: true }, }, diff --git a/packages/core/base/core-base-common/BUILD.bazel b/packages/core/base/core-base-common/BUILD.bazel index 7282d7ad4af18..0dd9cf7a57d94 100644 --- a/packages/core/base/core-base-common/BUILD.bazel +++ b/packages/core/base/core-base-common/BUILD.bazel @@ -26,11 +26,13 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ + "//packages/kbn-std", ] TYPES_DEPS = [ "@npm//@types/node", "@npm//@types/jest", + "//packages/kbn-std:npm_module_types", "//packages/kbn-config:npm_module_types", ] diff --git a/packages/core/base/core-base-common/src/index.ts b/packages/core/base/core-base-common/src/index.ts index ae2ac637e3e08..7785bd332aecd 100644 --- a/packages/core/base/core-base-common/src/index.ts +++ b/packages/core/base/core-base-common/src/index.ts @@ -9,3 +9,5 @@ export type { PluginOpaqueId, PluginName, DiscoveredPlugin } from './plugins'; export { PluginType } from './plugins'; export { EUI_STYLES_GLOBAL } from './eui'; +export { ServiceStatusLevels } from './service_status'; +export type { ServiceStatus, ServiceStatusLevel } from './service_status'; diff --git a/packages/core/base/core-base-common/src/service_status.ts b/packages/core/base/core-base-common/src/service_status.ts new file mode 100644 index 0000000000000..4c9539f015d86 --- /dev/null +++ b/packages/core/base/core-base-common/src/service_status.ts @@ -0,0 +1,101 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { deepFreeze } from '@kbn/std'; + +/** + * The current status of a service at a point in time. + * + * @typeParam Meta - JSON-serializable object. Plugins should export this type to allow other plugins to read the `meta` + * field in a type-safe way. + * @public + */ +export interface ServiceStatus | unknown = unknown> { + /** + * The current availability level of the service. + */ + level: ServiceStatusLevel; + /** + * A high-level summary of the service status. + */ + summary: string; + /** + * A more detailed description of the service status. + */ + detail?: string; + /** + * A URL to open in a new tab about how to resolve or troubleshoot the problem. + */ + documentationUrl?: string; + /** + * Any JSON-serializable data to be included in the HTTP API response. Useful for providing more fine-grained, + * machine-readable information about the service status. May include status information for underlying features. + */ + meta?: Meta; +} + +/** + * The current "level" of availability of a service. + * + * @remarks + * The values implement `valueOf` to allow for easy comparisons between status levels with <, >, etc. Higher values + * represent higher severities. Note that the default `Array.prototype.sort` implementation does not correctly sort + * these values. + * + * A snapshot serializer is available in `src/core/server/test_utils` to ease testing of these values with Jest. + * + * @public + */ +export const ServiceStatusLevels = deepFreeze({ + /** + * Everything is working! + */ + available: { + toString: () => 'available', + valueOf: () => 0, + toJSON() { + return this.toString(); + }, + }, + /** + * Some features may not be working. + */ + degraded: { + toString: () => 'degraded', + valueOf: () => 1, + toJSON() { + return this.toString(); + }, + }, + /** + * The service is unavailable, but other functions that do not depend on this service should work. + */ + unavailable: { + toString: () => 'unavailable', + valueOf: () => 2, + toJSON() { + return this.toString(); + }, + }, + /** + * Block all user functions and display the status page, reserved for Core services only. + */ + critical: { + toString: () => 'critical', + valueOf: () => 3, + toJSON() { + return this.toString(); + }, + }, +}); + +/** + * A convenience type that represents the union of each value in {@link ServiceStatusLevels}. + * @public + */ +export type ServiceStatusLevel = typeof ServiceStatusLevels[keyof typeof ServiceStatusLevels]; diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/BUILD.bazel b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/BUILD.bazel new file mode 100644 index 0000000000000..c297697811253 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/BUILD.bazel @@ -0,0 +1,116 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-elasticsearch-client-server-internal" +PKG_REQUIRE_NAME = "@kbn/core-elasticsearch-client-server-internal" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], + exclude = [ + "**/*.test.*", + "**/*.stories.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "@npm//moment", + "@npm//@elastic/elasticsearch", + "@npm//@elastic/numeral", + "//packages/kbn-std", + "//packages/kbn-es-errors", + "//packages/core/http/core-http-router-server-internal", + ### test dependencies + "//packages/core/logging/core-logging-server-mocks", + "//packages/core/http/core-http-server-mocks", +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//moment", + "@npm//@elastic/elasticsearch", + "@npm//@elastic/numeral", + "//packages/kbn-utility-types:npm_module_types", + "//packages/kbn-std:npm_module_types", + "//packages/kbn-es-errors:npm_module_types", + "//packages/kbn-logging:npm_module_types", + "//packages/core/http/core-http-server:npm_module_types", + "//packages/core/http/core-http-router-server-internal:npm_module_types", + "//packages/core/elasticsearch/core-elasticsearch-server:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + declaration_map = True, + emit_declaration_only = True, + out_dir = "target_types", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/README.md b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/README.md new file mode 100644 index 0000000000000..019af4b68bc66 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/README.md @@ -0,0 +1,3 @@ +# @kbn/core-elasticsearch-client-server-internal + +This package contains the internal implementation for Core's server-side elasticsearch client. diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/jest.config.js b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/jest.config.js new file mode 100644 index 0000000000000..49e02733250cf --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/jest.config.js @@ -0,0 +1,13 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../..', + roots: ['/packages/core/elasticsearch/core-elasticsearch-client-server-internal'], +}; diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/package.json b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/package.json new file mode 100644 index 0000000000000..8029d8dfcf9f5 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/core-elasticsearch-client-server-internal", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/src/core/server/elasticsearch/client/client_config.test.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/client_config.test.ts similarity index 98% rename from src/core/server/elasticsearch/client/client_config.test.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/client_config.test.ts index dcc6d25c565bf..f7988a19009bb 100644 --- a/src/core/server/elasticsearch/client/client_config.test.ts +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/client_config.test.ts @@ -7,8 +7,9 @@ */ import { duration } from 'moment'; -import { ElasticsearchClientConfig, parseClientOptions } from './client_config'; -import { DEFAULT_HEADERS } from '../default_headers'; +import type { ElasticsearchClientConfig } from '@kbn/core-elasticsearch-server'; +import { parseClientOptions } from './client_config'; +import { DEFAULT_HEADERS } from './headers'; const createConfig = ( parts: Partial = {} diff --git a/src/core/server/elasticsearch/client/client_config.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/client_config.ts similarity index 81% rename from src/core/server/elasticsearch/client/client_config.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/client_config.ts index 63b9555a420ab..9d380fcbaa455 100644 --- a/src/core/server/elasticsearch/client/client_config.ts +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/client_config.ts @@ -10,35 +10,8 @@ import { ConnectionOptions as TlsConnectionOptions } from 'tls'; import { URL } from 'url'; import { Duration } from 'moment'; import type { ClientOptions } from '@elastic/elasticsearch/lib/client'; -import { ElasticsearchConfig } from '../elasticsearch_config'; -import { DEFAULT_HEADERS } from '../default_headers'; - -/** - * Configuration options to be used to create a {@link IClusterClient | cluster client} using the - * {@link ElasticsearchServiceStart.createClient | createClient API} - * - * @public - */ -export type ElasticsearchClientConfig = Pick< - ElasticsearchConfig, - | 'customHeaders' - | 'maxSockets' - | 'compression' - | 'sniffOnStart' - | 'sniffOnConnectionFault' - | 'requestHeadersWhitelist' - | 'sniffInterval' - | 'hosts' - | 'username' - | 'password' - | 'serviceAccountToken' -> & { - pingTimeout?: ElasticsearchConfig['pingTimeout'] | ClientOptions['pingTimeout']; - requestTimeout?: ElasticsearchConfig['requestTimeout'] | ClientOptions['requestTimeout']; - ssl?: Partial; - keepAlive?: boolean; - caFingerprint?: ClientOptions['caFingerprint']; -}; +import type { ElasticsearchClientConfig } from '@kbn/core-elasticsearch-server'; +import { DEFAULT_HEADERS } from './headers'; /** * Parse the client options from given client config and `scoped` flag. diff --git a/src/core/server/elasticsearch/client/cluster_client.test.mocks.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/cluster_client.test.mocks.ts similarity index 100% rename from src/core/server/elasticsearch/client/cluster_client.test.mocks.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/cluster_client.test.mocks.ts diff --git a/src/core/server/elasticsearch/client/cluster_client.test.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/cluster_client.test.ts similarity index 97% rename from src/core/server/elasticsearch/client/cluster_client.test.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/cluster_client.test.ts index 78fc0494951a7..3b2e6f82fe40d 100644 --- a/src/core/server/elasticsearch/client/cluster_client.test.ts +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/cluster_client.test.ts @@ -11,12 +11,12 @@ import { createTransportMock, createInternalErrorHandlerMock, } from './cluster_client.test.mocks'; +import type { Client } from '@elastic/elasticsearch'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { httpServerMock, httpServiceMock } from '@kbn/core-http-server-mocks'; -import { elasticsearchClientMock } from './mocks'; +import type { ElasticsearchClientConfig } from '@kbn/core-elasticsearch-server'; import { ClusterClient } from './cluster_client'; -import { ElasticsearchClientConfig } from './client_config'; -import { DEFAULT_HEADERS } from '../default_headers'; +import { DEFAULT_HEADERS } from './headers'; const createConfig = ( parts: Partial = {} @@ -34,18 +34,21 @@ const createConfig = ( }; }; +const createClient = () => + ({ close: jest.fn(), child: jest.fn() } as unknown as jest.Mocked); + describe('ClusterClient', () => { let logger: ReturnType; let authHeaders: ReturnType; - let internalClient: ReturnType; - let scopedClient: ReturnType; + let internalClient: jest.Mocked; + let scopedClient: jest.Mocked; const mockTransport = { mockTransport: true }; beforeEach(() => { logger = loggingSystemMock.createLogger(); - internalClient = elasticsearchClientMock.createInternalClient(); - scopedClient = elasticsearchClientMock.createInternalClient(); + internalClient = createClient(); + scopedClient = createClient(); authHeaders = httpServiceMock.createAuthHeaderStorage(); authHeaders.get.mockImplementation(() => ({ diff --git a/src/core/server/elasticsearch/client/cluster_client.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/cluster_client.ts similarity index 74% rename from src/core/server/elasticsearch/client/cluster_client.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/cluster_client.ts index 2eaaa0d6efca4..088a99c7642f0 100644 --- a/src/core/server/elasticsearch/client/cluster_client.ts +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/cluster_client.ts @@ -15,52 +15,20 @@ import { isKibanaRequest, isRealRequest, } from '@kbn/core-http-router-server-internal'; -import { ScopeableRequest } from '../types'; -import { ElasticsearchClient } from './types'; -import { configureClient } from './configure_client'; -import { ElasticsearchClientConfig } from './client_config'; -import { ScopedClusterClient, IScopedClusterClient } from './scoped_cluster_client'; -import { DEFAULT_HEADERS } from '../default_headers'; -import { +import type { + ScopeableRequest, UnauthorizedErrorHandler, - createInternalErrorHandler, - InternalUnauthorizedErrorHandler, -} from './retry_unauthorized'; + ICustomClusterClient, +} from '@kbn/core-elasticsearch-server'; +import type { ElasticsearchClientConfig } from '@kbn/core-elasticsearch-server'; +import { configureClient } from './configure_client'; +import { ScopedClusterClient } from './scoped_cluster_client'; +import { DEFAULT_HEADERS } from './headers'; +import { createInternalErrorHandler, InternalUnauthorizedErrorHandler } from './retry_unauthorized'; import { createTransport } from './create_transport'; const noop = () => undefined; -/** - * Represents an Elasticsearch cluster API client created by the platform. - * It allows to call API on behalf of the internal Kibana user and - * the actual user that is derived from the request headers (via `asScoped(...)`). - * - * @public - **/ -export interface IClusterClient { - /** - * A {@link ElasticsearchClient | client} to be used to query the ES cluster on behalf of the Kibana internal user - */ - readonly asInternalUser: ElasticsearchClient; - /** - * Creates a {@link IScopedClusterClient | scoped cluster client} bound to given {@link ScopeableRequest | request} - */ - asScoped: (request: ScopeableRequest) => IScopedClusterClient; -} - -/** - * See {@link IClusterClient} - * - * @public - */ -export interface ICustomClusterClient extends IClusterClient { - /** - * Closes the cluster client. After that client cannot be used and one should - * create a new client instance to be able to interact with Elasticsearch API. - */ - close: () => Promise; -} - /** @internal **/ export class ClusterClient implements ICustomClusterClient { private readonly config: ElasticsearchClientConfig; diff --git a/src/core/server/elasticsearch/client/configure_client.test.mocks.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/configure_client.test.mocks.ts similarity index 100% rename from src/core/server/elasticsearch/client/configure_client.test.mocks.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/configure_client.test.mocks.ts diff --git a/src/core/server/elasticsearch/client/configure_client.test.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/configure_client.test.ts similarity index 98% rename from src/core/server/elasticsearch/client/configure_client.test.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/configure_client.test.ts index b25568bbd906e..e4fb582972b1b 100644 --- a/src/core/server/elasticsearch/client/configure_client.test.ts +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/configure_client.test.ts @@ -18,7 +18,7 @@ import { } from './configure_client.test.mocks'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { ClusterConnectionPool } from '@elastic/elasticsearch'; -import type { ElasticsearchClientConfig } from './client_config'; +import type { ElasticsearchClientConfig } from '@kbn/core-elasticsearch-server'; import { configureClient } from './configure_client'; import { instrumentEsQueryAndDeprecationLogger } from './log_query_and_deprecation'; diff --git a/src/core/server/elasticsearch/client/configure_client.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/configure_client.ts similarity index 91% rename from src/core/server/elasticsearch/client/configure_client.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/configure_client.ts index 248820ceb1f56..4901349e6b487 100644 --- a/src/core/server/elasticsearch/client/configure_client.ts +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/configure_client.ts @@ -8,7 +8,8 @@ import { Client, HttpConnection, ClusterConnectionPool } from '@elastic/elasticsearch'; import type { Logger } from '@kbn/logging'; -import { parseClientOptions, ElasticsearchClientConfig } from './client_config'; +import type { ElasticsearchClientConfig } from '@kbn/core-elasticsearch-server'; +import { parseClientOptions } from './client_config'; import { instrumentEsQueryAndDeprecationLogger } from './log_query_and_deprecation'; import { createTransport } from './create_transport'; diff --git a/src/core/server/elasticsearch/client/create_transport.test.mocks.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/create_transport.test.mocks.ts similarity index 100% rename from src/core/server/elasticsearch/client/create_transport.test.mocks.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/create_transport.test.mocks.ts diff --git a/src/core/server/elasticsearch/client/create_transport.test.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/create_transport.test.ts similarity index 100% rename from src/core/server/elasticsearch/client/create_transport.test.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/create_transport.test.ts diff --git a/src/core/server/elasticsearch/client/create_transport.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/create_transport.ts similarity index 91% rename from src/core/server/elasticsearch/client/create_transport.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/create_transport.ts index 363dbb416979d..07ed3833a7af2 100644 --- a/src/core/server/elasticsearch/client/create_transport.ts +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/create_transport.ts @@ -7,13 +7,13 @@ */ import type { IncomingHttpHeaders } from 'http'; -import type { - TransportRequestParams, - TransportRequestOptions, - TransportResult, -} from '@elastic/transport'; -import type { TransportOptions } from '@elastic/transport/lib/Transport'; -import { Transport } from '@elastic/elasticsearch'; +import { + Transport, + type TransportOptions, + type TransportRequestParams, + type TransportRequestOptions, + type TransportResult, +} from '@elastic/elasticsearch'; import { isUnauthorizedError } from '@kbn/es-errors'; import { InternalUnauthorizedErrorHandler, isRetryResult } from './retry_unauthorized'; diff --git a/src/core/server/elasticsearch/client/get_ecs_response_log.test.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/get_ecs_response_log.test.ts similarity index 99% rename from src/core/server/elasticsearch/client/get_ecs_response_log.test.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/get_ecs_response_log.test.ts index ec00badbcdf28..03c8c118edcf2 100644 --- a/src/core/server/elasticsearch/client/get_ecs_response_log.test.ts +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/get_ecs_response_log.test.ts @@ -5,6 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ + import { type DiagnosticResult, type ConnectionRequestParams } from '@elastic/elasticsearch'; import { getEcsResponseLog } from './get_ecs_response_log'; diff --git a/src/core/server/elasticsearch/client/get_ecs_response_log.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/get_ecs_response_log.ts similarity index 99% rename from src/core/server/elasticsearch/client/get_ecs_response_log.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/get_ecs_response_log.ts index b977f03a9a062..fa122166ada08 100644 --- a/src/core/server/elasticsearch/client/get_ecs_response_log.ts +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/get_ecs_response_log.ts @@ -5,6 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ + import { type IncomingHttpHeaders } from 'http'; import { type DiagnosticResult } from '@elastic/elasticsearch'; import { type LogMeta } from '@kbn/logging'; diff --git a/src/core/server/elasticsearch/default_headers.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/headers.ts similarity index 72% rename from src/core/server/elasticsearch/default_headers.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/headers.ts index eef04754cd958..755947490f05c 100644 --- a/src/core/server/elasticsearch/default_headers.ts +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/headers.ts @@ -8,22 +8,26 @@ import { deepFreeze } from '@kbn/std'; +/** + * @internal + */ +export const PRODUCT_RESPONSE_HEADER = 'x-elastic-product'; + +/** + * @internal + */ export const PRODUCT_ORIGIN_HEADER = 'x-elastic-product-origin'; +/** + * @internal + */ export const RESERVED_HEADERS = deepFreeze([PRODUCT_ORIGIN_HEADER]); +/** + * @internal + */ export const DEFAULT_HEADERS = deepFreeze({ // Elasticsearch uses this to identify when a request is coming from Kibana, to allow Kibana to // access system indices using the standard ES APIs. [PRODUCT_ORIGIN_HEADER]: 'kibana', }); - -export const getReservedHeaders = (headerNames: string[]): string[] => { - const reservedHeaders = []; - for (const headerName of headerNames) { - if (RESERVED_HEADERS.includes(headerName.toLowerCase())) { - reservedHeaders.push(headerName); - } - } - return reservedHeaders; -}; diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/index.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/index.ts new file mode 100644 index 0000000000000..a4ca96fdd7036 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/index.ts @@ -0,0 +1,18 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { ScopedClusterClient } from './scoped_cluster_client'; +export { ClusterClient } from './cluster_client'; +export { configureClient } from './configure_client'; +export { getRequestDebugMeta, getErrorMessage } from './log_query_and_deprecation'; +export { + PRODUCT_RESPONSE_HEADER, + DEFAULT_HEADERS, + PRODUCT_ORIGIN_HEADER, + RESERVED_HEADERS, +} from './headers'; diff --git a/src/core/server/elasticsearch/client/log_query_and_deprecation.test.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/log_query_and_deprecation.test.ts similarity index 100% rename from src/core/server/elasticsearch/client/log_query_and_deprecation.test.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/log_query_and_deprecation.test.ts diff --git a/src/core/server/elasticsearch/client/log_query_and_deprecation.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/log_query_and_deprecation.ts similarity index 99% rename from src/core/server/elasticsearch/client/log_query_and_deprecation.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/log_query_and_deprecation.ts index 7d48b924cdf36..460ca0446f0fc 100644 --- a/src/core/server/elasticsearch/client/log_query_and_deprecation.ts +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/log_query_and_deprecation.ts @@ -5,6 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ + import type { IncomingHttpHeaders } from 'http'; import { Buffer } from 'buffer'; import { stringify } from 'querystring'; diff --git a/src/core/server/elasticsearch/client/retry_unauthorized.test.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/retry_unauthorized.test.ts similarity index 100% rename from src/core/server/elasticsearch/client/retry_unauthorized.test.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/retry_unauthorized.test.ts diff --git a/src/core/server/elasticsearch/client/retry_unauthorized.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/retry_unauthorized.ts similarity index 58% rename from src/core/server/elasticsearch/client/retry_unauthorized.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/retry_unauthorized.ts index 568bc530e2fe8..e8337898eb6c3 100644 --- a/src/core/server/elasticsearch/client/retry_unauthorized.ts +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/retry_unauthorized.ts @@ -8,71 +8,16 @@ import { MaybePromise } from '@kbn/utility-types'; import { UnauthorizedError } from '@kbn/es-errors'; -import type { AuthHeaders, KibanaRequest, SetAuthHeaders } from '@kbn/core-http-server'; +import type { SetAuthHeaders } from '@kbn/core-http-server'; import { isRealRequest } from '@kbn/core-http-router-server-internal'; -import { ScopeableRequest } from '../types'; - -/** - * @public - */ -export interface UnauthorizedErrorHandlerOptions { - error: UnauthorizedError; - request: KibanaRequest; -} - -/** - * @public - */ -export interface UnauthorizedErrorHandlerResultRetryParams { - authHeaders: AuthHeaders; -} - -/** - * @public - */ -export interface UnauthorizedErrorHandlerRetryResult - extends UnauthorizedErrorHandlerResultRetryParams { - type: 'retry'; -} - -/** - * @public - */ -export interface UnauthorizedErrorHandlerNotHandledResult { - type: 'notHandled'; -} - -/** - * @public - */ -export type UnauthorizedErrorHandlerResult = - | UnauthorizedErrorHandlerRetryResult - | UnauthorizedErrorHandlerNotHandledResult; - -/** - * Toolkit passed to a {@link UnauthorizedErrorHandler} used to generate responses from the handler - * @public - */ -export interface UnauthorizedErrorHandlerToolkit { - /** - * The handler cannot handle the error, or was not able to authenticate. - */ - notHandled: () => UnauthorizedErrorHandlerNotHandledResult; - /** - * The handler was able to authenticate. Will retry the failed request with new auth headers - */ - retry: (params: UnauthorizedErrorHandlerResultRetryParams) => UnauthorizedErrorHandlerRetryResult; -} - -/** - * A handler used to handle unauthorized error returned by elasticsearch - * - * @public - */ -export type UnauthorizedErrorHandler = ( - options: UnauthorizedErrorHandlerOptions, - toolkit: UnauthorizedErrorHandlerToolkit -) => MaybePromise; +import type { + ScopeableRequest, + UnauthorizedErrorHandler, + UnauthorizedErrorHandlerResult, + UnauthorizedErrorHandlerToolkit, + UnauthorizedErrorHandlerRetryResult, + UnauthorizedErrorHandlerNotHandledResult, +} from '@kbn/core-elasticsearch-server'; /** @internal */ export type InternalUnauthorizedErrorHandler = ( diff --git a/src/core/server/elasticsearch/client/scoped_cluster_client.test.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/scoped_cluster_client.test.ts similarity index 71% rename from src/core/server/elasticsearch/client/scoped_cluster_client.test.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/scoped_cluster_client.test.ts index 6635f32b8863f..75d2e9d9e6361 100644 --- a/src/core/server/elasticsearch/client/scoped_cluster_client.test.ts +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/scoped_cluster_client.test.ts @@ -6,13 +6,15 @@ * Side Public License, v 1. */ -import { elasticsearchClientMock } from './mocks'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { ScopedClusterClient } from './scoped_cluster_client'; +const createEsClient = () => ({} as unknown as ElasticsearchClient); + describe('ScopedClusterClient', () => { it('uses the internal client passed in the constructor', () => { - const internalClient = elasticsearchClientMock.createElasticsearchClient(); - const scopedClient = elasticsearchClientMock.createElasticsearchClient(); + const internalClient = createEsClient(); + const scopedClient = createEsClient(); const scopedClusterClient = new ScopedClusterClient(internalClient, scopedClient); @@ -20,8 +22,8 @@ describe('ScopedClusterClient', () => { }); it('uses the scoped client passed in the constructor', () => { - const internalClient = elasticsearchClientMock.createElasticsearchClient(); - const scopedClient = elasticsearchClientMock.createElasticsearchClient(); + const internalClient = createEsClient(); + const scopedClient = createEsClient(); const scopedClusterClient = new ScopedClusterClient(internalClient, scopedClient); diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/scoped_cluster_client.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/scoped_cluster_client.ts new file mode 100644 index 0000000000000..dedccacf43202 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/src/scoped_cluster_client.ts @@ -0,0 +1,17 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { ElasticsearchClient, IScopedClusterClient } from '@kbn/core-elasticsearch-server'; + +/** @internal **/ +export class ScopedClusterClient implements IScopedClusterClient { + constructor( + public readonly asInternalUser: ElasticsearchClient, + public readonly asCurrentUser: ElasticsearchClient + ) {} +} diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/tsconfig.json b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/tsconfig.json new file mode 100644 index 0000000000000..39d3c7097814a --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node" + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/BUILD.bazel b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/BUILD.bazel new file mode 100644 index 0000000000000..a8534e09fd929 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/BUILD.bazel @@ -0,0 +1,102 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-elasticsearch-client-server-mocks" +PKG_REQUIRE_NAME = "@kbn/core-elasticsearch-client-server-mocks" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], + exclude = [ + "**/*.test.*", + "**/*.stories.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "//packages/core/elasticsearch/core-elasticsearch-client-server-internal", +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//@elastic/elasticsearch", + "//packages/kbn-utility-types:npm_module_types", + "//packages/core/elasticsearch/core-elasticsearch-server:npm_module_types", + "//packages/core/elasticsearch/core-elasticsearch-client-server-internal:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + declaration_map = True, + emit_declaration_only = True, + out_dir = "target_types", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/README.md b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/README.md new file mode 100644 index 0000000000000..3f2b0129bd374 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/README.md @@ -0,0 +1,3 @@ +# @kbn/core-elasticsearch-client-server-mocks + +This package contains the mocks for the server-side elasticsearch client. diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/jest.config.js b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/jest.config.js new file mode 100644 index 0000000000000..a88ecf94eb734 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/jest.config.js @@ -0,0 +1,13 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../..', + roots: ['/packages/core/elasticsearch/core-elasticsearch-client-server-mocks'], +}; diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/package.json b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/package.json new file mode 100644 index 0000000000000..5668979087411 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/core-elasticsearch-client-server-mocks", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/src/index.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/src/index.ts new file mode 100644 index 0000000000000..41192f12c2f65 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/src/index.ts @@ -0,0 +1,17 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { elasticsearchClientMock } from './mocks'; +export type { + ClientApiMockInstance, + ClusterClientMock, + ScopedClusterClientMock, + CustomClusterClientMock, + DeeplyMockedApi, + ElasticsearchClientMock, +} from './mocks'; diff --git a/src/core/server/elasticsearch/client/mocks.test.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/src/mocks.test.ts similarity index 100% rename from src/core/server/elasticsearch/client/mocks.test.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-mocks/src/mocks.test.ts diff --git a/src/core/server/elasticsearch/client/mocks.ts b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/src/mocks.ts similarity index 96% rename from src/core/server/elasticsearch/client/mocks.ts rename to packages/core/elasticsearch/core-elasticsearch-client-server-mocks/src/mocks.ts index 2c34629f2fd57..be3fe6f839dce 100644 --- a/src/core/server/elasticsearch/client/mocks.ts +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/src/mocks.ts @@ -6,12 +6,10 @@ * Side Public License, v 1. */ -import type { Client } from '@elastic/elasticsearch'; -import type { TransportResult, TransportRequestOptions } from '@elastic/elasticsearch'; +import type { Client, TransportResult, TransportRequestOptions } from '@elastic/elasticsearch'; import type { PublicKeys } from '@kbn/utility-types'; -import { ElasticsearchClient } from './types'; -import { ICustomClusterClient } from './cluster_client'; -import { PRODUCT_RESPONSE_HEADER } from '../supported_server_response_check'; +import type { ElasticsearchClient, ICustomClusterClient } from '@kbn/core-elasticsearch-server'; +import { PRODUCT_RESPONSE_HEADER } from '@kbn/core-elasticsearch-client-server-internal'; const omittedProps = [ 'diagnostic', diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/tsconfig.json b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/tsconfig.json new file mode 100644 index 0000000000000..39d3c7097814a --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node" + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/core/elasticsearch/core-elasticsearch-server-internal/BUILD.bazel b/packages/core/elasticsearch/core-elasticsearch-server-internal/BUILD.bazel new file mode 100644 index 0000000000000..1593da93f0234 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/BUILD.bazel @@ -0,0 +1,132 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-elasticsearch-server-internal" +PKG_REQUIRE_NAME = "@kbn/core-elasticsearch-server-internal" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], + exclude = [ + "**/*.test.*", + "**/*.stories.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "@npm//rxjs", + "@npm//semver", + "@npm//moment", + "@npm//@elastic/elasticsearch", + "//packages/kbn-std", + "//packages/kbn-i18n", + "//packages/kbn-crypto", + "//packages/kbn-config-schema", + "//packages/core/elasticsearch/core-elasticsearch-client-server-internal", + ### test dependencies + "//packages/kbn-config-mocks", + "//packages/core/logging/core-logging-server-mocks", + "//packages/core/analytics/core-analytics-server-mocks", + "//packages/core/execution-context/core-execution-context-server-mocks", + "//packages/core/http/core-http-server-mocks", + "//packages/core/elasticsearch/core-elasticsearch-client-server-mocks", + "//packages/core/config/core-config-server-internal", +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//rxjs", + "@npm//@types/semver", + "@npm//moment", + "@npm//@elastic/elasticsearch", + "//packages/kbn-utility-types:npm_module_types", + "//packages/kbn-std:npm_module_types", + "//packages/kbn-logging:npm_module_types", + "//packages/kbn-i18n:npm_module_types", + "//packages/kbn-crypto:npm_module_types", + "//packages/kbn-config-schema:npm_module_types", + "//packages/core/base/core-base-common:npm_module_types", + "//packages/core/base/core-base-server-internal:npm_module_types", + "//packages/core/analytics/core-analytics-server:npm_module_types", + "//packages/core/http/core-http-server:npm_module_types", + "//packages/core/http/core-http-server-internal:npm_module_types", + "//packages/core/execution-context/core-execution-context-server-internal:npm_module_types", + "//packages/core/elasticsearch/core-elasticsearch-server:npm_module_types", + "//packages/core/elasticsearch/core-elasticsearch-client-server-internal:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + declaration_map = True, + emit_declaration_only = True, + out_dir = "target_types", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/elasticsearch/core-elasticsearch-server-internal/README.md b/packages/core/elasticsearch/core-elasticsearch-server-internal/README.md new file mode 100644 index 0000000000000..38df445ccf465 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/README.md @@ -0,0 +1,3 @@ +# @kbn/core-elasticsearch-server-internal + +This package contains the internal types and implementation for Core's server-side elasticsearch service. diff --git a/packages/core/elasticsearch/core-elasticsearch-server-internal/jest.config.js b/packages/core/elasticsearch/core-elasticsearch-server-internal/jest.config.js new file mode 100644 index 0000000000000..bf51a18cb31b7 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/jest.config.js @@ -0,0 +1,13 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../..', + roots: ['/packages/core/elasticsearch/core-elasticsearch-server-internal'], +}; diff --git a/packages/core/elasticsearch/core-elasticsearch-server-internal/package.json b/packages/core/elasticsearch/core-elasticsearch-server-internal/package.json new file mode 100644 index 0000000000000..c4d93c383d421 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/core-elasticsearch-server-internal", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/src/core/server/elasticsearch/default_headers.test.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/default_headers.test.ts similarity index 84% rename from src/core/server/elasticsearch/default_headers.test.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/default_headers.test.ts index 58e6e222a3f2b..862020ba77fea 100644 --- a/src/core/server/elasticsearch/default_headers.test.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/default_headers.test.ts @@ -6,7 +6,8 @@ * Side Public License, v 1. */ -import { getReservedHeaders, PRODUCT_ORIGIN_HEADER } from './default_headers'; +import { PRODUCT_ORIGIN_HEADER } from '@kbn/core-elasticsearch-client-server-internal'; +import { getReservedHeaders } from './default_headers'; describe('getReservedHeaders', () => { it('returns the list of reserved headers contained in a list', () => { diff --git a/packages/core/elasticsearch/core-elasticsearch-server-internal/src/default_headers.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/default_headers.ts new file mode 100644 index 0000000000000..4c447d66fd57a --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/default_headers.ts @@ -0,0 +1,19 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { RESERVED_HEADERS } from '@kbn/core-elasticsearch-client-server-internal'; + +export const getReservedHeaders = (headerNames: string[]): string[] => { + const reservedHeaders = []; + for (const headerName of headerNames) { + if (RESERVED_HEADERS.includes(headerName.toLowerCase())) { + reservedHeaders.push(headerName); + } + } + return reservedHeaders; +}; diff --git a/src/core/server/elasticsearch/elasticsearch_config.test.mocks.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_config.test.mocks.ts similarity index 100% rename from src/core/server/elasticsearch/elasticsearch_config.test.mocks.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_config.test.mocks.ts diff --git a/src/core/server/elasticsearch/elasticsearch_config.test.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_config.test.ts similarity index 100% rename from src/core/server/elasticsearch/elasticsearch_config.test.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_config.test.ts diff --git a/src/core/server/elasticsearch/elasticsearch_config.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_config.ts similarity index 98% rename from src/core/server/elasticsearch/elasticsearch_config.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_config.ts index 201f285d72874..8420d8d72346f 100644 --- a/src/core/server/elasticsearch/elasticsearch_config.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_config.ts @@ -12,7 +12,8 @@ import { i18n } from '@kbn/i18n'; import { Duration } from 'moment'; import { readFileSync } from 'fs'; import type { ServiceConfigDescriptor } from '@kbn/core-base-server-internal'; -import { ConfigDeprecationProvider } from '..'; +import type { ConfigDeprecationProvider } from '@kbn/config'; +import type { IElasticsearchConfig, ElasticsearchSslConfig } from '@kbn/core-elasticsearch-server'; import { getReservedHeaders } from './default_headers'; const hostURISchema = schema.uri({ scheme: ['http', 'https'] }); @@ -20,7 +21,6 @@ const hostURISchema = schema.uri({ scheme: ['http', 'https'] }); export const DEFAULT_API_VERSION = 'master'; export type ElasticsearchConfigType = TypeOf; -type SslConfigSchema = ElasticsearchConfigType['ssl']; /** * Validation schema for elasticsearch service config. It can be reused when plugins allow users @@ -270,9 +270,9 @@ export const config: ServiceConfigDescriptor = { /** * Wrapper of config schema. - * @public + * @internal */ -export class ElasticsearchConfig { +export class ElasticsearchConfig implements IElasticsearchConfig { /** * @internal * Only valid in dev mode. Skip the valid connection check during startup. The connection check allows @@ -381,10 +381,7 @@ export class ElasticsearchConfig { * are required when `xpack.ssl.verification_mode` in Elasticsearch is set to * either `certificate` or `full`. */ - public readonly ssl: Pick< - SslConfigSchema, - Exclude - > & { certificateAuthorities?: string[] }; + public readonly ssl: ElasticsearchSslConfig; /** * Header names and values to send to Elasticsearch with every request. These diff --git a/src/core/server/elasticsearch/elasticsearch_route_handler_context.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_route_handler_context.ts similarity index 82% rename from src/core/server/elasticsearch/elasticsearch_route_handler_context.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_route_handler_context.ts index e33cd854546fc..0b4a1474a88e8 100644 --- a/src/core/server/elasticsearch/elasticsearch_route_handler_context.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_route_handler_context.ts @@ -7,17 +7,12 @@ */ import type { KibanaRequest } from '@kbn/core-http-server'; -import type { IScopedClusterClient } from './client'; +import type { + IScopedClusterClient, + ElasticsearchRequestHandlerContext, +} from '@kbn/core-elasticsearch-server'; import type { InternalElasticsearchServiceStart } from './types'; -/** - * Core's `elasticsearch` request handler context. - * @public - */ -export interface ElasticsearchRequestHandlerContext { - client: IScopedClusterClient; -} - /** * The {@link UiSettingsRequestHandlerContext} implementation. * @internal diff --git a/src/core/server/elasticsearch/elasticsearch_service.test.mocks.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.test.mocks.ts similarity index 83% rename from src/core/server/elasticsearch/elasticsearch_service.test.mocks.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.test.mocks.ts index 0ac23c1b37cf6..29b9a2cda3dfd 100644 --- a/src/core/server/elasticsearch/elasticsearch_service.test.mocks.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.test.mocks.ts @@ -7,7 +7,9 @@ */ export const MockClusterClient = jest.fn(); -jest.mock('./client/cluster_client', () => ({ ClusterClient: MockClusterClient })); +jest.mock('@kbn/core-elasticsearch-client-server-internal', () => ({ + ClusterClient: MockClusterClient, +})); export const isScriptingEnabledMock = jest.fn(); jest.doMock('./is_scripting_enabled', () => ({ diff --git a/src/core/server/elasticsearch/elasticsearch_service.test.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.test.ts similarity index 99% rename from src/core/server/elasticsearch/elasticsearch_service.test.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.test.ts index b40a157a4ca2f..aaf7344fdc3b6 100644 --- a/src/core/server/elasticsearch/elasticsearch_service.test.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.test.ts @@ -16,9 +16,6 @@ jest.mock('./version_check/ensure_es_version', () => ({ pollEsNodesVersion: jest.fn(), })); -// Mocking the module to disable caching for tests -jest.mock('../ui_settings/cache'); - import { MockClusterClient, isScriptingEnabledMock } from './elasticsearch_service.test.mocks'; import type { NodesVersionCompatibility } from './version_check/ensure_es_version'; @@ -32,9 +29,9 @@ import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { analyticsServiceMock } from '@kbn/core-analytics-server-mocks'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; import { httpServiceMock } from '@kbn/core-http-server-mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { configSchema, ElasticsearchConfig } from './elasticsearch_config'; import { ElasticsearchService, SetupDeps } from './elasticsearch_service'; -import { elasticsearchClientMock } from './client/mocks'; import { duration } from 'moment'; import { isValidConnection as isValidConnectionMock } from './is_valid_connection'; import { pollEsNodesVersion as pollEsNodesVersionMocked } from './version_check/ensure_es_version'; diff --git a/src/core/server/elasticsearch/elasticsearch_service.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.ts similarity index 97% rename from src/core/server/elasticsearch/elasticsearch_service.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.ts index a60069d644ca2..8e7ab46b0edd4 100644 --- a/src/core/server/elasticsearch/elasticsearch_service.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.ts @@ -18,9 +18,13 @@ import type { } from '@kbn/core-execution-context-server-internal'; import type { IAuthHeadersStorage } from '@kbn/core-http-server'; import type { InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; +import type { + UnauthorizedErrorHandler, + ElasticsearchClientConfig, +} from '@kbn/core-elasticsearch-server'; +import { ClusterClient } from '@kbn/core-elasticsearch-client-server-internal'; import { registerAnalyticsContextProvider } from './register_analytics_context_provider'; -import { ClusterClient, ElasticsearchClientConfig } from './client'; import { ElasticsearchConfig, ElasticsearchConfigType } from './elasticsearch_config'; import { InternalElasticsearchServicePreboot, @@ -32,7 +36,6 @@ import { pollEsNodesVersion } from './version_check/ensure_es_version'; import { calculateStatus$ } from './status'; import { isValidConnection } from './is_valid_connection'; import { isInlineScriptingEnabled } from './is_scripting_enabled'; -import type { UnauthorizedErrorHandler } from './client/retry_unauthorized'; import { mergeConfig } from './merge_config'; import { getClusterInfo$ } from './get_cluster_info'; diff --git a/src/core/server/elasticsearch/get_cluster_info.test.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/get_cluster_info.test.ts similarity index 81% rename from src/core/server/elasticsearch/get_cluster_info.test.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/get_cluster_info.test.ts index fd3b3b71844ac..e7da3cdebabcc 100644 --- a/src/core/server/elasticsearch/get_cluster_info.test.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/get_cluster_info.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { elasticsearchClientMock } from './client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { firstValueFrom } from 'rxjs'; import { getClusterInfo$ } from './get_cluster_info'; @@ -39,9 +39,9 @@ describe('getClusterInfo', () => { const context$ = getClusterInfo$(internalClient); await expect(firstValueFrom(context$)).resolves.toMatchInlineSnapshot(` Object { - "cluster_name": "cluster-name", - "cluster_uuid": "cluster_uuid", - "cluster_version": "1.2.3", + "clusterName": "cluster-name", + "clusterUuid": "cluster_uuid", + "clusterVersion": "1.2.3", } `); }); @@ -52,9 +52,9 @@ describe('getClusterInfo', () => { const context$ = getClusterInfo$(internalClient); await expect(firstValueFrom(context$)).resolves.toMatchInlineSnapshot(` Object { - "cluster_name": "cluster-name", - "cluster_uuid": "cluster_uuid", - "cluster_version": "1.2.3", + "clusterName": "cluster-name", + "clusterUuid": "cluster_uuid", + "clusterVersion": "1.2.3", } `); expect(internalClient.info).toHaveBeenCalledTimes(2); @@ -65,16 +65,16 @@ describe('getClusterInfo', () => { const context$ = getClusterInfo$(internalClient); await expect(firstValueFrom(context$)).resolves.toMatchInlineSnapshot(` Object { - "cluster_name": "cluster-name", - "cluster_uuid": "cluster_uuid", - "cluster_version": "1.2.3", + "clusterName": "cluster-name", + "clusterUuid": "cluster_uuid", + "clusterVersion": "1.2.3", } `); await expect(firstValueFrom(context$)).resolves.toMatchInlineSnapshot(` Object { - "cluster_name": "cluster-name", - "cluster_uuid": "cluster_uuid", - "cluster_version": "1.2.3", + "clusterName": "cluster-name", + "clusterUuid": "cluster_uuid", + "clusterVersion": "1.2.3", } `); expect(internalClient.info).toHaveBeenCalledTimes(1); diff --git a/src/core/server/elasticsearch/get_cluster_info.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/get_cluster_info.ts similarity index 76% rename from src/core/server/elasticsearch/get_cluster_info.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/get_cluster_info.ts index c807965d3bbf8..84aaee48b7889 100644 --- a/src/core/server/elasticsearch/get_cluster_info.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/get_cluster_info.ts @@ -8,13 +8,13 @@ import type { Observable } from 'rxjs'; import { defer, map, retry, shareReplay } from 'rxjs'; -import type { ElasticsearchClient } from './client'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; /** @private */ export interface ClusterInfo { - cluster_name: string; - cluster_uuid: string; - cluster_version: string; + clusterName: string; + clusterUuid: string; + clusterVersion: string; } /** @@ -25,9 +25,9 @@ export interface ClusterInfo { export function getClusterInfo$(internalClient: ElasticsearchClient): Observable { return defer(() => internalClient.info()).pipe( map((info) => ({ - cluster_name: info.cluster_name, - cluster_uuid: info.cluster_uuid, - cluster_version: info.version.number, + clusterName: info.cluster_name, + clusterUuid: info.cluster_uuid, + clusterVersion: info.version.number, })), retry({ delay: 1000 }), shareReplay(1) diff --git a/src/core/server/elasticsearch/index.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/index.ts similarity index 51% rename from src/core/server/elasticsearch/index.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/index.ts index b23b12ffe392c..2554f225a58ab 100644 --- a/src/core/server/elasticsearch/index.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/index.ts @@ -7,45 +7,25 @@ */ export { ElasticsearchService } from './elasticsearch_service'; -export { config, configSchema } from './elasticsearch_config'; -export { ElasticsearchConfig } from './elasticsearch_config'; +export { config, configSchema, ElasticsearchConfig } from './elasticsearch_config'; +export type { ElasticsearchConfigType } from './elasticsearch_config'; export type { NodesVersionCompatibility, PollEsNodesVersionOptions, + NodesInfo, + NodeInfo, } from './version_check/ensure_es_version'; export type { - ElasticsearchServicePreboot, - ElasticsearchServiceSetup, - ElasticsearchServiceStart, ElasticsearchStatusMeta, InternalElasticsearchServicePreboot, InternalElasticsearchServiceSetup, InternalElasticsearchServiceStart, - FakeRequest, - ScopeableRequest, - ElasticsearchConfigPreboot, } from './types'; -export type { - IClusterClient, - ICustomClusterClient, - ElasticsearchClientConfig, - ElasticsearchClient, - IScopedClusterClient, - // unauthorized error handler - UnauthorizedErrorHandlerOptions, - UnauthorizedErrorHandlerResultRetryParams, - UnauthorizedErrorHandlerRetryResult, - UnauthorizedErrorHandlerNotHandledResult, - UnauthorizedErrorHandlerResult, - UnauthorizedErrorHandlerToolkit, - UnauthorizedErrorHandler, -} from './client'; -export { getRequestDebugMeta, getErrorMessage } from './client'; export { pollEsNodesVersion } from './version_check/ensure_es_version'; export { isSupportedEsServer, isNotFoundFromUnsupportedServer, - PRODUCT_RESPONSE_HEADER, } from './supported_server_response_check'; export { CoreElasticsearchRouteHandlerContext } from './elasticsearch_route_handler_context'; -export type { ElasticsearchRequestHandlerContext } from './elasticsearch_route_handler_context'; +export { retryCallCluster, migrationRetryCallCluster } from './retry_call_cluster'; +export { isInlineScriptingEnabled } from './is_scripting_enabled'; diff --git a/src/core/server/elasticsearch/is_scripting_enabled.test.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/is_scripting_enabled.test.ts similarity index 91% rename from src/core/server/elasticsearch/is_scripting_enabled.test.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/is_scripting_enabled.test.ts index 797ff8972b7be..d2922c0161c6f 100644 --- a/src/core/server/elasticsearch/is_scripting_enabled.test.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/is_scripting_enabled.test.ts @@ -7,14 +7,14 @@ */ import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { elasticsearchServiceMock } from './elasticsearch_service.mock'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { isInlineScriptingEnabled } from './is_scripting_enabled'; describe('isInlineScriptingEnabled', () => { - let client: ReturnType; + let client: ReturnType; beforeEach(() => { - client = elasticsearchServiceMock.createElasticsearchClient(); + client = elasticsearchClientMock.createElasticsearchClient(); }); const mockSettingsValue = (settings: estypes.ClusterGetSettingsResponse) => { diff --git a/src/core/server/elasticsearch/is_scripting_enabled.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/is_scripting_enabled.ts similarity index 93% rename from src/core/server/elasticsearch/is_scripting_enabled.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/is_scripting_enabled.ts index 13685362c11ca..6a3900229c0d4 100644 --- a/src/core/server/elasticsearch/is_scripting_enabled.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/is_scripting_enabled.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { ElasticsearchClient } from './client'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; const scriptAllowedTypesKey = 'script.allowed_types'; diff --git a/src/core/server/elasticsearch/is_valid_connection.test.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/is_valid_connection.test.ts similarity index 100% rename from src/core/server/elasticsearch/is_valid_connection.test.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/is_valid_connection.test.ts diff --git a/src/core/server/elasticsearch/is_valid_connection.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/is_valid_connection.ts similarity index 100% rename from src/core/server/elasticsearch/is_valid_connection.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/is_valid_connection.ts diff --git a/src/core/server/elasticsearch/merge_config.test.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/merge_config.test.ts similarity index 97% rename from src/core/server/elasticsearch/merge_config.test.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/merge_config.test.ts index c89a759435284..02317546a9dbc 100644 --- a/src/core/server/elasticsearch/merge_config.test.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/merge_config.test.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ +import type { ElasticsearchClientConfig } from '@kbn/core-elasticsearch-server'; import { mergeConfig } from './merge_config'; -import type { ElasticsearchClientConfig } from './client'; import { configSchema, ElasticsearchConfig } from './elasticsearch_config'; const partialToConfig = (parts: Partial): ElasticsearchClientConfig => { diff --git a/src/core/server/elasticsearch/merge_config.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/merge_config.ts similarity index 93% rename from src/core/server/elasticsearch/merge_config.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/merge_config.ts index 373bf6fc6cbe0..9bb06670a09a9 100644 --- a/src/core/server/elasticsearch/merge_config.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/merge_config.ts @@ -8,7 +8,7 @@ import { merge } from '@kbn/std'; import { Writable } from '@kbn/utility-types'; -import type { ElasticsearchClientConfig } from './client'; +import type { ElasticsearchClientConfig } from '@kbn/core-elasticsearch-server'; type WritableConfig = Writable; diff --git a/src/core/server/elasticsearch/register_analytics_context_provider.test.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/register_analytics_context_provider.test.ts similarity index 84% rename from src/core/server/elasticsearch/register_analytics_context_provider.test.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/register_analytics_context_provider.test.ts index b041586cf1903..afecaf2b5d78f 100644 --- a/src/core/server/elasticsearch/register_analytics_context_provider.test.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/register_analytics_context_provider.test.ts @@ -21,14 +21,14 @@ describe('registerAnalyticsContextProvider', () => { test('it provides the context', async () => { registerAnalyticsContextProvider( analyticsMock, - of({ cluster_name: 'cluster-name', cluster_uuid: 'cluster_uuid', cluster_version: '1.2.3' }) + of({ clusterName: 'cluster-name', clusterUuid: 'cluster_uuid', clusterVersion: '1.2.3' }) ); const { context$ } = analyticsMock.registerContextProvider.mock.calls[0][0]; await expect(firstValueFrom(context$)).resolves.toMatchInlineSnapshot(` Object { - "cluster_name": "cluster-name", - "cluster_uuid": "cluster_uuid", - "cluster_version": "1.2.3", + "clusterName": "cluster-name", + "clusterUuid": "cluster_uuid", + "clusterVersion": "1.2.3", } `); }); diff --git a/src/core/server/elasticsearch/register_analytics_context_provider.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/register_analytics_context_provider.ts similarity index 78% rename from src/core/server/elasticsearch/register_analytics_context_provider.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/register_analytics_context_provider.ts index 9120d48fcb606..c50d817692c4b 100644 --- a/src/core/server/elasticsearch/register_analytics_context_provider.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/register_analytics_context_provider.ts @@ -24,9 +24,9 @@ export function registerAnalyticsContextProvider( name: 'elasticsearch info', context$, schema: { - cluster_name: { type: 'keyword', _meta: { description: 'The Cluster Name' } }, - cluster_uuid: { type: 'keyword', _meta: { description: 'The Cluster UUID' } }, - cluster_version: { type: 'keyword', _meta: { description: 'The Cluster version' } }, + clusterName: { type: 'keyword', _meta: { description: 'The Cluster Name' } }, + clusterUuid: { type: 'keyword', _meta: { description: 'The Cluster UUID' } }, + clusterVersion: { type: 'keyword', _meta: { description: 'The Cluster version' } }, }, }); } diff --git a/src/core/server/elasticsearch/client/retry_call_cluster.test.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/retry_call_cluster.test.ts similarity index 99% rename from src/core/server/elasticsearch/client/retry_call_cluster.test.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/retry_call_cluster.test.ts index aacb683197882..78bb907c5cc48 100644 --- a/src/core/server/elasticsearch/client/retry_call_cluster.test.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/retry_call_cluster.test.ts @@ -8,7 +8,7 @@ import { errors } from '@elastic/elasticsearch'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; -import { elasticsearchClientMock } from './mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { retryCallCluster, migrationRetryCallCluster } from './retry_call_cluster'; const dummyBody: any = { foo: 'bar' }; diff --git a/src/core/server/elasticsearch/client/retry_call_cluster.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/retry_call_cluster.ts similarity index 100% rename from src/core/server/elasticsearch/client/retry_call_cluster.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/retry_call_cluster.ts diff --git a/src/core/server/elasticsearch/status.test.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/status.test.ts similarity index 96% rename from src/core/server/elasticsearch/status.test.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/status.test.ts index c1f7cf0e35892..f6aec43e680c4 100644 --- a/src/core/server/elasticsearch/status.test.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/status.test.ts @@ -9,11 +9,15 @@ import { take } from 'rxjs/operators'; import { Subject, of } from 'rxjs'; +import { ServiceStatusLevels, ServiceStatusLevel, ServiceStatus } from '@kbn/core-base-common'; import { calculateStatus$ } from './status'; -import { ServiceStatusLevels, ServiceStatus } from '../status'; -import { ServiceStatusLevelSnapshotSerializer } from '../status/test_utils'; import { NodesVersionCompatibility } from './version_check/ensure_es_version'; +const ServiceStatusLevelSnapshotSerializer: jest.SnapshotSerializerPlugin = { + test: (val: any) => Object.values(ServiceStatusLevels).includes(val), + serialize: (val: ServiceStatusLevel) => val.toString(), +}; + expect.addSnapshotSerializer(ServiceStatusLevelSnapshotSerializer); const nodeInfo = { diff --git a/src/core/server/elasticsearch/status.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/status.ts similarity index 96% rename from src/core/server/elasticsearch/status.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/status.ts index 23e44b71863f1..5a38f11432b7b 100644 --- a/src/core/server/elasticsearch/status.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/status.ts @@ -8,8 +8,7 @@ import { Observable, merge, of } from 'rxjs'; import { map } from 'rxjs/operators'; - -import { ServiceStatus, ServiceStatusLevels } from '../status'; +import { ServiceStatus, ServiceStatusLevels } from '@kbn/core-base-common'; import { ElasticsearchStatusMeta } from './types'; import { NodesVersionCompatibility } from './version_check/ensure_es_version'; diff --git a/src/core/server/elasticsearch/supported_server_response_check.test.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/supported_server_response_check.test.ts similarity index 100% rename from src/core/server/elasticsearch/supported_server_response_check.test.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/supported_server_response_check.test.ts diff --git a/src/core/server/elasticsearch/supported_server_response_check.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/supported_server_response_check.ts similarity index 94% rename from src/core/server/elasticsearch/supported_server_response_check.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/supported_server_response_check.ts index 91aa06e132de8..43f3f4ca92ce8 100644 --- a/src/core/server/elasticsearch/supported_server_response_check.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/supported_server_response_check.ts @@ -5,7 +5,9 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -export const PRODUCT_RESPONSE_HEADER = 'x-elastic-product'; + +import { PRODUCT_RESPONSE_HEADER } from '@kbn/core-elasticsearch-client-server-internal'; + /** * Response headers check to determine if the response is from Elasticsearch * @param headers Response headers diff --git a/packages/core/elasticsearch/core-elasticsearch-server-internal/src/types.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/types.ts new file mode 100644 index 0000000000000..57f3620a7911d --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/types.ts @@ -0,0 +1,39 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { Observable } from 'rxjs'; +import type { + ElasticsearchServicePreboot, + ElasticsearchServiceStart, + ElasticsearchServiceSetup, +} from '@kbn/core-elasticsearch-server'; +import type { ServiceStatus } from '@kbn/core-base-common'; +import type { NodesVersionCompatibility, NodeInfo } from './version_check/ensure_es_version'; +import type { ClusterInfo } from './get_cluster_info'; + +/** @internal */ +export type InternalElasticsearchServicePreboot = ElasticsearchServicePreboot; + +/** @internal */ +export interface InternalElasticsearchServiceSetup extends ElasticsearchServiceSetup { + clusterInfo$: Observable; + esNodesCompatibility$: Observable; + status$: Observable>; +} + +/** + * @internal + */ +export type InternalElasticsearchServiceStart = ElasticsearchServiceStart; + +/** @internal */ +export interface ElasticsearchStatusMeta { + warningNodes: NodeInfo[]; + incompatibleNodes: NodeInfo[]; + nodesInfoRequestError?: Error; +} diff --git a/src/core/server/elasticsearch/version_check/ensure_es_version.test.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.test.ts similarity index 99% rename from src/core/server/elasticsearch/version_check/ensure_es_version.test.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.test.ts index 49b8517f8c23e..dccb2722309c4 100644 --- a/src/core/server/elasticsearch/version_check/ensure_es_version.test.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.test.ts @@ -8,7 +8,7 @@ import { mapNodesVersionCompatibility, pollEsNodesVersion, NodesInfo } from './ensure_es_version'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; -import { elasticsearchClientMock } from '../client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { take, delay } from 'rxjs/operators'; import { TestScheduler } from 'rxjs/testing'; import { of } from 'rxjs'; diff --git a/src/core/server/elasticsearch/version_check/ensure_es_version.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.ts similarity index 98% rename from src/core/server/elasticsearch/version_check/ensure_es_version.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.ts index 7ef52dec33732..caa2dd372b8f3 100644 --- a/src/core/server/elasticsearch/version_check/ensure_es_version.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/ensure_es_version.ts @@ -14,11 +14,11 @@ import { timer, of, from, Observable } from 'rxjs'; import { map, distinctUntilChanged, catchError, exhaustMap } from 'rxjs/operators'; import type { Logger } from '@kbn/logging'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { esVersionCompatibleWithKibana, esVersionEqualsKibana, } from './es_kibana_version_compatability'; -import type { ElasticsearchClient } from '../client'; /** @public */ export interface PollEsNodesVersionOptions { @@ -29,7 +29,8 @@ export interface PollEsNodesVersionOptions { esVersionCheckInterval: number; } -interface NodeInfo { +/** @public */ +export interface NodeInfo { version: string; ip: string; http?: { diff --git a/src/core/server/elasticsearch/version_check/es_kibana_version_compatability.test.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/es_kibana_version_compatability.test.ts similarity index 100% rename from src/core/server/elasticsearch/version_check/es_kibana_version_compatability.test.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/es_kibana_version_compatability.test.ts diff --git a/src/core/server/elasticsearch/version_check/es_kibana_version_compatability.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/es_kibana_version_compatability.ts similarity index 100% rename from src/core/server/elasticsearch/version_check/es_kibana_version_compatability.ts rename to packages/core/elasticsearch/core-elasticsearch-server-internal/src/version_check/es_kibana_version_compatability.ts diff --git a/packages/core/elasticsearch/core-elasticsearch-server-internal/tsconfig.json b/packages/core/elasticsearch/core-elasticsearch-server-internal/tsconfig.json new file mode 100644 index 0000000000000..39d3c7097814a --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node" + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/core/elasticsearch/core-elasticsearch-server-mocks/BUILD.bazel b/packages/core/elasticsearch/core-elasticsearch-server-mocks/BUILD.bazel new file mode 100644 index 0000000000000..5b5f11738a10a --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server-mocks/BUILD.bazel @@ -0,0 +1,105 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-elasticsearch-server-mocks" +PKG_REQUIRE_NAME = "@kbn/core-elasticsearch-server-mocks" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], + exclude = [ + "**/*.test.*", + "**/*.stories.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "@npm//rxjs", + "//packages/core/elasticsearch/core-elasticsearch-client-server-mocks", +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//rxjs", + "//packages/kbn-utility-types:npm_module_types", + "//packages/core/base/core-base-common:npm_module_types", + "//packages/core/elasticsearch/core-elasticsearch-server:npm_module_types", + "//packages/core/elasticsearch/core-elasticsearch-client-server-mocks:npm_module_types", + "//packages/core/elasticsearch/core-elasticsearch-server-internal:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + declaration_map = True, + emit_declaration_only = True, + out_dir = "target_types", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/elasticsearch/core-elasticsearch-server-mocks/README.md b/packages/core/elasticsearch/core-elasticsearch-server-mocks/README.md new file mode 100644 index 0000000000000..afc49df686dce --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server-mocks/README.md @@ -0,0 +1,3 @@ +# @kbn/core-elasticsearch-server-mocks + +This package contains the mocks for Core's server-side elasticsearch service. diff --git a/packages/core/elasticsearch/core-elasticsearch-server-mocks/jest.config.js b/packages/core/elasticsearch/core-elasticsearch-server-mocks/jest.config.js new file mode 100644 index 0000000000000..297bfd70ae34a --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server-mocks/jest.config.js @@ -0,0 +1,13 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../..', + roots: ['/packages/core/elasticsearch/core-elasticsearch-server-mocks'], +}; diff --git a/packages/core/elasticsearch/core-elasticsearch-server-mocks/package.json b/packages/core/elasticsearch/core-elasticsearch-server-mocks/package.json new file mode 100644 index 0000000000000..4455a10b79d20 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server-mocks/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/core-elasticsearch-server-mocks", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/src/core/server/elasticsearch/elasticsearch_service.mock.ts b/packages/core/elasticsearch/core-elasticsearch-server-mocks/src/elasticsearch_service.mock.ts similarity index 86% rename from src/core/server/elasticsearch/elasticsearch_service.mock.ts rename to packages/core/elasticsearch/core-elasticsearch-server-mocks/src/elasticsearch_service.mock.ts index 02a846a5b8011..08840c53dce7e 100644 --- a/src/core/server/elasticsearch/elasticsearch_service.mock.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-mocks/src/elasticsearch_service.mock.ts @@ -11,21 +11,23 @@ import type { PublicMethodsOf } from '@kbn/utility-types'; import { elasticsearchClientMock, - ClusterClientMock, - CustomClusterClientMock, -} from './client/mocks'; -import { ElasticsearchClientConfig } from './client'; -import { ElasticsearchConfig } from './elasticsearch_config'; -import { ElasticsearchService } from './elasticsearch_service'; -import { - InternalElasticsearchServiceSetup, + type ClusterClientMock, + type CustomClusterClientMock, +} from '@kbn/core-elasticsearch-client-server-mocks'; +import type { + ElasticsearchClientConfig, ElasticsearchServiceSetup, - ElasticsearchStatusMeta, ElasticsearchServicePreboot, -} from './types'; -import { NodesVersionCompatibility } from './version_check/ensure_es_version'; -import { ServiceStatus, ServiceStatusLevels } from '../status'; -import type { ClusterInfo } from './get_cluster_info'; +} from '@kbn/core-elasticsearch-server'; +import type { + ElasticsearchConfig, + ElasticsearchService, + InternalElasticsearchServiceSetup, + ElasticsearchStatusMeta, + NodesVersionCompatibility, + ClusterInfo, +} from '@kbn/core-elasticsearch-server-internal'; +import { type ServiceStatus, ServiceStatusLevels } from '@kbn/core-base-common'; type MockedElasticSearchServicePreboot = jest.Mocked; @@ -91,9 +93,9 @@ const createInternalSetupContractMock = () => { kibanaVersion: '8.0.0', }), clusterInfo$: new BehaviorSubject({ - cluster_uuid: 'cluster-uuid', - cluster_name: 'cluster-name', - cluster_version: '8.0.0', + clusterUuid: 'cluster-uuid', + clusterName: 'cluster-name', + clusterVersion: '8.0.0', }), status$: new BehaviorSubject>({ level: ServiceStatusLevels.available, diff --git a/packages/core/elasticsearch/core-elasticsearch-server-mocks/src/index.ts b/packages/core/elasticsearch/core-elasticsearch-server-mocks/src/index.ts new file mode 100644 index 0000000000000..0c58017fdc429 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server-mocks/src/index.ts @@ -0,0 +1,13 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { elasticsearchServiceMock } from './elasticsearch_service.mock'; +export type { + MockedElasticSearchServiceSetup, + MockedElasticSearchServiceStart, +} from './elasticsearch_service.mock'; diff --git a/packages/core/elasticsearch/core-elasticsearch-server-mocks/tsconfig.json b/packages/core/elasticsearch/core-elasticsearch-server-mocks/tsconfig.json new file mode 100644 index 0000000000000..39d3c7097814a --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server-mocks/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node" + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/core/elasticsearch/core-elasticsearch-server/BUILD.bazel b/packages/core/elasticsearch/core-elasticsearch-server/BUILD.bazel new file mode 100644 index 0000000000000..c097ff5b33fd2 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server/BUILD.bazel @@ -0,0 +1,102 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-elasticsearch-server" +PKG_REQUIRE_NAME = "@kbn/core-elasticsearch-server" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], + exclude = [ + "**/*.test.*", + "**/*.stories.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//moment", + "@npm//@elastic/elasticsearch", + "//packages/kbn-utility-types:npm_module_types", + "//packages/kbn-es-errors:npm_module_types", + "//packages/core/http/core-http-server:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + declaration_map = True, + emit_declaration_only = True, + out_dir = "target_types", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/elasticsearch/core-elasticsearch-server/README.md b/packages/core/elasticsearch/core-elasticsearch-server/README.md new file mode 100644 index 0000000000000..3bcfd22475d34 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server/README.md @@ -0,0 +1,3 @@ +# @kbn/core-elasticsearch-server + +This package contains the public type for Core's server-side `elasticsearch` domain. diff --git a/scripts/ensure_all_tests_in_ci_group.js b/packages/core/elasticsearch/core-elasticsearch-server/jest.config.js similarity index 69% rename from scripts/ensure_all_tests_in_ci_group.js rename to packages/core/elasticsearch/core-elasticsearch-server/jest.config.js index 7e382c4a20d17..e3bdaf67022ce 100644 --- a/scripts/ensure_all_tests_in_ci_group.js +++ b/packages/core/elasticsearch/core-elasticsearch-server/jest.config.js @@ -6,5 +6,8 @@ * Side Public License, v 1. */ -require('../src/setup_node_env'); -require('../src/dev/ensure_all_tests_in_ci_group').runEnsureAllTestsInCiGroupsCli(); +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../..', + roots: ['/packages/core/elasticsearch/core-elasticsearch-server'], +}; diff --git a/packages/core/elasticsearch/core-elasticsearch-server/package.json b/packages/core/elasticsearch/core-elasticsearch-server/package.json new file mode 100644 index 0000000000000..87a6b652dbd44 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/core-elasticsearch-server", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/src/core/server/elasticsearch/client/types.ts b/packages/core/elasticsearch/core-elasticsearch-server/src/client/client.ts similarity index 100% rename from src/core/server/elasticsearch/client/types.ts rename to packages/core/elasticsearch/core-elasticsearch-server/src/client/client.ts diff --git a/packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts b/packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts new file mode 100644 index 0000000000000..8c8fa6343e546 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server/src/client/client_config.ts @@ -0,0 +1,45 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { Duration } from 'moment'; + +/** + * Configuration options to be used to create a {@link IClusterClient | cluster client} + * + * @public + */ +export interface ElasticsearchClientConfig { + customHeaders: Record; + requestHeadersWhitelist: string[]; + maxSockets: number; + compression: boolean; + sniffOnStart: boolean; + sniffOnConnectionFault: boolean; + sniffInterval: false | Duration; + username?: string; + password?: string; + serviceAccountToken?: string; + hosts: string[]; + keepAlive?: boolean; + pingTimeout?: Duration | number; + requestTimeout?: Duration | number; + caFingerprint?: string; + ssl?: ElasticsearchClientSslConfig; +} + +/** + * @public + */ +export interface ElasticsearchClientSslConfig { + verificationMode?: 'none' | 'certificate' | 'full'; + certificate?: string; + certificateAuthorities?: string[]; + key?: string; + keyPassphrase?: string; + alwaysPresentCertificate?: boolean; +} diff --git a/packages/core/elasticsearch/core-elasticsearch-server/src/client/cluster_client.ts b/packages/core/elasticsearch/core-elasticsearch-server/src/client/cluster_client.ts new file mode 100644 index 0000000000000..57eadf70ef68a --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server/src/client/cluster_client.ts @@ -0,0 +1,42 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { ElasticsearchClient } from './client'; +import { ScopeableRequest } from './scopeable_request'; +import { IScopedClusterClient } from './scoped_cluster_client'; + +/** + * Represents an Elasticsearch cluster API client created by the platform. + * It allows to call API on behalf of the internal Kibana user and + * the actual user that is derived from the request headers (via `asScoped(...)`). + * + * @public + **/ +export interface IClusterClient { + /** + * A {@link ElasticsearchClient | client} to be used to query the ES cluster on behalf of the Kibana internal user + */ + readonly asInternalUser: ElasticsearchClient; + /** + * Creates a {@link IScopedClusterClient | scoped cluster client} bound to given {@link ScopeableRequest | request} + */ + asScoped: (request: ScopeableRequest) => IScopedClusterClient; +} + +/** + * See {@link IClusterClient} + * + * @public + */ +export interface ICustomClusterClient extends IClusterClient { + /** + * Closes the cluster client. After that client cannot be used and one should + * create a new client instance to be able to interact with Elasticsearch API. + */ + close: () => Promise; +} diff --git a/src/core/server/elasticsearch/client/index.ts b/packages/core/elasticsearch/core-elasticsearch-server/src/client/index.ts similarity index 61% rename from src/core/server/elasticsearch/client/index.ts rename to packages/core/elasticsearch/core-elasticsearch-server/src/client/index.ts index b1630ec25c9ff..377d836508989 100644 --- a/src/core/server/elasticsearch/client/index.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server/src/client/index.ts @@ -6,21 +6,17 @@ * Side Public License, v 1. */ -export type { ElasticsearchClient } from './types'; -export { ScopedClusterClient } from './scoped_cluster_client'; -export type { IScopedClusterClient } from './scoped_cluster_client'; -export type { ElasticsearchClientConfig } from './client_config'; -export { ClusterClient } from './cluster_client'; +export type { ElasticsearchClient } from './client'; export type { IClusterClient, ICustomClusterClient } from './cluster_client'; -export { configureClient } from './configure_client'; -export { getRequestDebugMeta, getErrorMessage } from './log_query_and_deprecation'; -export { retryCallCluster, migrationRetryCallCluster } from './retry_call_cluster'; +export type { ScopeableRequest, FakeRequest } from './scopeable_request'; +export type { IScopedClusterClient } from './scoped_cluster_client'; export type { + UnauthorizedErrorHandler, UnauthorizedErrorHandlerOptions, + UnauthorizedErrorHandlerResult, UnauthorizedErrorHandlerResultRetryParams, + UnauthorizedErrorHandlerToolkit, UnauthorizedErrorHandlerRetryResult, UnauthorizedErrorHandlerNotHandledResult, - UnauthorizedErrorHandlerResult, - UnauthorizedErrorHandlerToolkit, - UnauthorizedErrorHandler, -} from './retry_unauthorized'; +} from './unauthorized_error_handler'; +export type { ElasticsearchClientConfig, ElasticsearchClientSslConfig } from './client_config'; diff --git a/packages/core/elasticsearch/core-elasticsearch-server/src/client/scopeable_request.ts b/packages/core/elasticsearch/core-elasticsearch-server/src/client/scopeable_request.ts new file mode 100644 index 0000000000000..ab0eed169d5a8 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server/src/client/scopeable_request.ts @@ -0,0 +1,27 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { Headers, KibanaRequest } from '@kbn/core-http-server'; + +/** + * Fake request object created manually by Kibana plugins. + * @public + */ +export interface FakeRequest { + /** Headers used for authentication against Elasticsearch */ + headers: Headers; +} + +/** + A user credentials container. + * It accommodates the necessary auth credentials to impersonate the current user. + * + * @public + * See {@link KibanaRequest}. + */ +export type ScopeableRequest = KibanaRequest | FakeRequest; diff --git a/src/core/server/elasticsearch/client/scoped_cluster_client.ts b/packages/core/elasticsearch/core-elasticsearch-server/src/client/scoped_cluster_client.ts similarity index 81% rename from src/core/server/elasticsearch/client/scoped_cluster_client.ts rename to packages/core/elasticsearch/core-elasticsearch-server/src/client/scoped_cluster_client.ts index 9ef77e200b0ed..4e3f7b6924e7c 100644 --- a/src/core/server/elasticsearch/client/scoped_cluster_client.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server/src/client/scoped_cluster_client.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { ElasticsearchClient } from './types'; +import { ElasticsearchClient } from './client'; /** * Serves the same purpose as the normal {@link IClusterClient | cluster client} but exposes @@ -28,11 +28,3 @@ export interface IScopedClusterClient { */ readonly asCurrentUser: ElasticsearchClient; } - -/** @internal **/ -export class ScopedClusterClient implements IScopedClusterClient { - constructor( - public readonly asInternalUser: ElasticsearchClient, - public readonly asCurrentUser: ElasticsearchClient - ) {} -} diff --git a/packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts b/packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts new file mode 100644 index 0000000000000..3463e091a650c --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server/src/client/unauthorized_error_handler.ts @@ -0,0 +1,73 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { MaybePromise } from '@kbn/utility-types'; +import type { UnauthorizedError } from '@kbn/es-errors'; +import type { AuthHeaders, KibanaRequest } from '@kbn/core-http-server'; + +/** + * @public + */ +export interface UnauthorizedErrorHandlerOptions { + error: UnauthorizedError; + request: KibanaRequest; +} + +/** + * @public + */ +export interface UnauthorizedErrorHandlerResultRetryParams { + authHeaders: AuthHeaders; +} + +/** + * @public + */ +export interface UnauthorizedErrorHandlerRetryResult + extends UnauthorizedErrorHandlerResultRetryParams { + type: 'retry'; +} + +/** + * @public + */ +export interface UnauthorizedErrorHandlerNotHandledResult { + type: 'notHandled'; +} + +/** + * @public + */ +export type UnauthorizedErrorHandlerResult = + | UnauthorizedErrorHandlerRetryResult + | UnauthorizedErrorHandlerNotHandledResult; + +/** + * Toolkit passed to a {@link UnauthorizedErrorHandler} used to generate responses from the handler + * @public + */ +export interface UnauthorizedErrorHandlerToolkit { + /** + * The handler cannot handle the error, or was not able to authenticate. + */ + notHandled: () => UnauthorizedErrorHandlerNotHandledResult; + /** + * The handler was able to authenticate. Will retry the failed request with new auth headers + */ + retry: (params: UnauthorizedErrorHandlerResultRetryParams) => UnauthorizedErrorHandlerRetryResult; +} + +/** + * A handler used to handle unauthorized error returned by elasticsearch + * + * @public + */ +export type UnauthorizedErrorHandler = ( + options: UnauthorizedErrorHandlerOptions, + toolkit: UnauthorizedErrorHandlerToolkit +) => MaybePromise; diff --git a/src/core/server/elasticsearch/types.ts b/packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts similarity index 72% rename from src/core/server/elasticsearch/types.ts rename to packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts index 5caf4dabc4a5a..39fed7cbd2803 100644 --- a/src/core/server/elasticsearch/types.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts @@ -7,13 +7,13 @@ */ import { Observable } from 'rxjs'; -import type { Headers, KibanaRequest } from '@kbn/core-http-server'; -import { ElasticsearchConfig } from './elasticsearch_config'; -import { IClusterClient, ICustomClusterClient, ElasticsearchClientConfig } from './client'; -import { NodesVersionCompatibility } from './version_check/ensure_es_version'; -import { ServiceStatus } from '../status'; -import type { UnauthorizedErrorHandler } from './client/retry_unauthorized'; -import { ClusterInfo } from './get_cluster_info'; +import type { + IClusterClient, + ICustomClusterClient, + ElasticsearchClientConfig, + UnauthorizedErrorHandler, +} from './client'; +import { IElasticsearchConfig } from './elasticsearch_config'; /** * @public @@ -88,20 +88,10 @@ export interface ElasticsearchServiceSetup { * * @deprecated Can be removed when https://github.com/elastic/kibana/issues/119862 is done. */ - readonly config$: Observable; + readonly config$: Observable; }; } -/** @internal */ -export type InternalElasticsearchServicePreboot = ElasticsearchServicePreboot; - -/** @internal */ -export interface InternalElasticsearchServiceSetup extends ElasticsearchServiceSetup { - clusterInfo$: Observable; - esNodesCompatibility$: Observable; - status$: Observable>; -} - /** * @public */ @@ -138,36 +128,6 @@ export interface ElasticsearchServiceStart { ) => ICustomClusterClient; } -/** - * @internal - */ -export type InternalElasticsearchServiceStart = ElasticsearchServiceStart; - -/** @public */ -export interface ElasticsearchStatusMeta { - warningNodes: NodesVersionCompatibility['warningNodes']; - incompatibleNodes: NodesVersionCompatibility['incompatibleNodes']; - nodesInfoRequestError?: NodesVersionCompatibility['nodesInfoRequestError']; -} - -/** - * Fake request object created manually by Kibana plugins. - * @public - */ -export interface FakeRequest { - /** Headers used for authentication against Elasticsearch */ - headers: Headers; -} - -/** - A user credentials container. - * It accommodates the necessary auth credentials to impersonate the current user. - * - * @public - * See {@link KibanaRequest}. - */ -export type ScopeableRequest = KibanaRequest | FakeRequest; - /** * A limited set of Elasticsearch configuration entries exposed to the `preboot` plugins at `setup`. * diff --git a/packages/core/elasticsearch/core-elasticsearch-server/src/elasticsearch_config.ts b/packages/core/elasticsearch/core-elasticsearch-server/src/elasticsearch_config.ts new file mode 100644 index 0000000000000..a0cd6a34cca89 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server/src/elasticsearch_config.ts @@ -0,0 +1,144 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { Duration } from 'moment'; + +/** + * @public + */ +export interface IElasticsearchConfig { + /** + * The interval between health check requests Kibana sends to the Elasticsearch. + */ + readonly healthCheckDelay: Duration; + + /** + * Whether to allow kibana to connect to a non-compatible elasticsearch node. + */ + readonly ignoreVersionMismatch: boolean; + + /** + * Version of the Elasticsearch (6.7, 7.1 or `master`) client will be connecting to. + */ + readonly apiVersion: string; + + /** + * The maximum number of sockets that can be used for communications with elasticsearch. + */ + readonly maxSockets: number; + + /** + * Whether to use compression for communications with elasticsearch. + */ + readonly compression: boolean; + + /** + * Hosts that the client will connect to. If sniffing is enabled, this list will + * be used as seeds to discover the rest of your cluster. + */ + readonly hosts: string[]; + + /** + * List of Kibana client-side headers to send to Elasticsearch when request + * scoped cluster client is used. If this is an empty array then *no* client-side + * will be sent. + */ + readonly requestHeadersWhitelist: string[]; + + /** + * Timeout after which PING HTTP request will be aborted and retried. + */ + readonly pingTimeout: Duration; + + /** + * Timeout after which HTTP request will be aborted and retried. + */ + readonly requestTimeout: Duration; + + /** + * Timeout for Elasticsearch to wait for responses from shards. Set to 0 to disable. + */ + readonly shardTimeout: Duration; + + /** + * Specifies whether the client should attempt to detect the rest of the cluster + * when it is first instantiated. + */ + readonly sniffOnStart: boolean; + + /** + * Interval to perform a sniff operation and make sure the list of nodes is complete. + * If `false` then sniffing is disabled. + */ + readonly sniffInterval: false | Duration; + + /** + * Specifies whether the client should immediately sniff for a more current list + * of nodes when a connection dies. + */ + readonly sniffOnConnectionFault: boolean; + + /** + * If Elasticsearch is protected with basic authentication, this setting provides + * the username that the Kibana server uses to perform its administrative functions. + * Cannot be used in conjunction with serviceAccountToken. + */ + readonly username?: string; + + /** + * If Elasticsearch is protected with basic authentication, this setting provides + * the password that the Kibana server uses to perform its administrative functions. + */ + readonly password?: string; + + /** + * If Elasticsearch security features are enabled, this setting provides the service account + * token that the Kibana server users to perform its administrative functions. + * + * This is an alternative to specifying a username and password. + */ + readonly serviceAccountToken?: string; + + /** + * Header names and values to send to Elasticsearch with every request. These + * headers cannot be overwritten by client-side headers and aren't affected by + * `requestHeadersWhitelist` configuration. + */ + readonly customHeaders: Record; + + /** + * @internal + * Only valid in dev mode. Skip the valid connection check during startup. The connection check allows + * Kibana to ensure that the Elasticsearch connection is valid before allowing + * any other services to be set up. + * + * @remarks + * You should disable this check at your own risk: Other services in Kibana + * may fail if this step is not completed. + */ + readonly skipStartupConnectionCheck: boolean; + + /** + * Set of settings configure SSL connection between Kibana and Elasticsearch that + * are required when `xpack.ssl.verification_mode` in Elasticsearch is set to + * either `certificate` or `full`. + */ + readonly ssl: ElasticsearchSslConfig; +} + +/** + * @public + */ +export interface ElasticsearchSslConfig { + verificationMode: 'none' | 'certificate' | 'full'; + certificate?: string; + certificateAuthorities?: string[]; + key?: string; + keyPassphrase?: string; + alwaysPresentCertificate: boolean; +} diff --git a/packages/core/elasticsearch/core-elasticsearch-server/src/index.ts b/packages/core/elasticsearch/core-elasticsearch-server/src/index.ts new file mode 100644 index 0000000000000..ad418bc2f5940 --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server/src/index.ts @@ -0,0 +1,34 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export type { + ElasticsearchClient, + IScopedClusterClient, + IClusterClient, + ICustomClusterClient, + ScopeableRequest, + UnauthorizedErrorHandlerResult, + UnauthorizedErrorHandler, + UnauthorizedErrorHandlerRetryResult, + UnauthorizedErrorHandlerToolkit, + UnauthorizedErrorHandlerResultRetryParams, + UnauthorizedErrorHandlerNotHandledResult, + UnauthorizedErrorHandlerOptions, + FakeRequest, + ElasticsearchClientSslConfig, + ElasticsearchClientConfig, +} from './client'; + +export type { + ElasticsearchConfigPreboot, + ElasticsearchServicePreboot, + ElasticsearchServiceStart, + ElasticsearchServiceSetup, +} from './contracts'; +export type { IElasticsearchConfig, ElasticsearchSslConfig } from './elasticsearch_config'; +export type { ElasticsearchRequestHandlerContext } from './request_handler_context'; diff --git a/packages/core/elasticsearch/core-elasticsearch-server/src/request_handler_context.ts b/packages/core/elasticsearch/core-elasticsearch-server/src/request_handler_context.ts new file mode 100644 index 0000000000000..af59db5c5d85b --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server/src/request_handler_context.ts @@ -0,0 +1,17 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { IScopedClusterClient } from './client'; + +/** + * Core's `elasticsearch` request handler context. + * @public + */ +export interface ElasticsearchRequestHandlerContext { + client: IScopedClusterClient; +} diff --git a/packages/core/elasticsearch/core-elasticsearch-server/tsconfig.json b/packages/core/elasticsearch/core-elasticsearch-server/tsconfig.json new file mode 100644 index 0000000000000..39d3c7097814a --- /dev/null +++ b/packages/core/elasticsearch/core-elasticsearch-server/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node" + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/core/environment/core-environment-server-internal/src/environment_service.ts b/packages/core/environment/core-environment-server-internal/src/environment_service.ts index cb09b1b587e74..2adf51e9801e7 100644 --- a/packages/core/environment/core-environment-server-internal/src/environment_service.ts +++ b/packages/core/environment/core-environment-server-internal/src/environment_service.ts @@ -91,11 +91,11 @@ export class EnvironmentService { analytics.registerContextProvider({ name: 'kibana info', context$: of({ - kibana_uuid: this.uuid, + kibanaUuid: this.uuid, pid: process.pid, }), schema: { - kibana_uuid: { + kibanaUuid: { type: 'keyword', _meta: { description: 'Kibana instance UUID' }, }, diff --git a/packages/kbn-optimizer/src/worker/webpack.config.ts b/packages/kbn-optimizer/src/worker/webpack.config.ts index 876bc347a21c5..13e342356a2bc 100644 --- a/packages/kbn-optimizer/src/worker/webpack.config.ts +++ b/packages/kbn-optimizer/src/worker/webpack.config.ts @@ -166,8 +166,8 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker: loader: 'postcss-loader', options: { sourceMap: !worker.dist, - config: { - path: require.resolve('@kbn/optimizer/postcss.config.js'), + postcssOptions: { + config: require.resolve('@kbn/optimizer/postcss.config.js'), }, }, }, diff --git a/packages/kbn-securitysolution-autocomplete/src/operator/index.test.tsx b/packages/kbn-securitysolution-autocomplete/src/operator/index.test.tsx index 48f5cbf25b91c..3595b96d7e426 100644 --- a/packages/kbn-securitysolution-autocomplete/src/operator/index.test.tsx +++ b/packages/kbn-securitysolution-autocomplete/src/operator/index.test.tsx @@ -132,6 +132,9 @@ describe('operator', () => { { label: 'matches', }, + { + label: 'does not match', + }, ]); }); diff --git a/packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts b/packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts index 4461cda5b23d6..f9caa6387e359 100644 --- a/packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts +++ b/packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts @@ -94,6 +94,15 @@ export const matchesOperator: OperatorOption = { value: 'matches', }; +export const doesNotMatchOperator: OperatorOption = { + message: i18n.translate('lists.exceptions.doesNotMatchOperatorLabel', { + defaultMessage: 'does not match', + }), + operator: OperatorEnum.EXCLUDED, + type: OperatorTypeEnum.WILDCARD, + value: 'does_not_match', +}; + export const EVENT_FILTERS_OPERATORS: OperatorOption[] = [ isOperator, isNotOperator, @@ -115,6 +124,8 @@ export const DETECTION_ENGINE_EXCEPTION_OPERATORS: OperatorOption[] = [ doesNotExistOperator, isInListOperator, isNotInListOperator, + matchesOperator, + doesNotMatchOperator, ]; export const ALL_OPERATORS: OperatorOption[] = [ @@ -127,6 +138,7 @@ export const ALL_OPERATORS: OperatorOption[] = [ isInListOperator, isNotInListOperator, matchesOperator, + doesNotMatchOperator, ]; export const EXCEPTION_OPERATORS_SANS_LISTS: OperatorOption[] = [ @@ -136,6 +148,8 @@ export const EXCEPTION_OPERATORS_SANS_LISTS: OperatorOption[] = [ isNotOneOfOperator, existsOperator, doesNotExistOperator, + matchesOperator, + doesNotMatchOperator, ]; export const EXCEPTION_OPERATORS_ONLY_LISTS: OperatorOption[] = [ diff --git a/packages/kbn-securitysolution-list-utils/src/build_exception_filter/index.ts b/packages/kbn-securitysolution-list-utils/src/build_exception_filter/index.ts index 966cf4281ad75..e8a9d8e74a486 100644 --- a/packages/kbn-securitysolution-list-utils/src/build_exception_filter/index.ts +++ b/packages/kbn-securitysolution-list-utils/src/build_exception_filter/index.ts @@ -20,13 +20,15 @@ import { entriesMatchAny, entriesNested, OsTypeArray, + entriesMatchWildcard, + EntryMatchWildcard, } from '@kbn/securitysolution-io-ts-list-types'; import { Filter } from '@kbn/es-query'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { hasLargeValueList } from '../has_large_value_list'; -type NonListEntry = EntryMatch | EntryMatchAny | EntryNested | EntryExists; +type NonListEntry = EntryMatch | EntryMatchAny | EntryNested | EntryExists | EntryMatchWildcard; interface ExceptionListItemNonLargeList extends ExceptionListItemSchema { entries: NonListEntry[]; } @@ -290,6 +292,25 @@ export const buildMatchAnyClause = (entry: EntryMatchAny): BooleanFilter => { } }; +export const buildMatchWildcardClause = (entry: EntryMatchWildcard): BooleanFilter => { + const { field, operator, value } = entry; + const wildcardClause = { + bool: { + filter: { + wildcard: { + [field]: value, + }, + }, + }, + }; + + if (operator === 'excluded') { + return buildExclusionClause(wildcardClause); + } else { + return wildcardClause; + } +}; + export const buildExistsClause = (entry: EntryExists): BooleanFilter => { const { field, operator } = entry; const existsClause = { @@ -352,15 +373,15 @@ export const createInnerAndClauses = ( entry: NonListEntry, parent?: string ): BooleanFilter | NestedFilter => { + const field = parent != null ? `${parent}.${entry.field}` : entry.field; if (entriesExists.is(entry)) { - const field = parent != null ? `${parent}.${entry.field}` : entry.field; return buildExistsClause({ ...entry, field }); } else if (entriesMatch.is(entry)) { - const field = parent != null ? `${parent}.${entry.field}` : entry.field; return buildMatchClause({ ...entry, field }); } else if (entriesMatchAny.is(entry)) { - const field = parent != null ? `${parent}.${entry.field}` : entry.field; return buildMatchAnyClause({ ...entry, field }); + } else if (entriesMatchWildcard.is(entry)) { + return buildMatchWildcardClause({ ...entry, field }); } else if (entriesNested.is(entry)) { return buildNestedClause(entry); } else { diff --git a/packages/kbn-storybook/src/webpack.config.ts b/packages/kbn-storybook/src/webpack.config.ts index 7f4821767cd9c..880afe83528a8 100644 --- a/packages/kbn-storybook/src/webpack.config.ts +++ b/packages/kbn-storybook/src/webpack.config.ts @@ -91,8 +91,8 @@ export default ({ config: storybookConfig }: { config: Configuration }) => { { loader: 'postcss-loader', options: { - config: { - path: require.resolve('@kbn/optimizer/postcss.config.js'), + postcssOptions: { + config: require.resolve('@kbn/optimizer/postcss.config.js'), }, }, }, diff --git a/src/cli_setup/utils.ts b/src/cli_setup/utils.ts index 6a5b60681a9f0..de047a0540db4 100644 --- a/src/cli_setup/utils.ts +++ b/src/cli_setup/utils.ts @@ -13,8 +13,8 @@ import { merge } from 'lodash'; import { kibanaPackageJson } from '@kbn/utils'; import { Logger } from '@kbn/core/server'; -import { ClusterClient } from '@kbn/core/server/elasticsearch/client'; -import { configSchema } from '@kbn/core/server/elasticsearch'; +import { ClusterClient } from '@kbn/core-elasticsearch-client-server-internal'; +import { configSchema } from '@kbn/core-elasticsearch-server-internal'; import { ElasticsearchService } from '@kbn/interactive-setup-plugin/server/elasticsearch_service'; import { KibanaConfigWriter } from '@kbn/interactive-setup-plugin/server/kibana_config_writer'; import type { EnrollmentToken } from '@kbn/interactive-setup-plugin/common'; diff --git a/src/core/public/core_system.test.ts b/src/core/public/core_system.test.ts index 0cafa8ed6bd39..4092ce6ce0dae 100644 --- a/src/core/public/core_system.test.ts +++ b/src/core/public/core_system.test.ts @@ -290,7 +290,7 @@ describe('#start()', () => { expect(analyticsServiceStartMock.reportEvent).toHaveBeenNthCalledWith(2, 'metric', { eventName: KIBANA_LOADED_EVENT, meta: { - kibana_version: '1.2.3', + kibanaVersion: '1.2.3', protocol: 'http:', }, key1: LOAD_START, @@ -323,7 +323,7 @@ describe('#start()', () => { expect(analyticsServiceStartMock.reportEvent).toHaveBeenNthCalledWith(2, 'metric', { eventName: KIBANA_LOADED_EVENT, meta: { - kibana_version: '1.2.3', + kibanaVersion: '1.2.3', protocol: 'http:', }, key1: LOAD_START, diff --git a/src/core/public/core_system.ts b/src/core/public/core_system.ts index 34ad06766fabc..ff7945546eee0 100644 --- a/src/core/public/core_system.ts +++ b/src/core/public/core_system.ts @@ -167,7 +167,7 @@ export class CoreSystem { reportMetricEvent(analytics, { eventName: KIBANA_LOADED_EVENT, meta: { - kibana_version: this.coreContext.env.packageInfo.version, + kibanaVersion: this.coreContext.env.packageInfo.version, protocol: window.location.protocol, }, duration: timing[LOAD_FIRST_NAV], diff --git a/src/core/server/core_route_handler_context.ts b/src/core/server/core_route_handler_context.ts index ccdefc97f6293..3f4dfbcc8adde 100644 --- a/src/core/server/core_route_handler_context.ts +++ b/src/core/server/core_route_handler_context.ts @@ -7,15 +7,13 @@ */ import type { KibanaRequest } from '@kbn/core-http-server'; +import type { ElasticsearchRequestHandlerContext } from '@kbn/core-elasticsearch-server'; +import { CoreElasticsearchRouteHandlerContext } from '@kbn/core-elasticsearch-server-internal'; import type { InternalCoreStart } from './internal_types'; import { CoreSavedObjectsRouteHandlerContext, SavedObjectsRequestHandlerContext, } from './saved_objects'; -import { - CoreElasticsearchRouteHandlerContext, - ElasticsearchRequestHandlerContext, -} from './elasticsearch'; import { CoreUiSettingsRouteHandlerContext, UiSettingsRequestHandlerContext } from './ui_settings'; import { CoreDeprecationsRouteHandlerContext, diff --git a/src/core/server/core_usage_data/core_usage_data_service.test.ts b/src/core/server/core_usage_data/core_usage_data_service.test.ts index c22f1d3667365..a9219ede9d659 100644 --- a/src/core/server/core_usage_data/core_usage_data_service.test.ts +++ b/src/core/server/core_usage_data/core_usage_data_service.test.ts @@ -16,7 +16,7 @@ import { HotObservable } from 'rxjs/internal/testing/HotObservable'; import { configServiceMock } from '@kbn/config-mocks'; import { mockCoreContext } from '@kbn/core-base-server-mocks'; import { config as RawLoggingConfig } from '@kbn/core-logging-server-internal'; -import { config as RawElasticsearchConfig } from '../elasticsearch/elasticsearch_config'; +import { config as RawElasticsearchConfig } from '@kbn/core-elasticsearch-server-internal'; import { config as RawHttpConfig } from '@kbn/core-http-server-internal'; import { savedObjectsConfig as RawSavedObjectsConfig } from '../saved_objects/saved_objects_config'; import { httpServiceMock } from '@kbn/core-http-server-mocks'; @@ -24,7 +24,7 @@ import { metricsServiceMock } from '../metrics/metrics_service.mock'; import { savedObjectsServiceMock } from '../saved_objects/saved_objects_service.mock'; import { CoreUsageDataService } from './core_usage_data_service'; -import { elasticsearchServiceMock } from '../elasticsearch/elasticsearch_service.mock'; +import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; import { typeRegistryMock } from '../saved_objects/saved_objects_type_registry.mock'; import { CORE_USAGE_STATS_TYPE } from './constants'; import { CoreUsageStatsClient } from './core_usage_stats_client'; diff --git a/src/core/server/core_usage_data/core_usage_data_service.ts b/src/core/server/core_usage_data/core_usage_data_service.ts index f18dfe0dcd624..10258ac004aa7 100644 --- a/src/core/server/core_usage_data/core_usage_data_service.ts +++ b/src/core/server/core_usage_data/core_usage_data_service.ts @@ -20,8 +20,9 @@ import type { CoreContext, CoreService } from '@kbn/core-base-server-internal'; import type { LoggingConfigType } from '@kbn/core-logging-server-internal'; import type { Logger } from '@kbn/logging'; import type { HttpConfigType, InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; +import type { ElasticsearchServiceStart } from '@kbn/core-elasticsearch-server'; +import type { ElasticsearchConfigType } from '@kbn/core-elasticsearch-server-internal'; import { SavedObjectsServiceStart, SavedObjectTypeRegistry } from '..'; -import { ElasticsearchConfigType } from '../elasticsearch/elasticsearch_config'; import { SavedObjectsConfigType } from '../saved_objects/saved_objects_config'; import type { @@ -33,7 +34,6 @@ import type { CoreConfigUsageData, } from './types'; import { isConfigured } from './is_configured'; -import { ElasticsearchServiceStart } from '../elasticsearch'; import { coreUsageStatsType } from './core_usage_stats'; import { LEGACY_URL_ALIAS_TYPE } from '../saved_objects/object_types'; import { CORE_USAGE_STATS_TYPE } from './constants'; diff --git a/src/core/server/deprecations/deprecations_registry.mock.ts b/src/core/server/deprecations/deprecations_registry.mock.ts index bb178c3935cdc..65433f5eca5cb 100644 --- a/src/core/server/deprecations/deprecations_registry.mock.ts +++ b/src/core/server/deprecations/deprecations_registry.mock.ts @@ -7,10 +7,11 @@ */ import type { PublicMethodsOf } from '@kbn/utility-types'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import type { DeprecationsRegistry } from './deprecations_registry'; import type { GetDeprecationsContext } from './types'; -import { elasticsearchClientMock } from '../elasticsearch/client/mocks'; import { savedObjectsClientMock } from '../saved_objects/service/saved_objects_client.mock'; + type DeprecationsRegistryContract = PublicMethodsOf; const createDeprecationsRegistryMock = () => { diff --git a/src/core/server/deprecations/deprecations_route_handler_context.ts b/src/core/server/deprecations/deprecations_route_handler_context.ts index 76e5d974056d4..bd19023a1ec78 100644 --- a/src/core/server/deprecations/deprecations_route_handler_context.ts +++ b/src/core/server/deprecations/deprecations_route_handler_context.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import type { CoreElasticsearchRouteHandlerContext } from '../elasticsearch'; +import type { CoreElasticsearchRouteHandlerContext } from '@kbn/core-elasticsearch-server-internal'; import type { CoreSavedObjectsRouteHandlerContext } from '../saved_objects'; import type { DeprecationsClient, InternalDeprecationsServiceStart } from './deprecations_service'; diff --git a/src/core/server/deprecations/deprecations_service.ts b/src/core/server/deprecations/deprecations_service.ts index 7b07b4c1d10de..d9a8e14eb3b05 100644 --- a/src/core/server/deprecations/deprecations_service.ts +++ b/src/core/server/deprecations/deprecations_service.ts @@ -12,11 +12,11 @@ import type { IConfigService } from '@kbn/config'; import type { CoreContext, CoreService } from '@kbn/core-base-server-internal'; import { DomainDeprecationDetails } from '@kbn/core-deprecations-common'; import type { InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; +import type { IScopedClusterClient } from '@kbn/core-elasticsearch-server'; import { DeprecationsFactory } from './deprecations_factory'; import { RegisterDeprecationsConfig } from './types'; import { registerRoutes } from './routes'; import { config as deprecationConfig, DeprecationConfigType } from './deprecation_config'; -import { IScopedClusterClient } from '../elasticsearch/client'; import { SavedObjectsClientContract } from '../saved_objects/types'; /** diff --git a/src/core/server/deprecations/types.ts b/src/core/server/deprecations/types.ts index 16104c6f9cc57..5cefb7b68dbe1 100644 --- a/src/core/server/deprecations/types.ts +++ b/src/core/server/deprecations/types.ts @@ -8,8 +8,8 @@ import type { MaybePromise } from '@kbn/utility-types'; import type { DeprecationsDetails } from '@kbn/core-deprecations-common'; +import type { IScopedClusterClient } from '@kbn/core-elasticsearch-server'; import type { SavedObjectsClientContract } from '../saved_objects/types'; -import type { IScopedClusterClient } from '../elasticsearch'; /** * @public diff --git a/src/core/server/index.ts b/src/core/server/index.ts index 82d98f875241e..c0e450ebde765 100644 --- a/src/core/server/index.ts +++ b/src/core/server/index.ts @@ -52,12 +52,12 @@ import type { HttpServiceStart, } from '@kbn/core-http-server'; import type { PrebootServicePreboot } from '@kbn/core-preboot-server'; -import { +import type { ElasticsearchServiceSetup, - configSchema as elasticsearchConfigSchema, ElasticsearchServiceStart, ElasticsearchServicePreboot, -} from './elasticsearch'; +} from '@kbn/core-elasticsearch-server'; +import { configSchema as elasticsearchConfigSchema } from '@kbn/core-elasticsearch-server-internal'; import { HttpResources } from './http_resources'; import { PluginsServiceSetup, PluginsServiceStart, PluginOpaqueId } from './plugins'; @@ -115,22 +115,25 @@ export type { export type { CoreId } from '@kbn/core-base-common-internal'; -export { ElasticsearchConfig, pollEsNodesVersion } from './elasticsearch'; +export { ElasticsearchConfig, pollEsNodesVersion } from '@kbn/core-elasticsearch-server-internal'; +export type { + NodesVersionCompatibility, + PollEsNodesVersionOptions, +} from '@kbn/core-elasticsearch-server-internal'; export type { ElasticsearchServicePreboot, ElasticsearchServiceSetup, ElasticsearchServiceStart, - ElasticsearchStatusMeta, - NodesVersionCompatibility, + ElasticsearchConfigPreboot, + ElasticsearchRequestHandlerContext, FakeRequest, ScopeableRequest, ElasticsearchClient, IClusterClient, ICustomClusterClient, ElasticsearchClientConfig, + ElasticsearchClientSslConfig, IScopedClusterClient, - ElasticsearchConfigPreboot, - PollEsNodesVersionOptions, UnauthorizedErrorHandlerOptions, UnauthorizedErrorHandlerResultRetryParams, UnauthorizedErrorHandlerRetryResult, @@ -138,8 +141,7 @@ export type { UnauthorizedErrorHandlerResult, UnauthorizedErrorHandlerToolkit, UnauthorizedErrorHandler, - ElasticsearchRequestHandlerContext, -} from './elasticsearch'; +} from '@kbn/core-elasticsearch-server'; export { CspConfig } from '@kbn/core-http-server-internal'; export { CoreKibanaRequest, kibanaResponseFactory } from '@kbn/core-http-router-server-internal'; diff --git a/src/core/server/capabilities/integration_tests/capabilities_service.test.ts b/src/core/server/integration_tests/capabilities/capabilities_service.test.ts similarity index 98% rename from src/core/server/capabilities/integration_tests/capabilities_service.test.ts rename to src/core/server/integration_tests/capabilities/capabilities_service.test.ts index fd5310a8bf444..40345e8a7e750 100644 --- a/src/core/server/capabilities/integration_tests/capabilities_service.test.ts +++ b/src/core/server/integration_tests/capabilities/capabilities_service.test.ts @@ -19,7 +19,7 @@ import { InternalHttpServiceSetup, } from '@kbn/core-http-server-internal'; import { createHttpServer } from '@kbn/core-http-server-mocks'; -import { CapabilitiesService, CapabilitiesSetup } from '..'; +import { CapabilitiesService, CapabilitiesSetup } from '../../capabilities'; const coreId = Symbol('core'); diff --git a/src/core/server/integration_tests/capabilities/jest.integration.config.js b/src/core/server/integration_tests/capabilities/jest.integration.config.js new file mode 100644 index 0000000000000..edc8b077ffb94 --- /dev/null +++ b/src/core/server/integration_tests/capabilities/jest.integration.config.js @@ -0,0 +1,19 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/server/integration_tests/capabilities'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/config/integration_tests/config_deprecation.test.mocks.ts b/src/core/server/integration_tests/config/config_deprecation.test.mocks.ts similarity index 100% rename from src/core/server/config/integration_tests/config_deprecation.test.mocks.ts rename to src/core/server/integration_tests/config/config_deprecation.test.mocks.ts diff --git a/src/core/server/config/integration_tests/config_deprecation.test.ts b/src/core/server/integration_tests/config/config_deprecation.test.ts similarity index 100% rename from src/core/server/config/integration_tests/config_deprecation.test.ts rename to src/core/server/integration_tests/config/config_deprecation.test.ts diff --git a/src/core/server/integration_tests/config/jest.integration.config.js b/src/core/server/integration_tests/config/jest.integration.config.js new file mode 100644 index 0000000000000..ff1c6a75ed900 --- /dev/null +++ b/src/core/server/integration_tests/config/jest.integration.config.js @@ -0,0 +1,19 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/server/integration_tests/config'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/core_app/integration_tests/__fixtures__/outside_output.js b/src/core/server/integration_tests/core_app/__fixtures__/outside_output.js similarity index 100% rename from src/core/server/core_app/integration_tests/__fixtures__/outside_output.js rename to src/core/server/integration_tests/core_app/__fixtures__/outside_output.js diff --git a/src/core/server/core_app/integration_tests/__fixtures__/plugin/foo/gzip_chunk.js b/src/core/server/integration_tests/core_app/__fixtures__/plugin/foo/gzip_chunk.js similarity index 100% rename from src/core/server/core_app/integration_tests/__fixtures__/plugin/foo/gzip_chunk.js rename to src/core/server/integration_tests/core_app/__fixtures__/plugin/foo/gzip_chunk.js diff --git a/src/core/server/core_app/integration_tests/__fixtures__/plugin/foo/gzip_chunk.js.gz b/src/core/server/integration_tests/core_app/__fixtures__/plugin/foo/gzip_chunk.js.gz similarity index 100% rename from src/core/server/core_app/integration_tests/__fixtures__/plugin/foo/gzip_chunk.js.gz rename to src/core/server/integration_tests/core_app/__fixtures__/plugin/foo/gzip_chunk.js.gz diff --git a/src/core/server/core_app/integration_tests/__fixtures__/plugin/foo/image.png b/src/core/server/integration_tests/core_app/__fixtures__/plugin/foo/image.png similarity index 100% rename from src/core/server/core_app/integration_tests/__fixtures__/plugin/foo/image.png rename to src/core/server/integration_tests/core_app/__fixtures__/plugin/foo/image.png diff --git a/src/core/server/core_app/integration_tests/__fixtures__/plugin/foo/plugin.js b/src/core/server/integration_tests/core_app/__fixtures__/plugin/foo/plugin.js similarity index 100% rename from src/core/server/core_app/integration_tests/__fixtures__/plugin/foo/plugin.js rename to src/core/server/integration_tests/core_app/__fixtures__/plugin/foo/plugin.js diff --git a/src/core/server/core_app/integration_tests/bundle_routes.test.ts b/src/core/server/integration_tests/core_app/bundle_routes.test.ts similarity index 97% rename from src/core/server/core_app/integration_tests/bundle_routes.test.ts rename to src/core/server/integration_tests/core_app/bundle_routes.test.ts index 30ff025ac2a14..b3b02cef691d9 100644 --- a/src/core/server/core_app/integration_tests/bundle_routes.test.ts +++ b/src/core/server/integration_tests/core_app/bundle_routes.test.ts @@ -15,8 +15,8 @@ import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; import type { IRouter } from '@kbn/core-http-server'; import { HttpService } from '@kbn/core-http-server-internal'; import { createHttpServer } from '@kbn/core-http-server-mocks'; -import { registerRouteForBundle } from '../bundle_routes/bundles_route'; -import { FileHashCache } from '../bundle_routes/file_hash_cache'; +import { registerRouteForBundle } from '../../core_app/bundle_routes/bundles_route'; +import { FileHashCache } from '../../core_app/bundle_routes/file_hash_cache'; const buildNum = 1234; const fooPluginFixture = resolve(__dirname, './__fixtures__/plugin/foo'); diff --git a/src/core/server/core_app/integration_tests/core_app_routes.test.ts b/src/core/server/integration_tests/core_app/core_app_routes.test.ts similarity index 100% rename from src/core/server/core_app/integration_tests/core_app_routes.test.ts rename to src/core/server/integration_tests/core_app/core_app_routes.test.ts diff --git a/src/core/server/core_app/integration_tests/default_route_provider_config.test.ts b/src/core/server/integration_tests/core_app/default_route_provider_config.test.ts similarity index 100% rename from src/core/server/core_app/integration_tests/default_route_provider_config.test.ts rename to src/core/server/integration_tests/core_app/default_route_provider_config.test.ts diff --git a/src/core/server/integration_tests/core_app/jest.integration.config.js b/src/core/server/integration_tests/core_app/jest.integration.config.js new file mode 100644 index 0000000000000..990934f54c982 --- /dev/null +++ b/src/core/server/integration_tests/core_app/jest.integration.config.js @@ -0,0 +1,19 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/server/integration_tests/core_app'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/core_app/integration_tests/static_assets.test.ts b/src/core/server/integration_tests/core_app/static_assets.test.ts similarity index 100% rename from src/core/server/core_app/integration_tests/static_assets.test.ts rename to src/core/server/integration_tests/core_app/static_assets.test.ts diff --git a/src/core/server/elasticsearch/integration_tests/client.test.ts b/src/core/server/integration_tests/elasticsearch/client.test.ts similarity index 100% rename from src/core/server/elasticsearch/integration_tests/client.test.ts rename to src/core/server/integration_tests/elasticsearch/client.test.ts diff --git a/src/core/server/elasticsearch/integration_tests/is_scripting_enabled.test.ts b/src/core/server/integration_tests/elasticsearch/is_scripting_enabled.test.ts similarity index 96% rename from src/core/server/elasticsearch/integration_tests/is_scripting_enabled.test.ts rename to src/core/server/integration_tests/elasticsearch/is_scripting_enabled.test.ts index 501193a833f27..353acbc70c18e 100644 --- a/src/core/server/elasticsearch/integration_tests/is_scripting_enabled.test.ts +++ b/src/core/server/integration_tests/elasticsearch/is_scripting_enabled.test.ts @@ -11,7 +11,7 @@ import { TestElasticsearchUtils, TestKibanaUtils, } from '../../../test_helpers/kbn_server'; -import { isInlineScriptingEnabled } from '../is_scripting_enabled'; +import { isInlineScriptingEnabled } from '@kbn/core-elasticsearch-server-internal'; describe('isInlineScriptingEnabled', () => { let esServer: TestElasticsearchUtils; diff --git a/src/core/server/integration_tests/elasticsearch/jest.integration.config.js b/src/core/server/integration_tests/elasticsearch/jest.integration.config.js new file mode 100644 index 0000000000000..e40d650120e77 --- /dev/null +++ b/src/core/server/integration_tests/elasticsearch/jest.integration.config.js @@ -0,0 +1,19 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/server/integration_tests/elasticsearch'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/integration_tests/execution_context/jest.integration.config.js b/src/core/server/integration_tests/execution_context/jest.integration.config.js new file mode 100644 index 0000000000000..b091874152f90 --- /dev/null +++ b/src/core/server/integration_tests/execution_context/jest.integration.config.js @@ -0,0 +1,19 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/server/integration_tests/execution_context'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/execution_context/integration_tests/tracing.test.ts b/src/core/server/integration_tests/execution_context/tracing.test.ts similarity index 100% rename from src/core/server/execution_context/integration_tests/tracing.test.ts rename to src/core/server/integration_tests/execution_context/tracing.test.ts diff --git a/src/core/server/http/integration_tests/cookie_session_storage.test.ts b/src/core/server/integration_tests/http/cookie_session_storage.test.ts similarity index 100% rename from src/core/server/http/integration_tests/cookie_session_storage.test.ts rename to src/core/server/integration_tests/http/cookie_session_storage.test.ts diff --git a/src/core/server/http/integration_tests/core_service.test.mocks.ts b/src/core/server/integration_tests/http/core_service.test.mocks.ts similarity index 100% rename from src/core/server/http/integration_tests/core_service.test.mocks.ts rename to src/core/server/integration_tests/http/core_service.test.mocks.ts diff --git a/src/core/server/http/integration_tests/core_services.test.ts b/src/core/server/integration_tests/http/core_services.test.ts similarity index 98% rename from src/core/server/http/integration_tests/core_services.test.ts rename to src/core/server/integration_tests/http/core_services.test.ts index 8bf0908ae4dc7..dbbc16105b070 100644 --- a/src/core/server/http/integration_tests/core_services.test.ts +++ b/src/core/server/integration_tests/http/core_services.test.ts @@ -7,10 +7,10 @@ */ import { MockElasticsearchClient } from './core_service.test.mocks'; -import { elasticsearchClientMock } from '../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { errors } from '@elastic/elasticsearch'; +import type { InternalElasticsearchServiceStart } from '@kbn/core-elasticsearch-server-internal'; import * as kbnTestServer from '../../../test_helpers/kbn_server'; -import { InternalElasticsearchServiceStart } from '../../elasticsearch'; const cookieOptions = { name: 'sid', diff --git a/src/core/server/http/integration_tests/fixtures/static/compression_available.json b/src/core/server/integration_tests/http/fixtures/static/compression_available.json similarity index 100% rename from src/core/server/http/integration_tests/fixtures/static/compression_available.json rename to src/core/server/integration_tests/http/fixtures/static/compression_available.json diff --git a/src/core/server/http/integration_tests/fixtures/static/compression_available.json.gz b/src/core/server/integration_tests/http/fixtures/static/compression_available.json.gz similarity index 100% rename from src/core/server/http/integration_tests/fixtures/static/compression_available.json.gz rename to src/core/server/integration_tests/http/fixtures/static/compression_available.json.gz diff --git a/src/core/server/http/integration_tests/fixtures/static/some_json.json b/src/core/server/integration_tests/http/fixtures/static/some_json.json similarity index 100% rename from src/core/server/http/integration_tests/fixtures/static/some_json.json rename to src/core/server/integration_tests/http/fixtures/static/some_json.json diff --git a/src/core/server/http/integration_tests/http_auth.test.ts b/src/core/server/integration_tests/http/http_auth.test.ts similarity index 100% rename from src/core/server/http/integration_tests/http_auth.test.ts rename to src/core/server/integration_tests/http/http_auth.test.ts diff --git a/src/core/server/http/integration_tests/http_server.test.ts b/src/core/server/integration_tests/http/http_server.test.ts similarity index 100% rename from src/core/server/http/integration_tests/http_server.test.ts rename to src/core/server/integration_tests/http/http_server.test.ts diff --git a/src/core/server/jest.integration.config.js b/src/core/server/integration_tests/http/jest.integration.config.js similarity index 73% rename from src/core/server/jest.integration.config.js rename to src/core/server/integration_tests/http/jest.integration.config.js index 0392fe6006547..523bff2c1d9f6 100644 --- a/src/core/server/jest.integration.config.js +++ b/src/core/server/integration_tests/http/jest.integration.config.js @@ -12,6 +12,8 @@ module.exports = { // to do so, we must fix all integration tests first // see https://github.com/elastic/kibana/pull/130255/ preset: '@kbn/test/jest_integration', - rootDir: '../../..', - roots: ['/src/core/server'], + rootDir: '../../../../..', + roots: ['/src/core/server/integration_tests/http'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], }; diff --git a/src/core/server/http/integration_tests/lifecycle.test.ts b/src/core/server/integration_tests/http/lifecycle.test.ts similarity index 100% rename from src/core/server/http/integration_tests/lifecycle.test.ts rename to src/core/server/integration_tests/http/lifecycle.test.ts diff --git a/src/core/server/http/integration_tests/lifecycle_handlers.test.ts b/src/core/server/integration_tests/http/lifecycle_handlers.test.ts similarity index 100% rename from src/core/server/http/integration_tests/lifecycle_handlers.test.ts rename to src/core/server/integration_tests/http/lifecycle_handlers.test.ts diff --git a/src/core/server/http/integration_tests/logging.test.ts b/src/core/server/integration_tests/http/logging.test.ts similarity index 100% rename from src/core/server/http/integration_tests/logging.test.ts rename to src/core/server/integration_tests/http/logging.test.ts diff --git a/src/core/server/http/integration_tests/preboot.test.ts b/src/core/server/integration_tests/http/preboot.test.ts similarity index 100% rename from src/core/server/http/integration_tests/preboot.test.ts rename to src/core/server/integration_tests/http/preboot.test.ts diff --git a/src/core/server/http/integration_tests/request.test.ts b/src/core/server/integration_tests/http/request.test.ts similarity index 100% rename from src/core/server/http/integration_tests/request.test.ts rename to src/core/server/integration_tests/http/request.test.ts diff --git a/src/core/server/http/integration_tests/router.test.ts b/src/core/server/integration_tests/http/router.test.ts similarity index 100% rename from src/core/server/http/integration_tests/router.test.ts rename to src/core/server/integration_tests/http/router.test.ts diff --git a/src/core/server/http_resources/integration_tests/http_resources_service.test.ts b/src/core/server/integration_tests/http_resources/http_resources_service.test.ts similarity index 100% rename from src/core/server/http_resources/integration_tests/http_resources_service.test.ts rename to src/core/server/integration_tests/http_resources/http_resources_service.test.ts diff --git a/src/core/server/integration_tests/http_resources/jest.integration.config.js b/src/core/server/integration_tests/http_resources/jest.integration.config.js new file mode 100644 index 0000000000000..5dfb722c5071e --- /dev/null +++ b/src/core/server/integration_tests/http_resources/jest.integration.config.js @@ -0,0 +1,19 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/server/integration_tests/http_resources'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/integration_tests/logging/jest.integration.config.js b/src/core/server/integration_tests/logging/jest.integration.config.js new file mode 100644 index 0000000000000..b55eebc9ba21c --- /dev/null +++ b/src/core/server/integration_tests/logging/jest.integration.config.js @@ -0,0 +1,19 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/server/integration_tests/logging'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/logging/integration_tests/logging.test.ts b/src/core/server/integration_tests/logging/logging.test.ts similarity index 100% rename from src/core/server/logging/integration_tests/logging.test.ts rename to src/core/server/integration_tests/logging/logging.test.ts diff --git a/src/core/server/logging/integration_tests/rolling_file_appender.test.ts b/src/core/server/integration_tests/logging/rolling_file_appender.test.ts similarity index 100% rename from src/core/server/logging/integration_tests/rolling_file_appender.test.ts rename to src/core/server/integration_tests/logging/rolling_file_appender.test.ts diff --git a/src/core/server/logging/integration_tests/utils.ts b/src/core/server/integration_tests/logging/utils.ts similarity index 100% rename from src/core/server/logging/integration_tests/utils.ts rename to src/core/server/integration_tests/logging/utils.ts diff --git a/src/core/server/integration_tests/metrics/jest.integration.config.js b/src/core/server/integration_tests/metrics/jest.integration.config.js new file mode 100644 index 0000000000000..d55cb61f42571 --- /dev/null +++ b/src/core/server/integration_tests/metrics/jest.integration.config.js @@ -0,0 +1,19 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/server/integration_tests/metrics'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/metrics/integration_tests/server_collector.test.ts b/src/core/server/integration_tests/metrics/server_collector.test.ts similarity index 99% rename from src/core/server/metrics/integration_tests/server_collector.test.ts rename to src/core/server/integration_tests/metrics/server_collector.test.ts index 73be33c868cf5..1febd1aab56ea 100644 --- a/src/core/server/metrics/integration_tests/server_collector.test.ts +++ b/src/core/server/integration_tests/metrics/server_collector.test.ts @@ -15,7 +15,7 @@ import type { IRouter } from '@kbn/core-http-server'; import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; import type { HttpService } from '@kbn/core-http-server-internal'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; -import { ServerMetricsCollector } from '../collectors/server'; +import { ServerMetricsCollector } from '../../metrics/collectors/server'; import { setTimeout as setTimeoutPromise } from 'timers/promises'; describe('ServerMetricsCollector', () => { diff --git a/src/core/server/integration_tests/node/jest.integration.config.js b/src/core/server/integration_tests/node/jest.integration.config.js new file mode 100644 index 0000000000000..fd25c9f3882a1 --- /dev/null +++ b/src/core/server/integration_tests/node/jest.integration.config.js @@ -0,0 +1,19 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/server/integration_tests/node'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/node/integration_tests/logging.test.ts b/src/core/server/integration_tests/node/logging.test.ts similarity index 100% rename from src/core/server/node/integration_tests/logging.test.ts rename to src/core/server/integration_tests/node/logging.test.ts diff --git a/src/core/server/integration_tests/plugins/jest.integration.config.js b/src/core/server/integration_tests/plugins/jest.integration.config.js new file mode 100644 index 0000000000000..55bbf66147bb8 --- /dev/null +++ b/src/core/server/integration_tests/plugins/jest.integration.config.js @@ -0,0 +1,19 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/server/integration_tests/plugins'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/plugins/integration_tests/plugins_service.test.mocks.ts b/src/core/server/integration_tests/plugins/plugins_service.test.mocks.ts similarity index 85% rename from src/core/server/plugins/integration_tests/plugins_service.test.mocks.ts rename to src/core/server/integration_tests/plugins/plugins_service.test.mocks.ts index 30b409e8791c6..d20d3bc094ac4 100644 --- a/src/core/server/plugins/integration_tests/plugins_service.test.mocks.ts +++ b/src/core/server/integration_tests/plugins/plugins_service.test.mocks.ts @@ -15,4 +15,4 @@ jest.doMock('load-json-file', () => ({ })); export const mockDiscover = jest.fn(); -jest.mock('../discovery/plugins_discovery', () => ({ discover: mockDiscover })); +jest.mock('../../plugins/discovery/plugins_discovery', () => ({ discover: mockDiscover })); diff --git a/src/core/server/plugins/integration_tests/plugins_service.test.ts b/src/core/server/integration_tests/plugins/plugins_service.test.ts similarity index 95% rename from src/core/server/plugins/integration_tests/plugins_service.test.ts rename to src/core/server/integration_tests/plugins/plugins_service.test.ts index dc832b093f917..2d51b63921bad 100644 --- a/src/core/server/plugins/integration_tests/plugins_service.test.ts +++ b/src/core/server/integration_tests/plugins/plugins_service.test.ts @@ -17,12 +17,12 @@ import { getEnvOptions, rawConfigServiceMock } from '@kbn/config-mocks'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { environmentServiceMock } from '@kbn/core-environment-server-mocks'; import { nodeServiceMock } from '@kbn/core-node-server-mocks'; -import { PluginsService } from '../plugins_service'; +import { PluginsService } from '../../plugins/plugins_service'; import { BehaviorSubject, from } from 'rxjs'; -import { config } from '../plugins_config'; +import { config } from '../../plugins/plugins_config'; import { coreMock } from '../../mocks'; -import { AsyncPlugin, PluginType } from '../types'; -import { PluginWrapper } from '../plugin'; +import { AsyncPlugin, PluginType } from '../../plugins/types'; +import { PluginWrapper } from '../../plugins/plugin'; describe('PluginsService', () => { const logger = loggingSystemMock.create(); diff --git a/src/core/server/integration_tests/saved_objects/jest.integration.config.js b/src/core/server/integration_tests/saved_objects/jest.integration.config.js new file mode 100644 index 0000000000000..9f20cc58db7e9 --- /dev/null +++ b/src/core/server/integration_tests/saved_objects/jest.integration.config.js @@ -0,0 +1,19 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/server/integration_tests/saved_objects'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/saved_objects/migrations/integration_tests/.gitignore b/src/core/server/integration_tests/saved_objects/migrations/.gitignore similarity index 100% rename from src/core/server/saved_objects/migrations/integration_tests/.gitignore rename to src/core/server/integration_tests/saved_objects/migrations/.gitignore diff --git a/src/core/server/saved_objects/migrations/integration_tests/7.7.2_xpack_100k.test.ts b/src/core/server/integration_tests/saved_objects/migrations/7.7.2_xpack_100k.test.ts similarity index 97% rename from src/core/server/saved_objects/migrations/integration_tests/7.7.2_xpack_100k.test.ts rename to src/core/server/integration_tests/saved_objects/migrations/7.7.2_xpack_100k.test.ts index 66c7d2e81b846..530a4b92ead6a 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/7.7.2_xpack_100k.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/7.7.2_xpack_100k.test.ts @@ -11,8 +11,8 @@ import { unlink } from 'fs/promises'; import { REPO_ROOT } from '@kbn/utils'; import { Env } from '@kbn/config'; import { getEnvOptions } from '@kbn/config-mocks'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; -import { ElasticsearchClient } from '../../../elasticsearch'; import { InternalCoreStart } from '../../../internal_types'; import { Root } from '../../../root'; diff --git a/src/core/server/saved_objects/migrations/integration_tests/7_13_0_failed_action_tasks.test.ts b/src/core/server/integration_tests/saved_objects/migrations/7_13_0_failed_action_tasks.test.ts similarity index 98% rename from src/core/server/saved_objects/migrations/integration_tests/7_13_0_failed_action_tasks.test.ts rename to src/core/server/integration_tests/saved_objects/migrations/7_13_0_failed_action_tasks.test.ts index d2bf71f023de7..cffc23b476c71 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/7_13_0_failed_action_tasks.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/7_13_0_failed_action_tasks.test.ts @@ -8,9 +8,9 @@ import Path from 'path'; import fs from 'fs/promises'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; import { Root } from '../../../root'; -import { ElasticsearchClient } from '../../../elasticsearch'; const logFilePath = Path.join(__dirname, '7_13_failed_action_tasks.log'); diff --git a/src/core/server/saved_objects/migrations/integration_tests/7_13_0_transform_failures.test.ts b/src/core/server/integration_tests/saved_objects/migrations/7_13_0_transform_failures.test.ts similarity index 99% rename from src/core/server/saved_objects/migrations/integration_tests/7_13_0_transform_failures.test.ts rename to src/core/server/integration_tests/saved_objects/migrations/7_13_0_transform_failures.test.ts index 714ce363c06e2..b177332322c00 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/7_13_0_transform_failures.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/7_13_0_transform_failures.test.ts @@ -12,7 +12,7 @@ import Util from 'util'; import { Env } from '@kbn/config'; import { REPO_ROOT } from '@kbn/utils'; import { getEnvOptions } from '@kbn/config-mocks'; -import type { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; import { Root } from '../../../root'; import { SearchTotalHits } from '@elastic/elasticsearch/lib/api/types'; diff --git a/src/core/server/saved_objects/migrations/integration_tests/7_13_0_unknown_types.test.ts b/src/core/server/integration_tests/saved_objects/migrations/7_13_0_unknown_types.test.ts similarity index 98% rename from src/core/server/saved_objects/migrations/integration_tests/7_13_0_unknown_types.test.ts rename to src/core/server/integration_tests/saved_objects/migrations/7_13_0_unknown_types.test.ts index 6ccb6497516f9..2008cc370f2ce 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/7_13_0_unknown_types.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/7_13_0_unknown_types.test.ts @@ -12,9 +12,9 @@ import type { IndicesIndexSettings } from '@elastic/elasticsearch/lib/api/types' import { Env } from '@kbn/config'; import { REPO_ROOT } from '@kbn/utils'; import { getEnvOptions } from '@kbn/config-mocks'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; import type { Root } from '../../../root'; -import type { ElasticsearchClient } from '../../../elasticsearch'; const logFilePath = Path.join(__dirname, '7_13_unknown_types.log'); diff --git a/src/core/server/saved_objects/migrations/actions/integration_tests/actions.test.ts b/src/core/server/integration_tests/saved_objects/migrations/actions/actions.test.ts similarity index 99% rename from src/core/server/saved_objects/migrations/actions/integration_tests/actions.test.ts rename to src/core/server/integration_tests/saved_objects/migrations/actions/actions.test.ts index a799ced0ffe39..67dd9a54fa26f 100644 --- a/src/core/server/saved_objects/migrations/actions/integration_tests/actions.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/actions/actions.test.ts @@ -13,7 +13,7 @@ import { errors } from '@elastic/elasticsearch'; import type { TaskEither } from 'fp-ts/lib/TaskEither'; import type { ElasticsearchClient } from '../../../..'; import * as kbnTestServer from '../../../../../test_helpers/kbn_server'; -import type { SavedObjectsRawDoc } from '../../../serialization'; +import type { SavedObjectsRawDoc } from '../../../../saved_objects/serialization'; import { bulkOverwriteTransformedDocuments, cloneIndex, @@ -40,18 +40,18 @@ import { transformDocs, waitForIndexStatusYellow, initAction, -} from '..'; -import type { DocumentsTransformFailed, DocumentsTransformSuccess } from '../../core'; +} from '../../../../saved_objects/migrations/actions'; +import type { + DocumentsTransformFailed, + DocumentsTransformSuccess, +} from '../../../../saved_objects/migrations/core'; const { startES } = kbnTestServer.createTestServers({ adjustTimeout: (t: number) => jest.setTimeout(t), settings: { es: { license: 'basic', - dataArchive: Path.resolve( - __dirname, - '../../integration_tests/archives/7.7.2_xpack_100k_obj.zip' - ), + dataArchive: Path.resolve(__dirname, '../archives/7.7.2_xpack_100k_obj.zip'), esArgs: ['http.max_content_length=10Kb'], }, }, diff --git a/src/core/server/saved_objects/migrations/actions/integration_tests/es_errors.test.ts b/src/core/server/integration_tests/saved_objects/migrations/actions/es_errors.test.ts similarity index 93% rename from src/core/server/saved_objects/migrations/actions/integration_tests/es_errors.test.ts rename to src/core/server/integration_tests/saved_objects/migrations/actions/es_errors.test.ts index 8a051835cad67..dab9067e93efb 100644 --- a/src/core/server/saved_objects/migrations/actions/integration_tests/es_errors.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/actions/es_errors.test.ts @@ -10,9 +10,12 @@ import { ElasticsearchClient } from '../../../..'; import { InternalCoreStart } from '../../../../internal_types'; import * as kbnTestServer from '../../../../../test_helpers/kbn_server'; import { Root } from '../../../../root'; -import { isWriteBlockException, isClusterShardLimitExceeded } from '../es_errors'; -import { createIndex } from '../create_index'; -import { setWriteBlock } from '../set_write_block'; +import { + isWriteBlockException, + isClusterShardLimitExceeded, +} from '../../../../saved_objects/migrations/actions/es_errors'; +import { createIndex } from '../../../../saved_objects/migrations/actions/create_index'; +import { setWriteBlock } from '../../../../saved_objects/migrations/actions/set_write_block'; const { startES } = kbnTestServer.createTestServers({ adjustTimeout: (t: number) => jest.setTimeout(t), diff --git a/src/core/server/saved_objects/migrations/integration_tests/archives/7.13.0_5k_so_node_01.zip b/src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_01.zip similarity index 100% rename from src/core/server/saved_objects/migrations/integration_tests/archives/7.13.0_5k_so_node_01.zip rename to src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_01.zip diff --git a/src/core/server/saved_objects/migrations/integration_tests/archives/7.13.0_5k_so_node_02.zip b/src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_02.zip similarity index 100% rename from src/core/server/saved_objects/migrations/integration_tests/archives/7.13.0_5k_so_node_02.zip rename to src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_02.zip diff --git a/src/core/server/saved_objects/migrations/integration_tests/archives/7.13.0_concurrent_5k_foo.zip b/src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_concurrent_5k_foo.zip similarity index 100% rename from src/core/server/saved_objects/migrations/integration_tests/archives/7.13.0_concurrent_5k_foo.zip rename to src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_concurrent_5k_foo.zip diff --git a/src/core/server/saved_objects/migrations/integration_tests/archives/7.13.0_with_corrupted_so.zip b/src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_with_corrupted_so.zip similarity index 100% rename from src/core/server/saved_objects/migrations/integration_tests/archives/7.13.0_with_corrupted_so.zip rename to src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_with_corrupted_so.zip diff --git a/src/core/server/saved_objects/migrations/integration_tests/archives/7.13.0_with_unknown_so.zip b/src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_with_unknown_so.zip similarity index 100% rename from src/core/server/saved_objects/migrations/integration_tests/archives/7.13.0_with_unknown_so.zip rename to src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_with_unknown_so.zip diff --git a/src/core/server/saved_objects/migrations/integration_tests/archives/7.13.2_so_with_multiple_namespaces.zip b/src/core/server/integration_tests/saved_objects/migrations/archives/7.13.2_so_with_multiple_namespaces.zip similarity index 100% rename from src/core/server/saved_objects/migrations/integration_tests/archives/7.13.2_so_with_multiple_namespaces.zip rename to src/core/server/integration_tests/saved_objects/migrations/archives/7.13.2_so_with_multiple_namespaces.zip diff --git a/src/core/server/saved_objects/migrations/integration_tests/archives/7.13_1.5k_failed_action_tasks.zip b/src/core/server/integration_tests/saved_objects/migrations/archives/7.13_1.5k_failed_action_tasks.zip similarity index 100% rename from src/core/server/saved_objects/migrations/integration_tests/archives/7.13_1.5k_failed_action_tasks.zip rename to src/core/server/integration_tests/saved_objects/migrations/archives/7.13_1.5k_failed_action_tasks.zip diff --git a/src/core/server/saved_objects/migrations/integration_tests/archives/7.14.0_xpack_sample_saved_objects.zip b/src/core/server/integration_tests/saved_objects/migrations/archives/7.14.0_xpack_sample_saved_objects.zip similarity index 100% rename from src/core/server/saved_objects/migrations/integration_tests/archives/7.14.0_xpack_sample_saved_objects.zip rename to src/core/server/integration_tests/saved_objects/migrations/archives/7.14.0_xpack_sample_saved_objects.zip diff --git a/src/core/server/saved_objects/migrations/integration_tests/archives/7.3.0_xpack_sample_saved_objects.zip b/src/core/server/integration_tests/saved_objects/migrations/archives/7.3.0_xpack_sample_saved_objects.zip similarity index 100% rename from src/core/server/saved_objects/migrations/integration_tests/archives/7.3.0_xpack_sample_saved_objects.zip rename to src/core/server/integration_tests/saved_objects/migrations/archives/7.3.0_xpack_sample_saved_objects.zip diff --git a/src/core/server/saved_objects/migrations/integration_tests/archives/7.7.2_xpack_100k_obj.zip b/src/core/server/integration_tests/saved_objects/migrations/archives/7.7.2_xpack_100k_obj.zip similarity index 100% rename from src/core/server/saved_objects/migrations/integration_tests/archives/7.7.2_xpack_100k_obj.zip rename to src/core/server/integration_tests/saved_objects/migrations/archives/7.7.2_xpack_100k_obj.zip diff --git a/src/core/server/saved_objects/migrations/integration_tests/archives/7_13_corrupt_and_transform_failures_docs.zip b/src/core/server/integration_tests/saved_objects/migrations/archives/7_13_corrupt_and_transform_failures_docs.zip similarity index 100% rename from src/core/server/saved_objects/migrations/integration_tests/archives/7_13_corrupt_and_transform_failures_docs.zip rename to src/core/server/integration_tests/saved_objects/migrations/archives/7_13_corrupt_and_transform_failures_docs.zip diff --git a/src/core/server/saved_objects/migrations/integration_tests/archives/8.0.0_document_migration_failure.zip b/src/core/server/integration_tests/saved_objects/migrations/archives/8.0.0_document_migration_failure.zip similarity index 100% rename from src/core/server/saved_objects/migrations/integration_tests/archives/8.0.0_document_migration_failure.zip rename to src/core/server/integration_tests/saved_objects/migrations/archives/8.0.0_document_migration_failure.zip diff --git a/src/core/server/saved_objects/migrations/integration_tests/archives/8.0.0_migrated_with_corrupt_outdated_docs.zip b/src/core/server/integration_tests/saved_objects/migrations/archives/8.0.0_migrated_with_corrupt_outdated_docs.zip similarity index 100% rename from src/core/server/saved_objects/migrations/integration_tests/archives/8.0.0_migrated_with_corrupt_outdated_docs.zip rename to src/core/server/integration_tests/saved_objects/migrations/archives/8.0.0_migrated_with_corrupt_outdated_docs.zip diff --git a/src/core/server/saved_objects/migrations/integration_tests/archives/8.0.0_migrated_with_outdated_docs.zip b/src/core/server/integration_tests/saved_objects/migrations/archives/8.0.0_migrated_with_outdated_docs.zip similarity index 100% rename from src/core/server/saved_objects/migrations/integration_tests/archives/8.0.0_migrated_with_outdated_docs.zip rename to src/core/server/integration_tests/saved_objects/migrations/archives/8.0.0_migrated_with_outdated_docs.zip diff --git a/src/core/server/saved_objects/migrations/integration_tests/archives/8.0.0_v1_migrations_sample_data_saved_objects.zip b/src/core/server/integration_tests/saved_objects/migrations/archives/8.0.0_v1_migrations_sample_data_saved_objects.zip similarity index 100% rename from src/core/server/saved_objects/migrations/integration_tests/archives/8.0.0_v1_migrations_sample_data_saved_objects.zip rename to src/core/server/integration_tests/saved_objects/migrations/archives/8.0.0_v1_migrations_sample_data_saved_objects.zip diff --git a/src/core/server/saved_objects/migrations/integration_tests/batch_size_bytes.test.ts b/src/core/server/integration_tests/saved_objects/migrations/batch_size_bytes.test.ts similarity index 97% rename from src/core/server/saved_objects/migrations/integration_tests/batch_size_bytes.test.ts rename to src/core/server/integration_tests/saved_objects/migrations/batch_size_bytes.test.ts index b6e10e6b3034b..1b903ea864890 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/batch_size_bytes.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/batch_size_bytes.test.ts @@ -11,12 +11,12 @@ import fs from 'fs/promises'; import JSON5 from 'json5'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; import { Root } from '../../../root'; -import { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { Env } from '@kbn/config'; import { REPO_ROOT } from '@kbn/utils'; import { getEnvOptions } from '@kbn/config-mocks'; import { LogRecord } from '@kbn/logging'; -import { retryAsync } from '../test_helpers/retry_async'; +import { retryAsync } from '../../../saved_objects/migrations/test_helpers/retry_async'; const kibanaVersion = Env.createDefault(REPO_ROOT, getEnvOptions()).packageInfo.version; const targetIndex = `.kibana_${kibanaVersion}_001`; diff --git a/src/core/server/saved_objects/migrations/integration_tests/batch_size_bytes_exceeds_es_content_length.test.ts b/src/core/server/integration_tests/saved_objects/migrations/batch_size_bytes_exceeds_es_content_length.test.ts similarity index 97% rename from src/core/server/saved_objects/migrations/integration_tests/batch_size_bytes_exceeds_es_content_length.test.ts rename to src/core/server/integration_tests/saved_objects/migrations/batch_size_bytes_exceeds_es_content_length.test.ts index ae9dc76b134a5..670660509f7a8 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/batch_size_bytes_exceeds_es_content_length.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/batch_size_bytes_exceeds_es_content_length.test.ts @@ -11,7 +11,7 @@ import fs from 'fs/promises'; import JSON5 from 'json5'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; import { Root } from '../../../root'; -import { retryAsync } from '../test_helpers/retry_async'; +import { retryAsync } from '../../../saved_objects/migrations/test_helpers/retry_async'; const logFilePath = Path.join(__dirname, 'batch_size_bytes_exceeds_es_content_length.log'); diff --git a/src/core/server/saved_objects/migrations/integration_tests/cleanup.test.ts b/src/core/server/integration_tests/saved_objects/migrations/cleanup.test.ts similarity index 100% rename from src/core/server/saved_objects/migrations/integration_tests/cleanup.test.ts rename to src/core/server/integration_tests/saved_objects/migrations/cleanup.test.ts diff --git a/src/core/server/saved_objects/migrations/integration_tests/collects_corrupt_docs.test.ts b/src/core/server/integration_tests/saved_objects/migrations/collects_corrupt_docs.test.ts similarity index 100% rename from src/core/server/saved_objects/migrations/integration_tests/collects_corrupt_docs.test.ts rename to src/core/server/integration_tests/saved_objects/migrations/collects_corrupt_docs.test.ts diff --git a/src/core/server/saved_objects/migrations/integration_tests/corrupt_outdated_docs.test.ts b/src/core/server/integration_tests/saved_objects/migrations/corrupt_outdated_docs.test.ts similarity index 100% rename from src/core/server/saved_objects/migrations/integration_tests/corrupt_outdated_docs.test.ts rename to src/core/server/integration_tests/saved_objects/migrations/corrupt_outdated_docs.test.ts diff --git a/src/core/server/saved_objects/migrations/integration_tests/incompatible_cluster_routing_allocation.test.ts b/src/core/server/integration_tests/saved_objects/migrations/incompatible_cluster_routing_allocation.test.ts similarity index 97% rename from src/core/server/saved_objects/migrations/integration_tests/incompatible_cluster_routing_allocation.test.ts rename to src/core/server/integration_tests/saved_objects/migrations/incompatible_cluster_routing_allocation.test.ts index 8a075aa08bbe2..371f4b7e712ff 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/incompatible_cluster_routing_allocation.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/incompatible_cluster_routing_allocation.test.ts @@ -15,9 +15,9 @@ import { getDocLinksMeta } from '@kbn/doc-links'; import { getEnvOptions } from '@kbn/config-mocks'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; import { Root } from '../../../root'; -import { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { LogRecord } from '@kbn/logging'; -import { retryAsync } from '../test_helpers/retry_async'; +import { retryAsync } from '../../../saved_objects/migrations/test_helpers/retry_async'; const logFilePath = Path.join(__dirname, 'incompatible_cluster_routing_allocation.log'); const env = Env.createDefault(REPO_ROOT, getEnvOptions()); diff --git a/src/core/server/saved_objects/migrations/integration_tests/migration_from_older_v1.test.ts b/src/core/server/integration_tests/saved_objects/migrations/migration_from_older_v1.test.ts similarity index 97% rename from src/core/server/saved_objects/migrations/integration_tests/migration_from_older_v1.test.ts rename to src/core/server/integration_tests/saved_objects/migrations/migration_from_older_v1.test.ts index 69c9cc38fc79d..2420895833077 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/migration_from_older_v1.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/migration_from_older_v1.test.ts @@ -13,9 +13,9 @@ import Semver from 'semver'; import { REPO_ROOT } from '@kbn/utils'; import { Env } from '@kbn/config'; import { getEnvOptions } from '@kbn/config-mocks'; +import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; -import { ElasticsearchClient } from '../../../elasticsearch'; -import { SavedObjectsRawDoc } from '../../serialization'; +import { SavedObjectsRawDoc } from '../../../saved_objects/serialization'; import { InternalCoreStart } from '../../../internal_types'; import { Root } from '../../../root'; diff --git a/src/core/server/saved_objects/migrations/integration_tests/migration_from_same_v1.test.ts b/src/core/server/integration_tests/saved_objects/migrations/migration_from_same_v1.test.ts similarity index 97% rename from src/core/server/saved_objects/migrations/integration_tests/migration_from_same_v1.test.ts rename to src/core/server/integration_tests/saved_objects/migrations/migration_from_same_v1.test.ts index 5c723b89c23d1..53a2dd64d4084 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/migration_from_same_v1.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/migration_from_same_v1.test.ts @@ -14,8 +14,8 @@ import { REPO_ROOT } from '@kbn/utils'; import { Env } from '@kbn/config'; import { getEnvOptions } from '@kbn/config-mocks'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; -import { ElasticsearchClient } from '../../../elasticsearch'; -import { SavedObjectsRawDoc } from '../../serialization'; +import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; +import { SavedObjectsRawDoc } from '../../../saved_objects/serialization'; import { InternalCoreStart } from '../../../internal_types'; import { Root } from '../../../root'; diff --git a/src/core/server/saved_objects/migrations/integration_tests/multiple_es_nodes.test.ts b/src/core/server/integration_tests/saved_objects/migrations/multiple_es_nodes.test.ts similarity index 98% rename from src/core/server/saved_objects/migrations/integration_tests/multiple_es_nodes.test.ts rename to src/core/server/integration_tests/saved_objects/migrations/multiple_es_nodes.test.ts index f88f97a677616..adb7aeacf4610 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/multiple_es_nodes.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/multiple_es_nodes.test.ts @@ -11,7 +11,7 @@ import del from 'del'; import { kibanaServerTestUser } from '@kbn/test'; import { kibanaPackageJson as pkg } from '@kbn/utils'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; -import type { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { Root } from '../../../root'; const LOG_FILE_PREFIX = 'migration_test_multiple_es_nodes'; diff --git a/src/core/server/saved_objects/migrations/integration_tests/multiple_kibana_nodes.test.ts b/src/core/server/integration_tests/saved_objects/migrations/multiple_kibana_nodes.test.ts similarity index 98% rename from src/core/server/saved_objects/migrations/integration_tests/multiple_kibana_nodes.test.ts rename to src/core/server/integration_tests/saved_objects/migrations/multiple_kibana_nodes.test.ts index bc8c138e9ef20..b1ee15572d6e2 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/multiple_kibana_nodes.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/multiple_kibana_nodes.test.ts @@ -11,8 +11,8 @@ import del from 'del'; import { esTestConfig, kibanaServerTestUser } from '@kbn/test'; import { kibanaPackageJson as pkg } from '@kbn/utils'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; -import type { ElasticsearchClient } from '../../../elasticsearch'; -import { SavedObjectsType } from '../../types'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; +import { SavedObjectsType } from '../../../saved_objects/types'; import type { Root } from '../../../root'; const LOG_FILE_PREFIX = 'migration_test_multiple_kibana_nodes'; diff --git a/src/core/server/saved_objects/migrations/integration_tests/outdated_docs.test.ts b/src/core/server/integration_tests/saved_objects/migrations/outdated_docs.test.ts similarity index 97% rename from src/core/server/saved_objects/migrations/integration_tests/outdated_docs.test.ts rename to src/core/server/integration_tests/saved_objects/migrations/outdated_docs.test.ts index bc1f41b542380..74dc2d785c35e 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/outdated_docs.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/outdated_docs.test.ts @@ -11,7 +11,7 @@ import Fs from 'fs'; import Util from 'util'; import { kibanaPackageJson as pkg } from '@kbn/utils'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; -import type { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { Root } from '../../../root'; const logFilePath = Path.join(__dirname, 'outdated_docs.log'); diff --git a/src/core/server/saved_objects/migrations/integration_tests/rewriting_id.test.ts b/src/core/server/integration_tests/saved_objects/migrations/rewriting_id.test.ts similarity index 97% rename from src/core/server/saved_objects/migrations/integration_tests/rewriting_id.test.ts rename to src/core/server/integration_tests/saved_objects/migrations/rewriting_id.test.ts index cf350c0e9a35e..4cfbe4d9bd1dd 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/rewriting_id.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/rewriting_id.test.ts @@ -11,9 +11,9 @@ import Fs from 'fs'; import Util from 'util'; import { kibanaPackageJson as pkg } from '@kbn/utils'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; -import type { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { Root } from '../../../root'; -import { deterministicallyRegenerateObjectId } from '../core/document_migrator'; +import { deterministicallyRegenerateObjectId } from '../../../saved_objects/migrations/core/document_migrator'; const logFilePath = Path.join(__dirname, 'rewriting_id.log'); diff --git a/src/core/server/saved_objects/migrations/integration_tests/type_registrations.test.ts b/src/core/server/integration_tests/saved_objects/migrations/type_registrations.test.ts similarity index 98% rename from src/core/server/saved_objects/migrations/integration_tests/type_registrations.test.ts rename to src/core/server/integration_tests/saved_objects/migrations/type_registrations.test.ts index 4eddd54acf121..1c8ea64eb8dea 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/type_registrations.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/type_registrations.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { REMOVED_TYPES } from '../core'; +import { REMOVED_TYPES } from '../../../saved_objects/migrations/core'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; // Types should NEVER be removed from this array diff --git a/src/core/server/saved_objects/routes/integration_tests/bulk_create.test.ts b/src/core/server/integration_tests/saved_objects/routes/bulk_create.test.ts similarity index 95% rename from src/core/server/saved_objects/routes/integration_tests/bulk_create.test.ts rename to src/core/server/integration_tests/saved_objects/routes/bulk_create.test.ts index c34ea099d0ec8..899cf114f6869 100644 --- a/src/core/server/saved_objects/routes/integration_tests/bulk_create.test.ts +++ b/src/core/server/integration_tests/saved_objects/routes/bulk_create.test.ts @@ -7,13 +7,13 @@ */ import supertest from 'supertest'; -import { registerBulkCreateRoute } from '../bulk_create'; +import { registerBulkCreateRoute } from '../../../saved_objects/routes/bulk_create'; import { savedObjectsClientMock } from '../../../mocks'; import { CoreUsageStatsClient } from '../../../core_usage_data'; import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock'; import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock'; -import { setupServer } from '../test_utils'; -import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types'; +import { setupServer } from '../../../saved_objects/routes/test_utils'; +import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types'; type SetupServerReturn = Awaited>; diff --git a/src/core/server/saved_objects/routes/integration_tests/bulk_get.test.ts b/src/core/server/integration_tests/saved_objects/routes/bulk_get.test.ts similarity index 94% rename from src/core/server/saved_objects/routes/integration_tests/bulk_get.test.ts rename to src/core/server/integration_tests/saved_objects/routes/bulk_get.test.ts index a82a5351e9949..6c903ff672b3d 100644 --- a/src/core/server/saved_objects/routes/integration_tests/bulk_get.test.ts +++ b/src/core/server/integration_tests/saved_objects/routes/bulk_get.test.ts @@ -7,13 +7,13 @@ */ import supertest from 'supertest'; -import { registerBulkGetRoute } from '../bulk_get'; +import { registerBulkGetRoute } from '../../../saved_objects/routes/bulk_get'; import { savedObjectsClientMock } from '../../../mocks'; import { CoreUsageStatsClient } from '../../../core_usage_data'; import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock'; import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock'; -import { setupServer } from '../test_utils'; -import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types'; +import { setupServer } from '../../../saved_objects/routes/test_utils'; +import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types'; type SetupServerReturn = Awaited>; diff --git a/src/core/server/saved_objects/routes/integration_tests/bulk_resolve.test.ts b/src/core/server/integration_tests/saved_objects/routes/bulk_resolve.test.ts similarity index 94% rename from src/core/server/saved_objects/routes/integration_tests/bulk_resolve.test.ts rename to src/core/server/integration_tests/saved_objects/routes/bulk_resolve.test.ts index 90f06368468be..0c51e58f713b6 100644 --- a/src/core/server/saved_objects/routes/integration_tests/bulk_resolve.test.ts +++ b/src/core/server/integration_tests/saved_objects/routes/bulk_resolve.test.ts @@ -7,13 +7,13 @@ */ import supertest from 'supertest'; -import { registerBulkResolveRoute } from '../bulk_resolve'; +import { registerBulkResolveRoute } from '../../../saved_objects/routes/bulk_resolve'; import { savedObjectsClientMock } from '../../../mocks'; import { CoreUsageStatsClient } from '../../../core_usage_data'; import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock'; import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock'; -import { setupServer } from '../test_utils'; -import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types'; +import { setupServer } from '../../../saved_objects/routes/test_utils'; +import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types'; type SetupServerReturn = Awaited>; diff --git a/src/core/server/saved_objects/routes/integration_tests/bulk_update.test.ts b/src/core/server/integration_tests/saved_objects/routes/bulk_update.test.ts similarity index 95% rename from src/core/server/saved_objects/routes/integration_tests/bulk_update.test.ts rename to src/core/server/integration_tests/saved_objects/routes/bulk_update.test.ts index d92041bce3c72..45aedf8544dfa 100644 --- a/src/core/server/saved_objects/routes/integration_tests/bulk_update.test.ts +++ b/src/core/server/integration_tests/saved_objects/routes/bulk_update.test.ts @@ -7,13 +7,13 @@ */ import supertest from 'supertest'; -import { registerBulkUpdateRoute } from '../bulk_update'; +import { registerBulkUpdateRoute } from '../../../saved_objects/routes/bulk_update'; import { savedObjectsClientMock } from '../../../mocks'; import { CoreUsageStatsClient } from '../../../core_usage_data'; import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock'; import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock'; -import { setupServer } from '../test_utils'; -import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types'; +import { setupServer } from '../../../saved_objects/routes/test_utils'; +import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types'; type SetupServerReturn = Awaited>; diff --git a/src/core/server/saved_objects/routes/integration_tests/create.test.ts b/src/core/server/integration_tests/saved_objects/routes/create.test.ts similarity index 93% rename from src/core/server/saved_objects/routes/integration_tests/create.test.ts rename to src/core/server/integration_tests/saved_objects/routes/create.test.ts index e4f566c769234..bdaca61ee23e4 100644 --- a/src/core/server/saved_objects/routes/integration_tests/create.test.ts +++ b/src/core/server/integration_tests/saved_objects/routes/create.test.ts @@ -7,13 +7,13 @@ */ import supertest from 'supertest'; -import { registerCreateRoute } from '../create'; -import { savedObjectsClientMock } from '../../service/saved_objects_client.mock'; +import { registerCreateRoute } from '../../../saved_objects/routes/create'; +import { savedObjectsClientMock } from '../../../saved_objects/service/saved_objects_client.mock'; import { CoreUsageStatsClient } from '../../../core_usage_data'; import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock'; import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock'; -import { setupServer } from '../test_utils'; -import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types'; +import { setupServer } from '../../../saved_objects/routes/test_utils'; +import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types'; type SetupServerReturn = Awaited>; diff --git a/src/core/server/saved_objects/routes/integration_tests/delete.test.ts b/src/core/server/integration_tests/saved_objects/routes/delete.test.ts similarity index 94% rename from src/core/server/saved_objects/routes/integration_tests/delete.test.ts rename to src/core/server/integration_tests/saved_objects/routes/delete.test.ts index 849b99b49fbc0..41f7fd06556f9 100644 --- a/src/core/server/saved_objects/routes/integration_tests/delete.test.ts +++ b/src/core/server/integration_tests/saved_objects/routes/delete.test.ts @@ -7,13 +7,13 @@ */ import supertest from 'supertest'; -import { registerDeleteRoute } from '../delete'; +import { registerDeleteRoute } from '../../../saved_objects/routes/delete'; import { savedObjectsClientMock } from '../../../mocks'; import { CoreUsageStatsClient } from '../../../core_usage_data'; import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock'; import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock'; -import { setupServer } from '../test_utils'; -import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types'; +import { setupServer } from '../../../saved_objects/routes/test_utils'; +import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types'; type SetupServerReturn = Awaited>; diff --git a/src/core/server/saved_objects/routes/integration_tests/delete_unknown_types.test.ts b/src/core/server/integration_tests/saved_objects/routes/delete_unknown_types.test.ts similarity index 88% rename from src/core/server/saved_objects/routes/integration_tests/delete_unknown_types.test.ts rename to src/core/server/integration_tests/saved_objects/routes/delete_unknown_types.test.ts index 87376de206810..4a13921750d1f 100644 --- a/src/core/server/saved_objects/routes/integration_tests/delete_unknown_types.test.ts +++ b/src/core/server/integration_tests/saved_objects/routes/delete_unknown_types.test.ts @@ -7,12 +7,12 @@ */ import supertest from 'supertest'; -import { registerDeleteUnknownTypesRoute } from '../deprecations'; -import { elasticsearchServiceMock } from '../../../elasticsearch/elasticsearch_service.mock'; -import { typeRegistryMock } from '../../saved_objects_type_registry.mock'; -import { setupServer } from '../test_utils'; +import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; +import { registerDeleteUnknownTypesRoute } from '../../../saved_objects/routes/deprecations'; +import { typeRegistryMock } from '../../../saved_objects/saved_objects_type_registry.mock'; +import { setupServer } from '../../../saved_objects/routes/test_utils'; import { SavedObjectsType } from '../../..'; -import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types'; +import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types'; type SetupServerReturn = Awaited>; diff --git a/src/core/server/saved_objects/routes/integration_tests/export.test.ts b/src/core/server/integration_tests/saved_objects/routes/export.test.ts similarity index 90% rename from src/core/server/saved_objects/routes/integration_tests/export.test.ts rename to src/core/server/integration_tests/saved_objects/routes/export.test.ts index 9bdd6f39abbd0..358a23902d5e1 100644 --- a/src/core/server/saved_objects/routes/integration_tests/export.test.ts +++ b/src/core/server/integration_tests/saved_objects/routes/export.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -jest.mock('../../export', () => ({ +jest.mock('../../../saved_objects/export', () => ({ exportSavedObjectsToStream: jest.fn(), })); @@ -15,11 +15,11 @@ import { createListStream } from '@kbn/utils'; import { CoreUsageStatsClient } from '../../../core_usage_data'; import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock'; import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock'; -import { savedObjectsExporterMock } from '../../export/saved_objects_exporter.mock'; -import { SavedObjectConfig } from '../../saved_objects_config'; -import { registerExportRoute } from '../export'; -import { setupServer, createExportableType } from '../test_utils'; -import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types'; +import { savedObjectsExporterMock } from '../../../saved_objects/export/saved_objects_exporter.mock'; +import { SavedObjectConfig } from '../../../saved_objects/saved_objects_config'; +import { registerExportRoute } from '../../../saved_objects/routes/export'; +import { setupServer, createExportableType } from '../../../saved_objects/routes/test_utils'; +import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types'; type SetupServerReturn = Awaited>; const allowedTypes = ['index-pattern', 'search']; diff --git a/src/core/server/saved_objects/routes/integration_tests/find.test.ts b/src/core/server/integration_tests/saved_objects/routes/find.test.ts similarity index 98% rename from src/core/server/saved_objects/routes/integration_tests/find.test.ts rename to src/core/server/integration_tests/saved_objects/routes/find.test.ts index 8758666bc487d..41ec6c26041d4 100644 --- a/src/core/server/saved_objects/routes/integration_tests/find.test.ts +++ b/src/core/server/integration_tests/saved_objects/routes/find.test.ts @@ -9,13 +9,13 @@ import supertest from 'supertest'; import querystring from 'querystring'; -import { registerFindRoute } from '../find'; +import { registerFindRoute } from '../../../saved_objects/routes/find'; import { savedObjectsClientMock } from '../../../mocks'; import { CoreUsageStatsClient } from '../../../core_usage_data'; import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock'; import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock'; -import { setupServer } from '../test_utils'; -import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types'; +import { setupServer } from '../../../saved_objects/routes/test_utils'; +import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types'; type SetupServerReturn = Awaited>; diff --git a/src/core/server/saved_objects/routes/integration_tests/get.test.ts b/src/core/server/integration_tests/saved_objects/routes/get.test.ts similarity index 94% rename from src/core/server/saved_objects/routes/integration_tests/get.test.ts rename to src/core/server/integration_tests/saved_objects/routes/get.test.ts index 6f0cb25934ef5..264919a9d96b3 100644 --- a/src/core/server/saved_objects/routes/integration_tests/get.test.ts +++ b/src/core/server/integration_tests/saved_objects/routes/get.test.ts @@ -7,17 +7,17 @@ */ import supertest from 'supertest'; -import { registerGetRoute } from '../get'; +import { registerGetRoute } from '../../../saved_objects/routes/get'; import { ContextService } from '@kbn/core-http-context-server-internal'; import type { HttpService, InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; import { createHttpServer, createCoreContext } from '@kbn/core-http-server-mocks'; -import { savedObjectsClientMock } from '../../service/saved_objects_client.mock'; +import { savedObjectsClientMock } from '../../../saved_objects/service/saved_objects_client.mock'; import type { CoreUsageStatsClient } from '../../../core_usage_data'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock'; import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock'; import { contextServiceMock, coreMock } from '../../../mocks'; -import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types'; +import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types'; const coreId = Symbol('core'); diff --git a/src/core/server/saved_objects/routes/integration_tests/import.test.ts b/src/core/server/integration_tests/saved_objects/routes/import.test.ts similarity index 98% rename from src/core/server/saved_objects/routes/integration_tests/import.test.ts rename to src/core/server/integration_tests/saved_objects/routes/import.test.ts index 9e6e52977b2e1..a9062b8d07919 100644 --- a/src/core/server/saved_objects/routes/integration_tests/import.test.ts +++ b/src/core/server/integration_tests/saved_objects/routes/import.test.ts @@ -9,15 +9,15 @@ jest.mock('uuid'); import supertest from 'supertest'; -import { registerImportRoute } from '../import'; +import { registerImportRoute } from '../../../saved_objects/routes/import'; import { savedObjectsClientMock } from '../../../mocks'; import { CoreUsageStatsClient } from '../../../core_usage_data'; import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock'; import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock'; -import { SavedObjectConfig } from '../../saved_objects_config'; -import { setupServer, createExportableType } from '../test_utils'; -import { SavedObjectsErrorHelpers, SavedObjectsImporter } from '../..'; -import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types'; +import { SavedObjectConfig } from '../../../saved_objects/saved_objects_config'; +import { setupServer, createExportableType } from '../../../saved_objects/routes/test_utils'; +import { SavedObjectsErrorHelpers, SavedObjectsImporter } from '../../../saved_objects'; +import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types'; type SetupServerReturn = Awaited>; diff --git a/src/core/server/saved_objects/routes/legacy_import_export/integration_tests/export.test.ts b/src/core/server/integration_tests/saved_objects/routes/legacy_import_export/export.test.ts similarity index 90% rename from src/core/server/saved_objects/routes/legacy_import_export/integration_tests/export.test.ts rename to src/core/server/integration_tests/saved_objects/routes/legacy_import_export/export.test.ts index 7d0a8607fb6ed..22facc0f3235c 100644 --- a/src/core/server/saved_objects/routes/legacy_import_export/integration_tests/export.test.ts +++ b/src/core/server/integration_tests/saved_objects/routes/legacy_import_export/export.test.ts @@ -27,7 +27,7 @@ const exportObjects = [ }, ]; -jest.mock('../lib/export_dashboards', () => ({ +jest.mock('../../../../saved_objects/routes/legacy_import_export/lib/export_dashboards', () => ({ exportDashboards: jest.fn().mockResolvedValue({ version: 'mockversion', objects: exportObjects }), })); @@ -35,10 +35,10 @@ import supertest from 'supertest'; import { CoreUsageStatsClient } from '../../../../core_usage_data'; import { coreUsageStatsClientMock } from '../../../../core_usage_data/core_usage_stats_client.mock'; import { coreUsageDataServiceMock } from '../../../../core_usage_data/core_usage_data_service.mock'; -import { registerLegacyExportRoute } from '../export'; -import { setupServer } from '../../test_utils'; +import { registerLegacyExportRoute } from '../../../../saved_objects/routes/legacy_import_export/export'; +import { setupServer } from '../../../../saved_objects/routes/test_utils'; import { loggerMock } from '@kbn/logging-mocks'; -import type { InternalSavedObjectsRequestHandlerContext } from '../../../internal_types'; +import type { InternalSavedObjectsRequestHandlerContext } from '../../../../saved_objects/internal_types'; type SetupServerReturn = Awaited>; let coreUsageStatsClient: jest.Mocked; diff --git a/src/core/server/saved_objects/routes/legacy_import_export/integration_tests/import.test.ts b/src/core/server/integration_tests/saved_objects/routes/legacy_import_export/import.test.ts similarity index 89% rename from src/core/server/saved_objects/routes/legacy_import_export/integration_tests/import.test.ts rename to src/core/server/integration_tests/saved_objects/routes/legacy_import_export/import.test.ts index 37f82aa47ece5..d508d4c048bfb 100644 --- a/src/core/server/saved_objects/routes/legacy_import_export/integration_tests/import.test.ts +++ b/src/core/server/integration_tests/saved_objects/routes/legacy_import_export/import.test.ts @@ -27,7 +27,7 @@ const importObjects = [ }, ]; -jest.mock('../lib/import_dashboards', () => ({ +jest.mock('../../../../saved_objects/routes/legacy_import_export/lib/import_dashboards', () => ({ importDashboards: jest.fn().mockResolvedValue({ objects: importObjects }), })); @@ -35,10 +35,10 @@ import supertest from 'supertest'; import { CoreUsageStatsClient } from '../../../../core_usage_data'; import { coreUsageStatsClientMock } from '../../../../core_usage_data/core_usage_stats_client.mock'; import { coreUsageDataServiceMock } from '../../../../core_usage_data/core_usage_data_service.mock'; -import { registerLegacyImportRoute } from '../import'; -import { setupServer } from '../../test_utils'; +import { registerLegacyImportRoute } from '../../../../saved_objects/routes/legacy_import_export/import'; +import { setupServer } from '../../../../saved_objects/routes/test_utils'; import { loggerMock } from '@kbn/logging-mocks'; -import type { InternalSavedObjectsRequestHandlerContext } from '../../../internal_types'; +import type { InternalSavedObjectsRequestHandlerContext } from '../../../../saved_objects/internal_types'; type SetupServerReturn = Awaited>; let coreUsageStatsClient: jest.Mocked; diff --git a/src/core/server/saved_objects/routes/integration_tests/migrate.test.mocks.ts b/src/core/server/integration_tests/saved_objects/routes/migrate.test.mocks.ts similarity index 76% rename from src/core/server/saved_objects/routes/integration_tests/migrate.test.mocks.ts rename to src/core/server/integration_tests/saved_objects/routes/migrate.test.mocks.ts index b8b3a22c5d0fa..7f5f03ecfbc0c 100644 --- a/src/core/server/saved_objects/routes/integration_tests/migrate.test.mocks.ts +++ b/src/core/server/integration_tests/saved_objects/routes/migrate.test.mocks.ts @@ -6,10 +6,10 @@ * Side Public License, v 1. */ -import { mockKibanaMigrator } from '../../migrations/kibana_migrator.mock'; +import { mockKibanaMigrator } from '../../../saved_objects/migrations/kibana_migrator.mock'; export const migratorInstanceMock = mockKibanaMigrator.create(); export const KibanaMigratorMock = jest.fn().mockImplementation(() => migratorInstanceMock); -jest.doMock('../../migrations/kibana_migrator', () => ({ +jest.doMock('../../../saved_objects/migrations/kibana_migrator', () => ({ KibanaMigrator: KibanaMigratorMock, })); diff --git a/src/core/server/saved_objects/routes/integration_tests/migrate.test.ts b/src/core/server/integration_tests/saved_objects/routes/migrate.test.ts similarity index 100% rename from src/core/server/saved_objects/routes/integration_tests/migrate.test.ts rename to src/core/server/integration_tests/saved_objects/routes/migrate.test.ts diff --git a/src/core/server/saved_objects/routes/integration_tests/resolve.test.ts b/src/core/server/integration_tests/saved_objects/routes/resolve.test.ts similarity index 94% rename from src/core/server/saved_objects/routes/integration_tests/resolve.test.ts rename to src/core/server/integration_tests/saved_objects/routes/resolve.test.ts index 9ee1b0f1200e6..8ae3635a8b6ea 100644 --- a/src/core/server/saved_objects/routes/integration_tests/resolve.test.ts +++ b/src/core/server/integration_tests/saved_objects/routes/resolve.test.ts @@ -10,14 +10,14 @@ import supertest from 'supertest'; import { ContextService } from '@kbn/core-http-context-server-internal'; import type { HttpService, InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; import { createHttpServer, createCoreContext } from '@kbn/core-http-server-mocks'; -import { registerResolveRoute } from '../resolve'; -import { savedObjectsClientMock } from '../../service/saved_objects_client.mock'; +import { registerResolveRoute } from '../../../saved_objects/routes/resolve'; +import { savedObjectsClientMock } from '../../../saved_objects/service/saved_objects_client.mock'; import { CoreUsageStatsClient } from '../../../core_usage_data'; import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock'; import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; import { contextServiceMock, coreMock } from '../../../mocks'; -import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types'; +import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types'; const coreId = Symbol('core'); diff --git a/src/core/server/saved_objects/routes/integration_tests/resolve_import_errors.test.ts b/src/core/server/integration_tests/saved_objects/routes/resolve_import_errors.test.ts similarity index 97% rename from src/core/server/saved_objects/routes/integration_tests/resolve_import_errors.test.ts rename to src/core/server/integration_tests/saved_objects/routes/resolve_import_errors.test.ts index 101cf05032618..defdbc5cfc1d6 100644 --- a/src/core/server/saved_objects/routes/integration_tests/resolve_import_errors.test.ts +++ b/src/core/server/integration_tests/saved_objects/routes/resolve_import_errors.test.ts @@ -9,15 +9,15 @@ jest.mock('uuid'); import supertest from 'supertest'; -import { registerResolveImportErrorsRoute } from '../resolve_import_errors'; +import { registerResolveImportErrorsRoute } from '../../../saved_objects/routes/resolve_import_errors'; import { savedObjectsClientMock } from '../../../mocks'; import { CoreUsageStatsClient } from '../../../core_usage_data'; import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock'; import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock'; -import { setupServer, createExportableType } from '../test_utils'; -import { SavedObjectConfig } from '../../saved_objects_config'; -import { SavedObjectsImporter } from '../..'; -import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types'; +import { setupServer, createExportableType } from '../../../saved_objects/routes/test_utils'; +import { SavedObjectConfig } from '../../../saved_objects/saved_objects_config'; +import { SavedObjectsImporter } from '../../../saved_objects/import'; +import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types'; type SetupServerReturn = Awaited>; diff --git a/src/core/server/saved_objects/routes/integration_tests/update.test.ts b/src/core/server/integration_tests/saved_objects/routes/update.test.ts similarity index 94% rename from src/core/server/saved_objects/routes/integration_tests/update.test.ts rename to src/core/server/integration_tests/saved_objects/routes/update.test.ts index 1a41d94b0febe..d0b950093239f 100644 --- a/src/core/server/saved_objects/routes/integration_tests/update.test.ts +++ b/src/core/server/integration_tests/saved_objects/routes/update.test.ts @@ -7,13 +7,13 @@ */ import supertest from 'supertest'; -import { registerUpdateRoute } from '../update'; +import { registerUpdateRoute } from '../../../saved_objects/routes/update'; import { savedObjectsClientMock } from '../../../mocks'; import { CoreUsageStatsClient } from '../../../core_usage_data'; import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock'; import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock'; -import { setupServer } from '../test_utils'; -import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types'; +import { setupServer } from '../../../saved_objects/routes/test_utils'; +import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types'; type SetupServerReturn = Awaited>; diff --git a/src/core/server/saved_objects/service/lib/integration_tests/repository.test.ts b/src/core/server/integration_tests/saved_objects/service/lib/repository.test.ts similarity index 100% rename from src/core/server/saved_objects/service/lib/integration_tests/repository.test.ts rename to src/core/server/integration_tests/saved_objects/service/lib/repository.test.ts diff --git a/src/core/server/saved_objects/service/lib/integration_tests/repository_with_proxy.test.ts b/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy.test.ts similarity index 99% rename from src/core/server/saved_objects/service/lib/integration_tests/repository_with_proxy.test.ts rename to src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy.test.ts index 925b23a64f03e..b82cb54053482 100644 --- a/src/core/server/saved_objects/service/lib/integration_tests/repository_with_proxy.test.ts +++ b/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy.test.ts @@ -9,8 +9,8 @@ import Hapi from '@hapi/hapi'; import h2o2 from '@hapi/h2o2'; import { URL } from 'url'; -import { ISavedObjectsRepository } from '../repository'; -import { SavedObject } from '../../../types'; +import { ISavedObjectsRepository } from '../../../../saved_objects/service/lib/repository'; +import { SavedObject } from '../../../../saved_objects/types'; import { InternalCoreSetup, InternalCoreStart } from '../../../../internal_types'; import { Root } from '../../../../root'; import * as kbnTestServer from '../../../../../test_helpers/kbn_server'; diff --git a/src/core/server/saved_objects/service/lib/integration_tests/repository_with_proxy_utils.ts b/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy_utils.ts similarity index 100% rename from src/core/server/saved_objects/service/lib/integration_tests/repository_with_proxy_utils.ts rename to src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy_utils.ts diff --git a/src/core/server/saved_objects/validation/integration_tests/validator.test.ts b/src/core/server/integration_tests/saved_objects/validation/validator.test.ts similarity index 97% rename from src/core/server/saved_objects/validation/integration_tests/validator.test.ts rename to src/core/server/integration_tests/saved_objects/validation/validator.test.ts index 83d6b0f087804..44d882b0fe80b 100644 --- a/src/core/server/saved_objects/validation/integration_tests/validator.test.ts +++ b/src/core/server/integration_tests/saved_objects/validation/validator.test.ts @@ -12,8 +12,8 @@ import Util from 'util'; import { Env } from '@kbn/config'; import { schema } from '@kbn/config-schema'; import { REPO_ROOT } from '@kbn/utils'; -import { SavedObjectsType } from '../../types'; -import { ISavedObjectsRepository } from '../../service/lib'; +import { SavedObjectsType } from '../../../saved_objects/types'; +import { ISavedObjectsRepository } from '../../../saved_objects/service/lib'; import { getEnvOptions } from '@kbn/config-mocks'; import { InternalCoreSetup, InternalCoreStart } from '../../../internal_types'; import { Root } from '../../../root'; diff --git a/src/core/server/integration_tests/status/jest.integration.config.js b/src/core/server/integration_tests/status/jest.integration.config.js new file mode 100644 index 0000000000000..57f19325a6be4 --- /dev/null +++ b/src/core/server/integration_tests/status/jest.integration.config.js @@ -0,0 +1,19 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/server/integration_tests/status'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/status/routes/integration_tests/status.test.ts b/src/core/server/integration_tests/status/routes/status.test.ts similarity index 98% rename from src/core/server/status/routes/integration_tests/status.test.ts rename to src/core/server/integration_tests/status/routes/status.test.ts index 6034542fab932..12b185a61cf54 100644 --- a/src/core/server/status/routes/integration_tests/status.test.ts +++ b/src/core/server/integration_tests/status/routes/status.test.ts @@ -16,9 +16,9 @@ import type { HttpService, InternalHttpServiceSetup } from '@kbn/core-http-serve import { metricsServiceMock } from '../../../metrics/metrics_service.mock'; import type { MetricsServiceSetup } from '../../../metrics'; -import { registerStatusRoute } from '../status'; -import { ServiceStatus, ServiceStatusLevels, ServiceStatusLevel } from '../../types'; -import { statusServiceMock } from '../../status_service.mock'; +import { registerStatusRoute } from '../../../status/routes/status'; +import { ServiceStatus, ServiceStatusLevels, ServiceStatusLevel } from '../../../status/types'; +import { statusServiceMock } from '../../../status/status_service.mock'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; diff --git a/src/core/server/ui_settings/create_or_upgrade_saved_config/integration_tests/create_or_upgrade.test.ts b/src/core/server/integration_tests/ui_settings/create_or_upgrade.test.ts similarity index 96% rename from src/core/server/ui_settings/create_or_upgrade_saved_config/integration_tests/create_or_upgrade.test.ts rename to src/core/server/integration_tests/ui_settings/create_or_upgrade.test.ts index e94c696b4eca8..ec4d1025e9f69 100644 --- a/src/core/server/ui_settings/create_or_upgrade_saved_config/integration_tests/create_or_upgrade.test.ts +++ b/src/core/server/integration_tests/ui_settings/create_or_upgrade.test.ts @@ -6,15 +6,15 @@ * Side Public License, v 1. */ -import { SavedObjectsClientContract } from '../../..'; +import { SavedObjectsClientContract } from '../../saved_objects/types'; import { createTestServers, TestElasticsearchUtils, TestKibanaUtils, TestUtils, -} from '../../../../test_helpers/kbn_server'; -import { createOrUpgradeSavedConfig } from '../create_or_upgrade_saved_config'; +} from '../../../test_helpers/kbn_server'; +import { createOrUpgradeSavedConfig } from '../../ui_settings/create_or_upgrade_saved_config'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { httpServerMock } from '@kbn/core-http-server-mocks'; diff --git a/src/core/server/ui_settings/integration_tests/doc_exists.ts b/src/core/server/integration_tests/ui_settings/doc_exists.ts similarity index 100% rename from src/core/server/ui_settings/integration_tests/doc_exists.ts rename to src/core/server/integration_tests/ui_settings/doc_exists.ts diff --git a/src/core/server/ui_settings/integration_tests/doc_missing.ts b/src/core/server/integration_tests/ui_settings/doc_missing.ts similarity index 100% rename from src/core/server/ui_settings/integration_tests/doc_missing.ts rename to src/core/server/integration_tests/ui_settings/doc_missing.ts diff --git a/src/core/server/ui_settings/integration_tests/index.test.ts b/src/core/server/integration_tests/ui_settings/index.test.ts similarity index 100% rename from src/core/server/ui_settings/integration_tests/index.test.ts rename to src/core/server/integration_tests/ui_settings/index.test.ts diff --git a/src/core/server/integration_tests/ui_settings/jest.integration.config.js b/src/core/server/integration_tests/ui_settings/jest.integration.config.js new file mode 100644 index 0000000000000..aa41cd5a6b7b3 --- /dev/null +++ b/src/core/server/integration_tests/ui_settings/jest.integration.config.js @@ -0,0 +1,19 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/server/integration_tests/ui_settings'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/ui_settings/integration_tests/lib/chance.ts b/src/core/server/integration_tests/ui_settings/lib/chance.ts similarity index 100% rename from src/core/server/ui_settings/integration_tests/lib/chance.ts rename to src/core/server/integration_tests/ui_settings/lib/chance.ts diff --git a/src/core/server/ui_settings/integration_tests/lib/index.ts b/src/core/server/integration_tests/ui_settings/lib/index.ts similarity index 100% rename from src/core/server/ui_settings/integration_tests/lib/index.ts rename to src/core/server/integration_tests/ui_settings/lib/index.ts diff --git a/src/core/server/ui_settings/integration_tests/lib/servers.ts b/src/core/server/integration_tests/ui_settings/lib/servers.ts similarity index 100% rename from src/core/server/ui_settings/integration_tests/lib/servers.ts rename to src/core/server/integration_tests/ui_settings/lib/servers.ts diff --git a/src/core/server/ui_settings/integration_tests/routes.test.ts b/src/core/server/integration_tests/ui_settings/routes.test.ts similarity index 100% rename from src/core/server/ui_settings/integration_tests/routes.test.ts rename to src/core/server/integration_tests/ui_settings/routes.test.ts diff --git a/src/core/server/ui_settings/integration_tests/so_migrations.test.ts b/src/core/server/integration_tests/ui_settings/so_migrations.test.ts similarity index 100% rename from src/core/server/ui_settings/integration_tests/so_migrations.test.ts rename to src/core/server/integration_tests/ui_settings/so_migrations.test.ts diff --git a/src/core/server/internal_types.ts b/src/core/server/internal_types.ts index ca02ad45eacf4..4338d55e7ac3d 100644 --- a/src/core/server/internal_types.ts +++ b/src/core/server/internal_types.ts @@ -31,12 +31,12 @@ import type { InternalHttpServiceSetup, InternalHttpServiceStart, } from '@kbn/core-http-server-internal'; -import { CapabilitiesSetup, CapabilitiesStart } from './capabilities'; -import { +import type { InternalElasticsearchServicePreboot, InternalElasticsearchServiceSetup, InternalElasticsearchServiceStart, -} from './elasticsearch'; +} from '@kbn/core-elasticsearch-server-internal'; +import { CapabilitiesSetup, CapabilitiesStart } from './capabilities'; import { InternalSavedObjectsServiceSetup, InternalSavedObjectsServiceStart, diff --git a/src/core/server/mocks.ts b/src/core/server/mocks.ts index 9e693ac7600e8..c13051932f2d6 100644 --- a/src/core/server/mocks.ts +++ b/src/core/server/mocks.ts @@ -20,6 +20,7 @@ import { executionContextServiceMock } from '@kbn/core-execution-context-server- import { prebootServiceMock } from '@kbn/core-preboot-server-mocks'; import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; import { httpServiceMock } from '@kbn/core-http-server-mocks'; +import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; import type { PluginInitializerContext, CoreSetup, @@ -28,7 +29,6 @@ import type { CorePreboot, RequestHandlerContext, } from '.'; -import { elasticsearchServiceMock } from './elasticsearch/elasticsearch_service.mock'; import { httpResourcesMock } from './http_resources/http_resources_service.mock'; import { savedObjectsServiceMock } from './saved_objects/saved_objects_service.mock'; import { savedObjectsClientMock } from './saved_objects/service/saved_objects_client.mock'; @@ -46,8 +46,8 @@ import { deprecationsServiceMock } from './deprecations/deprecations_service.moc export { configServiceMock, configDeprecationsMock } from '@kbn/config-mocks'; export { loggingSystemMock } from '@kbn/core-logging-server-mocks'; export { httpServerMock, sessionStorageMock, httpServiceMock } from '@kbn/core-http-server-mocks'; +export { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; export { httpResourcesMock } from './http_resources/http_resources_service.mock'; -export { elasticsearchServiceMock } from './elasticsearch/elasticsearch_service.mock'; export { savedObjectsRepositoryMock } from './saved_objects/service/lib/repository.mock'; export { savedObjectsServiceMock } from './saved_objects/saved_objects_service.mock'; export { savedObjectsClientMock } from './saved_objects/service/saved_objects_client.mock'; @@ -70,7 +70,7 @@ export type { ElasticsearchClientMock, ClusterClientMock, ScopedClusterClientMock, -} from './elasticsearch/client/mocks'; +} from '@kbn/core-elasticsearch-client-server-mocks'; type MockedPluginInitializerConfig = jest.Mocked['config']>; diff --git a/src/core/server/plugins/legacy_config.ts b/src/core/server/plugins/legacy_config.ts index 9dc4afc37515a..4bee00d615748 100644 --- a/src/core/server/plugins/legacy_config.ts +++ b/src/core/server/plugins/legacy_config.ts @@ -12,11 +12,11 @@ import { PathConfigType, config as pathConfig } from '@kbn/utils'; import { pick, deepFreeze } from '@kbn/std'; import { IConfigService } from '@kbn/config'; -import { SharedGlobalConfig, SharedGlobalConfigKeys } from './types'; import { ElasticsearchConfigType, config as elasticsearchConfig, -} from '../elasticsearch/elasticsearch_config'; +} from '@kbn/core-elasticsearch-server-internal'; +import { SharedGlobalConfig, SharedGlobalConfigKeys } from './types'; import { SavedObjectsConfigType, savedObjectsConfig } from '../saved_objects/saved_objects_config'; const createGlobalConfig = ({ diff --git a/src/core/server/plugins/types.ts b/src/core/server/plugins/types.ts index 98c5b6cb60497..a07eff177108e 100644 --- a/src/core/server/plugins/types.ts +++ b/src/core/server/plugins/types.ts @@ -19,8 +19,8 @@ import type { } from '@kbn/config'; import type { PluginName, PluginOpaqueId, PluginType } from '@kbn/core-base-common'; import type { NodeInfo } from '@kbn/core-node-server'; +import type { ElasticsearchConfigType } from '@kbn/core-elasticsearch-server-internal'; -import { ElasticsearchConfigType } from '../elasticsearch/elasticsearch_config'; import { SavedObjectsConfigType } from '../saved_objects/saved_objects_config'; import { CorePreboot, CoreSetup, CoreStart } from '..'; diff --git a/src/core/server/rendering/__mocks__/params.ts b/src/core/server/rendering/__mocks__/params.ts index 47c5612555e48..71b4996590c64 100644 --- a/src/core/server/rendering/__mocks__/params.ts +++ b/src/core/server/rendering/__mocks__/params.ts @@ -8,7 +8,7 @@ import { mockCoreContext } from '@kbn/core-base-server-mocks'; import { httpServiceMock } from '@kbn/core-http-server-mocks'; -import { elasticsearchServiceMock } from '../../elasticsearch/elasticsearch_service.mock'; +import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; import { pluginServiceMock } from '../../plugins/plugins_service.mock'; import { statusServiceMock } from '../../status/status_service.mock'; diff --git a/src/core/server/rendering/__snapshots__/rendering_service.test.ts.snap b/src/core/server/rendering/__snapshots__/rendering_service.test.ts.snap index 9fe0cb545e7aa..fd4c332daadad 100644 --- a/src/core/server/rendering/__snapshots__/rendering_service.test.ts.snap +++ b/src/core/server/rendering/__snapshots__/rendering_service.test.ts.snap @@ -347,9 +347,9 @@ Object { "branch": Any, "buildNumber": Any, "clusterInfo": Object { - "cluster_name": "cluster-name", - "cluster_uuid": "cluster-uuid", - "cluster_version": "8.0.0", + "clusterName": "cluster-name", + "clusterUuid": "cluster-uuid", + "clusterVersion": "8.0.0", }, "csp": Object { "warnLegacyBrowsers": true, @@ -411,9 +411,9 @@ Object { "branch": Any, "buildNumber": Any, "clusterInfo": Object { - "cluster_name": "cluster-name", - "cluster_uuid": "cluster-uuid", - "cluster_version": "8.0.0", + "clusterName": "cluster-name", + "clusterUuid": "cluster-uuid", + "clusterVersion": "8.0.0", }, "csp": Object { "warnLegacyBrowsers": true, @@ -527,9 +527,9 @@ Object { "branch": Any, "buildNumber": Any, "clusterInfo": Object { - "cluster_name": "cluster-name", - "cluster_uuid": "cluster-uuid", - "cluster_version": "8.0.0", + "clusterName": "cluster-name", + "clusterUuid": "cluster-uuid", + "clusterVersion": "8.0.0", }, "csp": Object { "warnLegacyBrowsers": true, diff --git a/src/core/server/rendering/types.ts b/src/core/server/rendering/types.ts index d6c660f3b5ec1..0c5382627e9b6 100644 --- a/src/core/server/rendering/types.ts +++ b/src/core/server/rendering/types.ts @@ -14,7 +14,7 @@ import type { InternalHttpServicePreboot, InternalHttpServiceSetup, } from '@kbn/core-http-server-internal'; -import { InternalElasticsearchServiceSetup } from '../elasticsearch'; +import type { InternalElasticsearchServiceSetup } from '@kbn/core-elasticsearch-server-internal'; import { UiPlugins } from '../plugins'; import { IUiSettingsClient } from '../ui_settings'; import type { InternalStatusServiceSetup } from '../status'; diff --git a/src/core/server/saved_objects/deprecations/unknown_object_types.test.ts b/src/core/server/saved_objects/deprecations/unknown_object_types.test.ts index 84a8d94f8bf2c..51f228f46438b 100644 --- a/src/core/server/saved_objects/deprecations/unknown_object_types.test.ts +++ b/src/core/server/saved_objects/deprecations/unknown_object_types.test.ts @@ -10,7 +10,7 @@ import { getIndexForTypeMock } from './unknown_object_types.test.mocks'; import { deleteUnknownTypeObjects, getUnknownTypesDeprecations } from './unknown_object_types'; import { typeRegistryMock } from '../saved_objects_type_registry.mock'; -import { elasticsearchClientMock } from '../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { SavedObjectsType } from '../..'; import { createAggregateTypesSearchResponse } from '../migrations/actions/check_for_unknown_docs.mocks'; diff --git a/src/core/server/saved_objects/deprecations/unknown_object_types.ts b/src/core/server/saved_objects/deprecations/unknown_object_types.ts index d8762ebcfd1bd..ba2b593dff9e5 100644 --- a/src/core/server/saved_objects/deprecations/unknown_object_types.ts +++ b/src/core/server/saved_objects/deprecations/unknown_object_types.ts @@ -8,7 +8,7 @@ import { i18n } from '@kbn/i18n'; import type { DeprecationsDetails } from '@kbn/core-deprecations-common'; -import { IScopedClusterClient } from '../../elasticsearch'; +import type { IScopedClusterClient } from '@kbn/core-elasticsearch-server'; import { getAggregatedTypesDocuments } from '../migrations/actions/check_for_unknown_docs'; import { addExcludedTypesToBoolQuery } from '../migrations/model/helpers'; import { ISavedObjectTypeRegistry } from '../saved_objects_type_registry'; diff --git a/src/core/server/saved_objects/internal_types.ts b/src/core/server/saved_objects/internal_types.ts index 4f8dc1f520e71..9235f700f25ec 100644 --- a/src/core/server/saved_objects/internal_types.ts +++ b/src/core/server/saved_objects/internal_types.ts @@ -7,7 +7,7 @@ */ import type { IRouter, RequestHandlerContextBase } from '@kbn/core-http-server'; -import type { ElasticsearchRequestHandlerContext } from '../elasticsearch'; +import type { ElasticsearchRequestHandlerContext } from '@kbn/core-elasticsearch-server'; import type { SavedObjectsRequestHandlerContext } from './saved_objects_route_handler_context'; /** diff --git a/src/core/server/saved_objects/migrations/actions/bulk_overwrite_transformed_documents.test.ts b/src/core/server/saved_objects/migrations/actions/bulk_overwrite_transformed_documents.test.ts index 7f2cfa01ec42f..06b5dd762cffc 100644 --- a/src/core/server/saved_objects/migrations/actions/bulk_overwrite_transformed_documents.test.ts +++ b/src/core/server/saved_objects/migrations/actions/bulk_overwrite_transformed_documents.test.ts @@ -8,7 +8,7 @@ import * as Either from 'fp-ts/Either'; import { errors as EsErrors } from '@elastic/elasticsearch'; -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; import { bulkOverwriteTransformedDocuments } from './bulk_overwrite_transformed_documents'; diff --git a/src/core/server/saved_objects/migrations/actions/bulk_overwrite_transformed_documents.ts b/src/core/server/saved_objects/migrations/actions/bulk_overwrite_transformed_documents.ts index 8318bd8f7a69b..2948c56166133 100644 --- a/src/core/server/saved_objects/migrations/actions/bulk_overwrite_transformed_documents.ts +++ b/src/core/server/saved_objects/migrations/actions/bulk_overwrite_transformed_documents.ts @@ -10,7 +10,7 @@ import * as Either from 'fp-ts/lib/Either'; import * as TaskEither from 'fp-ts/lib/TaskEither'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { errors as esErrors } from '@elastic/elasticsearch'; -import { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import type { SavedObjectsRawDoc } from '../../serialization'; import { catchRetryableEsClientErrors, diff --git a/src/core/server/saved_objects/migrations/actions/calculate_exclude_filters.test.ts b/src/core/server/saved_objects/migrations/actions/calculate_exclude_filters.test.ts index 68bd6c934a80f..95a9a33831d09 100644 --- a/src/core/server/saved_objects/migrations/actions/calculate_exclude_filters.test.ts +++ b/src/core/server/saved_objects/migrations/actions/calculate_exclude_filters.test.ts @@ -8,7 +8,7 @@ import * as Either from 'fp-ts/lib/Either'; import { errors as esErrors } from '@elastic/elasticsearch'; -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { calculateExcludeFilters } from './calculate_exclude_filters'; describe('calculateExcludeFilters', () => { diff --git a/src/core/server/saved_objects/migrations/actions/calculate_exclude_filters.ts b/src/core/server/saved_objects/migrations/actions/calculate_exclude_filters.ts index a2cea776792ad..ecf29aa25f9f4 100644 --- a/src/core/server/saved_objects/migrations/actions/calculate_exclude_filters.ts +++ b/src/core/server/saved_objects/migrations/actions/calculate_exclude_filters.ts @@ -10,8 +10,8 @@ import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/type import { withTimeout } from '@kbn/std'; import * as Either from 'fp-ts/lib/Either'; import * as TaskEither from 'fp-ts/lib/TaskEither'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import type { RetryableEsClientError } from '.'; -import type { ElasticsearchClient } from '../../../elasticsearch'; import type { SavedObjectTypeExcludeFromUpgradeFilterHook } from '../../types'; import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; diff --git a/src/core/server/saved_objects/migrations/actions/catch_retryable_es_client_errors.test.ts b/src/core/server/saved_objects/migrations/actions/catch_retryable_es_client_errors.test.ts index 175631945d52f..989e50af73683 100644 --- a/src/core/server/saved_objects/migrations/actions/catch_retryable_es_client_errors.test.ts +++ b/src/core/server/saved_objects/migrations/actions/catch_retryable_es_client_errors.test.ts @@ -7,7 +7,7 @@ */ import { errors as esErrors } from '@elastic/elasticsearch'; -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; describe('catchRetryableEsClientErrors', () => { diff --git a/src/core/server/saved_objects/migrations/actions/check_for_unknown_docs.test.ts b/src/core/server/saved_objects/migrations/actions/check_for_unknown_docs.test.ts index d5c99f01ada33..465d4c8aa7ee8 100644 --- a/src/core/server/saved_objects/migrations/actions/check_for_unknown_docs.test.ts +++ b/src/core/server/saved_objects/migrations/actions/check_for_unknown_docs.test.ts @@ -10,7 +10,7 @@ import * as Either from 'fp-ts/lib/Either'; import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; import { errors as EsErrors } from '@elastic/elasticsearch'; import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { checkForUnknownDocs } from './check_for_unknown_docs'; import { createAggregateTypesSearchResponse } from './check_for_unknown_docs.mocks'; diff --git a/src/core/server/saved_objects/migrations/actions/check_for_unknown_docs.ts b/src/core/server/saved_objects/migrations/actions/check_for_unknown_docs.ts index b475f47e3d7f2..a7027c65d011e 100644 --- a/src/core/server/saved_objects/migrations/actions/check_for_unknown_docs.ts +++ b/src/core/server/saved_objects/migrations/actions/check_for_unknown_docs.ts @@ -15,8 +15,8 @@ import type { QueryDslQueryContainer, SearchRequest, } from '@elastic/elasticsearch/lib/api/types'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import type { SavedObjectsRawDocSource } from '../../serialization'; -import type { ElasticsearchClient } from '../../../elasticsearch'; import { catchRetryableEsClientErrors, type RetryableEsClientError, diff --git a/src/core/server/saved_objects/migrations/actions/clone_index.test.ts b/src/core/server/saved_objects/migrations/actions/clone_index.test.ts index 84b4b00bc7e7f..49e20d7fc7b39 100644 --- a/src/core/server/saved_objects/migrations/actions/clone_index.test.ts +++ b/src/core/server/saved_objects/migrations/actions/clone_index.test.ts @@ -9,8 +9,9 @@ import { errors as EsErrors } from '@elastic/elasticsearch'; import { cloneIndex } from './clone_index'; import { setWriteBlock } from './set_write_block'; -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; + jest.mock('./catch_retryable_es_client_errors'); describe('cloneIndex', () => { diff --git a/src/core/server/saved_objects/migrations/actions/clone_index.ts b/src/core/server/saved_objects/migrations/actions/clone_index.ts index c64b715468c28..8b0bce96989f2 100644 --- a/src/core/server/saved_objects/migrations/actions/clone_index.ts +++ b/src/core/server/saved_objects/migrations/actions/clone_index.ts @@ -10,7 +10,7 @@ import * as Either from 'fp-ts/lib/Either'; import * as TaskEither from 'fp-ts/lib/TaskEither'; import { errors as EsErrors } from '@elastic/elasticsearch'; import { pipe } from 'fp-ts/lib/pipeable'; -import { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { catchRetryableEsClientErrors, RetryableEsClientError, @@ -25,6 +25,7 @@ import { } from './constants'; import { isClusterShardLimitExceeded } from './es_errors'; import { ClusterShardLimitExceeded } from './create_index'; + export type CloneIndexResponse = AcknowledgeResponse; /** @internal */ diff --git a/src/core/server/saved_objects/migrations/actions/close_pit.test.ts b/src/core/server/saved_objects/migrations/actions/close_pit.test.ts index 5d9696239a61e..d2e4a9439e326 100644 --- a/src/core/server/saved_objects/migrations/actions/close_pit.test.ts +++ b/src/core/server/saved_objects/migrations/actions/close_pit.test.ts @@ -6,11 +6,12 @@ * Side Public License, v 1. */ import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; -jest.mock('./catch_retryable_es_client_errors'); import { errors as EsErrors } from '@elastic/elasticsearch'; -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { closePit } from './close_pit'; +jest.mock('./catch_retryable_es_client_errors'); + describe('closePit', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/src/core/server/saved_objects/migrations/actions/close_pit.ts b/src/core/server/saved_objects/migrations/actions/close_pit.ts index cb340068560d4..a3ea50edccae6 100644 --- a/src/core/server/saved_objects/migrations/actions/close_pit.ts +++ b/src/core/server/saved_objects/migrations/actions/close_pit.ts @@ -8,7 +8,7 @@ import * as Either from 'fp-ts/lib/Either'; import * as TaskEither from 'fp-ts/lib/TaskEither'; -import { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { catchRetryableEsClientErrors, RetryableEsClientError, diff --git a/src/core/server/saved_objects/migrations/actions/create_index.test.ts b/src/core/server/saved_objects/migrations/actions/create_index.test.ts index d5d906898943c..47ea28ca2953d 100644 --- a/src/core/server/saved_objects/migrations/actions/create_index.test.ts +++ b/src/core/server/saved_objects/migrations/actions/create_index.test.ts @@ -8,11 +8,12 @@ import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; import { errors as EsErrors } from '@elastic/elasticsearch'; -jest.mock('./catch_retryable_es_client_errors'); -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { createIndex } from './create_index'; import { setWriteBlock } from './set_write_block'; +jest.mock('./catch_retryable_es_client_errors'); + describe('createIndex', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/src/core/server/saved_objects/migrations/actions/create_index.ts b/src/core/server/saved_objects/migrations/actions/create_index.ts index 3766a470984f5..3436845f82382 100644 --- a/src/core/server/saved_objects/migrations/actions/create_index.ts +++ b/src/core/server/saved_objects/migrations/actions/create_index.ts @@ -10,8 +10,8 @@ import * as Either from 'fp-ts/lib/Either'; import * as TaskEither from 'fp-ts/lib/TaskEither'; import { pipe } from 'fp-ts/lib/pipeable'; import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { AcknowledgeResponse } from '.'; -import { ElasticsearchClient } from '../../../elasticsearch'; import { IndexMapping } from '../../mappings'; import { catchRetryableEsClientErrors, diff --git a/src/core/server/saved_objects/migrations/actions/fetch_indices.test.ts b/src/core/server/saved_objects/migrations/actions/fetch_indices.test.ts index ea53c8f4cfa54..b0839c10a8a92 100644 --- a/src/core/server/saved_objects/migrations/actions/fetch_indices.test.ts +++ b/src/core/server/saved_objects/migrations/actions/fetch_indices.test.ts @@ -8,6 +8,9 @@ import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; import { errors as EsErrors } from '@elastic/elasticsearch'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; +import { fetchIndices } from './fetch_indices'; + // Create a mock powered by the actual implementation jest.mock('./catch_retryable_es_client_errors', () => ({ catchRetryableEsClientErrors: jest @@ -17,9 +20,6 @@ jest.mock('./catch_retryable_es_client_errors', () => ({ ), })); -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; -import { fetchIndices } from './fetch_indices'; - describe('fetchIndices', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/src/core/server/saved_objects/migrations/actions/fetch_indices.ts b/src/core/server/saved_objects/migrations/actions/fetch_indices.ts index 8141670a7dbe6..a88d610a90221 100644 --- a/src/core/server/saved_objects/migrations/actions/fetch_indices.ts +++ b/src/core/server/saved_objects/migrations/actions/fetch_indices.ts @@ -7,12 +7,13 @@ */ import * as TaskEither from 'fp-ts/lib/TaskEither'; import * as Either from 'fp-ts/lib/Either'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { IndexMapping } from '../../mappings'; -import { ElasticsearchClient } from '../../../elasticsearch'; import { catchRetryableEsClientErrors, RetryableEsClientError, } from './catch_retryable_es_client_errors'; + export type FetchIndexResponse = Record< string, { aliases: Record; mappings: IndexMapping; settings: unknown } diff --git a/src/core/server/saved_objects/migrations/actions/initialize_action.test.ts b/src/core/server/saved_objects/migrations/actions/initialize_action.test.ts index 5d831a5bb8f78..ebcca7e1bb787 100644 --- a/src/core/server/saved_objects/migrations/actions/initialize_action.test.ts +++ b/src/core/server/saved_objects/migrations/actions/initialize_action.test.ts @@ -9,10 +9,11 @@ import * as Either from 'fp-ts/lib/Either'; import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; import { errors as EsErrors } from '@elastic/elasticsearch'; -jest.mock('./catch_retryable_es_client_errors'); -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { initAction } from './initialize_action'; +jest.mock('./catch_retryable_es_client_errors'); + describe('initAction', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/src/core/server/saved_objects/migrations/actions/initialize_action.ts b/src/core/server/saved_objects/migrations/actions/initialize_action.ts index b797d81a46ec3..a1b5e01360018 100644 --- a/src/core/server/saved_objects/migrations/actions/initialize_action.ts +++ b/src/core/server/saved_objects/migrations/actions/initialize_action.ts @@ -9,7 +9,7 @@ import * as TaskEither from 'fp-ts/lib/TaskEither'; import * as Either from 'fp-ts/lib/Either'; import { pipe } from 'fp-ts/lib/pipeable'; -import { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { catchRetryableEsClientErrors, RetryableEsClientError, diff --git a/src/core/server/saved_objects/migrations/actions/open_pit.test.ts b/src/core/server/saved_objects/migrations/actions/open_pit.test.ts index c8fc29d06f42f..5a6d00a1482d9 100644 --- a/src/core/server/saved_objects/migrations/actions/open_pit.test.ts +++ b/src/core/server/saved_objects/migrations/actions/open_pit.test.ts @@ -8,10 +8,11 @@ import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; import { errors as EsErrors } from '@elastic/elasticsearch'; -jest.mock('./catch_retryable_es_client_errors'); -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { openPit } from './open_pit'; +jest.mock('./catch_retryable_es_client_errors'); + describe('openPit', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/src/core/server/saved_objects/migrations/actions/open_pit.ts b/src/core/server/saved_objects/migrations/actions/open_pit.ts index 7e1f3a77f2d1e..c17b42d13a8c4 100644 --- a/src/core/server/saved_objects/migrations/actions/open_pit.ts +++ b/src/core/server/saved_objects/migrations/actions/open_pit.ts @@ -8,11 +8,12 @@ import * as Either from 'fp-ts/lib/Either'; import * as TaskEither from 'fp-ts/lib/TaskEither'; -import { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { catchRetryableEsClientErrors, RetryableEsClientError, } from './catch_retryable_es_client_errors'; + /** @internal */ export interface OpenPitResponse { pitId: string; diff --git a/src/core/server/saved_objects/migrations/actions/pickup_updated_mappings.test.ts b/src/core/server/saved_objects/migrations/actions/pickup_updated_mappings.test.ts index e319d4149dd1a..41253ebcd1ed2 100644 --- a/src/core/server/saved_objects/migrations/actions/pickup_updated_mappings.test.ts +++ b/src/core/server/saved_objects/migrations/actions/pickup_updated_mappings.test.ts @@ -7,10 +7,11 @@ */ import { errors as EsErrors } from '@elastic/elasticsearch'; import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; -jest.mock('./catch_retryable_es_client_errors'); -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { pickupUpdatedMappings } from './pickup_updated_mappings'; +jest.mock('./catch_retryable_es_client_errors'); + describe('pickupUpdatedMappings', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/src/core/server/saved_objects/migrations/actions/pickup_updated_mappings.ts b/src/core/server/saved_objects/migrations/actions/pickup_updated_mappings.ts index c1e1111a4afe3..9cb37facc0b5a 100644 --- a/src/core/server/saved_objects/migrations/actions/pickup_updated_mappings.ts +++ b/src/core/server/saved_objects/migrations/actions/pickup_updated_mappings.ts @@ -8,7 +8,7 @@ import * as Either from 'fp-ts/lib/Either'; import * as TaskEither from 'fp-ts/lib/TaskEither'; -import { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { catchRetryableEsClientErrors, RetryableEsClientError, diff --git a/src/core/server/saved_objects/migrations/actions/read_with_pit.test.ts b/src/core/server/saved_objects/migrations/actions/read_with_pit.test.ts index 3aca162218950..d2f7a3ab3c3d7 100644 --- a/src/core/server/saved_objects/migrations/actions/read_with_pit.test.ts +++ b/src/core/server/saved_objects/migrations/actions/read_with_pit.test.ts @@ -8,10 +8,11 @@ import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; import { errors as EsErrors } from '@elastic/elasticsearch'; -jest.mock('./catch_retryable_es_client_errors'); -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { readWithPit } from './read_with_pit'; +jest.mock('./catch_retryable_es_client_errors'); + describe('readWithPit', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/src/core/server/saved_objects/migrations/actions/read_with_pit.ts b/src/core/server/saved_objects/migrations/actions/read_with_pit.ts index 9ba54d58d37a8..10d5ff6bfff88 100644 --- a/src/core/server/saved_objects/migrations/actions/read_with_pit.ts +++ b/src/core/server/saved_objects/migrations/actions/read_with_pit.ts @@ -9,7 +9,7 @@ import * as Either from 'fp-ts/lib/Either'; import * as TaskEither from 'fp-ts/lib/TaskEither'; import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import type { SavedObjectsRawDoc } from '../../serialization'; import { catchRetryableEsClientErrors, diff --git a/src/core/server/saved_objects/migrations/actions/refresh_index.test.ts b/src/core/server/saved_objects/migrations/actions/refresh_index.test.ts index 0ebdb2b2b1851..1de2a0142032d 100644 --- a/src/core/server/saved_objects/migrations/actions/refresh_index.test.ts +++ b/src/core/server/saved_objects/migrations/actions/refresh_index.test.ts @@ -8,10 +8,11 @@ import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; import { errors as EsErrors } from '@elastic/elasticsearch'; -jest.mock('./catch_retryable_es_client_errors'); -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { refreshIndex } from './refresh_index'; +jest.mock('./catch_retryable_es_client_errors'); + describe('refreshIndex', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/src/core/server/saved_objects/migrations/actions/refresh_index.ts b/src/core/server/saved_objects/migrations/actions/refresh_index.ts index 371247789af24..7eb5c5d560d4c 100644 --- a/src/core/server/saved_objects/migrations/actions/refresh_index.ts +++ b/src/core/server/saved_objects/migrations/actions/refresh_index.ts @@ -7,7 +7,7 @@ */ import * as Either from 'fp-ts/lib/Either'; import * as TaskEither from 'fp-ts/lib/TaskEither'; -import { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { catchRetryableEsClientErrors, diff --git a/src/core/server/saved_objects/migrations/actions/reindex.test.ts b/src/core/server/saved_objects/migrations/actions/reindex.test.ts index 3352e4eebadca..969150a21cfcd 100644 --- a/src/core/server/saved_objects/migrations/actions/reindex.test.ts +++ b/src/core/server/saved_objects/migrations/actions/reindex.test.ts @@ -8,10 +8,11 @@ import * as Option from 'fp-ts/lib/Option'; import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; import { errors as EsErrors } from '@elastic/elasticsearch'; -jest.mock('./catch_retryable_es_client_errors'); -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { reindex } from './reindex'; +jest.mock('./catch_retryable_es_client_errors'); + describe('reindex', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/src/core/server/saved_objects/migrations/actions/reindex.ts b/src/core/server/saved_objects/migrations/actions/reindex.ts index 46f20928e1bef..594822f724760 100644 --- a/src/core/server/saved_objects/migrations/actions/reindex.ts +++ b/src/core/server/saved_objects/migrations/actions/reindex.ts @@ -10,7 +10,7 @@ import * as Either from 'fp-ts/lib/Either'; import * as TaskEither from 'fp-ts/lib/TaskEither'; import * as Option from 'fp-ts/lib/Option'; import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; -import type { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { catchRetryableEsClientErrors, type RetryableEsClientError, diff --git a/src/core/server/saved_objects/migrations/actions/remove_write_block.test.ts b/src/core/server/saved_objects/migrations/actions/remove_write_block.test.ts index 497211cb693ab..d8caaaca5eac6 100644 --- a/src/core/server/saved_objects/migrations/actions/remove_write_block.test.ts +++ b/src/core/server/saved_objects/migrations/actions/remove_write_block.test.ts @@ -7,9 +7,10 @@ */ import { removeWriteBlock } from './remove_write_block'; -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; import { errors as EsErrors } from '@elastic/elasticsearch'; + jest.mock('./catch_retryable_es_client_errors'); describe('removeWriteBlock', () => { diff --git a/src/core/server/saved_objects/migrations/actions/remove_write_block.ts b/src/core/server/saved_objects/migrations/actions/remove_write_block.ts index 47a3ecf7a4404..e5c64c8385e91 100644 --- a/src/core/server/saved_objects/migrations/actions/remove_write_block.ts +++ b/src/core/server/saved_objects/migrations/actions/remove_write_block.ts @@ -8,7 +8,7 @@ import * as Either from 'fp-ts/lib/Either'; import * as TaskEither from 'fp-ts/lib/TaskEither'; -import { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { catchRetryableEsClientErrors, RetryableEsClientError, diff --git a/src/core/server/saved_objects/migrations/actions/search_for_outdated_documents.test.ts b/src/core/server/saved_objects/migrations/actions/search_for_outdated_documents.test.ts index ab133e9a564be..9af32139bb78e 100644 --- a/src/core/server/saved_objects/migrations/actions/search_for_outdated_documents.test.ts +++ b/src/core/server/saved_objects/migrations/actions/search_for_outdated_documents.test.ts @@ -8,10 +8,11 @@ import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; import { errors as EsErrors } from '@elastic/elasticsearch'; -jest.mock('./catch_retryable_es_client_errors'); -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { searchForOutdatedDocuments } from './search_for_outdated_documents'; +jest.mock('./catch_retryable_es_client_errors'); + describe('searchForOutdatedDocuments', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/src/core/server/saved_objects/migrations/actions/search_for_outdated_documents.ts b/src/core/server/saved_objects/migrations/actions/search_for_outdated_documents.ts index bc6b6e5c29d46..fefc73c588fee 100644 --- a/src/core/server/saved_objects/migrations/actions/search_for_outdated_documents.ts +++ b/src/core/server/saved_objects/migrations/actions/search_for_outdated_documents.ts @@ -9,7 +9,7 @@ import * as Either from 'fp-ts/lib/Either'; import * as TaskEither from 'fp-ts/lib/TaskEither'; import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import type { SavedObjectsRawDoc, SavedObjectsRawDocSource } from '../../serialization'; import { catchRetryableEsClientErrors, diff --git a/src/core/server/saved_objects/migrations/actions/set_write_block.test.ts b/src/core/server/saved_objects/migrations/actions/set_write_block.test.ts index cf7b3091f38ff..7da18cb411453 100644 --- a/src/core/server/saved_objects/migrations/actions/set_write_block.test.ts +++ b/src/core/server/saved_objects/migrations/actions/set_write_block.test.ts @@ -6,9 +6,10 @@ * Side Public License, v 1. */ import { setWriteBlock } from './set_write_block'; -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; import { errors as EsErrors } from '@elastic/elasticsearch'; + jest.mock('./catch_retryable_es_client_errors'); describe('setWriteBlock', () => { diff --git a/src/core/server/saved_objects/migrations/actions/set_write_block.ts b/src/core/server/saved_objects/migrations/actions/set_write_block.ts index fcb508aa6cf3f..d5410cf11b57e 100644 --- a/src/core/server/saved_objects/migrations/actions/set_write_block.ts +++ b/src/core/server/saved_objects/migrations/actions/set_write_block.ts @@ -9,7 +9,7 @@ import * as Either from 'fp-ts/lib/Either'; import * as TaskEither from 'fp-ts/lib/TaskEither'; import { errors as EsErrors } from '@elastic/elasticsearch'; -import { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { catchRetryableEsClientErrors, RetryableEsClientError, diff --git a/src/core/server/saved_objects/migrations/actions/update_aliases.test.ts b/src/core/server/saved_objects/migrations/actions/update_aliases.test.ts index e2ea07d40281b..960029252da24 100644 --- a/src/core/server/saved_objects/migrations/actions/update_aliases.test.ts +++ b/src/core/server/saved_objects/migrations/actions/update_aliases.test.ts @@ -8,11 +8,12 @@ import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; import { errors as EsErrors } from '@elastic/elasticsearch'; -jest.mock('./catch_retryable_es_client_errors'); -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { updateAliases } from './update_aliases'; import { setWriteBlock } from './set_write_block'; +jest.mock('./catch_retryable_es_client_errors'); + describe('updateAliases', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/src/core/server/saved_objects/migrations/actions/update_aliases.ts b/src/core/server/saved_objects/migrations/actions/update_aliases.ts index c8ac3655ba72a..1a5e487ce9205 100644 --- a/src/core/server/saved_objects/migrations/actions/update_aliases.ts +++ b/src/core/server/saved_objects/migrations/actions/update_aliases.ts @@ -9,7 +9,7 @@ import * as Either from 'fp-ts/lib/Either'; import * as TaskEither from 'fp-ts/lib/TaskEither'; import { errors as EsErrors } from '@elastic/elasticsearch'; -import { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { catchRetryableEsClientErrors, RetryableEsClientError, diff --git a/src/core/server/saved_objects/migrations/actions/update_and_pickup_mappings.test.ts b/src/core/server/saved_objects/migrations/actions/update_and_pickup_mappings.test.ts index 3ecb990cd9e82..8fdb5550bd01e 100644 --- a/src/core/server/saved_objects/migrations/actions/update_and_pickup_mappings.test.ts +++ b/src/core/server/saved_objects/migrations/actions/update_and_pickup_mappings.test.ts @@ -8,10 +8,11 @@ import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; import { errors as EsErrors } from '@elastic/elasticsearch'; -jest.mock('./catch_retryable_es_client_errors'); -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { updateAndPickupMappings } from './update_and_pickup_mappings'; +jest.mock('./catch_retryable_es_client_errors'); + describe('updateAndPickupMappings', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/src/core/server/saved_objects/migrations/actions/update_and_pickup_mappings.ts b/src/core/server/saved_objects/migrations/actions/update_and_pickup_mappings.ts index 06b3e9051ffa3..bd1c2d6ff7614 100644 --- a/src/core/server/saved_objects/migrations/actions/update_and_pickup_mappings.ts +++ b/src/core/server/saved_objects/migrations/actions/update_and_pickup_mappings.ts @@ -9,7 +9,7 @@ import * as Either from 'fp-ts/lib/Either'; import * as TaskEither from 'fp-ts/lib/TaskEither'; import { pipe } from 'fp-ts/lib/pipeable'; -import { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { IndexMapping } from '../../mappings'; import { catchRetryableEsClientErrors, diff --git a/src/core/server/saved_objects/migrations/actions/verify_reindex.ts b/src/core/server/saved_objects/migrations/actions/verify_reindex.ts index 481daf459251d..866ec9974e929 100644 --- a/src/core/server/saved_objects/migrations/actions/verify_reindex.ts +++ b/src/core/server/saved_objects/migrations/actions/verify_reindex.ts @@ -8,7 +8,7 @@ import * as Either from 'fp-ts/lib/Either'; import * as TaskEither from 'fp-ts/lib/TaskEither'; -import { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { catchRetryableEsClientErrors, RetryableEsClientError, diff --git a/src/core/server/saved_objects/migrations/actions/wait_for_index_status_yellow.test.ts b/src/core/server/saved_objects/migrations/actions/wait_for_index_status_yellow.test.ts index 8cea34b80ffad..ecff30c595a78 100644 --- a/src/core/server/saved_objects/migrations/actions/wait_for_index_status_yellow.test.ts +++ b/src/core/server/saved_objects/migrations/actions/wait_for_index_status_yellow.test.ts @@ -8,8 +8,9 @@ import { errors as EsErrors } from '@elastic/elasticsearch'; import { waitForIndexStatusYellow } from './wait_for_index_status_yellow'; -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; + jest.mock('./catch_retryable_es_client_errors'); describe('waitForIndexStatusYellow', () => { diff --git a/src/core/server/saved_objects/migrations/actions/wait_for_index_status_yellow.ts b/src/core/server/saved_objects/migrations/actions/wait_for_index_status_yellow.ts index fed28252bd2a4..a306c0d2d058c 100644 --- a/src/core/server/saved_objects/migrations/actions/wait_for_index_status_yellow.ts +++ b/src/core/server/saved_objects/migrations/actions/wait_for_index_status_yellow.ts @@ -8,7 +8,7 @@ import * as Either from 'fp-ts/lib/Either'; import * as TaskEither from 'fp-ts/lib/TaskEither'; -import { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { catchRetryableEsClientErrors, RetryableEsClientError, diff --git a/src/core/server/saved_objects/migrations/actions/wait_for_pickup_updated_mappings_task.test.ts b/src/core/server/saved_objects/migrations/actions/wait_for_pickup_updated_mappings_task.test.ts index f7c380be9427c..896a687c1f8d3 100644 --- a/src/core/server/saved_objects/migrations/actions/wait_for_pickup_updated_mappings_task.test.ts +++ b/src/core/server/saved_objects/migrations/actions/wait_for_pickup_updated_mappings_task.test.ts @@ -8,11 +8,12 @@ import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; import { errors as EsErrors } from '@elastic/elasticsearch'; -jest.mock('./catch_retryable_es_client_errors'); -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { waitForPickupUpdatedMappingsTask } from './wait_for_pickup_updated_mappings_task'; import { setWriteBlock } from './set_write_block'; +jest.mock('./catch_retryable_es_client_errors'); + describe('waitForPickupUpdatedMappingsTask', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/src/core/server/saved_objects/migrations/actions/wait_for_reindex_task.test.ts b/src/core/server/saved_objects/migrations/actions/wait_for_reindex_task.test.ts index f6a236aab5c85..bb9858c60cb24 100644 --- a/src/core/server/saved_objects/migrations/actions/wait_for_reindex_task.test.ts +++ b/src/core/server/saved_objects/migrations/actions/wait_for_reindex_task.test.ts @@ -8,11 +8,12 @@ import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; import { errors as EsErrors } from '@elastic/elasticsearch'; -jest.mock('./catch_retryable_es_client_errors'); -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { waitForReindexTask } from './wait_for_reindex_task'; import { setWriteBlock } from './set_write_block'; +jest.mock('./catch_retryable_es_client_errors'); + describe('waitForReindexTask', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/src/core/server/saved_objects/migrations/actions/wait_for_task.test.ts b/src/core/server/saved_objects/migrations/actions/wait_for_task.test.ts index c7ca9bf36a2c6..4a5fc20e1fe12 100644 --- a/src/core/server/saved_objects/migrations/actions/wait_for_task.test.ts +++ b/src/core/server/saved_objects/migrations/actions/wait_for_task.test.ts @@ -7,8 +7,9 @@ */ import { errors as EsErrors } from '@elastic/elasticsearch'; import { waitForTask } from './wait_for_task'; -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; + jest.mock('./catch_retryable_es_client_errors'); describe('waitForTask', () => { diff --git a/src/core/server/saved_objects/migrations/actions/wait_for_task.ts b/src/core/server/saved_objects/migrations/actions/wait_for_task.ts index f3f1e116ab3c0..a5762ff10a122 100644 --- a/src/core/server/saved_objects/migrations/actions/wait_for_task.ts +++ b/src/core/server/saved_objects/migrations/actions/wait_for_task.ts @@ -10,11 +10,12 @@ import * as Either from 'fp-ts/lib/Either'; import * as TaskEither from 'fp-ts/lib/TaskEither'; import * as Option from 'fp-ts/lib/Option'; import { errors as EsErrors } from '@elastic/elasticsearch'; -import { ElasticsearchClient } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { catchRetryableEsClientErrors, RetryableEsClientError, } from './catch_retryable_es_client_errors'; + /** @internal */ export interface WaitForTaskResponse { error: Option.Option<{ type: string; reason: string; index?: string }>; diff --git a/src/core/server/saved_objects/migrations/kibana_migrator.test.ts b/src/core/server/saved_objects/migrations/kibana_migrator.test.ts index a19071a7d2d76..926b6efcf1803 100644 --- a/src/core/server/saved_objects/migrations/kibana_migrator.test.ts +++ b/src/core/server/saved_objects/migrations/kibana_migrator.test.ts @@ -10,7 +10,7 @@ import { take } from 'rxjs/operators'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; -import { elasticsearchClientMock } from '../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { KibanaMigratorOptions, KibanaMigrator } from './kibana_migrator'; import { SavedObjectTypeRegistry } from '../saved_objects_type_registry'; import { SavedObjectsType } from '../types'; diff --git a/src/core/server/saved_objects/migrations/kibana_migrator.ts b/src/core/server/saved_objects/migrations/kibana_migrator.ts index 7be5576e55241..c7fb2533a89ba 100644 --- a/src/core/server/saved_objects/migrations/kibana_migrator.ts +++ b/src/core/server/saved_objects/migrations/kibana_migrator.ts @@ -15,7 +15,7 @@ import { BehaviorSubject } from 'rxjs'; import Semver from 'semver'; import type { Logger } from '@kbn/logging'; import type { DocLinksServiceStart } from '@kbn/core-doc-links-server'; -import { ElasticsearchClient } from '../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { IndexMapping, SavedObjectsTypeMappingDefinitions } from '../mappings'; import { SavedObjectUnsanitizedDoc, diff --git a/src/core/server/saved_objects/migrations/migrations_state_action_machine.test.ts b/src/core/server/saved_objects/migrations/migrations_state_action_machine.test.ts index 2a182873be061..db319c63e216f 100644 --- a/src/core/server/saved_objects/migrations/migrations_state_action_machine.test.ts +++ b/src/core/server/saved_objects/migrations/migrations_state_action_machine.test.ts @@ -16,7 +16,7 @@ import { typeRegistryMock } from '../saved_objects_type_registry.mock'; import * as Either from 'fp-ts/lib/Either'; import * as Option from 'fp-ts/lib/Option'; import { errors } from '@elastic/elasticsearch'; -import { elasticsearchClientMock } from '../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { AllControlStates, State } from './state'; import { createInitialState } from './initial_state'; import { ByteSizeValue } from '@kbn/config-schema'; diff --git a/src/core/server/saved_objects/migrations/migrations_state_action_machine.ts b/src/core/server/saved_objects/migrations/migrations_state_action_machine.ts index 8eaae216914f7..92806236203af 100644 --- a/src/core/server/saved_objects/migrations/migrations_state_action_machine.ts +++ b/src/core/server/saved_objects/migrations/migrations_state_action_machine.ts @@ -9,8 +9,11 @@ import { errors as EsErrors } from '@elastic/elasticsearch'; import * as Option from 'fp-ts/lib/Option'; import type { Logger, LogMeta } from '@kbn/logging'; -import type { ElasticsearchClient } from '../../elasticsearch'; -import { getErrorMessage, getRequestDebugMeta } from '../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; +import { + getErrorMessage, + getRequestDebugMeta, +} from '@kbn/core-elasticsearch-client-server-internal'; import { Model, Next, stateActionMachine } from './state_action_machine'; import { cleanup } from './migrations_state_machine_cleanup'; import { ReindexSourceToTempTransform, ReindexSourceToTempIndexBulk, State } from './state'; diff --git a/src/core/server/saved_objects/migrations/migrations_state_machine_cleanup.ts b/src/core/server/saved_objects/migrations/migrations_state_machine_cleanup.ts index ff8ff57d41ce4..8b1f93c327857 100644 --- a/src/core/server/saved_objects/migrations/migrations_state_machine_cleanup.ts +++ b/src/core/server/saved_objects/migrations/migrations_state_machine_cleanup.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import type { ElasticsearchClient } from '../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import * as Actions from './actions'; import type { State } from './state'; diff --git a/src/core/server/saved_objects/migrations/next.test.ts b/src/core/server/saved_objects/migrations/next.test.ts index 98a8690844872..548c6b8c43b51 100644 --- a/src/core/server/saved_objects/migrations/next.test.ts +++ b/src/core/server/saved_objects/migrations/next.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { ElasticsearchClient } from '../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { next } from './next'; import { State } from './state'; diff --git a/src/core/server/saved_objects/migrations/next.ts b/src/core/server/saved_objects/migrations/next.ts index e50331d3b7658..7d73d4830259b 100644 --- a/src/core/server/saved_objects/migrations/next.ts +++ b/src/core/server/saved_objects/migrations/next.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import type { AllActionStates, ReindexSourceToTempOpenPit, @@ -42,7 +43,6 @@ import type { } from './state'; import type { TransformRawDocs } from './types'; import * as Actions from './actions'; -import type { ElasticsearchClient } from '../../elasticsearch'; type ActionMap = ReturnType; diff --git a/src/core/server/saved_objects/migrations/run_resilient_migrator.ts b/src/core/server/saved_objects/migrations/run_resilient_migrator.ts index 4d75bc09caf2d..87618dcbab1c9 100644 --- a/src/core/server/saved_objects/migrations/run_resilient_migrator.ts +++ b/src/core/server/saved_objects/migrations/run_resilient_migrator.ts @@ -8,7 +8,7 @@ import type { Logger } from '@kbn/logging'; import type { DocLinksServiceStart } from '@kbn/core-doc-links-server'; -import { ElasticsearchClient } from '../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { IndexMapping } from '../mappings'; import type { SavedObjectsMigrationVersion } from '../types'; import type { TransformRawDocs } from './types'; diff --git a/src/core/server/saved_objects/routes/test_utils.ts b/src/core/server/saved_objects/routes/test_utils.ts index 74d813ab68793..10207682e9bda 100644 --- a/src/core/server/saved_objects/routes/test_utils.ts +++ b/src/core/server/saved_objects/routes/test_utils.ts @@ -11,7 +11,7 @@ import { ContextService } from '@kbn/core-http-context-server-internal'; import { createHttpServer, createCoreContext } from '@kbn/core-http-server-mocks'; import { contextServiceMock, coreMock } from '../../mocks'; import { SavedObjectsType } from '../types'; -import { InternalSavedObjectsRequestHandlerContext } from '../internal_types'; +import type { InternalSavedObjectsRequestHandlerContext } from '../internal_types'; const defaultCoreId = Symbol('core'); diff --git a/src/core/server/saved_objects/saved_objects_service.test.ts b/src/core/server/saved_objects/saved_objects_service.test.ts index e2b7cdb92c46b..c821ff9b4bbd2 100644 --- a/src/core/server/saved_objects/saved_objects_service.test.ts +++ b/src/core/server/saved_objects/saved_objects_service.test.ts @@ -28,11 +28,11 @@ import { httpServiceMock, httpServerMock } from '@kbn/core-http-server-mocks'; import { SavedObjectsService } from './saved_objects_service'; import { configServiceMock } from '../mocks'; -import { elasticsearchServiceMock } from '../elasticsearch/elasticsearch_service.mock'; +import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; import { coreUsageDataServiceMock } from '../core_usage_data/core_usage_data_service.mock'; import { deprecationsServiceMock } from '../deprecations/deprecations_service.mock'; import { SavedObjectsClientFactoryProvider } from './service/lib'; -import { NodesVersionCompatibility } from '../elasticsearch/version_check/ensure_es_version'; +import type { NodesVersionCompatibility } from '@kbn/core-elasticsearch-server-internal'; import { SavedObjectsRepository } from './service/lib/repository'; import { registerCoreObjectTypes } from './object_types'; import { getSavedObjectsDeprecationsProvider } from './deprecations'; diff --git a/src/core/server/saved_objects/saved_objects_service.ts b/src/core/server/saved_objects/saved_objects_service.ts index 83f906f0d14c9..123550393f49b 100644 --- a/src/core/server/saved_objects/saved_objects_service.ts +++ b/src/core/server/saved_objects/saved_objects_service.ts @@ -13,6 +13,11 @@ import type { CoreContext, CoreService } from '@kbn/core-base-server-internal'; import type { DocLinksServiceStart } from '@kbn/core-doc-links-server'; import type { KibanaRequest } from '@kbn/core-http-server'; import type { InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; +import type { + InternalElasticsearchServiceSetup, + InternalElasticsearchServiceStart, +} from '@kbn/core-elasticsearch-server-internal'; import { SavedObjectsClient, SavedObjectsClientProvider, @@ -20,11 +25,6 @@ import { } from '.'; import { KibanaMigrator, IKibanaMigrator } from './migrations'; import { InternalCoreUsageDataSetup } from '../core_usage_data'; -import { - ElasticsearchClient, - InternalElasticsearchServiceSetup, - InternalElasticsearchServiceStart, -} from '../elasticsearch'; import { InternalDeprecationsServiceSetup } from '../deprecations'; import { SavedObjectsConfigType, diff --git a/src/core/server/saved_objects/service/lib/collect_multi_namespace_references.test.ts b/src/core/server/saved_objects/service/lib/collect_multi_namespace_references.test.ts index bac745995ce07..cc219579d9c0b 100644 --- a/src/core/server/saved_objects/service/lib/collect_multi_namespace_references.test.ts +++ b/src/core/server/saved_objects/service/lib/collect_multi_namespace_references.test.ts @@ -12,7 +12,7 @@ import { mockRawDocExistsInNamespace, } from './collect_multi_namespace_references.test.mock'; -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { typeRegistryMock } from '../../saved_objects_type_registry.mock'; import { SavedObjectsSerializer } from '../../serialization'; import { diff --git a/src/core/server/saved_objects/service/lib/collect_multi_namespace_references.ts b/src/core/server/saved_objects/service/lib/collect_multi_namespace_references.ts index a6336a89ac6fe..fb6bd89f358f6 100644 --- a/src/core/server/saved_objects/service/lib/collect_multi_namespace_references.ts +++ b/src/core/server/saved_objects/service/lib/collect_multi_namespace_references.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { isNotFoundFromUnsupportedServer } from '../../../elasticsearch'; +import { isNotFoundFromUnsupportedServer } from '@kbn/core-elasticsearch-server-internal'; import type { ISavedObjectTypeRegistry } from '../../saved_objects_type_registry'; import type { SavedObjectsSerializer } from '../../serialization'; import type { SavedObject, SavedObjectsBaseOptions } from '../../types'; diff --git a/src/core/server/saved_objects/service/lib/decorate_es_error.test.ts b/src/core/server/saved_objects/service/lib/decorate_es_error.test.ts index 4e187e85f81a7..a7aa52f7a0f5a 100644 --- a/src/core/server/saved_objects/service/lib/decorate_es_error.test.ts +++ b/src/core/server/saved_objects/service/lib/decorate_es_error.test.ts @@ -7,7 +7,7 @@ */ import { errors as esErrors } from '@elastic/elasticsearch'; -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { decorateEsError } from './decorate_es_error'; import { SavedObjectsErrorHelpers } from './errors'; diff --git a/src/core/server/saved_objects/service/lib/decorate_es_error.ts b/src/core/server/saved_objects/service/lib/decorate_es_error.ts index cfe80df789142..40eda7a854a25 100644 --- a/src/core/server/saved_objects/service/lib/decorate_es_error.ts +++ b/src/core/server/saved_objects/service/lib/decorate_es_error.ts @@ -9,7 +9,7 @@ import { get } from 'lodash'; import { errors as esErrors } from '@elastic/elasticsearch'; import type { ElasticsearchErrorDetails } from '@kbn/es-errors'; -import { isSupportedEsServer } from '../../../elasticsearch'; +import { isSupportedEsServer } from '@kbn/core-elasticsearch-server-internal'; const responseErrors = { isServiceUnavailable: (statusCode?: number) => statusCode === 503, diff --git a/src/core/server/saved_objects/service/lib/internal_bulk_resolve.test.mock.ts b/src/core/server/saved_objects/service/lib/internal_bulk_resolve.test.mock.ts index fbd774f1c10d5..277d1ae4af34a 100644 --- a/src/core/server/saved_objects/service/lib/internal_bulk_resolve.test.mock.ts +++ b/src/core/server/saved_objects/service/lib/internal_bulk_resolve.test.mock.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ +import type { isNotFoundFromUnsupportedServer } from '@kbn/core-elasticsearch-server-internal'; import type * as InternalUtils from './internal_utils'; -import type { isNotFoundFromUnsupportedServer } from '../../../elasticsearch'; export const mockGetSavedObjectFromSource = jest.fn() as jest.MockedFunction< typeof InternalUtils['getSavedObjectFromSource'] @@ -28,8 +28,8 @@ jest.mock('./internal_utils', () => { export const mockIsNotFoundFromUnsupportedServer = jest.fn() as jest.MockedFunction< typeof isNotFoundFromUnsupportedServer >; -jest.mock('../../../elasticsearch', () => { - const actual = jest.requireActual('../../../elasticsearch'); +jest.mock('@kbn/core-elasticsearch-server-internal', () => { + const actual = jest.requireActual('@kbn/core-elasticsearch-server-internal'); return { ...actual, isNotFoundFromUnsupportedServer: mockIsNotFoundFromUnsupportedServer, diff --git a/src/core/server/saved_objects/service/lib/internal_bulk_resolve.test.ts b/src/core/server/saved_objects/service/lib/internal_bulk_resolve.test.ts index 749eff0e33875..44940cd0ae0d7 100644 --- a/src/core/server/saved_objects/service/lib/internal_bulk_resolve.test.ts +++ b/src/core/server/saved_objects/service/lib/internal_bulk_resolve.test.ts @@ -12,7 +12,7 @@ import { mockIsNotFoundFromUnsupportedServer, } from './internal_bulk_resolve.test.mock'; -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { LEGACY_URL_ALIAS_TYPE } from '../../object_types'; import { typeRegistryMock } from '../../saved_objects_type_registry.mock'; import { SavedObjectsSerializer } from '../../serialization'; diff --git a/src/core/server/saved_objects/service/lib/internal_bulk_resolve.ts b/src/core/server/saved_objects/service/lib/internal_bulk_resolve.ts index 3a59ab8a8d9f3..96ea29486520b 100644 --- a/src/core/server/saved_objects/service/lib/internal_bulk_resolve.ts +++ b/src/core/server/saved_objects/service/lib/internal_bulk_resolve.ts @@ -8,12 +8,12 @@ import type { MgetResponseItem } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { isNotFoundFromUnsupportedServer } from '@kbn/core-elasticsearch-server-internal'; import { CORE_USAGE_STATS_ID, CORE_USAGE_STATS_TYPE, REPOSITORY_RESOLVE_OUTCOME_STATS, } from '../../../core_usage_data'; -import { isNotFoundFromUnsupportedServer } from '../../../elasticsearch'; import { LegacyUrlAlias, LEGACY_URL_ALIAS_TYPE } from '../../object_types'; import type { ISavedObjectTypeRegistry } from '../../saved_objects_type_registry'; import type { SavedObjectsRawDocSource, SavedObjectsSerializer } from '../../serialization'; diff --git a/src/core/server/saved_objects/service/lib/legacy_url_aliases/delete_legacy_url_aliases.test.mock.ts b/src/core/server/saved_objects/service/lib/legacy_url_aliases/delete_legacy_url_aliases.test.mock.ts index d8c1b8edb9558..0922910936c52 100644 --- a/src/core/server/saved_objects/service/lib/legacy_url_aliases/delete_legacy_url_aliases.test.mock.ts +++ b/src/core/server/saved_objects/service/lib/legacy_url_aliases/delete_legacy_url_aliases.test.mock.ts @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -import type { getErrorMessage } from '../../../../elasticsearch'; +import type { getErrorMessage } from '@kbn/core-elasticsearch-client-server-internal'; export const mockGetEsErrorMessage = jest.fn() as jest.MockedFunction; -jest.mock('../../../../elasticsearch', () => { +jest.mock('@kbn/core-elasticsearch-client-server-internal', () => { return { getErrorMessage: mockGetEsErrorMessage }; }); diff --git a/src/core/server/saved_objects/service/lib/legacy_url_aliases/delete_legacy_url_aliases.test.ts b/src/core/server/saved_objects/service/lib/legacy_url_aliases/delete_legacy_url_aliases.test.ts index e23f8ef1eb9fd..dc261ee23aafb 100644 --- a/src/core/server/saved_objects/service/lib/legacy_url_aliases/delete_legacy_url_aliases.test.ts +++ b/src/core/server/saved_objects/service/lib/legacy_url_aliases/delete_legacy_url_aliases.test.ts @@ -10,7 +10,7 @@ import { mockGetEsErrorMessage } from './delete_legacy_url_aliases.test.mock'; / import { errors as EsErrors } from '@elastic/elasticsearch'; -import { elasticsearchClientMock } from '../../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { typeRegistryMock } from '../../../saved_objects_type_registry.mock'; import { ALL_NAMESPACES_STRING } from '../utils'; import { deleteLegacyUrlAliases } from './delete_legacy_url_aliases'; diff --git a/src/core/server/saved_objects/service/lib/legacy_url_aliases/delete_legacy_url_aliases.ts b/src/core/server/saved_objects/service/lib/legacy_url_aliases/delete_legacy_url_aliases.ts index 690465f08bd36..e562543125472 100644 --- a/src/core/server/saved_objects/service/lib/legacy_url_aliases/delete_legacy_url_aliases.ts +++ b/src/core/server/saved_objects/service/lib/legacy_url_aliases/delete_legacy_url_aliases.ts @@ -8,7 +8,7 @@ import * as esKuery from '@kbn/es-query'; -import { getErrorMessage as getEsErrorMessage } from '../../../../elasticsearch'; +import { getErrorMessage as getEsErrorMessage } from '@kbn/core-elasticsearch-client-server-internal'; import type { ISavedObjectTypeRegistry } from '../../../saved_objects_type_registry'; import type { IndexMapping } from '../../../mappings'; import { LEGACY_URL_ALIAS_TYPE } from '../../../object_types'; diff --git a/src/core/server/saved_objects/service/lib/preflight_check_for_create.test.ts b/src/core/server/saved_objects/service/lib/preflight_check_for_create.test.ts index b7c61bc6f7711..9563ebd51344f 100644 --- a/src/core/server/saved_objects/service/lib/preflight_check_for_create.test.ts +++ b/src/core/server/saved_objects/service/lib/preflight_check_for_create.test.ts @@ -13,8 +13,8 @@ import { import type { DeeplyMockedKeys } from '@kbn/utility-types-jest'; -import type { ElasticsearchClient } from '../../../elasticsearch'; -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { LEGACY_URL_ALIAS_TYPE } from '../../object_types'; import { typeRegistryMock } from '../../saved_objects_type_registry.mock'; import { SavedObjectsSerializer } from '../../serialization'; diff --git a/src/core/server/saved_objects/service/lib/preflight_check_for_create.ts b/src/core/server/saved_objects/service/lib/preflight_check_for_create.ts index 55eb80dbc4874..2611ae19184c9 100644 --- a/src/core/server/saved_objects/service/lib/preflight_check_for_create.ts +++ b/src/core/server/saved_objects/service/lib/preflight_check_for_create.ts @@ -5,8 +5,9 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ + import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { isNotFoundFromUnsupportedServer } from '../../../elasticsearch'; +import { isNotFoundFromUnsupportedServer } from '@kbn/core-elasticsearch-server-internal'; import { LegacyUrlAlias, LEGACY_URL_ALIAS_TYPE } from '../../object_types'; import type { ISavedObjectTypeRegistry } from '../../saved_objects_type_registry'; import type { diff --git a/src/core/server/saved_objects/service/lib/repository.test.ts b/src/core/server/saved_objects/service/lib/repository.test.ts index 199ad514c28ed..c916953df2ad5 100644 --- a/src/core/server/saved_objects/service/lib/repository.test.ts +++ b/src/core/server/saved_objects/service/lib/repository.test.ts @@ -56,7 +56,7 @@ import { SavedObjectTypeRegistry } from '../../saved_objects_type_registry'; import { DocumentMigrator } from '../../migrations/core/document_migrator'; import { mockKibanaMigrator } from '../../migrations/kibana_migrator.mock'; import { LEGACY_URL_ALIAS_TYPE } from '../../object_types'; -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import * as esKuery from '@kbn/es-query'; import { errors as EsErrors } from '@elastic/elasticsearch'; import { diff --git a/src/core/server/saved_objects/service/lib/repository.ts b/src/core/server/saved_objects/service/lib/repository.ts index 679d3fbdb498f..6688b8ce18485 100644 --- a/src/core/server/saved_objects/service/lib/repository.ts +++ b/src/core/server/saved_objects/service/lib/repository.ts @@ -10,8 +10,11 @@ import { omit, isObject } from 'lodash'; import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import * as esKuery from '@kbn/es-query'; import type { Logger } from '@kbn/logging'; -import type { ElasticsearchClient } from '../../../elasticsearch'; -import { isSupportedEsServer, isNotFoundFromUnsupportedServer } from '../../../elasticsearch'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; +import { + isSupportedEsServer, + isNotFoundFromUnsupportedServer, +} from '@kbn/core-elasticsearch-server-internal'; import { getRootPropertiesObjects, IndexMapping } from '../../mappings'; import { ISavedObjectsPointInTimeFinder, diff --git a/src/core/server/saved_objects/service/lib/repository_es_client.test.mock.ts b/src/core/server/saved_objects/service/lib/repository_es_client.test.mock.ts index 22702a6a565f1..700786beb64aa 100644 --- a/src/core/server/saved_objects/service/lib/repository_es_client.test.mock.ts +++ b/src/core/server/saved_objects/service/lib/repository_es_client.test.mock.ts @@ -7,6 +7,6 @@ */ export const retryCallClusterMock = jest.fn((fn) => fn()); -jest.doMock('../../../elasticsearch/client/retry_call_cluster', () => ({ +jest.doMock('@kbn/core-elasticsearch-server-internal', () => ({ retryCallCluster: retryCallClusterMock, })); diff --git a/src/core/server/saved_objects/service/lib/repository_es_client.test.ts b/src/core/server/saved_objects/service/lib/repository_es_client.test.ts index d06172fc6a673..f465ffb6a3dab 100644 --- a/src/core/server/saved_objects/service/lib/repository_es_client.test.ts +++ b/src/core/server/saved_objects/service/lib/repository_es_client.test.ts @@ -9,7 +9,7 @@ import { retryCallClusterMock } from './repository_es_client.test.mock'; import { createRepositoryEsClient, RepositoryEsClient } from './repository_es_client'; -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { SavedObjectsErrorHelpers } from './errors'; describe('RepositoryEsClient', () => { diff --git a/src/core/server/saved_objects/service/lib/repository_es_client.ts b/src/core/server/saved_objects/service/lib/repository_es_client.ts index 9c9d84d975d0d..14dcb99626789 100644 --- a/src/core/server/saved_objects/service/lib/repository_es_client.ts +++ b/src/core/server/saved_objects/service/lib/repository_es_client.ts @@ -8,8 +8,8 @@ import type { TransportRequestOptions } from '@elastic/elasticsearch'; -import { ElasticsearchClient } from '../../../elasticsearch'; -import { retryCallCluster } from '../../../elasticsearch/client/retry_call_cluster'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; +import { retryCallCluster } from '@kbn/core-elasticsearch-server-internal'; import { decorateEsError } from './decorate_es_error'; const methods = [ diff --git a/src/core/server/saved_objects/service/lib/update_objects_spaces.test.ts b/src/core/server/saved_objects/service/lib/update_objects_spaces.test.ts index 5a600128a38ec..194caef879fe8 100644 --- a/src/core/server/saved_objects/service/lib/update_objects_spaces.test.ts +++ b/src/core/server/saved_objects/service/lib/update_objects_spaces.test.ts @@ -13,7 +13,7 @@ import { mockDeleteLegacyUrlAliases, } from './update_objects_spaces.test.mock'; -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { loggerMock } from '@kbn/logging-mocks'; import { typeRegistryMock } from '../../saved_objects_type_registry.mock'; diff --git a/src/core/server/saved_objects/service/lib/update_objects_spaces.ts b/src/core/server/saved_objects/service/lib/update_objects_spaces.ts index 9a1ca70b83fc7..b8ffd0ad7e528 100644 --- a/src/core/server/saved_objects/service/lib/update_objects_spaces.ts +++ b/src/core/server/saved_objects/service/lib/update_objects_spaces.ts @@ -11,7 +11,7 @@ import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import intersection from 'lodash/intersection'; import type { Logger } from '@kbn/logging'; -import { isNotFoundFromUnsupportedServer } from '../../../elasticsearch'; +import { isNotFoundFromUnsupportedServer } from '@kbn/core-elasticsearch-server-internal'; import type { IndexMapping } from '../../mappings'; import type { ISavedObjectTypeRegistry } from '../../saved_objects_type_registry'; import type { SavedObjectsRawDocSource, SavedObjectsSerializer } from '../../serialization'; diff --git a/src/core/server/saved_objects/types.ts b/src/core/server/saved_objects/types.ts index eb4eb77f8d4b8..134289cb2b493 100644 --- a/src/core/server/saved_objects/types.ts +++ b/src/core/server/saved_objects/types.ts @@ -7,6 +7,7 @@ */ import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { SavedObjectsClient } from './service/saved_objects_client'; import { SavedObjectsTypeMappingDefinition } from './mappings'; import { SavedObjectMigrationMap } from './migrations'; @@ -30,7 +31,6 @@ export type { } from './import/types'; import { SavedObject } from '../../types'; -import { ElasticsearchClient } from '../elasticsearch'; type KueryNode = any; diff --git a/src/core/server/server.test.mocks.ts b/src/core/server/server.test.mocks.ts index e1b294fb6778a..4b7f7ec958979 100644 --- a/src/core/server/server.test.mocks.ts +++ b/src/core/server/server.test.mocks.ts @@ -20,10 +20,10 @@ jest.doMock('./plugins/plugins_service', () => ({ PluginsService: jest.fn(() => mockPluginsService), })); -import { elasticsearchServiceMock } from './elasticsearch/elasticsearch_service.mock'; +import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; export const mockElasticsearchService = elasticsearchServiceMock.create(); -jest.doMock('./elasticsearch/elasticsearch_service', () => ({ +jest.doMock('@kbn/core-elasticsearch-server-internal', () => ({ ElasticsearchService: jest.fn(() => mockElasticsearchService), })); diff --git a/src/core/server/server.ts b/src/core/server/server.ts index 6ad4717e57344..6f1abccd454fd 100644 --- a/src/core/server/server.ts +++ b/src/core/server/server.ts @@ -38,9 +38,12 @@ import { cspConfig, externalUrlConfig, } from '@kbn/core-http-server-internal'; +import { + ElasticsearchService, + config as elasticsearchConfig, +} from '@kbn/core-elasticsearch-server-internal'; import { CoreApp } from './core_app'; import { I18nService } from './i18n'; -import { ElasticsearchService } from './elasticsearch'; import { HttpResourcesService } from './http_resources'; import { RenderingService } from './rendering'; import { UiSettingsService } from './ui_settings'; @@ -51,7 +54,6 @@ import { CapabilitiesService } from './capabilities'; // do not try to shorten the import to `./status`, it will break server test mocking import { StatusService } from './status/status_service'; -import { config as elasticsearchConfig } from './elasticsearch'; import { savedObjectsConfig, savedObjectsMigrationConfig } from './saved_objects'; import { config as uiSettingsConfig } from './ui_settings'; import { config as statusConfig } from './status'; diff --git a/src/core/server/status/status_service.test.ts b/src/core/server/status/status_service.test.ts index 13f2b65f75b99..9354022c3f66a 100644 --- a/src/core/server/status/status_service.test.ts +++ b/src/core/server/status/status_service.test.ts @@ -560,12 +560,12 @@ describe('StatusService', () => { .toMatchInlineSnapshot(` Array [ Object { - "overall_status_level": "initializing", - "overall_status_summary": "Kibana is starting up", + "overallStatusLevel": "initializing", + "overallStatusSummary": "Kibana is starting up", }, Object { - "overall_status_level": "available", - "overall_status_summary": "All services are available", + "overallStatusLevel": "available", + "overallStatusSummary": "All services are available", }, ] `); @@ -581,8 +581,8 @@ describe('StatusService', () => { Array [ "core-overall_status_changed", Object { - "overall_status_level": "available", - "overall_status_summary": "All services are available", + "overallStatusLevel": "available", + "overallStatusSummary": "All services are available", }, ] `); diff --git a/src/core/server/status/status_service.ts b/src/core/server/status/status_service.ts index dc73bd83c4625..def11b4538bd9 100644 --- a/src/core/server/status/status_service.ts +++ b/src/core/server/status/status_service.ts @@ -25,7 +25,7 @@ import type { PluginName } from '@kbn/core-base-common'; import type { AnalyticsServiceSetup } from '@kbn/core-analytics-server'; import type { InternalEnvironmentServiceSetup } from '@kbn/core-environment-server-internal'; import type { InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; -import { InternalElasticsearchServiceSetup } from '../elasticsearch'; +import type { InternalElasticsearchServiceSetup } from '@kbn/core-elasticsearch-server-internal'; import { InternalSavedObjectsServiceSetup } from '../saved_objects'; import { InternalMetricsServiceSetup } from '../metrics'; import { registerStatusRoute } from './routes'; @@ -42,8 +42,8 @@ interface StatusLogMeta extends LogMeta { } interface StatusAnalyticsPayload { - overall_status_level: string; - overall_status_summary: string; + overallStatusLevel: string; + overallStatusSummary: string; } export interface SetupDeps { @@ -214,17 +214,17 @@ export class StatusService implements CoreService { private setupAnalyticsContextAndEvents(analytics: AnalyticsServiceSetup) { // Set an initial "initializing" status, so we can attach it to early events. const context$ = new BehaviorSubject({ - overall_status_level: 'initializing', - overall_status_summary: 'Kibana is starting up', + overallStatusLevel: 'initializing', + overallStatusSummary: 'Kibana is starting up', }); // The schema is the same for the context and the events. const schema: RootSchema = { - overall_status_level: { + overallStatusLevel: { type: 'keyword', _meta: { description: 'The current availability level of the service.' }, }, - overall_status_summary: { + overallStatusSummary: { type: 'text', _meta: { description: 'A high-level summary of the service status.' }, }, @@ -238,8 +238,8 @@ export class StatusService implements CoreService { this.overall$!.pipe( takeUntil(this.stop$), map(({ level, summary }) => ({ - overall_status_level: level.toString(), - overall_status_summary: summary, + overallStatusLevel: level.toString(), + overallStatusSummary: summary, })), // Emit the event before spreading the status to the context. // This way we see from the context the previous status and the current one. diff --git a/src/core/server/status/types.ts b/src/core/server/status/types.ts index b44dde13983bb..8217b29463700 100644 --- a/src/core/server/status/types.ts +++ b/src/core/server/status/types.ts @@ -7,100 +7,10 @@ */ import { Observable } from 'rxjs'; -import { deepFreeze } from '@kbn/std'; -import type { PluginName } from '@kbn/core-base-common'; +import type { PluginName, ServiceStatus } from '@kbn/core-base-common'; -/** - * The current status of a service at a point in time. - * - * @typeParam Meta - JSON-serializable object. Plugins should export this type to allow other plugins to read the `meta` - * field in a type-safe way. - * @public - */ -export interface ServiceStatus | unknown = unknown> { - /** - * The current availability level of the service. - */ - level: ServiceStatusLevel; - /** - * A high-level summary of the service status. - */ - summary: string; - /** - * A more detailed description of the service status. - */ - detail?: string; - /** - * A URL to open in a new tab about how to resolve or troubleshoot the problem. - */ - documentationUrl?: string; - /** - * Any JSON-serializable data to be included in the HTTP API response. Useful for providing more fine-grained, - * machine-readable information about the service status. May include status information for underlying features. - */ - meta?: Meta; -} - -/** - * The current "level" of availability of a service. - * - * @remarks - * The values implement `valueOf` to allow for easy comparisons between status levels with <, >, etc. Higher values - * represent higher severities. Note that the default `Array.prototype.sort` implementation does not correctly sort - * these values. - * - * A snapshot serializer is available in `src/core/server/test_utils` to ease testing of these values with Jest. - * - * @public - */ -export const ServiceStatusLevels = deepFreeze({ - /** - * Everything is working! - */ - available: { - toString: () => 'available', - valueOf: () => 0, - toJSON() { - return this.toString(); - }, - }, - /** - * Some features may not be working. - */ - degraded: { - toString: () => 'degraded', - valueOf: () => 1, - toJSON() { - return this.toString(); - }, - }, - /** - * The service is unavailable, but other functions that do not depend on this service should work. - */ - unavailable: { - toString: () => 'unavailable', - valueOf: () => 2, - toJSON() { - return this.toString(); - }, - }, - /** - * Block all user functions and display the status page, reserved for Core services only. - */ - critical: { - toString: () => 'critical', - valueOf: () => 3, - toJSON() { - return this.toString(); - }, - }, -}); - -/** - * A convenience type that represents the union of each value in {@link ServiceStatusLevels}. - * @public - */ -export type ServiceStatusLevel = typeof ServiceStatusLevels[keyof typeof ServiceStatusLevels]; +export type { ServiceStatusLevel, ServiceStatus } from '@kbn/core-base-common'; +export { ServiceStatusLevels } from '@kbn/core-base-common'; /** * Status of core services. diff --git a/src/dev/ensure_all_tests_in_ci_group.ts b/src/dev/ensure_all_tests_in_ci_group.ts deleted file mode 100644 index 3f4824a429048..0000000000000 --- a/src/dev/ensure_all_tests_in_ci_group.ts +++ /dev/null @@ -1,53 +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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; -import Fs from 'fs/promises'; - -import execa from 'execa'; -import { safeLoad } from 'js-yaml'; - -import { run } from '@kbn/dev-cli-runner'; -import { REPO_ROOT } from '@kbn/utils'; -import { schema } from '@kbn/config-schema'; - -const RELATIVE_JOBS_YAML_PATH = '.ci/ci_groups.yml'; -const JOBS_YAML_PATH = Path.resolve(REPO_ROOT, RELATIVE_JOBS_YAML_PATH); -const SCHEMA = schema.object({ - root: schema.arrayOf(schema.string()), - xpack: schema.arrayOf(schema.string()), -}); - -export function runEnsureAllTestsInCiGroupsCli() { - run(async ({ log }) => { - const { root, xpack } = SCHEMA.validate(safeLoad(await Fs.readFile(JOBS_YAML_PATH, 'utf-8'))); - - log.info( - 'validating root tests directory contains all "root" ciGroups from', - RELATIVE_JOBS_YAML_PATH - ); - await execa(process.execPath, [ - 'scripts/functional_tests', - ...root.map((tag) => `--include-tag=${tag}`), - '--include-tag=runOutsideOfCiGroups', - '--assert-none-excluded', - ]); - - log.info( - 'validating x-pack/tests directory contains all "xpack" ciGroups from', - RELATIVE_JOBS_YAML_PATH - ); - await execa(process.execPath, [ - 'x-pack/scripts/functional_tests', - ...xpack.map((tag) => `--include-tag=${tag}`), - '--assert-none-excluded', - ]); - - log.success('all tests are in a valid ciGroup'); - }); -} diff --git a/src/plugins/dashboard/public/application/embeddable/viewport/print_media/styling/_index.scss b/src/plugins/dashboard/public/application/embeddable/viewport/print_media/styling/_index.scss index 16c4dd85ea45e..bb36c50fde4ec 100644 --- a/src/plugins/dashboard/public/application/embeddable/viewport/print_media/styling/_index.scss +++ b/src/plugins/dashboard/public/application/embeddable/viewport/print_media/styling/_index.scss @@ -45,8 +45,7 @@ Observations: } * { - -webkit-print-color-adjust: exact !important; /* Chrome, Safari, Edge */ - color-adjust: exact !important; /*Firefox*/ + print-color-adjust: exact !important; } } diff --git a/src/plugins/dashboard/public/application/top_nav/editor_menu.tsx b/src/plugins/dashboard/public/application/top_nav/editor_menu.tsx index 0422149b54a88..941a45cc6b956 100644 --- a/src/plugins/dashboard/public/application/top_nav/editor_menu.tsx +++ b/src/plugins/dashboard/public/application/top_nav/editor_menu.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import React, { useCallback } from 'react'; +import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { EuiContextMenu, EuiContextMenuPanelItemDescriptor, @@ -19,7 +19,11 @@ import { METRIC_TYPE } from '@kbn/analytics'; import { i18n } from '@kbn/i18n'; import { BaseVisType, VisGroups, VisTypeAlias } from '@kbn/visualizations-plugin/public'; import { SolutionToolbarPopover } from '@kbn/presentation-util-plugin/public'; -import { EmbeddableFactoryDefinition, EmbeddableInput } from '../../services/embeddable'; +import { + EmbeddableFactory, + EmbeddableFactoryDefinition, + EmbeddableInput, +} from '../../services/embeddable'; import { useKibana } from '../../services/kibana_react'; import { DashboardAppServices } from '../../types'; import { DashboardContainer } from '..'; @@ -41,10 +45,34 @@ interface FactoryGroup { factories: EmbeddableFactoryDefinition[]; } +interface UnwrappedEmbeddableFactory { + factory: EmbeddableFactory; + isEditable: boolean; +} + export const EditorMenu = ({ dashboardContainer, createNewVisType }: Props) => { const { core, embeddable, visualizations, usageCollection, uiSettings } = useKibana().services; + const embeddableFactories = useMemo( + () => (embeddable ? Array.from(embeddable.getEmbeddableFactories()) : []), + [embeddable] + ); + const [unwrappedEmbeddableFactories, setUnwrappedEmbeddableFactories] = useState< + UnwrappedEmbeddableFactory[] + >([]); + + useEffect(() => { + Promise.all( + embeddableFactories.map>(async (factory) => ({ + factory, + isEditable: await factory.isEditable(), + })) + ).then((factories) => { + setUnwrappedEmbeddableFactories(factories); + }); + }, [embeddableFactories]); + const IS_DARK_THEME = uiSettings.get('theme:darkMode'); const LABS_ENABLED = uiSettings.get('visualize:enableLabs'); @@ -89,13 +117,10 @@ export const EditorMenu = ({ dashboardContainer, createNewVisType }: Props) => { a === b ? 0 : a ? -1 : 1 ); - const factories = embeddable - ? Array.from(embeddable.getEmbeddableFactories()).filter( - ({ type, isEditable, canCreateNew, isContainerType }) => - // @ts-expect-error ts 4.5 upgrade - isEditable() && !isContainerType && canCreateNew() && type !== 'visualization' - ) - : []; + const factories = unwrappedEmbeddableFactories.filter( + ({ isEditable, factory: { type, canCreateNew, isContainerType } }) => + isEditable && !isContainerType && canCreateNew() && type !== 'visualization' + ); const factoryGroupMap: Record = {}; const ungroupedFactories: EmbeddableFactoryDefinition[] = []; @@ -103,7 +128,7 @@ export const EditorMenu = ({ dashboardContainer, createNewVisType }: Props) => { let panelCount = 1 + aggBasedPanelID; - factories.forEach((factory: EmbeddableFactoryDefinition, index) => { + factories.forEach(({ factory }) => { const { grouping } = factory; if (grouping) { diff --git a/src/plugins/data/common/search/tabify/tabify_docs.ts b/src/plugins/data/common/search/tabify/tabify_docs.ts index 29ae739f89f49..1c6675bf6da5e 100644 --- a/src/plugins/data/common/search/tabify/tabify_docs.ts +++ b/src/plugins/data/common/search/tabify/tabify_docs.ts @@ -92,7 +92,7 @@ export function flattenHit(hit: Hit, indexPattern?: DataView, params?: TabifyDoc continue; } - const hasValidMapping = field?.type !== 'conflict'; + const hasValidMapping = field && field.type !== 'conflict'; const isValue = !isPlainObject(val); if (hasValidMapping || isValue) { diff --git a/src/plugins/data_view_editor/kibana.json b/src/plugins/data_view_editor/kibana.json index 8e83cb1be046b..26bff485037e2 100644 --- a/src/plugins/data_view_editor/kibana.json +++ b/src/plugins/data_view_editor/kibana.json @@ -9,5 +9,5 @@ "name": "App Services", "githubTeam": "kibana-app-services" }, - "description": "This plugin provides the ability to create data views via a modal flyout from any kibana app" + "description": "This plugin provides the ability to create data views via a modal flyout inside Kibana apps" } diff --git a/src/plugins/data_view_field_editor/public/components/preview/field_preview_context.tsx b/src/plugins/data_view_field_editor/public/components/preview/field_preview_context.tsx index 6e21cc00e5dd5..127badffc826d 100644 --- a/src/plugins/data_view_field_editor/public/components/preview/field_preview_context.tsx +++ b/src/plugins/data_view_field_editor/public/components/preview/field_preview_context.tsx @@ -121,7 +121,7 @@ export const FieldPreviewProvider: FunctionComponent = ({ children }) => { // If no documents could be fetched from the cluster (and we are not trying to load // a custom doc ID) then we disable preview as the script field validation expect the result // of the preview to before resolving. If there are no documents we can't have a preview - // (the _execute API expects one) and thus the validation should not expect any value. + // (the _execute API expects one) and thus the validation should not expect a value. if (!isFetchingDocument && !isCustomDocId && documents.length === 0) { isPreviewAvailable = false; } @@ -341,7 +341,7 @@ export const FieldPreviewProvider: FunctionComponent = ({ children }) => { if (currentApiCall !== previewCount.current) { // Discard this response as there is another one inflight - // or we have called reset() and don't need the response anymore. + // or we have called reset() and no longer need the response. return; } @@ -410,7 +410,7 @@ export const FieldPreviewProvider: FunctionComponent = ({ children }) => { }, [currentIdx, totalDocs]); const reset = useCallback(() => { - // By resetting the previewCount we will discard any inflight + // By resetting the previewCount we will discard previous inflight // API call response coming in after calling reset() was called previewCount.current = 0; @@ -603,7 +603,7 @@ export const FieldPreviewProvider: FunctionComponent = ({ children }) => { }, [scriptEditorValidation, script?.source, setPreviewError, clearPreviewError]); /** - * Whenever updatePreview() changes (meaning whenever any of the params changes) + * Whenever updatePreview() changes (meaning whenever a param changes) * we call it to update the preview response with the field(s) value or possible error. */ useDebounce(updatePreview, 500, [updatePreview]); diff --git a/src/plugins/data_view_field_editor/public/types.ts b/src/plugins/data_view_field_editor/public/types.ts index 25f97e6737bf2..504a97eb7f329 100644 --- a/src/plugins/data_view_field_editor/public/types.ts +++ b/src/plugins/data_view_field_editor/public/types.ts @@ -6,20 +6,20 @@ * Side Public License, v 1. */ +import { SerializableRecord } from '@kbn/utility-types'; import { FunctionComponent } from 'react'; - +import { DeleteFieldProviderProps } from './components'; +import { OpenFieldDeleteModalOptions } from './open_delete_modal'; +import { OpenFieldEditorOptions } from './open_editor'; +import { FormatEditorServiceSetup, FormatEditorServiceStart } from './service'; import { DataPublicPluginStart, DataViewsPublicPluginStart, + FieldFormatsStart, RuntimeField, RuntimeType, UsageCollectionStart, - FieldFormatsStart, } from './shared_imports'; -import { OpenFieldEditorOptions } from './open_editor'; -import { OpenFieldDeleteModalOptions } from './open_delete_modal'; -import { FormatEditorServiceSetup, FormatEditorServiceStart } from './service'; -import { DeleteFieldProviderProps } from './components'; export interface PluginSetup { fieldFormatEditors: FormatEditorServiceSetup['fieldFormatEditors']; @@ -58,7 +58,7 @@ export interface Field { export interface FieldFormatConfig { id: string; - params?: { [key: string]: any }; + params?: SerializableRecord; } export interface EsRuntimeField { diff --git a/src/plugins/data_view_field_editor/server/plugin.ts b/src/plugins/data_view_field_editor/server/plugin.ts index c5bbe9bab7572..deb516ab25012 100644 --- a/src/plugins/data_view_field_editor/server/plugin.ts +++ b/src/plugins/data_view_field_editor/server/plugin.ts @@ -9,7 +9,7 @@ import { PluginInitializerContext, CoreSetup, Plugin, Logger } from '@kbn/core/s import { ApiRoutes } from './routes'; -export class IndexPatternPlugin implements Plugin { +export class IndexPatternPlugin implements Plugin { private readonly logger: Logger; private readonly apiRoutes: ApiRoutes; diff --git a/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx index d502038a1018d..74e1eb77cf503 100644 --- a/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx +++ b/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx @@ -70,7 +70,7 @@ export const EditIndexPattern = withRouter( indexPattern.fields.getAll().filter((field) => field.type === 'conflict') ); const [defaultIndex, setDefaultIndex] = useState(uiSettings.get('defaultIndex')); - const [tags, setTags] = useState([]); + const [tags, setTags] = useState>([]); const [showEditDialog, setShowEditDialog] = useState(false); const [relationships, setRelationships] = useState([]); const [allowedTypes, setAllowedTypes] = useState([]); @@ -220,7 +220,7 @@ export const EditIndexPattern = withRouter( {securityDataView} )} - {tags.map((tag: any) => ( + {tags.map((tag) => ( {tag.key === 'default' ? ( diff --git a/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx index 455371d6c5e2b..f2fd9ce2d2140 100644 --- a/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx +++ b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx @@ -33,7 +33,7 @@ export class SourceFiltersTable extends Component< SourceFiltersTableProps, SourceFiltersTableState > { - // Source filters do not have any unique ids, only the value is stored. + // Source filters do not have unique ids, only the value is stored. // To ensure we can create a consistent and expected UX when managing // source filters, we are assigning a unique id to each filter on the // client side only diff --git a/src/plugins/data_view_management/public/components/field_editor/field_editor.test.tsx b/src/plugins/data_view_management/public/components/field_editor/field_editor.test.tsx index 89f41e8b269ad..f3b533b7d8290 100644 --- a/src/plugins/data_view_management/public/components/field_editor/field_editor.test.tsx +++ b/src/plugins/data_view_management/public/components/field_editor/field_editor.test.tsx @@ -85,6 +85,7 @@ class Format { params() {} } +// FIXME: which interface is this? const field = { scripted: true, type: 'number', @@ -190,7 +191,7 @@ describe('FieldEditor', () => { add: jest.fn(), }, }; - indexPattern.fieldFormatMap = { test: field }; + indexPattern.fieldFormatMap = { test: field } as {}; (indexPattern.deleteFieldFormat as any) = jest.fn(); const component = createComponentWithContext( diff --git a/src/plugins/data_view_management/public/components/index_pattern_table/delete_modal_msg.tsx b/src/plugins/data_view_management/public/components/index_pattern_table/delete_modal_msg.tsx index e675f4be59b45..080b3b8bd8ea0 100644 --- a/src/plugins/data_view_management/public/components/index_pattern_table/delete_modal_msg.tsx +++ b/src/plugins/data_view_management/public/components/index_pattern_table/delete_modal_msg.tsx @@ -32,7 +32,7 @@ const tableTitle = i18n.translate('indexPatternManagement.dataViewTable.tableTit }); export const deleteModalMsg = (views: RemoveDataViewProps[], hasSpaces: boolean) => { - const columns: Array> = [ + const columns: Array> = [ { field: 'name', name: dataViewColumnName, diff --git a/src/plugins/data_views/README.mdx b/src/plugins/data_views/README.mdx index 2d7bf08d78586..7fdd435db746e 100644 --- a/src/plugins/data_views/README.mdx +++ b/src/plugins/data_views/README.mdx @@ -20,5 +20,5 @@ and field lists across the various Kibana apps. Its typically used in conjunctio **hasData:** A standardized way to check the empty state for indices and data views. - `hasESData: () => Promise; // Check to see if ES data exists` -- `hasDataView: () => Promise; // Check to see if any data view exists (managed or user created)` +- `hasDataView: () => Promise; // Check to see if data view exists (managed or user created)` - `hasUserDataView: () => Promise; // Check to see if user created data views exists` diff --git a/src/plugins/data_views/common/constants.ts b/src/plugins/data_views/common/constants.ts index 81a424d291bec..b79eef45e7fc8 100644 --- a/src/plugins/data_views/common/constants.ts +++ b/src/plugins/data_views/common/constants.ts @@ -22,7 +22,7 @@ export const RUNTIME_FIELD_TYPES = [ ] as const; /** - * Used to determine if the instance has any user created index patterns by filtering index patterns + * Used to determine if the instance has some user created index patterns by filtering index patterns * that are created and backed only by Fleet server data * Should be revised after https://github.com/elastic/kibana/issues/82851 is fixed * For more background see: https://github.com/elastic/kibana/issues/107020 diff --git a/src/plugins/data_views/common/data_views/data_view.ts b/src/plugins/data_views/common/data_views/data_view.ts index 6f01f61c98fe8..c8cafd36fb742 100644 --- a/src/plugins/data_views/common/data_views/data_view.ts +++ b/src/plugins/data_views/common/data_views/data_view.ts @@ -6,21 +6,31 @@ * Side Public License, v 1. */ -import _, { cloneDeep, each, reject } from 'lodash'; -import { castEsToKbnFieldTypeName, ES_FIELD_TYPES, KBN_FIELD_TYPES } from '@kbn/field-types'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { CharacterNotAllowedInField } from '@kbn/kibana-utils-plugin/common'; -import { - FieldFormatsStartCommon, +import type { DataViewBase } from '@kbn/es-query'; +import type { FieldFormat, + FieldFormatsStartCommon, SerializedFieldFormat, } from '@kbn/field-formats-plugin/common'; -import type { DataViewBase } from '@kbn/es-query'; -import { FieldAttrs, FieldAttrSet, DataViewAttributes } from '..'; -import type { RuntimeField, RuntimeFieldSpec, RuntimeType, FieldConfiguration } from '../types'; -import { DataViewField, IIndexPatternFieldList, fieldList } from '../fields'; +import { castEsToKbnFieldTypeName, ES_FIELD_TYPES, KBN_FIELD_TYPES } from '@kbn/field-types'; +import { CharacterNotAllowedInField } from '@kbn/kibana-utils-plugin/common'; +import _, { cloneDeep, each, reject } from 'lodash'; +import type { DataViewAttributes, FieldAttrs, FieldAttrSet } from '..'; +import type { DataViewField, IIndexPatternFieldList } from '../fields'; +import { fieldList } from '../fields'; +import type { + DataViewFieldMap, + DataViewSpec, + FieldConfiguration, + FieldFormatMap, + RuntimeField, + RuntimeFieldSpec, + RuntimeType, + SourceFilter, + TypeMeta, +} from '../types'; import { flattenHitWrapper } from './flatten_hit'; -import { DataViewSpec, TypeMeta, SourceFilter, DataViewFieldMap } from '../types'; import { removeFieldAttrs } from './utils'; interface DataViewDeps { @@ -70,7 +80,7 @@ export class DataView implements DataViewBase { /** * Map of field formats by field name */ - public fieldFormatMap: Record; + public fieldFormatMap: FieldFormatMap; /** * Only used by rollup indices, used by rollup specific endpoint to load field list. */ @@ -90,7 +100,7 @@ export class DataView implements DataViewBase { /** * @deprecated Use `flattenHit` utility method exported from data plugin instead. */ - public flattenHit: (hit: Record, deep?: boolean) => Record; + public flattenHit: (hit: Record, deep?: boolean) => Record; /** * List of meta fields by name */ @@ -233,7 +243,7 @@ export class DataView implements DataViewBase { }; } - // Date value returned in "_source" could be in any number of formats + // Date value returned in "_source" could be in a number of formats // Use a docvalue for each date field to ensure standardized formats when working with date fields // dataView.flattenHit will override "_source" values when the same field is also defined in "fields" const docvalueFields = reject(this.fields.getByType('date'), 'scripted').map((dateField) => { @@ -296,7 +306,7 @@ export class DataView implements DataViewBase { name: this.name, }; - // Filter any undefined values from the spec + // Filter undefined values from the spec return Object.fromEntries(Object.entries(spec).filter(([, v]) => typeof v !== 'undefined')); } diff --git a/src/plugins/data_views/common/data_views/data_views.ts b/src/plugins/data_views/common/data_views/data_views.ts index 85de6f2d5667e..8c98f7f18f0de 100644 --- a/src/plugins/data_views/common/data_views/data_views.ts +++ b/src/plugins/data_views/common/data_views/data_views.ts @@ -38,6 +38,10 @@ import { DuplicateDataViewError, DataViewInsufficientAccessError } from '../erro const MAX_ATTEMPTS_TO_RESOLVE_CONFLICTS = 3; +/* + * Attributes of the data view saved object + * @public + */ export type DataViewSavedObjectAttrs = Pick< DataViewAttributes, 'title' | 'type' | 'typeMeta' | 'name' @@ -445,7 +449,7 @@ export class DataViewsService { * Get default index pattern id */ getDefaultId = async (): Promise => { - const defaultIndexPatternId = await this.config.get('defaultIndex'); + const defaultIndexPatternId = await this.config.get('defaultIndex'); return defaultIndexPatternId ?? null; }; @@ -473,7 +477,7 @@ export class DataViewsService { * @returns FieldSpec[] */ getFieldsForWildcard = async (options: GetFieldsOptions): Promise => { - const metaFields = await this.config.get(META_FIELDS); + const metaFields = await this.config.get(META_FIELDS); return this.apiClient.getFieldsForWildcard({ pattern: options.pattern, metaFields, @@ -786,8 +790,8 @@ export class DataViewsService { { id, name, title, ...restOfSpec }: DataViewSpec, skipFetchFields = false ): Promise { - const shortDotsEnable = await this.config.get(FORMATS_UI_SETTINGS.SHORT_DOTS_ENABLE); - const metaFields = await this.config.get(META_FIELDS); + const shortDotsEnable = await this.config.get(FORMATS_UI_SETTINGS.SHORT_DOTS_ENABLE); + const metaFields = await this.config.get(META_FIELDS); const spec = { id: id ?? uuid.v4(), @@ -886,7 +890,8 @@ export class DataViewsService { // get changed keys const originalChangedKeys: string[] = []; Object.entries(body).forEach(([key, value]) => { - if (value !== (originalBody as any)[key]) { + const realKey = key as keyof typeof originalBody; + if (value !== originalBody[realKey]) { originalChangedKeys.push(key); } }); @@ -913,7 +918,8 @@ export class DataViewsService { const serverChangedKeys: string[] = []; Object.entries(updatedBody).forEach(([key, value]) => { - if (value !== (body as any)[key] && value !== (originalBody as any)[key]) { + const realKey = key as keyof typeof originalBody; + if (value !== body[realKey] && value !== originalBody[realKey]) { serverChangedKeys.push(key); } }); @@ -946,6 +952,7 @@ export class DataViewsService { // Set the updated response on this object serverChangedKeys.forEach((key) => { + // FIXME: this overwrites read-only properties (indexPattern as any)[key] = (samePattern as any)[key]; }); indexPattern.version = samePattern.version; diff --git a/src/plugins/data_views/common/data_views/flatten_hit.test.ts b/src/plugins/data_views/common/data_views/flatten_hit.test.ts index 24d5ee12885d2..ab7e7d14df4ec 100644 --- a/src/plugins/data_views/common/data_views/flatten_hit.test.ts +++ b/src/plugins/data_views/common/data_views/flatten_hit.test.ts @@ -59,7 +59,7 @@ describe('flattenHit', () => { zzz: ['z'], _abc: ['a'], }, - }); + } as {}); const expectedOrder = ['_abc', 'date', 'name', 'zzz', '_id', '_routing', '_score', '_type']; expect(Object.keys(response)).toEqual(expectedOrder); expect(Object.entries(response).map(([key]) => key)).toEqual(expectedOrder); diff --git a/src/plugins/data_views/common/data_views/flatten_hit.ts b/src/plugins/data_views/common/data_views/flatten_hit.ts index 0a6388f0914b1..b9932c0de950d 100644 --- a/src/plugins/data_views/common/data_views/flatten_hit.ts +++ b/src/plugins/data_views/common/data_views/flatten_hit.ts @@ -14,11 +14,21 @@ import _ from 'lodash'; import { DataView } from './data_view'; -// Takes a hit, merges it with any stored/scripted fields, and with the metaFields -// returns a flattened version - -function flattenHit(indexPattern: DataView, hit: Record, deep: boolean) { - const flat = {} as Record; +/** + * Takes a hit, merges it with whatever stored/scripted fields, and with the metaFields + * returns a flattened version + * + * @param {DataView} indexPattern + * @param {Record} hit - userland data + * @param {boolean} deep - whether to look into objects within arrays + * @returns {Record} + */ +function flattenHit( + indexPattern: DataView, + hit: Record, + deep: boolean +): Record { + const flat = {} as Record; // recursively merge _source const fields = indexPattern.fields.getByName; @@ -61,8 +71,11 @@ function flattenHit(indexPattern: DataView, hit: Record, deep: bool return flat; } -function decorateFlattenedWrapper(hit: Record, metaFields: Record) { - return function (flattened: Record) { +function decorateFlattenedWrapper( + hit: Record, + metaFields: Record +) { + return function (flattened: Record) { // assign the meta fields _.each(metaFields, function (meta) { if (meta === '_source') return; @@ -70,7 +83,7 @@ function decorateFlattenedWrapper(hit: Record, metaFields: Record, metaFields: Record, deep = false) { +export function flattenHitWrapper(dataView: DataView, metaFields = {}, cache = new WeakMap()) { + return function cachedFlatten(hit: Record, deep = false) { const decorateFlattened = decorateFlattenedWrapper(hit, metaFields); const cached = cache.get(hit); const flattened = cached || flattenHit(dataView, hit, deep); diff --git a/src/plugins/data_views/common/fields/utils.test.ts b/src/plugins/data_views/common/fields/utils.test.ts index 0f2ff280eb61b..e7d84f4dc6f0a 100644 --- a/src/plugins/data_views/common/fields/utils.test.ts +++ b/src/plugins/data_views/common/fields/utils.test.ts @@ -16,8 +16,8 @@ describe('shortenDottedString', () => { test('should ignore non-string values', () => { const obj = { key: 'val' }; - expect(shortenDottedString(true)).toBe(true); - expect(shortenDottedString(123)).toBe(123); - expect(shortenDottedString(obj)).toBe(obj); + expect(shortenDottedString(true as unknown as string)).toBe(true); + expect(shortenDottedString(123 as unknown as string)).toBe(123); + expect(shortenDottedString(obj as unknown as string)).toBe(obj); }); }); diff --git a/src/plugins/data_views/common/fields/utils.ts b/src/plugins/data_views/common/fields/utils.ts index 1dc7e7f698995..a6418bec744f0 100644 --- a/src/plugins/data_views/common/fields/utils.ts +++ b/src/plugins/data_views/common/fields/utils.ts @@ -30,10 +30,8 @@ const DOT_PREFIX_RE = /(.).+?\./g; /** * Convert a dot.notated.string into a short * version (d.n.string) - * - * @return {any} */ -export function shortenDottedString(input: any) { +export function shortenDottedString(input: string): string { return typeof input !== 'string' ? input : input.replace(DOT_PREFIX_RE, '$1.'); } diff --git a/src/plugins/data_views/common/index.ts b/src/plugins/data_views/common/index.ts index aeaca476a8abd..ffeeb069d1912 100644 --- a/src/plugins/data_views/common/index.ts +++ b/src/plugins/data_views/common/index.ts @@ -55,7 +55,11 @@ export type { } from './types'; export { DataViewType } from './types'; -export type { DataViewsContract, DataViewsServiceDeps } from './data_views'; +export type { + DataViewsContract, + DataViewsServiceDeps, + DataViewSavedObjectAttrs, +} from './data_views'; export { DataViewsService, DataViewPersistableStateService } from './data_views'; export type { DataViewListItem, diff --git a/src/plugins/data_views/common/types.ts b/src/plugins/data_views/common/types.ts index 5319ee8b0301f..40a70e3c1f547 100644 --- a/src/plugins/data_views/common/types.ts +++ b/src/plugins/data_views/common/types.ts @@ -6,15 +6,19 @@ * Side Public License, v 1. */ +import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; +import type { + SavedObject, + SavedObjectsCreateOptions, + SavedObjectsUpdateOptions, +} from '@kbn/core/public'; +import type { ErrorToastOptions, ToastInputFields } from '@kbn/core/public/notifications'; import type { DataViewFieldBase } from '@kbn/es-query'; -import { ToastInputFields, ErrorToastOptions } from '@kbn/core/public/notifications'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths,@kbn/imports/uniform_imports -import type { SavedObject } from 'src/core/server'; -import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { SerializedFieldFormat } from '@kbn/field-formats-plugin/common'; import { RUNTIME_FIELD_TYPES } from './constants'; export type { QueryDslQueryContainer }; +export type { SavedObject }; export type FieldFormatMap = Record; @@ -210,7 +214,7 @@ export interface UiSettingsCommon { * Get a setting value * @param key name of value */ - get: (key: string) => Promise; + get: (key: string) => Promise; /** * Get all settings values */ @@ -220,7 +224,7 @@ export interface UiSettingsCommon { * @param key name of value * @param value value to set */ - set: (key: string, value: T) => Promise; + set: (key: string, value: T) => Promise; /** * Remove a setting value * @param key name of value @@ -281,8 +285,8 @@ export interface SavedObjectsClientCommon { update: ( type: string, id: string, - attributes: Record, - options: Record + attributes: DataViewAttributes, + options: SavedObjectsUpdateOptions ) => Promise; /** * Create a saved object @@ -292,8 +296,8 @@ export interface SavedObjectsClientCommon { */ create: ( type: string, - attributes: Record, - options: Record + attributes: DataViewAttributes, + options: SavedObjectsCreateOptions ) => Promise; /** * Delete a saved object by id @@ -314,12 +318,10 @@ export interface GetFieldsOptions { } export interface IDataViewsApiClient { - getFieldsForWildcard: (options: GetFieldsOptions) => Promise; + getFieldsForWildcard: (options: GetFieldsOptions) => Promise; hasUserIndexPattern: () => Promise; } -export type { SavedObject }; - export type AggregationRestrictions = Record< string, { diff --git a/src/plugins/data_views/public/data_views/data_views_api_client.ts b/src/plugins/data_views/public/data_views/data_views_api_client.ts index e1b7ee1590acf..b02894d1afb63 100644 --- a/src/plugins/data_views/public/data_views/data_views_api_client.ts +++ b/src/plugins/data_views/public/data_views/data_views_api_client.ts @@ -8,7 +8,7 @@ import { HttpSetup } from '@kbn/core/public'; import { DataViewMissingIndices } from '../../common/lib'; -import { GetFieldsOptions, IDataViewsApiClient } from '../../common'; +import { FieldSpec, GetFieldsOptions, IDataViewsApiClient } from '../../common'; const API_BASE_URL: string = `/api/index_patterns/`; @@ -26,12 +26,12 @@ export class DataViewsApiClient implements IDataViewsApiClient { this.http = http; } - private _request(url: string, query?: any) { + private _request(url: string, query?: {}): Promise { return this.http .fetch(url, { query, }) - .catch((resp: any) => { + .catch((resp) => { if (resp.body.statusCode === 404 && resp.body.attributes?.code === 'no_matching_indices') { throw new DataViewMissingIndices(resp.body.message); } @@ -50,14 +50,14 @@ export class DataViewsApiClient implements IDataViewsApiClient { */ getFieldsForWildcard(options: GetFieldsOptions) { const { pattern, metaFields, type, rollupIndex, allowNoIndex, filter } = options; - return this._request(this._getUrl(['_fields_for_wildcard']), { + return this._request<{ fields: FieldSpec[] }>(this._getUrl(['_fields_for_wildcard']), { pattern, meta_fields: metaFields, type, rollup_index: rollupIndex, allow_no_index: allowNoIndex, filter, - }).then((resp: any) => resp.fields || []); + }).then((resp) => resp?.fields || []); } /** @@ -67,6 +67,6 @@ export class DataViewsApiClient implements IDataViewsApiClient { const response = await this._request<{ result: boolean }>( this._getUrl(['has_user_index_pattern']) ); - return response.result; + return response?.result ?? false; } } diff --git a/src/plugins/data_views/public/debounce_by_key.ts b/src/plugins/data_views/public/debounce_by_key.ts index c8ae7094a6437..402fd5baf9fc7 100644 --- a/src/plugins/data_views/public/debounce_by_key.ts +++ b/src/plugins/data_views/public/debounce_by_key.ts @@ -8,11 +8,19 @@ import { debounce } from 'lodash'; -export const debounceByKey = any>( +/** + * Uses a debouncer collector behind a debouncing factory to work on a set of functions + * + * @template F - function type + * @param {F} fn - function to debounce + * @param {number} waitInMs + * @returns {(key: string) => Function} + */ +export const debounceByKey = unknown>( fn: F, waitInMs: number -): ((key: string) => F) => { - const debouncerCollector: Record = {}; +): ((key: string) => Function) => { + const debouncerCollector: Record = {}; return (key: string) => { if (!debouncerCollector[key]) { debouncerCollector[key] = debounce(fn, waitInMs, { diff --git a/src/plugins/data_views/public/saved_objects_client_wrapper.ts b/src/plugins/data_views/public/saved_objects_client_wrapper.ts index 9dab5ec46f548..e8d008e130323 100644 --- a/src/plugins/data_views/public/saved_objects_client_wrapper.ts +++ b/src/plugins/data_views/public/saved_objects_client_wrapper.ts @@ -6,14 +6,20 @@ * Side Public License, v 1. */ +import { + SavedObjectsClientContract, + SavedObjectsCreateOptions, + SavedObjectsUpdateOptions, + SimpleSavedObject, +} from '@kbn/core/public'; import { omit } from 'lodash'; -import { SavedObjectsClientContract, SimpleSavedObject } from '@kbn/core/public'; +import { DataViewSavedObjectConflictError } from '../common/errors'; import { + DataViewAttributes, + SavedObject, SavedObjectsClientCommon, SavedObjectsClientCommonFindArgs, - SavedObject, } from '../common/types'; -import { DataViewSavedObjectConflictError } from '../common/errors'; type SOClient = Pick< SavedObjectsClientContract, @@ -24,7 +30,7 @@ const simpleSavedObjectToSavedObject = (simpleSavedObject: SimpleSavedObject) ({ version: simpleSavedObject._version, ...omit(simpleSavedObject, '_version'), - } as any); + } as SavedObject); export class SavedObjectsClientPublicToCommon implements SavedObjectsClientCommon { private savedObjectClient: SOClient; @@ -49,14 +55,14 @@ export class SavedObjectsClientPublicToCommon implements SavedObjectsClientCommo async update( type: string, id: string, - attributes: Record, - options: Record + attributes: DataViewAttributes, + options: SavedObjectsUpdateOptions ) { const response = await this.savedObjectClient.update(type, id, attributes, options); return simpleSavedObjectToSavedObject(response); } - async create(type: string, attributes: Record, options: Record) { + async create(type: string, attributes: DataViewAttributes, options?: SavedObjectsCreateOptions) { const response = await this.savedObjectClient.create(type, attributes, options); return simpleSavedObjectToSavedObject(response); } diff --git a/src/plugins/data_views/public/services/has_data.ts b/src/plugins/data_views/public/services/has_data.ts index 4c641e0e17f13..45f44e04e23a8 100644 --- a/src/plugins/data_views/public/services/has_data.ts +++ b/src/plugins/data_views/public/services/has_data.ts @@ -41,7 +41,7 @@ export class HasData { return hasLocalESData; }, /** - * Check to see if any data view exists + * Check to see if a data view exists */ hasDataView: async (): Promise => { const dataViewsCheck = await this.findDataViews(http); diff --git a/src/plugins/data_views/public/ui_settings_wrapper.ts b/src/plugins/data_views/public/ui_settings_wrapper.ts index 3474451ad720f..ad160ee39373e 100644 --- a/src/plugins/data_views/public/ui_settings_wrapper.ts +++ b/src/plugins/data_views/public/ui_settings_wrapper.ts @@ -14,15 +14,17 @@ export class UiSettingsPublicToCommon implements UiSettingsCommon { constructor(uiSettings: IUiSettingsClient) { this.uiSettings = uiSettings; } - get(key: string): Promise { + get(key: string): Promise { return Promise.resolve(this.uiSettings.get(key)); } - getAll(): Promise>> { + getAll(): Promise< + Record) | undefined> + > { return Promise.resolve(this.uiSettings.getAll()); } - set(key: string, value: any) { + set(key: string, value: unknown) { this.uiSettings.set(key, value); return Promise.resolve(); } diff --git a/src/plugins/data_views/server/fetcher/index.ts b/src/plugins/data_views/server/fetcher/index.ts index 8161f187a5e6a..2fbb7c8f3f3cb 100644 --- a/src/plugins/data_views/server/fetcher/index.ts +++ b/src/plugins/data_views/server/fetcher/index.ts @@ -8,7 +8,8 @@ export * from './index_patterns_fetcher'; export { - shouldReadFieldFromDocValues, - mergeCapabilitiesWithFields, getCapabilitiesForRollupIndices, + mergeCapabilitiesWithFields, + shouldReadFieldFromDocValues, } from './lib'; +export type { RollupIndexCapability } from './lib'; diff --git a/src/plugins/data_views/server/fetcher/index_patterns_fetcher.ts b/src/plugins/data_views/server/fetcher/index_patterns_fetcher.ts index 9d3b8a180d91e..dd02c9b7f9a12 100644 --- a/src/plugins/data_views/server/fetcher/index_patterns_fetcher.ts +++ b/src/plugins/data_views/server/fetcher/index_patterns_fetcher.ts @@ -79,11 +79,17 @@ export class IndexPatternsFetcher { }); if (type === 'rollup' && rollupIndex) { const rollupFields: FieldDescriptor[] = []; - const rollupIndexCapabilities = getCapabilitiesForRollupIndices( + const capabilityCheck = getCapabilitiesForRollupIndices( await this.elasticsearchClient.rollup.getRollupIndexCaps({ index: rollupIndex, }) - )[rollupIndex].aggs; + )[rollupIndex]; + + if (capabilityCheck.error) { + throw new Error(capabilityCheck.error); + } + + const rollupIndexCapabilities = capabilityCheck.aggs; const fieldCapsResponseObj = keyBy(fieldCapsResponse, 'name'); // Keep meta fields metaFields!.forEach( @@ -91,7 +97,7 @@ export class IndexPatternsFetcher { fieldCapsResponseObj[field] && rollupFields.push(fieldCapsResponseObj[field]) ); return mergeCapabilitiesWithFields( - rollupIndexCapabilities, + rollupIndexCapabilities!, fieldCapsResponseObj, rollupFields ); diff --git a/src/plugins/data_views/server/fetcher/lib/errors.ts b/src/plugins/data_views/server/fetcher/lib/errors.ts index c69e177535b76..eb510798c759f 100644 --- a/src/plugins/data_views/server/fetcher/lib/errors.ts +++ b/src/plugins/data_views/server/fetcher/lib/errors.ts @@ -7,6 +7,7 @@ */ import Boom from '@hapi/boom'; +import { CustomHttpResponseOptions } from '@kbn/core/server'; import { get } from 'lodash'; const ERR_ES_INDEX_NOT_FOUND = 'index_not_found_exception'; @@ -15,10 +16,10 @@ const ERR_NO_MATCHING_INDICES = 'no_matching_indices'; /** * Determines if an error is an elasticsearch error that's * describing a failure caused by missing index/indices - * @param {Any} err + * @param err * @return {Boolean} */ -export function isEsIndexNotFoundError(err: any) { +export function isEsIndexNotFoundError(err: unknown) { return get(err, ['body', 'error', 'type']) === ERR_ES_INDEX_NOT_FOUND; } @@ -30,17 +31,17 @@ export function isEsIndexNotFoundError(err: any) { */ export function createNoMatchingIndicesError(pattern: string[] | string) { const err = Boom.notFound(`No indices match "${pattern}"`); - (err.output.payload as any).code = ERR_NO_MATCHING_INDICES; + (err as Boom.Boom).output.payload.code = ERR_NO_MATCHING_INDICES; return err; } /** * Determines if an error is produced by `createNoMatchingIndicesError()` * - * @param {Any} err + * @param err * @return {Boolean} */ -export function isNoMatchingIndicesError(err: any) { +export function isNoMatchingIndicesError(err: unknown) { return get(err, ['output', 'payload', 'code']) === ERR_NO_MATCHING_INDICES; } @@ -48,18 +49,23 @@ export function isNoMatchingIndicesError(err: any) { * Wrap "index_not_found_exception" errors in custom Boom errors * automatically * @param {Array|String} indices + * @param {Boom.Boom|CustomHttpResponseOptions} error * @return {Boom} */ -export function convertEsError(indices: string[] | string, error: any) { +export function convertEsError(indices: string[] | string, error: unknown) { if (isEsIndexNotFoundError(error)) { return createNoMatchingIndicesError(indices); } - if (error.isBoom) { + if ((error as Boom.Boom).isBoom) { return error; } - const statusCode = error.statusCode; - const message = error.body ? error.body.error : undefined; - return Boom.boomify(error, { statusCode, message }); + const custom = error as CustomHttpResponseOptions<{ error: string; message: string }>; + const options = { + statusCode: custom.statusCode, + message: custom.body?.error ?? undefined, + }; + + return Boom.boomify(error as Error, options); } diff --git a/src/plugins/data_views/server/fetcher/lib/field_capabilities/field_caps_response.ts b/src/plugins/data_views/server/fetcher/lib/field_capabilities/field_caps_response.ts index 2581b2b78f5d8..c1bfc4c6c7e18 100644 --- a/src/plugins/data_views/server/fetcher/lib/field_capabilities/field_caps_response.ts +++ b/src/plugins/data_views/server/fetcher/lib/field_capabilities/field_caps_response.ts @@ -171,7 +171,7 @@ export function readFieldCapsResponse( subType = { ...subType, multi: { parent: firstParent.name } }; } - // We need to know if any parent field is nested + // We need to know if some parent field is nested const nestedParentCaps = parentFieldCapsAscending.find( (parentCaps) => parentCaps && parentCaps.type === 'nested' ); diff --git a/src/plugins/data_views/server/fetcher/lib/jobs_compatibility.ts b/src/plugins/data_views/server/fetcher/lib/jobs_compatibility.ts index adc60774fae37..2c104b03cf5c1 100644 --- a/src/plugins/data_views/server/fetcher/lib/jobs_compatibility.ts +++ b/src/plugins/data_views/server/fetcher/lib/jobs_compatibility.ts @@ -6,7 +6,10 @@ * Side Public License, v 1. */ +import { RollupGetRollupIndexCapsRollupJobSummary as RollupJobSummary } from '@elastic/elasticsearch/lib/api/types'; import { isEqual } from 'lodash'; +import { AggregationRestrictions } from '../../../common'; +import { RollupIndexCapability } from './map_capabilities'; /** * Checks if given job configs are compatible by attempting to merge them @@ -32,17 +35,19 @@ export function areJobsCompatible(jobs = []) { * by aggregation, then by field * * @param jobs - * @returns {{}} + * @returns {{ aggs: Dictionary }} */ -export function mergeJobConfigurations(jobs = []) { +export function mergeJobConfigurations( + jobs: RollupJobSummary[] = [] +): RollupIndexCapability[string] { if (!jobs || !Array.isArray(jobs) || !jobs.length) { throw new Error('No capabilities available'); } - const allAggs: { [key: string]: any } = {}; + const allAggs: RollupIndexCapability[string]['aggs'] = {}; // For each job, look through all of its fields - jobs.forEach((job: { fields: { [key: string]: any } }) => { + jobs.forEach((job) => { const fields = job.fields; const fieldNames = Object.keys(fields); @@ -51,7 +56,7 @@ export function mergeJobConfigurations(jobs = []) { const fieldAggs = fields[fieldName]; // Look through each field's capabilities (aggregations) - fieldAggs.forEach((agg: { agg: string; interval: string }) => { + fieldAggs.forEach((agg) => { const aggName = agg.agg; const aggDoesntExist = !allAggs[aggName]; const fieldDoesntExist = allAggs[aggName] && !allAggs[aggName][fieldName]; @@ -62,7 +67,7 @@ export function mergeJobConfigurations(jobs = []) { // date histogram field. if (aggDoesntExist || (fieldDoesntExist && !isDateHistogramAgg)) { allAggs[aggName] = allAggs[aggName] || {}; - allAggs[aggName][fieldName] = { ...agg }; + allAggs[aggName][fieldName] = { ...agg } as AggregationRestrictions[string]; } // If aggregation already exists, attempt to merge it else { @@ -73,6 +78,7 @@ export function mergeJobConfigurations(jobs = []) { // new interval and existing interval case 'histogram': // TODO: Fix this with LCD algorithm + // @ts-expect-error - Property 'interval' does not exist on type 'RollupGetRollupIndexCapsRollupJobSummaryField' const intervals = [fieldAgg.interval, agg.interval].sort((a, b) => a - b); const isMultiple = intervals[1] % intervals[0] === 0; fieldAgg.interval = isMultiple ? intervals[1] : intervals[0] * intervals[1]; diff --git a/src/plugins/data_views/server/fetcher/lib/map_capabilities.ts b/src/plugins/data_views/server/fetcher/lib/map_capabilities.ts index e2076a373d489..a5fdf98bd03e9 100644 --- a/src/plugins/data_views/server/fetcher/lib/map_capabilities.ts +++ b/src/plugins/data_views/server/fetcher/lib/map_capabilities.ts @@ -6,17 +6,31 @@ * Side Public License, v 1. */ +import { RollupGetRollupIndexCapsResponse } from '@elastic/elasticsearch/lib/api/types'; +import { Dictionary } from 'lodash'; +import { AggregationRestrictions } from '../../../common'; import { mergeJobConfigurations } from './jobs_compatibility'; +/** + * A record of capabilities (aggregations) for index rollup jobs + */ +export interface RollupIndexCapability { + /** + * A record of capabilities (aggregations) for an index rollup job + */ + [index: string]: { aggs?: Dictionary; error?: string }; +} + /** * Get rollup job capabilities * @public * @param indices rollup job index capabilites */ - -export function getCapabilitiesForRollupIndices(indices: Record) { +export function getCapabilitiesForRollupIndices( + indices: RollupGetRollupIndexCapsResponse +): RollupIndexCapability { const indexNames = Object.keys(indices); - const capabilities = {} as { [key: string]: any }; + const capabilities: RollupIndexCapability = {}; indexNames.forEach((index) => { try { diff --git a/src/plugins/data_views/server/fetcher/lib/merge_capabilities_with_fields.ts b/src/plugins/data_views/server/fetcher/lib/merge_capabilities_with_fields.ts index f80ae108fb681..922fde5347cfb 100644 --- a/src/plugins/data_views/server/fetcher/lib/merge_capabilities_with_fields.ts +++ b/src/plugins/data_views/server/fetcher/lib/merge_capabilities_with_fields.ts @@ -11,7 +11,7 @@ import { FieldDescriptor } from '../index_patterns_fetcher'; export const mergeCapabilitiesWithFields = ( - rollupIndexCapabilities: { [key: string]: any }, + rollupIndexCapabilities: Record, fieldsFromFieldCapsApi: Record, previousFields: FieldDescriptor[] = [] ) => { diff --git a/src/plugins/data_views/server/index.ts b/src/plugins/data_views/server/index.ts index e9eb7f0b50a3f..d7860e0bed473 100644 --- a/src/plugins/data_views/server/index.ts +++ b/src/plugins/data_views/server/index.ts @@ -7,7 +7,7 @@ */ export { getFieldByName, findIndexPatternById } from './utils'; -export type { FieldDescriptor } from './fetcher'; +export type { FieldDescriptor, RollupIndexCapability } from './fetcher'; export { IndexPatternsFetcher, getCapabilitiesForRollupIndices } from './fetcher'; export type { DataViewsServerPluginStart, diff --git a/src/plugins/data_views/server/rest_api_routes/util/handle_errors.ts b/src/plugins/data_views/server/rest_api_routes/util/handle_errors.ts index c828e064fce84..a01890c34a43d 100644 --- a/src/plugins/data_views/server/rest_api_routes/util/handle_errors.ts +++ b/src/plugins/data_views/server/rest_api_routes/util/handle_errors.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import Boom from '@hapi/boom'; import type { RequestHandler, RouteMethod, RequestHandlerContext } from '@kbn/core/server'; import { ErrorIndexPatternNotFound } from '../../error'; @@ -47,7 +48,8 @@ export const handleErrors = } const is404 = - (error as ErrorIndexPatternNotFound).is404 || (error as any)?.output?.statusCode === 404; + (error as ErrorIndexPatternNotFound).is404 || + (error as Boom.Boom)?.output?.statusCode === 404; if (is404) { return response.notFound({ diff --git a/src/plugins/data_views/server/saved_objects/data_views.ts b/src/plugins/data_views/server/saved_objects/data_views.ts index 064302e2b6fe6..3036efd5559d3 100644 --- a/src/plugins/data_views/server/saved_objects/data_views.ts +++ b/src/plugins/data_views/server/saved_objects/data_views.ts @@ -41,5 +41,5 @@ export const dataViewSavedObjectType: SavedObjectsType = { name: { type: 'text' }, }, }, - migrations: indexPatternSavedObjectTypeMigrations as any, + migrations: indexPatternSavedObjectTypeMigrations, }; diff --git a/src/plugins/data_views/server/saved_objects_client_wrapper.ts b/src/plugins/data_views/server/saved_objects_client_wrapper.ts index d8755b9ff1be1..9ac5e5203a10e 100644 --- a/src/plugins/data_views/server/saved_objects_client_wrapper.ts +++ b/src/plugins/data_views/server/saved_objects_client_wrapper.ts @@ -7,7 +7,11 @@ */ import { SavedObjectsClientContract, SavedObject } from '@kbn/core/server'; -import { SavedObjectsClientCommon, SavedObjectsClientCommonFindArgs } from '../common/types'; +import { + DataViewAttributes, + SavedObjectsClientCommon, + SavedObjectsClientCommonFindArgs, +} from '../common/types'; import { DataViewSavedObjectConflictError } from '../common/errors'; export class SavedObjectsClientServerToCommon implements SavedObjectsClientCommon { @@ -27,15 +31,10 @@ export class SavedObjectsClientServerToCommon implements SavedObjectsClientCommo } return response.saved_object; } - async update( - type: string, - id: string, - attributes: Record, - options: Record - ) { + async update(type: string, id: string, attributes: DataViewAttributes, options: {}) { return (await this.savedObjectClient.update(type, id, attributes, options)) as SavedObject; } - async create(type: string, attributes: Record, options: Record) { + async create(type: string, attributes: DataViewAttributes, options: {}) { return await this.savedObjectClient.create(type, attributes, options); } delete(type: string, id: string) { diff --git a/src/plugins/data_views/server/ui_settings_wrapper.ts b/src/plugins/data_views/server/ui_settings_wrapper.ts index 51f23d7de4cd6..e9968d500fca8 100644 --- a/src/plugins/data_views/server/ui_settings_wrapper.ts +++ b/src/plugins/data_views/server/ui_settings_wrapper.ts @@ -14,15 +14,15 @@ export class UiSettingsServerToCommon implements UiSettingsCommon { constructor(uiSettings: IUiSettingsClient) { this.uiSettings = uiSettings; } - get(key: string): Promise { + get(key: string): Promise { return this.uiSettings.get(key); } - getAll(): Promise> { + getAll(): Promise> { return this.uiSettings.getAll(); } - set(key: string, value: any) { + set(key: string, value: unknown) { return this.uiSettings.set(key, value); } diff --git a/src/plugins/discover/public/embeddable/saved_search_grid.scss b/src/plugins/discover/public/embeddable/saved_search_grid.scss new file mode 100644 index 0000000000000..1b1046485596b --- /dev/null +++ b/src/plugins/discover/public/embeddable/saved_search_grid.scss @@ -0,0 +1,16 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +/** + * 1. Fixes fullscreen mode for saved searches on Dashboard. Otherwise, sibling grids can obscure the grid in fullscreen mode. + * "euiDataGrid__restrictBody" is set to body element when a grid is in fullscreen + * https://github.com/elastic/kibana/issues/134032 + */ +.euiDataGrid__restrictBody .embPanel .embPanel__content { + z-index: unset !important; /* 1 */ +} diff --git a/src/plugins/discover/public/embeddable/saved_search_grid.tsx b/src/plugins/discover/public/embeddable/saved_search_grid.tsx index 7c567dc75dfa3..dbfb64775ed2e 100644 --- a/src/plugins/discover/public/embeddable/saved_search_grid.tsx +++ b/src/plugins/discover/public/embeddable/saved_search_grid.tsx @@ -10,6 +10,7 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { DataTableRecord } from '../types'; import { DiscoverGrid, DiscoverGridProps } from '../components/discover_grid/discover_grid'; import { TotalDocuments } from '../application/main/components/total_documents/total_documents'; +import './saved_search_grid.scss'; export interface DiscoverGridEmbeddableProps extends DiscoverGridProps { totalHitCount: number; diff --git a/src/plugins/vis_types/timeseries/common/fields_utils.ts b/src/plugins/vis_types/timeseries/common/fields_utils.ts index 65125f616155e..d5c2dfdc68811 100644 --- a/src/plugins/vis_types/timeseries/common/fields_utils.ts +++ b/src/plugins/vis_types/timeseries/common/fields_utils.ts @@ -94,7 +94,8 @@ export const createCachedFieldValueFormatter = ( return convert(cachedFormatter); } - if (dataView && !excludedFieldFormatsIds.includes(dataView.fieldFormatMap?.[fieldName]?.id)) { + const formatId = dataView?.fieldFormatMap?.[fieldName]?.id as FIELD_FORMAT_IDS; + if (dataView && !excludedFieldFormatsIds.includes(formatId)) { const field = dataView.fields.getByName(fieldName); if (field) { const formatter = dataView.getFormatterForField(field); diff --git a/test/analytics/fixtures/plugins/analytics_plugin_a/public/plugin.ts b/test/analytics/fixtures/plugins/analytics_plugin_a/public/plugin.ts index 963b829f6af86..4a2d455818dec 100644 --- a/test/analytics/fixtures/plugins/analytics_plugin_a/public/plugin.ts +++ b/test/analytics/fixtures/plugins/analytics_plugin_a/public/plugin.ts @@ -78,9 +78,9 @@ export class AnalyticsPluginA implements Plugin { registerContextProvider({ name: 'analyticsPluginA', - context$: new BehaviorSubject({ user_agent: navigator.userAgent }).asObservable(), + context$: new BehaviorSubject({ userAgent: navigator.userAgent }).asObservable(), schema: { - user_agent: { + userAgent: { type: 'keyword', _meta: { description: 'The user agent of the browser', diff --git a/test/analytics/tests/instrumented_events/from_the_browser/core_context_providers.ts b/test/analytics/tests/instrumented_events/from_the_browser/core_context_providers.ts index 3d0b018156ce7..3109b95744485 100644 --- a/test/analytics/tests/instrumented_events/from_the_browser/core_context_providers.ts +++ b/test/analytics/tests/instrumented_events/from_the_browser/core_context_providers.ts @@ -23,11 +23,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should have the properties provided by the "cluster info" context provider', () => { - expect(event.context).to.have.property('cluster_uuid'); + expect(event.context).to.have.property('clusterUuid'); expect(event.context.cluster_uuid).to.be.a('string'); - expect(event.context).to.have.property('cluster_name'); + expect(event.context).to.have.property('clusterName'); expect(event.context.cluster_name).to.be.a('string'); - expect(event.context).to.have.property('cluster_version'); + expect(event.context).to.have.property('clusterVersion'); expect(event.context.cluster_version).to.be.a('string'); }); @@ -47,18 +47,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should have the properties provided by the "session-id" context provider', () => { - expect(event.context).to.have.property('session_id'); + expect(event.context).to.have.property('sessionId'); expect(event.context.session_id).to.be.a('string'); }); it('should have the properties provided by the "browser info" context provider', () => { - expect(event.context).to.have.property('user_agent'); + expect(event.context).to.have.property('userAgent'); expect(event.context.user_agent).to.be.a('string'); - expect(event.context).to.have.property('preferred_language'); - expect(event.context.preferred_language).to.be.a('string'); - expect(event.context).to.have.property('preferred_languages'); - expect(event.context.preferred_languages).to.be.an('array'); - (event.context.preferred_languages as unknown[]).forEach((lang) => + expect(event.context).to.have.property('preferredLanguage'); + expect(event.context.preferredLanguage).to.be.a('string'); + expect(event.context).to.have.property('preferredLanguages'); + expect(event.context.preferredLanguages).to.be.an('array'); + (event.context.preferredLanguages as unknown[]).forEach((lang) => expect(lang).to.be.a('string') ); }); @@ -75,11 +75,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should have the properties provided by the "license info" context provider', async () => { await common.clickAndValidate('kibanaChrome', 'kibanaChrome'); [event] = await ebtUIHelper.getEvents(1, { eventTypes: ['click'] }); // Get a later event to ensure license has been obtained already. - expect(event.context).to.have.property('license_id'); + expect(event.context).to.have.property('licenseId'); expect(event.context.license_id).to.be.a('string'); - expect(event.context).to.have.property('license_status'); + expect(event.context).to.have.property('licenseStatus'); expect(event.context.license_status).to.be.a('string'); - expect(event.context).to.have.property('license_type'); + expect(event.context).to.have.property('licenseType'); expect(event.context.license_type).to.be.a('string'); }); diff --git a/test/analytics/tests/instrumented_events/from_the_browser/loaded_kibana.ts b/test/analytics/tests/instrumented_events/from_the_browser/loaded_kibana.ts index 0c7f39d3617b0..fbb18c0ecc85d 100644 --- a/test/analytics/tests/instrumented_events/from_the_browser/loaded_kibana.ts +++ b/test/analytics/tests/instrumented_events/from_the_browser/loaded_kibana.ts @@ -20,13 +20,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should emit the legacy "Loaded Kibana"', async () => { - const [event] = await ebtUIHelper.getEvents(1, { eventTypes: ['Loaded Kibana'] }); + const [legacyEvent] = await ebtUIHelper.getEvents(1, { eventTypes: ['Loaded Kibana'] }); - expect(event.event_type).to.eql('Loaded Kibana'); - expect(event.properties).to.have.property('kibana_version'); - expect(event.properties.kibana_version).to.be.a('string'); - expect(event.properties).to.have.property('protocol'); - expect(event.properties.protocol).to.be.a('string'); + expect(legacyEvent.event_type).to.eql('Loaded Kibana'); + expect(legacyEvent.properties).to.have.property('kibana_version'); + expect(legacyEvent.properties.kibana_version).to.be.a('string'); + expect(legacyEvent.properties).to.have.property('protocol'); + expect(legacyEvent.properties.protocol).to.be.a('string'); }); it('should emit the new kibana-loaded events', async () => { @@ -43,7 +43,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(event.properties).to.have.property('meta'); const meta = event.properties.meta as Record; - expect(meta.kibana_version).to.be.a('string'); + expect(meta.kibanaVersion).to.be.a('string'); expect(meta.protocol).to.be.a('string'); // Kibana Loaded timings diff --git a/test/analytics/tests/instrumented_events/from_the_server/core_context_providers.ts b/test/analytics/tests/instrumented_events/from_the_server/core_context_providers.ts index cf781bed5ad0e..a2cc4f24eb416 100644 --- a/test/analytics/tests/instrumented_events/from_the_server/core_context_providers.ts +++ b/test/analytics/tests/instrumented_events/from_the_server/core_context_providers.ts @@ -25,11 +25,11 @@ export default function ({ getService }: FtrProviderContext) { }); event = events[i - 1]; i++; - } while (event.properties.overall_status_level !== 'available'); + } while (event.properties.overallStatusLevel !== 'available'); }); it('should have the properties provided by the "kibana info" context provider', () => { - expect(event.context).to.have.property('kibana_uuid'); + expect(event.context).to.have.property('kibanaUuid'); expect(event.context.kibana_uuid).to.be.a('string'); expect(event.context).to.have.property('pid'); expect(event.context.pid).to.be.a('number'); @@ -51,27 +51,27 @@ export default function ({ getService }: FtrProviderContext) { }); it('should have the properties provided by the "cluster info" context provider', () => { - expect(event.context).to.have.property('cluster_uuid'); + expect(event.context).to.have.property('clusterUuid'); expect(event.context.cluster_uuid).to.be.a('string'); - expect(event.context).to.have.property('cluster_name'); + expect(event.context).to.have.property('clusterName'); expect(event.context.cluster_name).to.be.a('string'); - expect(event.context).to.have.property('cluster_version'); + expect(event.context).to.have.property('clusterVersion'); expect(event.context.cluster_version).to.be.a('string'); }); it('should have the properties provided by the "status info" context provider', () => { - expect(event.context).to.have.property('overall_status_level'); - expect(event.context.overall_status_level).to.be.a('string'); - expect(event.context).to.have.property('overall_status_summary'); - expect(event.context.overall_status_summary).to.be.a('string'); + expect(event.context).to.have.property('overallStatusLevel'); + expect(event.context.overallStatusLevel).to.be.a('string'); + expect(event.context).to.have.property('overallStatusSummary'); + expect(event.context.overallStatusSummary).to.be.a('string'); }); it('should have the properties provided by the "license info" context provider', () => { - expect(event.context).to.have.property('license_id'); + expect(event.context).to.have.property('licenseId'); expect(event.context.license_id).to.be.a('string'); - expect(event.context).to.have.property('license_status'); + expect(event.context).to.have.property('licenseStatus'); expect(event.context.license_status).to.be.a('string'); - expect(event.context).to.have.property('license_type'); + expect(event.context).to.have.property('licenseType'); expect(event.context.license_type).to.be.a('string'); }); diff --git a/test/analytics/tests/instrumented_events/from_the_server/core_overall_status_changed.ts b/test/analytics/tests/instrumented_events/from_the_server/core_overall_status_changed.ts index 8f904c4c8844c..bf871542c9b6d 100644 --- a/test/analytics/tests/instrumented_events/from_the_server/core_overall_status_changed.ts +++ b/test/analytics/tests/instrumented_events/from_the_server/core_overall_status_changed.ts @@ -25,28 +25,28 @@ export default function ({ getService }: FtrProviderContext) { it('should emit the initial "degraded" event with the context set to `initializing`', () => { expect(initialEvent.event_type).to.eql('core-overall_status_changed'); - expect(initialEvent.context).to.have.property('overall_status_level', 'initializing'); + expect(initialEvent.context).to.have.property('overallStatusLevel', 'initializing'); expect(initialEvent.context).to.have.property( - 'overall_status_summary', + 'overallStatusSummary', 'Kibana is starting up' ); - expect(initialEvent.properties).to.have.property('overall_status_level', 'degraded'); - expect(initialEvent.properties).to.have.property('overall_status_summary'); - expect(initialEvent.properties.overall_status_summary).to.be.a('string'); + expect(initialEvent.properties).to.have.property('overallStatusLevel', 'degraded'); + expect(initialEvent.properties).to.have.property('overallStatusSummary'); + expect(initialEvent.properties.overallStatusSummary).to.be.a('string'); }); it('should emit the 2nd event as `available` with the context set to the previous values', () => { expect(secondEvent.event_type).to.eql('core-overall_status_changed'); expect(secondEvent.context).to.have.property( - 'overall_status_level', - initialEvent.properties.overall_status_level + 'overallStatusLevel', + initialEvent.properties.overallStatusLevel ); expect(secondEvent.context).to.have.property( - 'overall_status_summary', - initialEvent.properties.overall_status_summary + 'overallStatusSummary', + initialEvent.properties.overallStatusSummary ); - expect(secondEvent.properties.overall_status_level).to.be.a('string'); // Ideally we would test it as `available`, but we can't do that as it may result flaky for many side effects in the CI. - expect(secondEvent.properties.overall_status_summary).to.be.a('string'); + expect(secondEvent.properties.overallStatusLevel).to.be.a('string'); // Ideally we would test it as `available`, but we can't do that as it may result flaky for many side effects in the CI. + expect(secondEvent.properties.overallStatusSummary).to.be.a('string'); }); }); } diff --git a/test/functional/apps/dashboard/group1/embeddable_rendering.ts b/test/functional/apps/dashboard/group1/embeddable_rendering.ts index 42f2e9a24f3d0..f57b1f1fda83a 100644 --- a/test/functional/apps/dashboard/group1/embeddable_rendering.ts +++ b/test/functional/apps/dashboard/group1/embeddable_rendering.ts @@ -99,8 +99,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboardExpect.vegaTextsDoNotExist(['5,000']); }; - // FLAKY: https://github.com/elastic/kibana/issues/132865 - describe.skip('dashboard embeddable rendering', function describeIndexTests() { + describe('dashboard embeddable rendering', function describeIndexTests() { before(async () => { await security.testUser.setRoles(['kibana_admin', 'animals', 'test_logstash_reader']); await kibanaServer.savedObjects.cleanStandardList(); diff --git a/test/functional/apps/dashboard/group1/url_field_formatter.ts b/test/functional/apps/dashboard/group1/url_field_formatter.ts index 2295693098ba7..ec6b39d7dc659 100644 --- a/test/functional/apps/dashboard/group1/url_field_formatter.ts +++ b/test/functional/apps/dashboard/group1/url_field_formatter.ts @@ -11,18 +11,19 @@ import { WebElementWrapper } from '../../../services/lib/web_element_wrapper'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { - const { common, dashboard, settings, timePicker, visChart } = getPageObjects([ + const { common, dashboard, settings, visChart, discover } = getPageObjects([ 'common', 'dashboard', 'settings', - 'timePicker', 'visChart', + 'discover', ]); const kibanaServer = getService('kibanaServer'); const testSubjects = getService('testSubjects'); const browser = getService('browser'); const fieldName = 'clientip'; const deployment = getService('deployment'); + const retry = getService('retry'); const clickFieldAndCheckUrl = async (fieldLink: WebElementWrapper) => { const fieldValue = await fieldLink.getVisibleText(); @@ -35,8 +36,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(currentUrl).to.equal(fieldUrl); }; - // FLAKY: https://github.com/elastic/kibana/issues/133973 - describe.skip('Changing field formatter to Url', () => { + describe('Changing field formatter to Url', () => { before(async function () { await kibanaServer.savedObjects.cleanStandardList(); await kibanaServer.importExport.load( @@ -68,12 +68,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('applied on discover', async () => { + const from = 'Sep 19, 2017 @ 06:31:44.000'; + const to = 'Sep 23, 2018 @ 18:31:44.000'; + await common.setTime({ from, to }); await common.navigateToApp('discover'); - await timePicker.setAbsoluteRange( - 'Sep 19, 2017 @ 06:31:44.000', - 'Sep 23, 2018 @ 18:31:44.000' - ); + await discover.selectIndexPattern('logstash-*'); await testSubjects.click('docTableExpandToggleColumn'); + await retry.waitForWithTimeout(`${fieldName} is visible`, 30000, async () => { + return await testSubjects.isDisplayed(`tableDocViewRow-${fieldName}-value`); + }); const fieldLink = await testSubjects.find(`tableDocViewRow-${fieldName}-value`); await clickFieldAndCheckUrl(fieldLink); }); diff --git a/test/scripts/jenkins_build_kibana.sh b/test/scripts/jenkins_build_kibana.sh index 7a5f1b67ac1be..28d4feef3a4b9 100755 --- a/test/scripts/jenkins_build_kibana.sh +++ b/test/scripts/jenkins_build_kibana.sh @@ -10,9 +10,6 @@ fi # doesn't persist, also set in kibanaPipeline.groovy export KBN_NP_PLUGINS_BUILT=true -echo " -> Ensuring all functional tests are in a ciGroup" -node scripts/ensure_all_tests_in_ci_group - # Do not build kibana for code coverage run if [[ -z "$CODE_COVERAGE" ]] ; then echo " -> building and extracting default Kibana distributable for use in functional tests" diff --git a/test/scripts/jenkins_code_coverage.sh b/test/scripts/jenkins_code_coverage.sh deleted file mode 100755 index 0931da5f9c4af..0000000000000 --- a/test/scripts/jenkins_code_coverage.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -cd "$KIBANA_DIR" -source src/dev/ci_setup/setup_env.sh - -if [[ ! "$TASK_QUEUE_PROCESS_ID" ]]; then - ./test/scripts/jenkins_build_plugins.sh -fi - -# doesn't persist, also set in kibanaPipeline.groovy -export KBN_NP_PLUGINS_BUILT=true - -echo " -> Ensuring all functional tests are in a ciGroup" -node scripts/ensure_all_tests_in_ci_group diff --git a/test/scripts/jenkins_unit.sh b/test/scripts/jenkins_unit.sh deleted file mode 100755 index e0ff16f387e3d..0000000000000 --- a/test/scripts/jenkins_unit.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash - -source test/scripts/jenkins_test_setup.sh - -if [[ -z "$CODE_COVERAGE" ]] ; then - # Lint - ./test/scripts/lint/eslint.sh - ./test/scripts/lint/stylelint.sh - - # Test - ./test/scripts/test/jest_integration.sh - ./test/scripts/test/jest_unit.sh - ./test/scripts/test/api_integration.sh - - # Check - ./test/scripts/checks/telemetry.sh - ./test/scripts/checks/ts_projects.sh - ./test/scripts/checks/jest_configs.sh - ./test/scripts/checks/type_check.sh - ./test/scripts/checks/bundle_limits.sh - ./test/scripts/checks/i18n.sh - ./test/scripts/checks/file_casing.sh - ./test/scripts/checks/licenses.sh - ./test/scripts/checks/plugins_with_circular_deps.sh - ./test/scripts/checks/verify_notice.sh - ./test/scripts/checks/test_projects.sh - ./test/scripts/checks/test_hardening.sh -else - echo " -> Running jest tests with coverage" - node scripts/jest --ci --maxWorkers=8 --coverage || true; - - echo " -> Running jest integration tests with coverage" - node scripts/jest_integration --ci --coverage || true; - - echo " -> Combine code coverage in a single report" - yarn nyc report --nycrc-path src/dev/code_coverage/nyc_config/nyc.jest.config.js -fi diff --git a/x-pack/packages/ml/agg_utils/src/get_agg_intervals.ts b/x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts similarity index 73% rename from x-pack/packages/ml/agg_utils/src/get_agg_intervals.ts rename to x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts index 67a6f28497d6e..1d6b3f781f901 100644 --- a/x-pack/packages/ml/agg_utils/src/get_agg_intervals.ts +++ b/x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts @@ -7,7 +7,6 @@ import { get } from 'lodash'; -import type { Client } from '@elastic/elasticsearch'; import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { KBN_FIELD_TYPES } from '@kbn/field-types'; @@ -16,39 +15,14 @@ import { stringHash } from '@kbn/ml-string-hash'; import { buildSamplerAggregation } from './build_sampler_aggregation'; import { getSamplerAggregationsResponsePath } from './get_sampler_aggregations_response_path'; - -// TODO Temporary type definition until we can import from `@kbn/core`. -// Copied from src/core/server/elasticsearch/client/types.ts -// as these types aren't part of any package yet. Once they are, remove this completely - -/** - * Client used to query the elasticsearch cluster. - * @deprecated At some point use the one from src/core/server/elasticsearch/client/types.ts when it is made into a package. If it never is, then keep using this one. - * @public - */ -type ElasticsearchClient = Omit< - Client, - 'connectionPool' | 'serializer' | 'extend' | 'close' | 'diagnostic' ->; +import type { ElasticsearchClient, HistogramField, NumericColumnStatsMap } from './types'; const MAX_CHART_COLUMNS = 20; -interface HistogramField { - fieldName: string; - type: string; -} - -interface NumericColumnStats { - interval: number; - min: number; - max: number; -} -type NumericColumnStatsMap = Record; - /** * Returns aggregation intervals for the supplied document fields. */ -export const getAggIntervals = async ( +export const fetchAggIntervals = async ( client: ElasticsearchClient, indexPattern: string, query: estypes.QueryDslQueryContainer, diff --git a/x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts b/x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts new file mode 100644 index 0000000000000..1e8e2667c0aac --- /dev/null +++ b/x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts @@ -0,0 +1,254 @@ +/* + * 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 get from 'lodash/get'; + +import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; + +import { KBN_FIELD_TYPES } from '@kbn/field-types'; +import { isPopulatedObject } from '@kbn/ml-is-populated-object'; +import { stringHash } from '@kbn/ml-string-hash'; + +import { buildSamplerAggregation } from './build_sampler_aggregation'; +import { fetchAggIntervals } from './fetch_agg_intervals'; +import { getSamplerAggregationsResponsePath } from './get_sampler_aggregations_response_path'; +import type { + AggCardinality, + ElasticsearchClient, + HistogramField, + NumericColumnStats, + NumericColumnStatsMap, +} from './types'; + +const MAX_CHART_COLUMNS = 20; + +interface AggHistogram { + histogram: { + field: string; + interval: number; + }; +} + +interface AggTerms { + terms: { + field: string; + size: number; + }; +} + +interface NumericDataItem { + key: number; + key_as_string?: string; + doc_count: number; +} + +/** + * Interface to describe the data structure returned for numeric based charts. + */ +export interface NumericChartData { + data: NumericDataItem[]; + id: string; + interval: number; + stats: [number, number]; + type: 'numeric'; +} + +/** + * Numeric based histogram field interface, limited to `date` and `number`. + */ +export interface NumericHistogramField extends HistogramField { + type: KBN_FIELD_TYPES.DATE | KBN_FIELD_TYPES.NUMBER; +} +type NumericHistogramFieldWithColumnStats = NumericHistogramField & NumericColumnStats; + +function isNumericHistogramField(arg: unknown): arg is NumericHistogramField { + return ( + isPopulatedObject(arg, ['fieldName', 'type']) && + (arg.type === KBN_FIELD_TYPES.DATE || arg.type === KBN_FIELD_TYPES.NUMBER) + ); +} +function isNumericHistogramFieldWithColumnStats( + arg: unknown +): arg is NumericHistogramFieldWithColumnStats { + return ( + isPopulatedObject(arg, ['fieldName', 'type', 'min', 'max', 'interval']) && + (arg.type === KBN_FIELD_TYPES.DATE || arg.type === KBN_FIELD_TYPES.NUMBER) + ); +} + +interface OrdinalDataItem { + key: string; + key_as_string?: string; + doc_count: number; +} + +interface OrdinalChartData { + type: 'ordinal' | 'boolean'; + cardinality: number; + data: OrdinalDataItem[]; + id: string; +} + +interface OrdinalHistogramField extends HistogramField { + type: KBN_FIELD_TYPES.STRING | KBN_FIELD_TYPES.BOOLEAN; +} + +function isOrdinalHistogramField(arg: unknown): arg is OrdinalHistogramField { + return ( + isPopulatedObject(arg, ['fieldName', 'type']) && + (arg.type === KBN_FIELD_TYPES.STRING || arg.type === KBN_FIELD_TYPES.BOOLEAN) + ); +} + +interface UnsupportedChartData { + id: string; + type: 'unsupported'; +} + +interface UnsupportedHistogramField extends HistogramField { + type: Exclude< + KBN_FIELD_TYPES, + KBN_FIELD_TYPES.STRING | KBN_FIELD_TYPES.BOOLEAN | KBN_FIELD_TYPES.DATE | KBN_FIELD_TYPES.NUMBER + >; +} + +type ChartRequestAgg = AggHistogram | AggCardinality | AggTerms; + +/** + * All types of histogram field definitions for fetching histogram data. + */ +export type FieldsForHistograms = Array< + | NumericHistogramField + | NumericHistogramFieldWithColumnStats + | OrdinalHistogramField + | UnsupportedHistogramField +>; + +/** + * Fetches data to be used in mini histogram charts. Supports auto-identifying + * the histogram interval and min/max values. + * + * @param client Elasticsearch Client + * @param indexPattern index pattern to be queried + * @param query Elasticsearch query + * @param fields the fields the histograms should be generated for + * @param samplerShardSize shard_size parameter of the sampler aggregation + * @param runtimeMappings optional runtime mappings + * @returns an array of histogram data for each supplied field + */ +export const fetchHistogramsForFields = async ( + client: ElasticsearchClient, + indexPattern: string, + query: any, + fields: FieldsForHistograms, + samplerShardSize: number, + runtimeMappings?: estypes.MappingRuntimeFields +) => { + const aggIntervals = { + ...(await fetchAggIntervals( + client, + indexPattern, + query, + fields.filter((f) => !isNumericHistogramFieldWithColumnStats(f)), + samplerShardSize, + runtimeMappings + )), + ...fields.filter(isNumericHistogramFieldWithColumnStats).reduce((p, field) => { + const { interval, min, max, fieldName } = field; + p[stringHash(fieldName)] = { interval, min, max }; + + return p; + }, {} as NumericColumnStatsMap), + }; + + const chartDataAggs = fields.reduce((aggs, field) => { + const id = stringHash(field.fieldName); + if (isNumericHistogramField(field)) { + if (aggIntervals[id] !== undefined) { + aggs[`${id}_histogram`] = { + histogram: { + field: field.fieldName, + interval: aggIntervals[id].interval !== 0 ? aggIntervals[id].interval : 1, + }, + }; + } + } else if (isOrdinalHistogramField(field)) { + if (field.type === KBN_FIELD_TYPES.STRING) { + aggs[`${id}_cardinality`] = { + cardinality: { + field: field.fieldName, + }, + }; + } + aggs[`${id}_terms`] = { + terms: { + field: field.fieldName, + size: MAX_CHART_COLUMNS, + }, + }; + } + return aggs; + }, {} as Record); + + if (Object.keys(chartDataAggs).length === 0) { + return []; + } + + const body = await client.search( + { + index: indexPattern, + size: 0, + body: { + query, + aggs: buildSamplerAggregation(chartDataAggs, samplerShardSize), + size: 0, + ...(isPopulatedObject(runtimeMappings) ? { runtime_mappings: runtimeMappings } : {}), + }, + }, + { maxRetries: 0 } + ); + + const aggsPath = getSamplerAggregationsResponsePath(samplerShardSize); + const aggregations = aggsPath.length > 0 ? get(body.aggregations, aggsPath) : body.aggregations; + + return fields.map((field) => { + const id = stringHash(field.fieldName); + + if (isNumericHistogramField(field)) { + if (aggIntervals[id] === undefined) { + return { + type: 'numeric', + data: [], + interval: 0, + stats: [0, 0], + id: field.fieldName, + } as NumericChartData; + } + + return { + data: aggregations[`${id}_histogram`].buckets, + interval: aggIntervals[id].interval, + stats: [aggIntervals[id].min, aggIntervals[id].max], + type: 'numeric', + id: field.fieldName, + } as NumericChartData; + } else if (isOrdinalHistogramField(field)) { + return { + type: field.type === KBN_FIELD_TYPES.STRING ? 'ordinal' : 'boolean', + cardinality: + field.type === KBN_FIELD_TYPES.STRING ? aggregations[`${id}_cardinality`].value : 2, + data: aggregations[`${id}_terms`].buckets, + id: field.fieldName, + } as OrdinalChartData; + } + + return { + type: 'unsupported', + id: field.fieldName, + } as UnsupportedChartData; + }); +}; diff --git a/x-pack/packages/ml/agg_utils/src/index.ts b/x-pack/packages/ml/agg_utils/src/index.ts index 80283c975c66d..ecab763d3e12e 100644 --- a/x-pack/packages/ml/agg_utils/src/index.ts +++ b/x-pack/packages/ml/agg_utils/src/index.ts @@ -6,7 +6,19 @@ */ export { buildSamplerAggregation } from './build_sampler_aggregation'; -export { getAggIntervals } from './get_agg_intervals'; +export { fetchAggIntervals } from './fetch_agg_intervals'; +export { fetchHistogramsForFields } from './fetch_histograms_for_fields'; export { getSamplerAggregationsResponsePath } from './get_sampler_aggregations_response_path'; -export type { NumberValidationResult } from './validate_number'; export { numberValidator } from './validate_number'; + +export type { FieldsForHistograms } from './fetch_histograms_for_fields'; +export type { + AggCardinality, + ChangePoint, + ChangePointHistogram, + ChangePointHistogramItem, + HistogramField, + NumericColumnStats, + NumericColumnStatsMap, +} from './types'; +export type { NumberValidationResult } from './validate_number'; diff --git a/x-pack/packages/ml/agg_utils/src/types.ts b/x-pack/packages/ml/agg_utils/src/types.ts new file mode 100644 index 0000000000000..352616d74cb3e --- /dev/null +++ b/x-pack/packages/ml/agg_utils/src/types.ts @@ -0,0 +1,101 @@ +/* + * 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 type { Client } from '@elastic/elasticsearch'; +import { KBN_FIELD_TYPES } from '@kbn/field-types'; + +// TODO Temporary type definition until we can import from `@kbn/core`. +// Copied from src/core/server/elasticsearch/client/types.ts +// as these types aren't part of any package yet. Once they are, remove this completely + +/** + * Client used to query the elasticsearch cluster. + * @deprecated At some point use the one from src/core/server/elasticsearch/client/types.ts when it is made into a package. If it never is, then keep using this one. + * @public + */ +export type ElasticsearchClient = Omit< + Client, + 'connectionPool' | 'serializer' | 'extend' | 'close' | 'diagnostic' +>; + +interface FieldAggCardinality { + field: string; + percent?: any; +} + +interface ScriptAggCardinality { + script: any; +} + +/** + * Interface for cardinality aggregation. + */ +export interface AggCardinality { + cardinality: FieldAggCardinality | ScriptAggCardinality; +} + +/** + * Field/value pair definition. + */ +export interface FieldValuePair { + fieldName: string; + // For dynamic fieldValues we only identify fields as `string`, + // but for example `http.response.status_code` which is part of + // of the list of predefined field candidates is of type long/number. + fieldValue: string | number; +} + +/** + * Interface to describe attributes used for histograms. + */ +export interface NumericColumnStats { + interval: number; + min: number; + max: number; +} + +/** + * Record/Map of histogram attributes where the key is the aggregation name. + */ +export type NumericColumnStatsMap = Record; + +/** + * Parameters to identify which histogram data needs to be generated for a field. + */ +export interface HistogramField { + fieldName: string; + type: KBN_FIELD_TYPES; +} + +/** + * Change point meta data for a field/value pair. + */ +export interface ChangePoint extends FieldValuePair { + doc_count: number; + bg_count: number; + score: number; + pValue: number | null; + normalizedScore: number; + histogram?: ChangePointHistogramItem[]; +} + +/** + * Change point histogram data item. + */ +export interface ChangePointHistogramItem { + doc_count_overall: number; + doc_count_change_point: number; + key: number; + key_as_string: string; +} + +/** + * Change point histogram data for a field/value pair. + */ +export interface ChangePointHistogram extends FieldValuePair { + histogram: ChangePointHistogramItem[]; +} diff --git a/x-pack/plugins/actions/server/builtin_action_types/es_index.test.ts b/x-pack/plugins/actions/server/builtin_action_types/es_index.test.ts index 98093b685cab2..4dfcccdbc13f7 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/es_index.test.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/es_index.test.ts @@ -19,8 +19,7 @@ import { ESIndexActionTypeExecutorOptions, } from './es_index'; import { AlertHistoryEsIndexConnectorId } from '../../common'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; const ACTION_TYPE_ID = '.index'; diff --git a/x-pack/plugins/actions/server/usage/actions_telemetry.test.ts b/x-pack/plugins/actions/server/usage/actions_telemetry.test.ts index 9fff9f9299ead..532cefec75f20 100644 --- a/x-pack/plugins/actions/server/usage/actions_telemetry.test.ts +++ b/x-pack/plugins/actions/server/usage/actions_telemetry.test.ts @@ -5,8 +5,7 @@ * 2.0. */ -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { loggingSystemMock } from '@kbn/core/server/mocks'; import { getExecutionsPerDayCount, getInUseTotalCount, getTotalCount } from './actions_telemetry'; diff --git a/x-pack/plugins/aiops/common/api/explain_log_rate_spikes/actions.ts b/x-pack/plugins/aiops/common/api/explain_log_rate_spikes/actions.ts index be380d966e250..78ec9c7c33432 100644 --- a/x-pack/plugins/aiops/common/api/explain_log_rate_spikes/actions.ts +++ b/x-pack/plugins/aiops/common/api/explain_log_rate_spikes/actions.ts @@ -5,10 +5,11 @@ * 2.0. */ -import type { ChangePoint } from '../../types'; +import type { ChangePoint, ChangePointHistogram } from '@kbn/ml-agg-utils'; export const API_ACTION_NAME = { ADD_CHANGE_POINTS: 'add_change_points', + ADD_CHANGE_POINTS_HISTOGRAM: 'add_change_points_histogram', ERROR: 'error', RESET: 'reset', UPDATE_LOADING_STATE: 'update_loading_state', @@ -29,6 +30,20 @@ export function addChangePointsAction( }; } +interface ApiActionAddChangePointsHistogram { + type: typeof API_ACTION_NAME.ADD_CHANGE_POINTS_HISTOGRAM; + payload: ChangePointHistogram[]; +} + +export function addChangePointsHistogramAction( + payload: ApiActionAddChangePointsHistogram['payload'] +): ApiActionAddChangePointsHistogram { + return { + type: API_ACTION_NAME.ADD_CHANGE_POINTS_HISTOGRAM, + payload, + }; +} + interface ApiActionError { type: typeof API_ACTION_NAME.ERROR; payload: string; @@ -69,6 +84,7 @@ export function updateLoadingStateAction( export type AiopsExplainLogRateSpikesApiAction = | ApiActionAddChangePoints + | ApiActionAddChangePointsHistogram | ApiActionError | ApiActionReset | ApiActionUpdateLoadingState; diff --git a/x-pack/plugins/aiops/common/api/explain_log_rate_spikes/index.ts b/x-pack/plugins/aiops/common/api/explain_log_rate_spikes/index.ts index fcf5ce818f4d3..e03a527eb576f 100644 --- a/x-pack/plugins/aiops/common/api/explain_log_rate_spikes/index.ts +++ b/x-pack/plugins/aiops/common/api/explain_log_rate_spikes/index.ts @@ -7,6 +7,7 @@ export { addChangePointsAction, + addChangePointsHistogramAction, errorAction, resetAction, updateLoadingStateAction, diff --git a/x-pack/plugins/aiops/common/api/stream_reducer.test.ts b/x-pack/plugins/aiops/common/api/stream_reducer.test.ts index 43735f586b88b..483de40e685d6 100644 --- a/x-pack/plugins/aiops/common/api/stream_reducer.test.ts +++ b/x-pack/plugins/aiops/common/api/stream_reducer.test.ts @@ -38,6 +38,7 @@ describe('streamReducer', () => { bg_count: 100, score: 0.1, pValue: 0.01, + normalizedScore: 0.123, }, ]) ); diff --git a/x-pack/plugins/aiops/common/api/stream_reducer.ts b/x-pack/plugins/aiops/common/api/stream_reducer.ts index 97c767a43ec47..5e37df418c6ab 100644 --- a/x-pack/plugins/aiops/common/api/stream_reducer.ts +++ b/x-pack/plugins/aiops/common/api/stream_reducer.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { ChangePoint } from '../types'; +import type { ChangePoint } from '@kbn/ml-agg-utils'; import { API_ACTION_NAME, AiopsExplainLogRateSpikesApiAction } from './explain_log_rate_spikes'; @@ -34,6 +34,17 @@ export function streamReducer( switch (action.type) { case API_ACTION_NAME.ADD_CHANGE_POINTS: return { ...state, changePoints: [...state.changePoints, ...action.payload] }; + case API_ACTION_NAME.ADD_CHANGE_POINTS_HISTOGRAM: + const changePoints = state.changePoints.map((cp) => { + const cpHistogram = action.payload.find( + (h) => h.fieldName === cp.fieldName && h.fieldValue && cp.fieldName + ); + if (cpHistogram) { + cp.histogram = cpHistogram.histogram; + } + return cp; + }); + return { ...state, changePoints }; case API_ACTION_NAME.RESET: return initialState; case API_ACTION_NAME.UPDATE_LOADING_STATE: diff --git a/x-pack/plugins/aiops/common/types.ts b/x-pack/plugins/aiops/common/types.ts deleted file mode 100644 index 218988ae2b29c..0000000000000 --- a/x-pack/plugins/aiops/common/types.ts +++ /dev/null @@ -1,19 +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 FieldValuePair { - fieldName: string; - fieldValue: string; - isFallbackResult?: boolean; -} - -export interface ChangePoint extends FieldValuePair { - doc_count: number; - bg_count: number; - score: number; - pValue: number | null; -} diff --git a/x-pack/plugins/transform/server/shared_imports.ts b/x-pack/plugins/aiops/public/components/mini_histogram/index.ts similarity index 79% rename from x-pack/plugins/transform/server/shared_imports.ts rename to x-pack/plugins/aiops/public/components/mini_histogram/index.ts index dbb216a541694..d3a7d590d80dc 100644 --- a/x-pack/plugins/transform/server/shared_imports.ts +++ b/x-pack/plugins/aiops/public/components/mini_histogram/index.ts @@ -5,4 +5,4 @@ * 2.0. */ -export { getHistogramsForFields } from '@kbn/ml-plugin/server'; +export { MiniHistogram } from './mini_histogram'; diff --git a/x-pack/plugins/aiops/public/components/mini_histogram/mini_histogram.tsx b/x-pack/plugins/aiops/public/components/mini_histogram/mini_histogram.tsx new file mode 100644 index 0000000000000..8eaa9d7e7215e --- /dev/null +++ b/x-pack/plugins/aiops/public/components/mini_histogram/mini_histogram.tsx @@ -0,0 +1,70 @@ +/* + * 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, { FC } from 'react'; + +import { Chart, BarSeries, PartialTheme, ScaleType, Settings } from '@elastic/charts'; + +import type { ChangePointHistogramItem } from '@kbn/ml-agg-utils'; + +interface MiniHistogramProps { + chartData: ChangePointHistogramItem[]; + label: string; +} + +export const MiniHistogram: FC = ({ chartData, label }) => { + const theme: PartialTheme = { + chartMargins: { + left: 0, + right: 0, + top: 0, + bottom: 0, + }, + chartPaddings: { + left: 0, + right: 0, + top: 0, + bottom: 0, + }, + scales: { + barsPadding: 0.1, + }, + }; + + return ( +
+ + + + + +
+ ); +}; diff --git a/x-pack/plugins/aiops/public/components/spike_analysis_table/spike_analysis_table.tsx b/x-pack/plugins/aiops/public/components/spike_analysis_table/spike_analysis_table.tsx index 9e125f4d47305..2df67e1a45bb1 100644 --- a/x-pack/plugins/aiops/public/components/spike_analysis_table/spike_analysis_table.tsx +++ b/x-pack/plugins/aiops/public/components/spike_analysis_table/spike_analysis_table.tsx @@ -6,10 +6,12 @@ */ import React, { FC, useCallback, useMemo, useState } from 'react'; -import { EuiBadge, EuiBasicTable, EuiBasicTableColumn, RIGHT_ALIGNMENT } from '@elastic/eui'; +import { EuiBadge, EuiBasicTable, EuiBasicTableColumn } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { ChangePoint } from '../../../common/types'; -import { ImpactBar } from './impact_bar'; +import type { ChangePoint } from '@kbn/ml-agg-utils'; + +import { MiniHistogram } from '../mini_histogram'; + import { getFailedTransactionsCorrelationImpactLabel } from './get_failed_transactions_correlation_impact_label'; const PAGINATION_SIZE_OPTIONS = [5, 10, 20, 50]; @@ -29,25 +31,45 @@ export const SpikeAnalysisTable: FC = ({ changePointData, error, loading const columns: Array> = [ { - field: 'score', + field: 'fieldName', + name: i18n.translate( + 'xpack.aiops.correlations.failedTransactions.correlationsTable.fieldNameLabel', + { defaultMessage: 'Field name' } + ), + sortable: true, + }, + { + field: 'fieldValue', + name: i18n.translate( + 'xpack.aiops.correlations.failedTransactions.correlationsTable.fieldValueLabel', + { defaultMessage: 'Field value' } + ), + render: (_, { fieldValue }) => String(fieldValue).slice(0, 50), + sortable: true, + }, + { + field: 'pValue', name: ( <> {i18n.translate( - 'xpack.aiops.correlations.failedTransactions.correlationsTable.pValueLabel', + 'xpack.aiops.correlations.failedTransactions.correlationsTable.logRateLabel', { - defaultMessage: 'Score', + defaultMessage: 'Log rate', } )} ), - align: RIGHT_ALIGNMENT, - render: (_, { score }) => { - return ( - <> - - - ); + render: (_, { histogram, fieldName, fieldValue }) => { + return histogram ? ( + + ) : null; }, + sortable: false, + }, + { + field: 'pValue', + name: 'p-value', + render: (pValue: number) => pValue.toPrecision(3), sortable: true, }, { @@ -68,29 +90,6 @@ export const SpikeAnalysisTable: FC = ({ changePointData, error, loading }, sortable: true, }, - { - field: 'fieldName', - name: i18n.translate( - 'xpack.aiops.correlations.failedTransactions.correlationsTable.fieldNameLabel', - { defaultMessage: 'Field name' } - ), - sortable: true, - }, - { - field: 'fieldValue', - name: i18n.translate( - 'xpack.aiops.correlations.failedTransactions.correlationsTable.fieldValueLabel', - { defaultMessage: 'Field value' } - ), - render: (_, { fieldValue }) => String(fieldValue).slice(0, 50), - sortable: true, - }, - { - field: 'pValue', - name: 'p-value', - render: (pValue: number) => pValue.toPrecision(3), - sortable: true, - }, ]; const onChange = useCallback((tableSettings) => { @@ -105,7 +104,12 @@ export const SpikeAnalysisTable: FC = ({ changePointData, error, loading const itemCount = changePointData?.length ?? 0; return { - pageOfItems: changePointData?.slice(pageStart, pageStart + pageSize), + pageOfItems: changePointData + // Temporary default sorting by ascending pValue until we add native table sorting + ?.sort((a, b) => { + return (a?.pValue ?? 1) - (b?.pValue ?? 0); + }) + .slice(pageStart, pageStart + pageSize), pagination: { pageIndex, pageSize, @@ -119,7 +123,7 @@ export const SpikeAnalysisTable: FC = ({ changePointData, error, loading , @@ -151,6 +156,105 @@ export const defineExplainLogRateSpikesRoute = ( } } + if (changePoints?.length === 0) { + push( + updateLoadingStateAction({ + ccsWarning: false, + loaded: 1, + loadingState: `Done.`, + }) + ); + + end(); + return; + } + + const histogramFields: [NumericHistogramField] = [ + { fieldName: request.body.timeFieldName, type: KBN_FIELD_TYPES.DATE }, + ]; + + const [overallTimeSeries] = (await fetchHistogramsForFields( + client, + request.body.index, + { match_all: {} }, + // fields + histogramFields, + // samplerShardSize + -1, + undefined + )) as [NumericChartData]; + + // time series filtered by fields + if (changePoints) { + await asyncForEach(changePoints, async (cp, index) => { + if (changePoints) { + const histogramQuery = { + bool: { + filter: [ + { + term: { [cp.fieldName]: cp.fieldValue }, + }, + ], + }, + }; + + const [cpTimeSeries] = (await fetchHistogramsForFields( + client, + request.body.index, + histogramQuery, + // fields + [ + { + fieldName: request.body.timeFieldName, + type: KBN_FIELD_TYPES.DATE, + interval: overallTimeSeries.interval, + min: overallTimeSeries.stats[0], + max: overallTimeSeries.stats[1], + }, + ], + // samplerShardSize + -1, + undefined + )) as [NumericChartData]; + + const histogram = + overallTimeSeries.data.map((o, i) => { + const current = cpTimeSeries.data.find( + (d1) => d1.key_as_string === o.key_as_string + ) ?? { + doc_count: 0, + }; + return { + key: o.key, + key_as_string: o.key_as_string ?? '', + doc_count_change_point: current.doc_count, + doc_count_overall: Math.max(0, o.doc_count - current.doc_count), + }; + }) ?? []; + + const { fieldName, fieldValue } = cp; + + loaded += (1 / changePoints.length) * PROGRESS_STEP_HISTOGRAMS; + push( + updateLoadingStateAction({ + ccsWarning: false, + loaded, + loadingState: `Loading histogram data.`, + }) + ); + push( + addChangePointsHistogramAction([ + { + fieldName, + fieldValue, + histogram, + }, + ]) + ); + } + }); + } + end(); })(); diff --git a/x-pack/plugins/aiops/server/routes/queries/fetch_change_point_p_values.ts b/x-pack/plugins/aiops/server/routes/queries/fetch_change_point_p_values.ts index 240eda6e328b5..dc60e608c9035 100644 --- a/x-pack/plugins/aiops/server/routes/queries/fetch_change_point_p_values.ts +++ b/x-pack/plugins/aiops/server/routes/queries/fetch_change_point_p_values.ts @@ -8,9 +8,9 @@ import { uniqBy } from 'lodash'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { ElasticsearchClient } from '@kbn/core/server'; +import { ChangePoint } from '@kbn/ml-agg-utils'; import { SPIKE_ANALYSIS_THRESHOLD } from '../../../common/constants'; import type { AiopsExplainLogRateSpikesSchema } from '../../../common/api/explain_log_rate_spikes'; -import { ChangePoint } from '../../../common/types'; import { getQueryWithParams } from './get_query_with_params'; import { getRequestBase } from './get_request_base'; @@ -109,6 +109,13 @@ export const fetchChangePointPValues = async ( for (const bucket of overallResult.buckets) { const pValue = Math.exp(-bucket.score); + // Scale the score into a value from 0 - 1 + // using a concave piecewise linear function in -log(p-value) + const normalizedScore = + 0.5 * Math.min(Math.max((bucket.score - 3.912) / 2.995, 0), 1) + + 0.25 * Math.min(Math.max((bucket.score - 6.908) / 6.908, 0), 1) + + 0.25 * Math.min(Math.max((bucket.score - 13.816) / 101.314, 0), 1); + if (typeof pValue === 'number' && pValue < SPIKE_ANALYSIS_THRESHOLD) { result.push({ fieldName, @@ -117,6 +124,7 @@ export const fetchChangePointPValues = async ( bg_count: bucket.doc_count, score: bucket.score, pValue, + normalizedScore, }); } } diff --git a/x-pack/plugins/aiops/server/routes/queries/get_query_with_params.ts b/x-pack/plugins/aiops/server/routes/queries/get_query_with_params.ts index 8c87dddaa28b4..1b53e5424b3db 100644 --- a/x-pack/plugins/aiops/server/routes/queries/get_query_with_params.ts +++ b/x-pack/plugins/aiops/server/routes/queries/get_query_with_params.ts @@ -7,7 +7,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import type { FieldValuePair } from '../../../common/types'; +import type { FieldValuePair } from '@kbn/ml-agg-utils'; import type { AiopsExplainLogRateSpikesSchema } from '../../../common/api/explain_log_rate_spikes'; import { getFilters } from './get_filters'; diff --git a/x-pack/plugins/apm/public/components/app/breadcrumb/index.tsx b/x-pack/plugins/apm/public/components/app/breadcrumb/index.tsx index 5cc1293d39f7d..d6afe4a7c1d19 100644 --- a/x-pack/plugins/apm/public/components/app/breadcrumb/index.tsx +++ b/x-pack/plugins/apm/public/components/app/breadcrumb/index.tsx @@ -18,7 +18,10 @@ export const Breadcrumb = ({ children: React.ReactElement; }) => { const { core } = useApmPluginContext(); - useBreadcrumb({ title, href: core.http.basePath.prepend('/app/apm' + href) }); + useBreadcrumb( + () => ({ title, href: core.http.basePath.prepend('/app/apm' + href) }), + [core.http.basePath, href, title] + ); return children; }; diff --git a/x-pack/plugins/apm/public/components/app/dependency_detail_overview/index.tsx b/x-pack/plugins/apm/public/components/app/dependency_detail_overview/index.tsx index 5c259494814a6..e129088b23f68 100644 --- a/x-pack/plugins/apm/public/components/app/dependency_detail_overview/index.tsx +++ b/x-pack/plugins/apm/public/components/app/dependency_detail_overview/index.tsx @@ -30,26 +30,39 @@ export function DependencyDetailOverview() { const apmRouter = useApmRouter(); - useBreadcrumb([ - { - title: i18n.translate( - 'xpack.apm.dependencyDetailOverview.breadcrumbTitle', - { defaultMessage: 'Overview' } - ), - href: apmRouter.link('/dependencies/overview', { - query: { - dependencyName, - rangeFrom, - rangeTo, - refreshInterval, - refreshPaused, - environment, - kuery, - comparisonEnabled, - }, - }), - }, - ]); + useBreadcrumb( + () => [ + { + title: i18n.translate( + 'xpack.apm.dependencyDetailOverview.breadcrumbTitle', + { defaultMessage: 'Overview' } + ), + href: apmRouter.link('/dependencies/overview', { + query: { + dependencyName, + rangeFrom, + rangeTo, + refreshInterval, + refreshPaused, + environment, + kuery, + comparisonEnabled, + }, + }), + }, + ], + [ + apmRouter, + comparisonEnabled, + dependencyName, + environment, + kuery, + rangeFrom, + rangeTo, + refreshInterval, + refreshPaused, + ] + ); return ( <> diff --git a/x-pack/plugins/apm/public/components/app/dependency_detail_view/index.tsx b/x-pack/plugins/apm/public/components/app/dependency_detail_view/index.tsx index a586546cab835..9ad1c2b6e19a0 100644 --- a/x-pack/plugins/apm/public/components/app/dependency_detail_view/index.tsx +++ b/x-pack/plugins/apm/public/components/app/dependency_detail_view/index.tsx @@ -31,36 +31,49 @@ export function DependencyDetailView({ const apmRouter = useApmRouter(); - useBreadcrumb([ - { - title: DependenciesInventoryTitle, - href: apmRouter.link('/dependencies/inventory', { - query: { - rangeFrom, - rangeTo, - refreshInterval, - refreshPaused, - environment, - kuery, - comparisonEnabled, - }, - }), - }, - { - title: dependencyName, - href: apmRouter.link('/dependencies', { - query: { - dependencyName, - rangeFrom, - rangeTo, - refreshInterval, - refreshPaused, - environment, - kuery, - comparisonEnabled, - }, - }), - }, - ]); + useBreadcrumb( + () => [ + { + title: DependenciesInventoryTitle, + href: apmRouter.link('/dependencies/inventory', { + query: { + rangeFrom, + rangeTo, + refreshInterval, + refreshPaused, + environment, + kuery, + comparisonEnabled, + }, + }), + }, + { + title: dependencyName, + href: apmRouter.link('/dependencies', { + query: { + dependencyName, + rangeFrom, + rangeTo, + refreshInterval, + refreshPaused, + environment, + kuery, + comparisonEnabled, + }, + }), + }, + ], + [ + apmRouter, + comparisonEnabled, + dependencyName, + environment, + kuery, + rangeFrom, + rangeTo, + refreshInterval, + refreshPaused, + ] + ); return {children}; } diff --git a/x-pack/plugins/apm/public/components/app/error_group_details/index.tsx b/x-pack/plugins/apm/public/components/app/error_group_details/index.tsx index 7dfaf13e42901..dcde173bffb11 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_details/index.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_details/index.tsx @@ -127,23 +127,36 @@ export function ErrorGroupDetails() { const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - useBreadcrumb({ - title: groupId, - href: apmRouter.link('/services/{serviceName}/errors/{groupId}', { - path: { - serviceName, - groupId, - }, - query: { - rangeFrom, - rangeTo, - environment, - kuery, - serviceGroup, - comparisonEnabled, - }, + useBreadcrumb( + () => ({ + title: groupId, + href: apmRouter.link('/services/{serviceName}/errors/{groupId}', { + path: { + serviceName, + groupId, + }, + query: { + rangeFrom, + rangeTo, + environment, + kuery, + serviceGroup, + comparisonEnabled, + }, + }), }), - }); + [ + apmRouter, + comparisonEnabled, + environment, + groupId, + kuery, + rangeFrom, + rangeTo, + serviceGroup, + serviceName, + ] + ); const { data: errorGroupData } = useFetcher( (callApmApi) => { diff --git a/x-pack/plugins/apm/public/components/app/service_node_metrics/index.tsx b/x-pack/plugins/apm/public/components/app/service_node_metrics/index.tsx index 9e4fb9b67509f..b902c7f0f1cea 100644 --- a/x-pack/plugins/apm/public/components/app/service_node_metrics/index.tsx +++ b/x-pack/plugins/apm/public/components/app/service_node_metrics/index.tsx @@ -60,19 +60,22 @@ export function ServiceNodeMetrics() { const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - useBreadcrumb({ - title: getServiceNodeName(serviceNodeName), - href: apmRouter.link( - '/services/{serviceName}/nodes/{serviceNodeName}/metrics', - { - path: { - serviceName, - serviceNodeName, - }, - query, - } - ), - }); + useBreadcrumb( + () => ({ + title: getServiceNodeName(serviceNodeName), + href: apmRouter.link( + '/services/{serviceName}/nodes/{serviceNodeName}/metrics', + { + path: { + serviceName, + serviceNodeName, + }, + query, + } + ), + }), + [apmRouter, query, serviceName, serviceNodeName] + ); const { data } = useServiceMetricChartsFetcher({ serviceNodeName, diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/index.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/index.tsx index d91ecf3cb9dab..255cacd0ce2c5 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/index.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/index.tsx @@ -44,13 +44,16 @@ export function TransactionDetails() { replace(history, { query: { transactionType } }); } - useBreadcrumb({ - title: transactionName, - href: apmRouter.link('/services/{serviceName}/transactions/view', { - path, - query, + useBreadcrumb( + () => ({ + title: transactionName, + href: apmRouter.link('/services/{serviceName}/transactions/view', { + path, + query, + }), }), - }); + [apmRouter, path, query, transactionName] + ); const isServerless = isServerlessAgent(runtimeName); diff --git a/x-pack/plugins/apm/public/components/routing/service_detail/apm_service_wrapper.tsx b/x-pack/plugins/apm/public/components/routing/service_detail/apm_service_wrapper.tsx index ef929331f3c1c..cbc20077da29f 100644 --- a/x-pack/plugins/apm/public/components/routing/service_detail/apm_service_wrapper.tsx +++ b/x-pack/plugins/apm/public/components/routing/service_detail/apm_service_wrapper.tsx @@ -19,19 +19,22 @@ export function ApmServiceWrapper() { const router = useApmRouter(); - useBreadcrumb([ - { - title: ServiceInventoryTitle, - href: router.link('/services', { query }), - }, - { - title: serviceName, - href: router.link('/services/{serviceName}', { - query, - path: { serviceName }, - }), - }, - ]); + useBreadcrumb( + () => [ + { + title: ServiceInventoryTitle, + href: router.link('/services', { query }), + }, + { + title: serviceName, + href: router.link('/services/{serviceName}', { + query, + path: { serviceName }, + }), + }, + ], + [query, router, serviceName] + ); return ; } diff --git a/x-pack/plugins/apm/public/components/routing/templates/apm_service_template/index.tsx b/x-pack/plugins/apm/public/components/routing/templates/apm_service_template/index.tsx index be4b2b0c3f25d..e8a4ccf0cce91 100644 --- a/x-pack/plugins/apm/public/components/routing/templates/apm_service_template/index.tsx +++ b/x-pack/plugins/apm/public/components/routing/templates/apm_service_template/index.tsx @@ -36,6 +36,7 @@ import { ServiceIcons } from '../../../shared/service_icons'; import { ApmMainTemplate } from '../apm_main_template'; import { AnalyzeDataButton } from './analyze_data_button'; import { getAlertingCapabilities } from '../../../alerting/get_alerting_capabilities'; +import { TechnicalPreviewBadge } from '../../../shared/technical_preview_badge'; type Tab = NonNullable[0] & { key: @@ -86,13 +87,16 @@ function TemplateWithContext({ const tabs = useTabs({ selectedTab }); - useBreadcrumb({ - title, - href: router.link(`/services/{serviceName}/${selectedTab}` as const, { - path: { serviceName }, - query, + useBreadcrumb( + () => ({ + title, + href: router.link(`/services/{serviceName}/${selectedTab}` as const, { + path: { serviceName }, + query, + }), }), - }); + [query, router, selectedTab, serviceName, title] + ); return ( + + {i18n.translate('xpack.apm.home.alertsTabLabel', { + defaultMessage: 'Alerts', + })} + + + + + + ), hidden: !(isAlertingAvailable && canReadAlerts), }, ]; diff --git a/x-pack/plugins/apm/public/components/routing/templates/service_group_template.tsx b/x-pack/plugins/apm/public/components/routing/templates/service_group_template.tsx index 8e22cf4633aeb..a891ab9bdcdce 100644 --- a/x-pack/plugins/apm/public/components/routing/templates/service_group_template.tsx +++ b/x-pack/plugins/apm/public/components/routing/templates/service_group_template.tsx @@ -116,30 +116,33 @@ export function ServiceGroupTemplate({ const tabs = useTabs(serviceGroupContextTab); const selectedTab = tabs?.find(({ isSelected }) => isSelected); - useBreadcrumb([ - { - title: i18n.translate('xpack.apm.serviceGroups.breadcrumb.title', { - defaultMessage: 'Services', - }), - href: serviceGroupsLink, - }, - ...(selectedTab - ? [ - ...(serviceGroupName - ? [ - { - title: serviceGroupName, - href: router.link('/services', { query }), - }, - ] - : []), - { - title: selectedTab.label, - href: selectedTab.href, - } as { title: string; href: string }, - ] - : []), - ]); + useBreadcrumb( + () => [ + { + title: i18n.translate('xpack.apm.serviceGroups.breadcrumb.title', { + defaultMessage: 'Services', + }), + href: serviceGroupsLink, + }, + ...(selectedTab + ? [ + ...(serviceGroupName + ? [ + { + title: serviceGroupName, + href: router.link('/services', { query }), + }, + ] + : []), + { + title: selectedTab.label, + href: selectedTab.href, + } as { title: string; href: string }, + ] + : []), + ], + [query, router, selectedTab, serviceGroupName, serviceGroupsLink] + ); return ( Breadcrumb | Breadcrumb[], + fnDeps: any[] +) { const api = useContext(BreadcrumbsContext); if (!api) { @@ -29,7 +32,7 @@ export function useBreadcrumb(breadcrumb: Breadcrumb | Breadcrumb[]) { matchedRoute.current = match?.route; if (matchedRoute.current) { - api.set(matchedRoute.current, castArray(breadcrumb)); + api.set(matchedRoute.current, castArray(callback())); } return () => { @@ -38,5 +41,5 @@ export function useBreadcrumb(breadcrumb: Breadcrumb | Breadcrumb[]) { } }; // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); + }, [match, ...fnDeps]); } diff --git a/x-pack/plugins/apm/public/hooks/use_dependency_detail_operations_breadcrumb.ts b/x-pack/plugins/apm/public/hooks/use_dependency_detail_operations_breadcrumb.ts index 1364b2a38231d..a2db87adadc51 100644 --- a/x-pack/plugins/apm/public/hooks/use_dependency_detail_operations_breadcrumb.ts +++ b/x-pack/plugins/apm/public/hooks/use_dependency_detail_operations_breadcrumb.ts @@ -26,24 +26,37 @@ export function useDependencyDetailOperationsBreadcrumb() { const apmRouter = useApmRouter(); - useBreadcrumb([ - { - title: i18n.translate( - 'xpack.apm.dependencyDetailOperations.breadcrumbTitle', - { defaultMessage: 'Operations' } - ), - href: apmRouter.link('/dependencies/operations', { - query: { - dependencyName, - rangeFrom, - rangeTo, - refreshInterval, - refreshPaused, - environment, - kuery, - comparisonEnabled, - }, - }), - }, - ]); + useBreadcrumb( + () => [ + { + title: i18n.translate( + 'xpack.apm.dependencyDetailOperations.breadcrumbTitle', + { defaultMessage: 'Operations' } + ), + href: apmRouter.link('/dependencies/operations', { + query: { + dependencyName, + rangeFrom, + rangeTo, + refreshInterval, + refreshPaused, + environment, + kuery, + comparisonEnabled, + }, + }), + }, + ], + [ + apmRouter, + comparisonEnabled, + dependencyName, + environment, + kuery, + rangeFrom, + rangeTo, + refreshInterval, + refreshPaused, + ] + ); } diff --git a/x-pack/plugins/canvas/public/components/element_content/element_content.tsx b/x-pack/plugins/canvas/public/components/element_content/element_content.tsx index 0a9e935aa2320..147c7c05ecf12 100644 --- a/x-pack/plugins/canvas/public/components/element_content/element_content.tsx +++ b/x-pack/plugins/canvas/public/components/element_content/element_content.tsx @@ -7,8 +7,7 @@ import React from 'react'; import { omitBy, isNil } from 'lodash'; -// @ts-expect-error Untyped library -import Style from 'style-it'; +import { css } from '@emotion/react'; import { ExpressionRenderer } from '@kbn/expressions-plugin'; import { getType } from '@kbn/interpreter'; @@ -56,9 +55,9 @@ export const ElementContent = (props: Props) => { const containerStyle = omitBy(renderable.containerStyle, isNil); - return Style.it( - renderable.css, + return (
{ renderFn={renderFunction.render} reuseNode={renderFunction.reuseDomNode} config={renderable.value} - css={renderable.css} // This is an actual CSS stylesheet string, it will be scoped by RenderElement width={width} height={height} handlers={handlers} diff --git a/x-pack/plugins/canvas/public/components/export_app/export_app.component.tsx b/x-pack/plugins/canvas/public/components/export_app/export_app.component.tsx index c3facb9268961..5b70d5703b50e 100644 --- a/x-pack/plugins/canvas/public/components/export_app/export_app.component.tsx +++ b/x-pack/plugins/canvas/public/components/export_app/export_app.component.tsx @@ -7,8 +7,7 @@ import React, { FC, useEffect } from 'react'; import PropTypes from 'prop-types'; -// @ts-expect-error untyped library -import Style from 'style-it'; +import { css } from '@emotion/react'; // @ts-expect-error untyped local import { WorkpadPage } from '../workpad_page'; import { RoutingLink } from '../routing'; @@ -33,9 +32,12 @@ export const ExportApp: FC = ({ workpad, selectedPageIndex, initializeWor
Edit Workpad
- {Style.it( - workpad.css, -
+ { +
= ({ workpad, selectedPageIndex, initializeWor unregisterLayout={() => {}} />
- )} + }
); diff --git a/x-pack/plugins/canvas/public/components/export_app/export_app.test.tsx b/x-pack/plugins/canvas/public/components/export_app/export_app.test.tsx index 8d9ea9e8b4185..c4b4db35c2d31 100644 --- a/x-pack/plugins/canvas/public/components/export_app/export_app.test.tsx +++ b/x-pack/plugins/canvas/public/components/export_app/export_app.test.tsx @@ -10,10 +10,6 @@ import { mount } from 'enzyme'; import { ExportApp } from './export_app.component'; import { CanvasWorkpad } from '../../../types'; -jest.mock('style-it', () => ({ - it: (css: string, Component: any) => Component, -})); - jest.mock('../workpad_page', () => ({ WorkpadPage: (props: any) =>
Page
, })); diff --git a/x-pack/plugins/canvas/public/components/page_manager/page_manager.component.tsx b/x-pack/plugins/canvas/public/components/page_manager/page_manager.component.tsx index 7743d508842ad..3522edf9d176c 100644 --- a/x-pack/plugins/canvas/public/components/page_manager/page_manager.component.tsx +++ b/x-pack/plugins/canvas/public/components/page_manager/page_manager.component.tsx @@ -20,8 +20,6 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -// @ts-expect-error untyped dependency -import Style from 'style-it'; import { ConfirmModal } from '../confirm_modal'; import { RoutingLink } from '../routing'; import { WorkpadRoutingContext } from '../../routes/workpad'; @@ -178,7 +176,7 @@ export class PageManager extends Component { }; renderPage = (page: CanvasPage, i: number) => { - const { isWriteable, selectedPage, workpadCSS } = this.props; + const { isWriteable, selectedPage } = this.props; const pageNumber = i + 1; return ( @@ -201,12 +199,9 @@ export class PageManager extends Component { {({ getUrl }) => ( - {Style.it( - workpadCSS, -
- -
- )} +
+ +
)}
diff --git a/x-pack/plugins/canvas/public/components/workpad/workpad.component.tsx b/x-pack/plugins/canvas/public/components/workpad/workpad.component.tsx index 740f71eab085a..0d403ec960c80 100644 --- a/x-pack/plugins/canvas/public/components/workpad/workpad.component.tsx +++ b/x-pack/plugins/canvas/public/components/workpad/workpad.component.tsx @@ -6,8 +6,7 @@ */ import React, { FC } from 'react'; -// @ts-expect-error -import Style from 'style-it'; +import { css } from '@emotion/react'; // @ts-expect-error import { WorkpadPage } from '../workpad_page'; import { Fullscreen } from '../fullscreen'; @@ -125,9 +124,9 @@ export const Workpad: FC = ({ : {}; // NOTE: the data-shared-* attributes here are used for reporting - return Style.it( - workpadCss || DEFAULT_WORKPAD_CSS, + return (
) => void; } +interface UnwrappedEmbeddableFactory { + factory: EmbeddableFactory; + isEditable: boolean; +} + export const EditorMenu: FC = ({ addElement }) => { const embeddablesService = useEmbeddablesService(); const { pathname, search, hash } = useLocation(); @@ -35,6 +44,26 @@ export const EditorMenu: FC = ({ addElement }) => { const visualizationsService = useVisualizationsService(); const IS_DARK_THEME = platformService.getUISetting('theme:darkMode'); + const embeddableFactories = useMemo( + () => (embeddablesService ? Array.from(embeddablesService.getEmbeddableFactories()) : []), + [embeddablesService] + ); + + const [unwrappedEmbeddableFactories, setUnwrappedEmbeddableFactories] = useState< + UnwrappedEmbeddableFactory[] + >([]); + + useEffect(() => { + Promise.all( + embeddableFactories.map>(async (factory) => ({ + factory, + isEditable: await factory.isEditable(), + })) + ).then((factories) => { + setUnwrappedEmbeddableFactories(factories); + }); + }, [embeddableFactories]); + const createNewVisType = useCallback( (visType?: BaseVisType | VisTypeAlias) => () => { let path = ''; @@ -113,18 +142,17 @@ export const EditorMenu: FC = ({ addElement }) => { a === b ? 0 : a ? -1 : 1 ); - const factories = embeddablesService - ? Array.from(embeddablesService.getEmbeddableFactories()).filter( - ({ type, isEditable, canCreateNew, isContainerType }) => - // @ts-expect-error ts 4.5 upgrade - isEditable() && - !isContainerType && - canCreateNew() && - !['visualization', 'ml'].some((factoryType) => { - return type.includes(factoryType); - }) - ) - : []; + const factories = unwrappedEmbeddableFactories + .filter( + ({ isEditable, factory: { type, canCreateNew, isContainerType } }) => + isEditable && + !isContainerType && + canCreateNew() && + !['visualization', 'ml'].some((factoryType) => { + return type.includes(factoryType); + }) + ) + .map(({ factory }) => factory); const promotedVisTypes = getVisTypesByGroup(VisGroups.PROMOTED); diff --git a/x-pack/plugins/canvas/shareable_runtime/api/__snapshots__/shareable.test.tsx.snap b/x-pack/plugins/canvas/shareable_runtime/api/__snapshots__/shareable.test.tsx.snap index 5fabff58521fa..fd505ff44c177 100644 --- a/x-pack/plugins/canvas/shareable_runtime/api/__snapshots__/shareable.test.tsx.snap +++ b/x-pack/plugins/canvas/shareable_runtime/api/__snapshots__/shareable.test.tsx.snap @@ -36,7 +36,8 @@ exports[`Canvas Shareable Workpad API Placed successfully with default propertie class="root" >
{ return (
- {Style.it( - elementCSS, -
-
-
-
-
+
+
+
+
- )} +
); diff --git a/x-pack/plugins/canvas/shareable_runtime/webpack.config.js b/x-pack/plugins/canvas/shareable_runtime/webpack.config.js index 6f0d9f43c9927..bc757a9d67bb7 100644 --- a/x-pack/plugins/canvas/shareable_runtime/webpack.config.js +++ b/x-pack/plugins/canvas/shareable_runtime/webpack.config.js @@ -78,8 +78,8 @@ module.exports = { { loader: 'postcss-loader', options: { - config: { - path: require.resolve('./postcss.config.js'), + postcssOptions: { + config: require.resolve('./postcss.config.js'), }, }, }, @@ -111,8 +111,8 @@ module.exports = { { loader: 'postcss-loader', options: { - config: { - path: require.resolve('@kbn/optimizer/postcss.config.js'), + postcssOptions: { + config: require.resolve('@kbn/optimizer/postcss.config.js'), }, }, }, @@ -142,8 +142,8 @@ module.exports = { loader: 'postcss-loader', options: { sourceMap: !isProd, - config: { - path: require.resolve('./postcss.config'), + postcssOptions: { + config: require.resolve('./postcss.config'), }, }, }, diff --git a/x-pack/plugins/canvas/storybook/canvas_webpack.ts b/x-pack/plugins/canvas/storybook/canvas_webpack.ts index e8ce5ff03b812..a8d967ec73ef6 100644 --- a/x-pack/plugins/canvas/storybook/canvas_webpack.ts +++ b/x-pack/plugins/canvas/storybook/canvas_webpack.ts @@ -30,7 +30,9 @@ export const canvasWebpack = { { loader: 'postcss-loader', options: { - path: resolve(KIBANA_ROOT, 'src/optimize/postcss.config.js'), + postcssOptions: { + config: resolve(KIBANA_ROOT, 'packages/kbn-optimizer/postcss.config.js'), + }, }, }, { diff --git a/x-pack/plugins/cloud/public/plugin.test.ts b/x-pack/plugins/cloud/public/plugin.test.ts index f7d71e7e1219a..2215fbd64fe98 100644 --- a/x-pack/plugins/cloud/public/plugin.test.ts +++ b/x-pack/plugins/cloud/public/plugin.test.ts @@ -434,7 +434,7 @@ describe('Cloud Plugin', () => { const securityStart = securityMock.createStart(); securityStart.authc.getCurrentUser.mockResolvedValue( securityMock.createMockAuthenticatedUser({ - roles: ['superuser'], + elastic_cloud_user: true, }) ); @@ -446,14 +446,15 @@ describe('Cloud Plugin', () => { expect(securityStart.authc.getCurrentUser).not.toHaveBeenCalled(); }); - it('registers a custom nav link for superusers', async () => { + it('registers a custom nav link for cloud users', async () => { const { plugin } = startPlugin(); const coreStart = coreMock.createStart(); const securityStart = securityMock.createStart(); + securityStart.authc.getCurrentUser.mockResolvedValue( securityMock.createMockAuthenticatedUser({ - roles: ['superuser'], + elastic_cloud_user: true, }) ); plugin.start(coreStart, { security: securityStart }); @@ -494,14 +495,14 @@ describe('Cloud Plugin', () => { `); }); - it('does not register a custom nav link for non-superusers', async () => { + it('does not register a custom nav link for non-cloud users', async () => { const { plugin } = startPlugin(); const coreStart = coreMock.createStart(); const securityStart = securityMock.createStart(); securityStart.authc.getCurrentUser.mockResolvedValue( securityMock.createMockAuthenticatedUser({ - roles: ['not-a-superuser'], + elastic_cloud_user: false, }) ); plugin.start(coreStart, { security: securityStart }); @@ -511,14 +512,14 @@ describe('Cloud Plugin', () => { expect(coreStart.chrome.setCustomNavLink).not.toHaveBeenCalled(); }); - it('registers user profile links for superusers', async () => { + it('registers user profile links for cloud users', async () => { const { plugin } = startPlugin(); const coreStart = coreMock.createStart(); const securityStart = securityMock.createStart(); securityStart.authc.getCurrentUser.mockResolvedValue( securityMock.createMockAuthenticatedUser({ - roles: ['superuser'], + elastic_cloud_user: true, }) ); plugin.start(coreStart, { security: securityStart }); @@ -532,7 +533,7 @@ describe('Cloud Plugin', () => { Object { "href": "https://cloud.elastic.co/profile/alice", "iconType": "user", - "label": "Profile", + "label": "Edit profile", "order": 100, "setAsProfile": true, }, @@ -564,7 +565,7 @@ describe('Cloud Plugin', () => { Object { "href": "https://cloud.elastic.co/profile/alice", "iconType": "user", - "label": "Profile", + "label": "Edit profile", "order": 100, "setAsProfile": true, }, @@ -579,14 +580,14 @@ describe('Cloud Plugin', () => { `); }); - it('does not register profile links for non-superusers', async () => { + it('does not register profile links for non-cloud users', async () => { const { plugin } = startPlugin(); const coreStart = coreMock.createStart(); const securityStart = securityMock.createStart(); securityStart.authc.getCurrentUser.mockResolvedValue( securityMock.createMockAuthenticatedUser({ - roles: ['not-a-superuser'], + elastic_cloud_user: false, }) ); plugin.start(coreStart, { security: securityStart }); diff --git a/x-pack/plugins/cloud/public/plugin.tsx b/x-pack/plugins/cloud/public/plugin.tsx index 10c7b7165528e..5b77b1d83e198 100644 --- a/x-pack/plugins/cloud/public/plugin.tsx +++ b/x-pack/plugins/cloud/public/plugin.tsx @@ -212,10 +212,12 @@ export class CloudPlugin implements Plugin { } // Security plugin is disabled if (!security) return true; - // Otherwise check roles. If user is not defined due to an unexpected error, then fail *open*. + + // Otherwise check if user is a cloud user. + // If user is not defined due to an unexpected error, then fail *open*. // Cloud admin console will always perform the actual authorization checks. const user = await security.authc.getCurrentUser().catch(() => null); - return user?.roles.includes('superuser') ?? true; + return user?.elastic_cloud_user ?? true; } /** @@ -259,7 +261,7 @@ export class CloudPlugin implements Plugin { if (security) { analytics.registerContextProvider({ - name: 'cloud_user_id', + name: 'cloud user id', context$: from(security.authc.getCurrentUser()).pipe( map((user) => { if (user.elastic_cloud_user) { diff --git a/x-pack/plugins/cloud/public/user_menu_links.ts b/x-pack/plugins/cloud/public/user_menu_links.ts index 55c41831cc18c..e29736e215e0d 100644 --- a/x-pack/plugins/cloud/public/user_menu_links.ts +++ b/x-pack/plugins/cloud/public/user_menu_links.ts @@ -17,7 +17,7 @@ export const createUserMenuLinks = (config: CloudConfigType): UserMenuLink[] => if (baseUrl && profileUrl) { userMenuLinks.push({ label: i18n.translate('xpack.cloud.userMenuLinks.profileLinkText', { - defaultMessage: 'Profile', + defaultMessage: 'Edit profile', }), iconType: 'user', href: getFullCloudUrl(baseUrl, profileUrl), diff --git a/x-pack/plugins/cloud_security_posture/common/schemas/csp_rule_metadata.ts b/x-pack/plugins/cloud_security_posture/common/schemas/csp_rule_metadata.ts index 4bda1af7e04a6..68a5c6fc9c504 100644 --- a/x-pack/plugins/cloud_security_posture/common/schemas/csp_rule_metadata.ts +++ b/x-pack/plugins/cloud_security_posture/common/schemas/csp_rule_metadata.ts @@ -6,11 +6,13 @@ */ import { schema as rt, TypeOf } from '@kbn/config-schema'; +export const benchmarkIdSchema = rt.oneOf([rt.literal('cis_k8s'), rt.literal('cis_eks')]); + export const cspRuleMetadataSchema = rt.object({ audit: rt.string(), benchmark: rt.object({ name: rt.string(), - id: rt.oneOf([rt.literal('cis_k8s'), rt.literal('cis_eks')]), + id: benchmarkIdSchema, version: rt.string(), }), default_value: rt.maybe(rt.string()), diff --git a/x-pack/plugins/cloud_security_posture/common/schemas/csp_rules_configuration.ts b/x-pack/plugins/cloud_security_posture/common/schemas/csp_rules_configuration.ts index 9d1940c869498..5301a5bd84279 100644 --- a/x-pack/plugins/cloud_security_posture/common/schemas/csp_rules_configuration.ts +++ b/x-pack/plugins/cloud_security_posture/common/schemas/csp_rules_configuration.ts @@ -5,13 +5,12 @@ * 2.0. */ import { schema as rt, TypeOf } from '@kbn/config-schema'; +import { benchmarkIdSchema } from './csp_rule_metadata'; // cspRulesConfigSchema has to match the 'DataYaml' struct in https://github.com/elastic/cloudbeat/blob/main/config/config.go#L45-L51 export const cspRulesConfigSchema = rt.object({ data_yaml: rt.object({ - activated_rules: rt.object({ - cis_k8s: rt.arrayOf(rt.string()), - }), + activated_rules: rt.recordOf(benchmarkIdSchema, rt.arrayOf(rt.string())), }), }); diff --git a/x-pack/plugins/cloud_security_posture/common/types.ts b/x-pack/plugins/cloud_security_posture/common/types.ts index b218916ea6b66..3fe552fef322a 100644 --- a/x-pack/plugins/cloud_security_posture/common/types.ts +++ b/x-pack/plugins/cloud_security_posture/common/types.ts @@ -6,6 +6,7 @@ */ import type { PackagePolicy, GetAgentPoliciesResponseItem } from '@kbn/fleet-plugin/common'; +import type { CspRuleMetadata } from './schemas/csp_rule_metadata'; export type Evaluation = 'passed' | 'failed' | 'NA'; /** number between 1-100 */ @@ -95,3 +96,5 @@ export interface Benchmark { agent_policy: Pick; rules: CspRulesStatus; } + +export type BenchmarkId = CspRuleMetadata['benchmark']['id']; diff --git a/x-pack/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts b/x-pack/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts index 65a4507de2511..e701e7c94cada 100644 --- a/x-pack/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts +++ b/x-pack/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts @@ -5,8 +5,7 @@ * 2.0. */ -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { loggingSystemMock } from '@kbn/core/server/mocks'; import { createTransformIfNotExists, startTransformIfNotStarted } from './create_transforms'; import { latestFindingsTransform } from './latest_findings_transform'; diff --git a/x-pack/plugins/cloud_security_posture/server/fleet_integration/fleet_integration.ts b/x-pack/plugins/cloud_security_posture/server/fleet_integration/fleet_integration.ts index be81e6dac27f9..92e06ad95536d 100644 --- a/x-pack/plugins/cloud_security_posture/server/fleet_integration/fleet_integration.ts +++ b/x-pack/plugins/cloud_security_posture/server/fleet_integration/fleet_integration.ts @@ -24,10 +24,10 @@ import { CSP_RULE_SAVED_OBJECT_TYPE, CSP_RULE_TEMPLATE_SAVED_OBJECT_TYPE, } from '../../common/constants'; -import type { CspRule, CspRuleMetadata, CspRuleTemplate } from '../../common/schemas'; +import type { CspRule, CspRuleTemplate } from '../../common/schemas'; +import type { BenchmarkId } from '../../common/types'; type CloudbeatInputType = keyof typeof CIS_INTEGRATION_INPUTS_MAP; -type BenchmarkId = CspRuleMetadata['benchmark']['id']; const getBenchmarkTypeFilter = (type: BenchmarkId): string => `${CSP_RULE_TEMPLATE_SAVED_OBJECT_TYPE}.attributes.metadata.benchmark.id: "${type}"`; diff --git a/x-pack/plugins/cloud_security_posture/server/lib/csp_app_services.ts b/x-pack/plugins/cloud_security_posture/server/lib/csp_app_services.ts deleted file mode 100644 index a455bf46d66c7..0000000000000 --- a/x-pack/plugins/cloud_security_posture/server/lib/csp_app_services.ts +++ /dev/null @@ -1,36 +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 { - AgentService, - PackageService, - AgentPolicyServiceInterface, - PackagePolicyServiceInterface, -} from '@kbn/fleet-plugin/server'; - -export interface CspAppServiceDependencies { - packageService: PackageService; - agentService: AgentService; - packagePolicyService: PackagePolicyServiceInterface; - agentPolicyService: AgentPolicyServiceInterface; -} - -export class CspAppService { - public agentService: AgentService | undefined; - public packageService: PackageService | undefined; - public packagePolicyService: PackagePolicyServiceInterface | undefined; - public agentPolicyService: AgentPolicyServiceInterface | undefined; - - public start(dependencies: CspAppServiceDependencies) { - this.agentService = dependencies.agentService; - this.packageService = dependencies.packageService; - this.packagePolicyService = dependencies.packagePolicyService; - this.agentPolicyService = dependencies.agentPolicyService; - } - - public stop() {} -} diff --git a/x-pack/plugins/cloud_security_posture/server/lib/is_latest_findings_index_exists.ts b/x-pack/plugins/cloud_security_posture/server/lib/is_latest_findings_index_exists.ts index 3b43bde45184d..fda35a6d6e2ba 100644 --- a/x-pack/plugins/cloud_security_posture/server/lib/is_latest_findings_index_exists.ts +++ b/x-pack/plugins/cloud_security_posture/server/lib/is_latest_findings_index_exists.ts @@ -5,13 +5,12 @@ * 2.0. */ -import { ElasticsearchClient } from '@kbn/core/server'; -import { CspAppContext } from '../plugin'; +import { ElasticsearchClient, type Logger } from '@kbn/core/server'; import { LATEST_FINDINGS_INDEX_DEFAULT_NS } from '../../common/constants'; export const isLatestFindingsIndexExists = async ( esClient: ElasticsearchClient, - logger: CspAppContext['logger'] + logger: Logger ): Promise => { try { const queryResult = await esClient.search({ diff --git a/x-pack/plugins/cloud_security_posture/server/mocks.ts b/x-pack/plugins/cloud_security_posture/server/mocks.ts new file mode 100644 index 0000000000000..249f18f6fd6fc --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/mocks.ts @@ -0,0 +1,36 @@ +/* + * 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 { loggingSystemMock } from '@kbn/core-logging-server-mocks'; +import { coreMock } from '@kbn/core/server/mocks'; +import { + createFleetRequestHandlerContextMock, + createMockAgentService, + createMockAgentPolicyService, + createPackagePolicyServiceMock, + createMockPackageService, +} from '@kbn/fleet-plugin/server/mocks'; +import { mockAuthenticatedUser } from '@kbn/security-plugin/common/model/authenticated_user.mock'; + +export const createCspRequestHandlerContextMock = () => { + const coreMockRequestContext = coreMock.createRequestHandlerContext(); + + return { + core: coreMockRequestContext, + fleet: createFleetRequestHandlerContextMock(), + csp: { + user: mockAuthenticatedUser(), + logger: loggingSystemMock.createLogger(), + esClient: coreMockRequestContext.elasticsearch.client, + soClient: coreMockRequestContext.savedObjects.client, + agentPolicyService: createMockAgentPolicyService(), + agentService: createMockAgentService(), + packagePolicyService: createPackagePolicyServiceMock(), + packageService: createMockPackageService(), + }, + }; +}; diff --git a/x-pack/plugins/cloud_security_posture/server/plugin.test.ts b/x-pack/plugins/cloud_security_posture/server/plugin.test.ts index 2e3e872e059a5..f18ea55f5eb1a 100644 --- a/x-pack/plugins/cloud_security_posture/server/plugin.test.ts +++ b/x-pack/plugins/cloud_security_posture/server/plugin.test.ts @@ -82,9 +82,20 @@ describe('Cloud Security Posture Plugin', () => { const findMock = mockRouteContext.core.savedObjects.client.find as jest.Mock; findMock.mockReturnValue( Promise.resolve({ - saved_objects: [], - total: 0, - per_page: 0, + saved_objects: [ + { + type: 'csp_rule', + attributes: { + enabled: false, + metadata: { + rego_rule_id: 'cis_1_1_1', + benchmark: { id: 'cis_k8s' }, + }, + }, + }, + ], + total: 1, + per_page: 10, page: 1, }) ); @@ -295,6 +306,9 @@ describe('Cloud Security Posture Plugin', () => { { type: 'csp-rule-template', id: 'csp_rule_template-41308bcdaaf665761478bb6f0d745a5c', + benchmark: { + id: 'cis_k8s', + }, }, ], }) diff --git a/x-pack/plugins/cloud_security_posture/server/plugin.ts b/x-pack/plugins/cloud_security_posture/server/plugin.ts index 4666c110b015d..b712422afe3ff 100755 --- a/x-pack/plugins/cloud_security_posture/server/plugin.ts +++ b/x-pack/plugins/cloud_security_posture/server/plugin.ts @@ -20,17 +20,14 @@ import { TaskManagerSetupContract, TaskManagerStartContract, } from '@kbn/task-manager-plugin/server'; -import type { SecurityPluginSetup } from '@kbn/security-plugin/server'; -import { CspAppService } from './lib/csp_app_services'; import type { CspServerPluginSetup, CspServerPluginStart, CspServerPluginSetupDeps, CspServerPluginStartDeps, - CspRequestHandlerContext, CspServerPluginStartServices, } from './types'; -import { defineRoutes } from './routes'; +import { setupRoutes } from './routes/setup_routes'; import { setupSavedObjects } from './saved_objects'; import { initializeCspIndices } from './create_indices/create_indices'; import { initializeCspTransforms } from './create_transforms/create_transforms'; @@ -48,12 +45,6 @@ import { setupFindingsStatsTask, } from './tasks/findings_stats_task'; -export interface CspAppContext { - logger: Logger; - service: CspAppService; - security: SecurityPluginSetup; -} - export class CspPlugin implements Plugin< @@ -69,24 +60,16 @@ export class CspPlugin this.logger = initializerContext.logger.get(); } - private readonly CspAppService = new CspAppService(); - public setup( core: CoreSetup, plugins: CspServerPluginSetupDeps ): CspServerPluginSetup { - const cspAppContext: CspAppContext = { - logger: this.logger, - service: this.CspAppService, - security: plugins.security, - }; - setupSavedObjects(core.savedObjects); - const router = core.http.createRouter(); - - // Register server side APIs - defineRoutes(router, cspAppContext); + setupRoutes({ + core, + logger: this.logger, + }); const coreStartServices = core.getStartServices(); this.setupCspTasks(plugins.taskManager, coreStartServices, this.logger); @@ -95,10 +78,6 @@ export class CspPlugin } public start(core: CoreStart, plugins: CspServerPluginStartDeps): CspServerPluginStart { - this.CspAppService.start({ - ...plugins.fleet, - }); - plugins.fleet.fleetSetupCompleted().then(async () => { const packageInfo = await plugins.fleet.packageService.asInternalUser.getInstallation( CLOUD_SECURITY_POSTURE_PACKAGE_NAME diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts index 2d06ce9f394a7..258d5c4fdf136 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts @@ -4,17 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { - httpServerMock, - httpServiceMock, - loggingSystemMock, - savedObjectsClientMock, -} from '@kbn/core/server/mocks'; -import { - ElasticsearchClientMock, - // eslint-disable-next-line @kbn/eslint/no-restricted-paths -} from '@kbn/core/server/elasticsearch/client/mocks'; -import type { KibanaRequest } from '@kbn/core/server'; +import { httpServerMock, httpServiceMock, savedObjectsClientMock } from '@kbn/core/server/mocks'; import { benchmarksQueryParamsSchema, DEFAULT_BENCHMARKS_PER_PAGE, @@ -37,21 +27,7 @@ import { } from '@kbn/fleet-plugin/server/mocks'; import { createPackagePolicyMock } from '@kbn/fleet-plugin/common/mocks'; import { AgentPolicy } from '@kbn/fleet-plugin/common'; - -import { CspAppService } from '../../lib/csp_app_services'; -import { CspAppContext } from '../../plugin'; -import { securityMock } from '@kbn/security-plugin/server/mocks'; - -export const getMockCspContext = (mockEsClient: ElasticsearchClientMock): KibanaRequest => { - return { - core: { - elasticsearch: { - client: { asCurrentUser: mockEsClient }, - }, - }, - fleet: { authz: { fleet: { all: false } } }, - } as unknown as KibanaRequest; -}; +import { createCspRequestHandlerContextMock } from '../../mocks'; function createMockAgentPolicy(props: Partial = {}): AgentPolicy { return { @@ -71,24 +47,16 @@ function createMockAgentPolicy(props: Partial = {}): AgentPolicy { ...props, }; } -describe('benchmarks API', () => { - let logger: ReturnType; +describe('benchmarks API', () => { beforeEach(() => { - logger = loggingSystemMock.createLogger(); jest.clearAllMocks(); }); it('validate the API route path', async () => { const router = httpServiceMock.createRouter(); - const cspAppContextService = new CspAppService(); - const cspContext: CspAppContext = { - logger, - service: cspAppContextService, - security: securityMock.createSetup(), - }; - defineGetBenchmarksRoute(router, cspContext); + defineGetBenchmarksRoute(router); const [config] = router.get.mock.calls[0]; @@ -97,20 +65,12 @@ describe('benchmarks API', () => { it('should accept to a user with fleet.all privilege', async () => { const router = httpServiceMock.createRouter(); - const cspAppContextService = new CspAppService(); - - const cspContext: CspAppContext = { - logger, - service: cspAppContextService, - security: securityMock.createSetup(), - }; - defineGetBenchmarksRoute(router, cspContext); - const [_, handler] = router.get.mock.calls[0]; - const mockContext = { - fleet: { authz: { fleet: { all: true } } }, - } as unknown as KibanaRequest; + defineGetBenchmarksRoute(router); + + const [_, handler] = router.get.mock.calls[0]; + const mockContext = createCspRequestHandlerContextMock(); const mockResponse = httpServerMock.createResponseFactory(); const mockRequest = httpServerMock.createKibanaRequest(); const [context, req, res] = [mockContext, mockRequest, mockResponse]; @@ -122,19 +82,13 @@ describe('benchmarks API', () => { it('should reject to a user without fleet.all privilege', async () => { const router = httpServiceMock.createRouter(); - const cspAppContextService = new CspAppService(); - - const cspContext: CspAppContext = { - logger, - service: cspAppContextService, - security: securityMock.createSetup(), - }; - defineGetBenchmarksRoute(router, cspContext); + + defineGetBenchmarksRoute(router); + const [_, handler] = router.get.mock.calls[0]; - const mockContext = { - fleet: { authz: { fleet: { all: false } } }, - } as unknown as KibanaRequest; + const mockContext = createCspRequestHandlerContextMock(); + mockContext.fleet.authz.fleet.all = false; const mockResponse = httpServerMock.createResponseFactory(); const mockRequest = httpServerMock.createKibanaRequest(); diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts index 0bd6996a05590..ef4314d542626 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts @@ -13,7 +13,6 @@ import { CSP_RULE_SAVED_OBJECT_TYPE, } from '../../../common/constants'; import { benchmarksQueryParamsSchema } from '../../../common/schemas/benchmark'; -import { CspAppContext } from '../../plugin'; import type { Benchmark, CspRulesStatus } from '../../../common/types'; import type { CspRule } from '../../../common/schemas'; import { @@ -130,7 +129,7 @@ const createBenchmarks = ( ); }; -export const defineGetBenchmarksRoute = (router: CspRouter, cspContext: CspAppContext): void => +export const defineGetBenchmarksRoute = (router: CspRouter): void => router.get( { path: BENCHMARKS_ROUTE_PATH, @@ -144,34 +143,29 @@ export const defineGetBenchmarksRoute = (router: CspRouter, cspContext: CspAppCo return response.forbidden(); } - try { - const soClient = (await context.core).savedObjects.client; - const { query } = request; - - const agentService = cspContext.service.agentService; - const agentPolicyService = cspContext.service.agentPolicyService; - const packagePolicyService = cspContext.service.packagePolicyService; - - if (!agentPolicyService || !agentService || !packagePolicyService) { - throw new Error(`Failed to get Fleet services`); - } + const cspContext = await context.csp; + try { const cspPackagePolicies = await getCspPackagePolicies( - soClient, - packagePolicyService, + cspContext.soClient, + cspContext.packagePolicyService, CLOUD_SECURITY_POSTURE_PACKAGE_NAME, - query + request.query ); const agentPolicies = await getCspAgentPolicies( - soClient, + cspContext.soClient, cspPackagePolicies.items, - agentPolicyService + cspContext.agentPolicyService + ); + + const enrichAgentPolicies = await addRunningAgentToAgentPolicy( + cspContext.agentService, + agentPolicies ); - const enrichAgentPolicies = await addRunningAgentToAgentPolicy(agentService, agentPolicies); const benchmarks = await createBenchmarks( - soClient, + cspContext.soClient, enrichAgentPolicies, cspPackagePolicies.items ); diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.test.ts b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.test.ts index 587eb53768cc5..5521ef7e44c26 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.test.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.test.ts @@ -4,40 +4,22 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { httpServerMock, httpServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; -import // eslint-disable-next-line @kbn/eslint/no-restricted-paths -'@kbn/core/server/elasticsearch/client/mocks'; -import type { KibanaRequest } from '@kbn/core/server'; +import { httpServerMock, httpServiceMock } from '@kbn/core/server/mocks'; import { defineGetComplianceDashboardRoute } from './compliance_dashboard'; - -import { CspAppService } from '../../lib/csp_app_services'; -import { CspAppContext } from '../../plugin'; -import { securityMock } from '@kbn/security-plugin/server/mocks'; +import { createCspRequestHandlerContextMock } from '../../mocks'; describe('compliance dashboard permissions API', () => { - let logger: ReturnType; - beforeEach(() => { - logger = loggingSystemMock.createLogger(); jest.clearAllMocks(); }); it('should accept to a user with fleet.all privilege', async () => { const router = httpServiceMock.createRouter(); - const cspAppContextService = new CspAppService(); - const cspContext: CspAppContext = { - logger, - service: cspAppContextService, - security: securityMock.createSetup(), - }; - defineGetComplianceDashboardRoute(router, cspContext); + defineGetComplianceDashboardRoute(router); const [_, handler] = router.get.mock.calls[0]; - const mockContext = { - fleet: { authz: { fleet: { all: true } } }, - } as unknown as KibanaRequest; - + const mockContext = createCspRequestHandlerContextMock(); const mockResponse = httpServerMock.createResponseFactory(); const mockRequest = httpServerMock.createKibanaRequest(); const [context, req, res] = [mockContext, mockRequest, mockResponse]; @@ -49,20 +31,11 @@ describe('compliance dashboard permissions API', () => { it('should reject to a user without fleet.all privilege', async () => { const router = httpServiceMock.createRouter(); - const cspAppContextService = new CspAppService(); - const cspContext: CspAppContext = { - logger, - service: cspAppContextService, - security: securityMock.createSetup(), - }; - defineGetComplianceDashboardRoute(router, cspContext); + defineGetComplianceDashboardRoute(router); const [_, handler] = router.get.mock.calls[0]; - const mockContext = { - fleet: { authz: { fleet: { all: true } } }, - } as unknown as KibanaRequest; - + const mockContext = createCspRequestHandlerContextMock(); const mockResponse = httpServerMock.createResponseFactory(); const mockRequest = httpServerMock.createKibanaRequest(); const [context, req, res] = [mockContext, mockRequest, mockResponse]; diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.ts b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.ts index c63b5ed1d5d3c..aa82b5844ce26 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.ts @@ -9,7 +9,6 @@ import { transformError } from '@kbn/securitysolution-es-utils'; import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; import type { ComplianceDashboardData } from '../../../common/types'; import { LATEST_FINDINGS_INDEX_DEFAULT_NS, STATS_ROUTE_PATH } from '../../../common/constants'; -import { CspAppContext } from '../../plugin'; import { getGroupedFindingsEvaluation } from './get_grouped_findings_evaluation'; import { ClusterWithoutTrend, getClusters } from './get_clusters'; import { getStats } from './get_stats'; @@ -33,10 +32,7 @@ const getClustersTrends = (clustersWithoutTrends: ClusterWithoutTrend[], trends: const getSummaryTrend = (trends: Trends) => trends.map(({ timestamp, summary }) => ({ timestamp, ...summary })); -export const defineGetComplianceDashboardRoute = ( - router: CspRouter, - cspContext: CspAppContext -): void => +export const defineGetComplianceDashboardRoute = (router: CspRouter): void => router.get( { path: STATS_ROUTE_PATH, @@ -46,8 +42,10 @@ export const defineGetComplianceDashboardRoute = ( }, }, async (context, _, response) => { + const cspContext = await context.csp; + try { - const esClient = (await context.core).elasticsearch.client.asCurrentUser; + const esClient = cspContext.esClient.asCurrentUser; const { id: pitId } = await esClient.openPointInTime({ index: LATEST_FINDINGS_INDEX_DEFAULT_NS, diff --git a/x-pack/plugins/cloud_security_posture/server/routes/configuration/update_rules_configuration.test.ts b/x-pack/plugins/cloud_security_posture/server/routes/configuration/update_rules_configuration.test.ts index 4b5ed5ddfc662..5c8b5c3d628e6 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/configuration/update_rules_configuration.test.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/configuration/update_rules_configuration.test.ts @@ -4,14 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; -import { - savedObjectsClientMock, - httpServiceMock, - loggingSystemMock, - httpServerMock, -} from '@kbn/core/server/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; +import { savedObjectsClientMock, httpServiceMock, httpServerMock } from '@kbn/core/server/mocks'; import { createRulesConfig, defineUpdateRulesConfigRoute, @@ -20,8 +14,6 @@ import { updateAgentConfiguration, } from './update_rules_configuration'; -import { CspAppService } from '../../lib/csp_app_services'; -import { CspAppContext } from '../../plugin'; import { createPackagePolicyMock } from '@kbn/fleet-plugin/common/mocks'; import { createPackagePolicyServiceMock } from '@kbn/fleet-plugin/server/mocks'; @@ -30,37 +22,28 @@ import type { CspRule } from '../../../common/schemas'; import { ElasticsearchClient, - KibanaRequest, SavedObjectsClientContract, SavedObjectsFindResponse, } from '@kbn/core/server'; import { Chance } from 'chance'; import { PackagePolicy, UpdatePackagePolicy } from '@kbn/fleet-plugin/common'; -import { securityMock } from '@kbn/security-plugin/server/mocks'; import { mockAuthenticatedUser } from '@kbn/security-plugin/common/model/authenticated_user.mock'; import { DeepPartial } from 'utility-types'; +import { createCspRequestHandlerContextMock } from '../../mocks'; describe('Update rules configuration API', () => { - let logger: ReturnType; let mockEsClient: jest.Mocked; let mockSoClient: jest.Mocked; const chance = new Chance(); beforeEach(() => { - logger = loggingSystemMock.createLogger(); jest.clearAllMocks(); }); it('validate the API route path', async () => { const router = httpServiceMock.createRouter(); - const cspAppContextService = new CspAppService(); - const cspContext: CspAppContext = { - logger, - service: cspAppContextService, - security: securityMock.createSetup(), - }; - defineUpdateRulesConfigRoute(router, cspContext); + defineUpdateRulesConfigRoute(router); const [config, _] = router.post.mock.calls[0]; @@ -69,20 +52,12 @@ describe('Update rules configuration API', () => { it('should accept to a user with fleet.all privilege', async () => { const router = httpServiceMock.createRouter(); - const cspAppContextService = new CspAppService(); - const cspContext: CspAppContext = { - logger, - service: cspAppContextService, - security: securityMock.createSetup(), - }; - defineUpdateRulesConfigRoute(router, cspContext); - const [_, handler] = router.post.mock.calls[0]; + defineUpdateRulesConfigRoute(router); - const mockContext = { - fleet: { authz: { fleet: { all: true } } }, - } as unknown as KibanaRequest; + const [_, handler] = router.post.mock.calls[0]; + const mockContext = createCspRequestHandlerContextMock(); const mockResponse = httpServerMock.createResponseFactory(); const mockRequest = httpServerMock.createKibanaRequest(); const [context, req, res] = [mockContext, mockRequest, mockResponse]; @@ -94,20 +69,11 @@ describe('Update rules configuration API', () => { it('should reject to a user without fleet.all privilege', async () => { const router = httpServiceMock.createRouter(); - const cspAppContextService = new CspAppService(); - const cspContext: CspAppContext = { - logger, - service: cspAppContextService, - security: securityMock.createSetup(), - }; - defineUpdateRulesConfigRoute(router, cspContext); + defineUpdateRulesConfigRoute(router); const [_, handler] = router.post.mock.calls[0]; - const mockContext = { - fleet: { authz: { fleet: { all: true } } }, - } as unknown as KibanaRequest; - + const mockContext = createCspRequestHandlerContextMock(); const mockResponse = httpServerMock.createResponseFactory(); const mockRequest = httpServerMock.createKibanaRequest(); const [context, req, res] = [mockContext, mockRequest, mockResponse]; @@ -140,6 +106,7 @@ describe('Update rules configuration API', () => { enabled: true, metadata: { rego_rule_id: 'cis_1_1_1', + benchmark: { id: 'cis_k8s' }, }, }, }, @@ -149,6 +116,7 @@ describe('Update rules configuration API', () => { enabled: false, metadata: { rego_rule_id: 'cis_1_1_2', + benchmark: { id: 'cis_k8s' }, }, }, }, @@ -158,6 +126,7 @@ describe('Update rules configuration API', () => { enabled: true, metadata: { rego_rule_id: 'cis_1_1_3', + benchmark: { id: 'cis_k8s' }, }, }, }, @@ -181,6 +150,7 @@ describe('Update rules configuration API', () => { enabled: false, metadata: { rego_rule_id: 'cis_1_1_1', + benchmark: { id: 'cis_k8s' }, }, }, }, @@ -190,6 +160,7 @@ describe('Update rules configuration API', () => { enabled: false, metadata: { rego_rule_id: 'cis_1_1_2', + benchmark: { id: 'cis_k8s' }, }, }, }, @@ -199,6 +170,7 @@ describe('Update rules configuration API', () => { enabled: false, metadata: { rego_rule_id: 'cis_1_1_3', + benchmark: { id: 'cis_k8s' }, }, }, }, @@ -253,6 +225,7 @@ describe('Update rules configuration API', () => { enabled: false, metadata: { rego_rule_id: 'cis_1_1_1', + benchmark: { id: 'cis_k8s' }, }, }, }, @@ -262,6 +235,7 @@ describe('Update rules configuration API', () => { enabled: false, metadata: { rego_rule_id: 'cis_1_1_2', + benchmark: { id: 'cis_k8s' }, }, }, }, @@ -271,6 +245,7 @@ describe('Update rules configuration API', () => { enabled: false, metadata: { rego_rule_id: 'cis_1_1_3', + benchmark: { id: 'cis_k8s' }, }, }, }, @@ -315,6 +290,7 @@ describe('Update rules configuration API', () => { enabled: false, metadata: { rego_rule_id: 'cis_1_1_1', + benchmark: { id: 'cis_k8s' }, }, }, }, @@ -324,6 +300,7 @@ describe('Update rules configuration API', () => { enabled: false, metadata: { rego_rule_id: 'cis_1_1_2', + benchmark: { id: 'cis_k8s' }, }, }, }, @@ -333,6 +310,7 @@ describe('Update rules configuration API', () => { enabled: false, metadata: { rego_rule_id: 'cis_1_1_3', + benchmark: { id: 'cis_k8s' }, }, }, }, @@ -389,6 +367,7 @@ describe('Update rules configuration API', () => { enabled: false, metadata: { rego_rule_id: 'cis_1_1_1', + benchmark: { id: 'cis_k8s' }, }, }, }, diff --git a/x-pack/plugins/cloud_security_posture/server/routes/configuration/update_rules_configuration.ts b/x-pack/plugins/cloud_security_posture/server/routes/configuration/update_rules_configuration.ts index 0ade8c95b6641..5ec1d0200f60d 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/configuration/update_rules_configuration.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/configuration/update_rules_configuration.ts @@ -20,7 +20,7 @@ import { PackagePolicy, PackagePolicyConfigRecord } from '@kbn/fleet-plugin/comm import { PackagePolicyServiceInterface } from '@kbn/fleet-plugin/server'; import { AuthenticatedUser } from '@kbn/security-plugin/common'; import { createCspRuleSearchFilterByPackagePolicy } from '../../../common/utils/helpers'; -import { CspAppContext } from '../../plugin'; + import type { CspRule, CspRulesConfiguration } from '../../../common/schemas'; import { CLOUD_SECURITY_POSTURE_PACKAGE_NAME, @@ -65,21 +65,26 @@ export const getCspRules = ( }); }; +const getEnabledRulesByBenchmark = (rules: SavedObjectsFindResponse['saved_objects']) => + rules.reduce( + (benchmarks, rule) => { + const benchmark = benchmarks[rule.attributes.metadata.benchmark.id]; + if (!rule.attributes.enabled || !benchmark) return benchmarks; + + benchmark.push(rule.attributes.metadata.rego_rule_id); + + return benchmarks; + }, + { cis_k8s: [], cis_eks: [] } + ); + export const createRulesConfig = ( cspRules: SavedObjectsFindResponse -): CspRulesConfiguration => { - const activatedRules = cspRules.saved_objects.filter((cspRule) => cspRule.attributes.enabled); - const config = { - data_yaml: { - activated_rules: { - cis_k8s: activatedRules.map( - (activatedRule) => activatedRule.attributes.metadata.rego_rule_id - ), - }, - }, - }; - return config; -}; +): CspRulesConfiguration => ({ + data_yaml: { + activated_rules: getEnabledRulesByBenchmark(cspRules.saved_objects), + }, +}); export const convertRulesConfigToYaml = (config: CspRulesConfiguration): string => { return yaml.safeDump(config); @@ -124,7 +129,7 @@ export const updateAgentConfiguration = async ( ); }; -export const defineUpdateRulesConfigRoute = (router: CspRouter, cspContext: CspAppContext): void => +export const defineUpdateRulesConfigRoute = (router: CspRouter): void => router.post( { path: UPDATE_RULES_CONFIG_ROUTE_PATH, @@ -134,33 +139,25 @@ export const defineUpdateRulesConfigRoute = (router: CspRouter, cspContext: CspA }, }, async (context, request, response) => { + const cspContext = await context.csp; + if (!(await context.fleet).authz.fleet.all) { return response.forbidden(); } try { - const coreContext = await context.core; - const esClient = coreContext.elasticsearch.client.asCurrentUser; - const soClient = coreContext.savedObjects.client; - const user = await cspContext.security.authc.getCurrentUser(request); - const packagePolicyService = cspContext.service.packagePolicyService; - const packagePolicyId = request.body.package_policy_id; - - if (!packagePolicyService) { - throw new Error(`Failed to get Fleet services`); - } const packagePolicy = await getPackagePolicy( - soClient, - packagePolicyService, - packagePolicyId + cspContext.soClient, + cspContext.packagePolicyService, + request.body.package_policy_id ); const updatedPackagePolicy = await updateAgentConfiguration( - packagePolicyService, + cspContext.packagePolicyService, packagePolicy, - esClient, - soClient, - user + cspContext.esClient.asCurrentUser, + cspContext.soClient, + cspContext.user ); return response.ok({ body: updatedPackagePolicy }); diff --git a/x-pack/plugins/cloud_security_posture/server/routes/es_pit/es_pit.test.ts b/x-pack/plugins/cloud_security_posture/server/routes/es_pit/es_pit.test.ts index b540db9f08f7b..8447e393f2f51 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/es_pit/es_pit.test.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/es_pit/es_pit.test.ts @@ -5,14 +5,14 @@ * 2.0. */ import { Chance } from 'chance'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { + elasticsearchClientMock, + ElasticsearchClientMock, +} from '@kbn/core-elasticsearch-client-server-mocks'; import type { ElasticsearchClient } from '@kbn/core/server'; -import { httpServerMock, httpServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; +import { httpServerMock, httpServiceMock } from '@kbn/core/server/mocks'; import { DEFAULT_PIT_KEEP_ALIVE, defineEsPitRoute, esPitInputSchema } from './es_pit'; -import { CspAppService } from '../../lib/csp_app_services'; -import { CspAppContext } from '../../plugin'; -import { securityMock } from '@kbn/security-plugin/server/mocks'; +import { createCspRequestHandlerContextMock } from '../../mocks'; describe('ES Point in time API endpoint', () => { const chance = new Chance(); @@ -24,13 +24,8 @@ describe('ES Point in time API endpoint', () => { it('validate the API route path', () => { const router = httpServiceMock.createRouter(); - const cspContext: CspAppContext = { - logger: loggingSystemMock.createLogger(), - service: new CspAppService(), - security: securityMock.createSetup(), - }; - defineEsPitRoute(router, cspContext); + defineEsPitRoute(router); const [config] = router.post.mock.calls[0]; expect(config.path).toEqual('/internal/cloud_security_posture/es_pit'); @@ -38,18 +33,10 @@ describe('ES Point in time API endpoint', () => { it('should accept to a user with fleet.all privilege', async () => { const router = httpServiceMock.createRouter(); - const cspContext: CspAppContext = { - logger: loggingSystemMock.createLogger(), - service: new CspAppService(), - security: securityMock.createSetup(), - }; - defineEsPitRoute(router, cspContext); - - const mockContext = { - fleet: { authz: { fleet: { all: true } } }, - }; + defineEsPitRoute(router); + const mockContext = createCspRequestHandlerContextMock(); const mockResponse = httpServerMock.createResponseFactory(); const mockRequest = httpServerMock.createKibanaRequest(); const [context, req, res] = [mockContext, mockRequest, mockResponse]; @@ -62,17 +49,11 @@ describe('ES Point in time API endpoint', () => { it('should reject to a user without fleet.all privilege', async () => { const router = httpServiceMock.createRouter(); - const cspContext: CspAppContext = { - logger: loggingSystemMock.createLogger(), - service: new CspAppService(), - security: securityMock.createSetup(), - }; - defineEsPitRoute(router, cspContext); + defineEsPitRoute(router); - const mockContext = { - fleet: { authz: { fleet: { all: false } } }, - }; + const mockContext = createCspRequestHandlerContextMock(); + mockContext.fleet.authz.fleet.all = false; const mockResponse = httpServerMock.createResponseFactory(); const mockRequest = httpServerMock.createKibanaRequest(); @@ -86,22 +67,15 @@ describe('ES Point in time API endpoint', () => { it('should return the newly created PIT ID from ES', async () => { const router = httpServiceMock.createRouter(); - const cspContext: CspAppContext = { - logger: loggingSystemMock.createLogger(), - service: new CspAppService(), - security: securityMock.createSetup(), - }; - defineEsPitRoute(router, cspContext); + defineEsPitRoute(router); const pitId = chance.string(); mockEsClient = elasticsearchClientMock.createClusterClient().asScoped().asInternalUser; mockEsClient.openPointInTime.mockImplementation(() => Promise.resolve({ id: pitId })); - const mockContext = { - fleet: { authz: { fleet: { all: true } } }, - core: { elasticsearch: { client: { asCurrentUser: mockEsClient } } }, - }; + const mockContext = createCspRequestHandlerContextMock(); + mockContext.core.elasticsearch.client.asCurrentUser = mockEsClient as ElasticsearchClientMock; const indexName = chance.string(); const keepAlive = chance.string(); diff --git a/x-pack/plugins/cloud_security_posture/server/routes/es_pit/es_pit.ts b/x-pack/plugins/cloud_security_posture/server/routes/es_pit/es_pit.ts index a8a0a16051570..beba811429aa5 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/es_pit/es_pit.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/es_pit/es_pit.ts @@ -8,7 +8,6 @@ import { schema } from '@kbn/config-schema'; import { transformError } from '@kbn/securitysolution-es-utils'; import { ES_PIT_ROUTE_PATH } from '../../../common/constants'; -import type { CspAppContext } from '../../plugin'; import type { CspRouter } from '../../types'; export const DEFAULT_PIT_KEEP_ALIVE = '1m'; @@ -18,7 +17,7 @@ export const esPitInputSchema = schema.object({ keep_alive: schema.string({ defaultValue: DEFAULT_PIT_KEEP_ALIVE }), }); -export const defineEsPitRoute = (router: CspRouter, cspContext: CspAppContext): void => +export const defineEsPitRoute = (router: CspRouter): void => router.post( { path: ES_PIT_ROUTE_PATH, @@ -28,13 +27,14 @@ export const defineEsPitRoute = (router: CspRouter, cspContext: CspAppContext): }, }, async (context, request, response) => { + const cspContext = await context.csp; + if (!(await context.fleet).authz.fleet.all) { return response.forbidden(); } try { - const coreContext = await context.core; - const esClient = coreContext.elasticsearch.client.asCurrentUser; + const esClient = cspContext.esClient.asCurrentUser; const { id } = await esClient.openPointInTime({ index: request.query.index_name, keep_alive: request.query.keep_alive, diff --git a/x-pack/plugins/cloud_security_posture/server/routes/index.ts b/x-pack/plugins/cloud_security_posture/server/routes/index.ts deleted file mode 100755 index e332068b8ee93..0000000000000 --- a/x-pack/plugins/cloud_security_posture/server/routes/index.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 { defineGetComplianceDashboardRoute } from './compliance_dashboard/compliance_dashboard'; -import { defineGetBenchmarksRoute } from './benchmarks/benchmarks'; -import { defineUpdateRulesConfigRoute } from './configuration/update_rules_configuration'; -import { defineGetCspSetupStatusRoute } from './status/status'; -import { defineEsPitRoute } from './es_pit/es_pit'; -import { CspAppContext } from '../plugin'; -import { CspRouter } from '../types'; - -export function defineRoutes(router: CspRouter, cspContext: CspAppContext) { - defineGetComplianceDashboardRoute(router, cspContext); - defineGetBenchmarksRoute(router, cspContext); - defineUpdateRulesConfigRoute(router, cspContext); - defineGetCspSetupStatusRoute(router, cspContext); - defineEsPitRoute(router, cspContext); -} diff --git a/x-pack/plugins/cloud_security_posture/server/routes/setup_routes.ts b/x-pack/plugins/cloud_security_posture/server/routes/setup_routes.ts new file mode 100644 index 0000000000000..03b42600b9261 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/setup_routes.ts @@ -0,0 +1,67 @@ +/* + * 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 type { CoreSetup, Logger } from '@kbn/core/server'; +import type { AuthenticatedUser } from '@kbn/security-plugin/common'; +import type { + CspRequestHandlerContext, + CspServerPluginStart, + CspServerPluginStartDeps, +} from '../types'; +import { PLUGIN_ID } from '../../common'; +import { defineGetComplianceDashboardRoute } from './compliance_dashboard/compliance_dashboard'; +import { defineGetBenchmarksRoute } from './benchmarks/benchmarks'; +import { defineUpdateRulesConfigRoute } from './configuration/update_rules_configuration'; +import { defineGetCspSetupStatusRoute } from './status/status'; +import { defineEsPitRoute } from './es_pit/es_pit'; + +/** + * 1. Registers routes + * 2. Registers routes handler context + */ +export function setupRoutes({ + core, + logger, +}: { + core: CoreSetup; + logger: Logger; +}) { + const router = core.http.createRouter(); + defineGetComplianceDashboardRoute(router); + defineGetBenchmarksRoute(router); + defineUpdateRulesConfigRoute(router); + defineGetCspSetupStatusRoute(router); + defineEsPitRoute(router); + + core.http.registerRouteHandlerContext( + PLUGIN_ID, + async (context, request) => { + const [, { security, fleet }] = await core.getStartServices(); + const coreContext = await context.core; + await fleet.fleetSetupCompleted(); + + let user: AuthenticatedUser | null = null; + + return { + get user() { + // We want to call getCurrentUser only when needed and only once + if (!user) { + user = security.authc.getCurrentUser(request); + } + return user; + }, + logger, + esClient: coreContext.elasticsearch.client, + soClient: coreContext.savedObjects.client, + agentPolicyService: fleet.agentPolicyService, + agentService: fleet.agentService, + packagePolicyService: fleet.packagePolicyService, + packageService: fleet.packageService, + }; + } + ); +} diff --git a/x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts b/x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts index 61227275eaea4..a67448f05a5ad 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts @@ -5,18 +5,9 @@ * 2.0. */ -import { CspAppContext } from '../../plugin'; import { defineGetCspSetupStatusRoute, INDEX_TIMEOUT_IN_MINUTES } from './status'; -import { httpServerMock, httpServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; +import { httpServerMock, httpServiceMock } from '@kbn/core/server/mocks'; import type { ESSearchResponse } from '@kbn/core/types/elasticsearch'; -import { securityMock } from '@kbn/security-plugin/server/mocks'; -import { - createMockAgentPolicyService, - createMockAgentService, - createMockPackageService, - createPackagePolicyServiceMock, - xpackMocks, -} from '@kbn/fleet-plugin/server/mocks'; import { AgentClient, AgentPolicyServiceInterface, @@ -32,6 +23,7 @@ import { RegistryPackage, } from '@kbn/fleet-plugin/common'; import { createPackagePolicyMock } from '@kbn/fleet-plugin/common/mocks'; +import { createCspRequestHandlerContextMock } from '../../mocks'; const mockCspPackageInfo: Installation = { verification_status: 'verified', @@ -65,43 +57,29 @@ const mockLatestCspPackageInfo: RegistryPackage = { describe('CspSetupStatus route', () => { const router = httpServiceMock.createRouter(); - const logger: ReturnType = - loggingSystemMock.createLogger(); - let mockContext: ReturnType; + let mockContext: ReturnType; let mockPackagePolicyService: jest.Mocked; let mockAgentPolicyService: jest.Mocked; let mockAgentService: jest.Mocked; let mockAgentClient: jest.Mocked; let mockPackageService: PackageService; let mockPackageClient: jest.Mocked; - let cspContext: CspAppContext; beforeEach(() => { jest.clearAllMocks(); - mockContext = xpackMocks.createRequestHandlerContext(); - mockPackagePolicyService = createPackagePolicyServiceMock(); - mockAgentPolicyService = createMockAgentPolicyService(); - mockAgentService = createMockAgentService(); - mockPackageService = createMockPackageService(); + mockContext = createCspRequestHandlerContextMock(); + mockPackagePolicyService = mockContext.csp.packagePolicyService; + mockAgentPolicyService = mockContext.csp.agentPolicyService; + mockAgentService = mockContext.csp.agentService; + mockPackageService = mockContext.csp.packageService; mockAgentClient = mockAgentService.asInternalUser as jest.Mocked; mockPackageClient = mockPackageService.asInternalUser as jest.Mocked; - - cspContext = { - logger, - service: { - agentService: mockAgentService, - agentPolicyService: mockAgentPolicyService, - packagePolicyService: mockPackagePolicyService, - packageService: mockPackageService, - }, - security: securityMock.createSetup(), - } as unknown as CspAppContext; }); it('validate the API route path', async () => { - defineGetCspSetupStatusRoute(router, cspContext); + defineGetCspSetupStatusRoute(router); const [config, _] = router.get.mock.calls[0]; expect(config.path).toEqual('/internal/cloud_security_posture/status'); @@ -123,7 +101,7 @@ describe('CspSetupStatus route', () => { }); // Act - defineGetCspSetupStatusRoute(router, cspContext); + defineGetCspSetupStatusRoute(router); const [_, handler] = router.get.mock.calls[0]; const mockResponse = httpServerMock.createResponseFactory(); @@ -162,7 +140,7 @@ describe('CspSetupStatus route', () => { }); // Act - defineGetCspSetupStatusRoute(router, cspContext); + defineGetCspSetupStatusRoute(router); const [_, handler] = router.get.mock.calls[0]; const mockResponse = httpServerMock.createResponseFactory(); @@ -210,7 +188,7 @@ describe('CspSetupStatus route', () => { } as unknown as GetAgentStatusResponse['results']); // Act - defineGetCspSetupStatusRoute(router, cspContext); + defineGetCspSetupStatusRoute(router); const [_, handler] = router.get.mock.calls[0]; const mockResponse = httpServerMock.createResponseFactory(); @@ -248,7 +226,7 @@ describe('CspSetupStatus route', () => { }); // Act - defineGetCspSetupStatusRoute(router, cspContext); + defineGetCspSetupStatusRoute(router); const [_, handler] = router.get.mock.calls[0]; const mockResponse = httpServerMock.createResponseFactory(); @@ -295,7 +273,7 @@ describe('CspSetupStatus route', () => { } as unknown as GetAgentStatusResponse['results']); // Act - defineGetCspSetupStatusRoute(router, cspContext); + defineGetCspSetupStatusRoute(router); const [_, handler] = router.get.mock.calls[0]; @@ -349,7 +327,7 @@ describe('CspSetupStatus route', () => { } as unknown as GetAgentStatusResponse['results']); // Act - defineGetCspSetupStatusRoute(router, cspContext); + defineGetCspSetupStatusRoute(router); const [_, handler] = router.get.mock.calls[0]; @@ -405,7 +383,7 @@ describe('CspSetupStatus route', () => { } as unknown as GetAgentStatusResponse['results']); // Act - defineGetCspSetupStatusRoute(router, cspContext); + defineGetCspSetupStatusRoute(router); const [_, handler] = router.get.mock.calls[0]; diff --git a/x-pack/plugins/cloud_security_posture/server/routes/status/status.ts b/x-pack/plugins/cloud_security_posture/server/routes/status/status.ts index 63d5d321330bf..b7deefff368ed 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/status/status.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/status/status.ts @@ -6,7 +6,7 @@ */ import { transformError } from '@kbn/securitysolution-es-utils'; -import type { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/server'; +import type { Logger, ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/server'; import type { AgentPolicyServiceInterface, AgentService, @@ -16,7 +16,6 @@ import type { import moment, { MomentInput } from 'moment'; import { PackagePolicy } from '@kbn/fleet-plugin/common'; import { CLOUD_SECURITY_POSTURE_PACKAGE_NAME, STATUS_ROUTE_PATH } from '../../../common/constants'; -import type { CspAppContext } from '../../plugin'; import type { CspRouter } from '../../types'; import type { CspSetupStatus, Status } from '../../../common/types'; import { @@ -71,7 +70,7 @@ const getStatus = ( }; const getCspSetupStatus = async ( - logger: CspAppContext['logger'], + logger: Logger, esClient: ElasticsearchClient, soClient: SavedObjectsClientContract, packageService: PackageService, @@ -123,7 +122,7 @@ const getCspSetupStatus = async ( }; }; -export const defineGetCspSetupStatusRoute = (router: CspRouter, cspContext: CspAppContext): void => +export const defineGetCspSetupStatusRoute = (router: CspRouter): void => router.get( { path: STATUS_ROUTE_PATH, @@ -133,27 +132,16 @@ export const defineGetCspSetupStatusRoute = (router: CspRouter, cspContext: CspA }, }, async (context, _, response) => { + const cspContext = await context.csp; try { - const esClient = (await context.core).elasticsearch.client.asCurrentUser; - const soClient = (await context.core).savedObjects.client; - - const packageService = cspContext.service.packageService; - const agentService = cspContext.service.agentService; - const agentPolicyService = cspContext.service.agentPolicyService; - const packagePolicyService = cspContext.service.packagePolicyService; - - if (!agentPolicyService || !agentService || !packagePolicyService || !packageService) { - throw new Error(`Failed to get Fleet services`); - } - const cspSetupStatus = await getCspSetupStatus( cspContext.logger, - esClient, - soClient, - packageService, - packagePolicyService, - agentPolicyService, - agentService + cspContext.esClient.asCurrentUser, + cspContext.soClient, + cspContext.packageService, + cspContext.packagePolicyService, + cspContext.agentPolicyService, + cspContext.agentService ); const body: CspSetupStatus = cspSetupStatus; diff --git a/x-pack/plugins/cloud_security_posture/server/types.ts b/x-pack/plugins/cloud_security_posture/server/types.ts index bf3fa5f12076e..ab77f1090552a 100644 --- a/x-pack/plugins/cloud_security_posture/server/types.ts +++ b/x-pack/plugins/cloud_security_posture/server/types.ts @@ -4,7 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - import type { PluginSetup as DataPluginSetup, PluginStart as DataPluginStart, @@ -13,15 +12,20 @@ import { TaskManagerSetupContract, TaskManagerStartContract, } from '@kbn/task-manager-plugin/server'; - import type { - RouteMethod, - KibanaResponseFactory, - RequestHandler, IRouter, CoreStart, + CustomRequestHandlerContext, + Logger, + SavedObjectsClientContract, + IScopedClusterClient, } from '@kbn/core/server'; - +import type { + AgentService, + PackageService, + AgentPolicyServiceInterface, + PackagePolicyServiceInterface, +} from '@kbn/fleet-plugin/server'; import type { FleetStartContract, FleetRequestHandlerContext } from '@kbn/fleet-plugin/server'; import { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/server'; @@ -49,19 +53,22 @@ export interface CspServerPluginStartDeps { export type CspServerPluginStartServices = Promise< [CoreStart, CspServerPluginStartDeps, CspServerPluginStart] >; -export type CspRequestHandlerContext = FleetRequestHandlerContext; -/** - * Convenience type for request handlers in CSP that includes the CspRequestHandlerContext type - * @internal - */ -export type CspRequestHandler< - P = unknown, - Q = unknown, - B = unknown, - Method extends RouteMethod = any, - ResponseFactory extends KibanaResponseFactory = KibanaResponseFactory -> = RequestHandler; +interface CspApiRequestHandlerContext { + user: ReturnType; + logger: Logger; + esClient: IScopedClusterClient; + soClient: SavedObjectsClientContract; + agentPolicyService: AgentPolicyServiceInterface; + agentService: AgentService; + packagePolicyService: PackagePolicyServiceInterface; + packageService: PackageService; +} + +export type CspRequestHandlerContext = CustomRequestHandlerContext<{ + csp: CspApiRequestHandlerContext; + fleet: FleetRequestHandlerContext['fleet']; +}>; /** * Convenience type for routers in Csp that includes the CspRequestHandlerContext type diff --git a/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/actions/flyout_create_drilldown/flyout_create_drilldown.tsx b/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/actions/flyout_create_drilldown/flyout_create_drilldown.tsx index c8715c9e3b416..582133890a4bc 100644 --- a/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/actions/flyout_create_drilldown/flyout_create_drilldown.tsx +++ b/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/actions/flyout_create_drilldown/flyout_create_drilldown.tsx @@ -88,6 +88,10 @@ export class FlyoutCreateDrilldownAction implements Action { closed$.next(true); handle.close(); }; + const closeFlyout = () => { + close(); + }; + const triggers = [ ...ensureNestedTriggers(embeddable.supportedTriggers()), CONTEXT_MENU_TRIGGER, @@ -111,11 +115,11 @@ export class FlyoutCreateDrilldownAction implements Action { ); // Close flyout on application change. - core.application.currentAppId$.pipe(takeUntil(closed$), skip(1), take(1)).subscribe(() => { - close(); - }); + core.application.currentAppId$ + .pipe(takeUntil(closed$), skip(1), take(1)) + .subscribe(closeFlyout); - // Close flyout on dashboard switch to "view" mode. + // Close flyout on dashboard switch to "view" mode or on embeddable destroy. embeddable .getInput$() .pipe( @@ -125,8 +129,6 @@ export class FlyoutCreateDrilldownAction implements Action { filter((mode) => mode !== ViewMode.EDIT), take(1) ) - .subscribe(() => { - close(); - }); + .subscribe({ next: closeFlyout, complete: closeFlyout }); } } diff --git a/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/actions/flyout_edit_drilldown/flyout_edit_drilldown.tsx b/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/actions/flyout_edit_drilldown/flyout_edit_drilldown.tsx index 44bfbb26421c6..f7cd8981451ea 100644 --- a/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/actions/flyout_edit_drilldown/flyout_edit_drilldown.tsx +++ b/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/actions/flyout_edit_drilldown/flyout_edit_drilldown.tsx @@ -67,6 +67,10 @@ export class FlyoutEditDrilldownAction implements Action { closed$.next(true); handle.close(); }; + const closeFlyout = () => { + close(); + }; + const handle = core.overlays.openFlyout( toMountPoint( { ); // Close flyout on application change. - core.application.currentAppId$.pipe(takeUntil(closed$), skip(1), take(1)).subscribe(() => { - close(); - }); + core.application.currentAppId$ + .pipe(takeUntil(closed$), skip(1), take(1)) + .subscribe(closeFlyout); - // Close flyout on dashboard switch to "view" mode. + // Close flyout on dashboard switch to "view" mode or on embeddable destroy. embeddable .getInput$() .pipe( @@ -99,8 +103,6 @@ export class FlyoutEditDrilldownAction implements Action { filter((mode) => mode !== ViewMode.EDIT), take(1) ) - .subscribe(() => { - close(); - }); + .subscribe({ next: closeFlyout, complete: closeFlyout }); } } diff --git a/x-pack/plugins/data_visualizer/common/types/field_stats.ts b/x-pack/plugins/data_visualizer/common/types/field_stats.ts index 75fa662281fb3..4f0fb1b81d8f9 100644 --- a/x-pack/plugins/data_visualizer/common/types/field_stats.ts +++ b/x-pack/plugins/data_visualizer/common/types/field_stats.ts @@ -32,11 +32,6 @@ export function isValidField(arg: unknown): arg is Field { return isPopulatedObject(arg, ['fieldName', 'type']) && typeof arg.fieldName === 'string'; } -export interface HistogramField { - fieldName: string; - type: string; -} - export interface Distribution { percentiles: Array<{ value?: number; percent: number; minValue: number; maxValue: number }>; minPercentile: number; @@ -107,13 +102,6 @@ export interface FieldExamples { examples: unknown[]; } -export interface NumericColumnStats { - interval: number; - min: number; - max: number; -} -export type NumericColumnStatsMap = Record; - export interface AggHistogram { histogram: estypes.AggregationsHistogramAggregation; } diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/overall_stats.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/overall_stats.ts index a25b3974d45b0..7bf8640c89fce 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/overall_stats.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/overall_stats.ts @@ -9,6 +9,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { get } from 'lodash'; import { Query } from '@kbn/es-query'; import { IKibanaSearchResponse } from '@kbn/data-plugin/common'; +import type { AggCardinality } from '@kbn/ml-agg-utils'; import { buildSamplerAggregation, getSamplerAggregationsResponsePath } from '@kbn/ml-agg-utils'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; import { @@ -17,7 +18,7 @@ import { } from '../../../../../common/utils/query_utils'; import { getDatafeedAggregations } from '../../../../../common/utils/datafeed_utils'; import { AggregatableField, NonAggregatableField } from '../../types/overall_stats'; -import { AggCardinality, Aggs } from '../../../../../common/types/field_stats'; +import { Aggs } from '../../../../../common/types/field_stats'; export const checkAggregatableFieldsExistRequest = ( dataViewTitle: string, diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.test.ts index a512b87ececc8..bd7fe8fecca8a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.test.ts @@ -365,9 +365,11 @@ describe('RelevanceTuningLogic', () => { weight: 1, }, }, + precision: 7, + precision_enabled: true, }; - const searchSettingsWithoutNewBoostProp = { + const { ['precision_enabled']: precisionEnabled, ...searchSettingsWithoutNewBoostProp } = { ...searchSettingsWithNewBoostProp, boosts: { foo: [ @@ -378,6 +380,7 @@ describe('RelevanceTuningLogic', () => { }, ], }, + precision: 7, }; mount({ @@ -413,6 +416,38 @@ describe('RelevanceTuningLogic', () => { searchSettings: { searchField: {}, boosts: {}, + precision: 7, + precision_enabled: true, + }, + }); + jest.spyOn(RelevanceTuningLogic.actions, 'setSearchResults'); + http.post.mockReturnValueOnce( + Promise.resolve({ + results: searchResults, + }) + ); + + RelevanceTuningLogic.actions.getSearchResults(); + + jest.runAllTimers(); + await nextTick(); + + expect(http.post).toHaveBeenCalledWith('/internal/app_search/engines/test-engine/search', { + body: JSON.stringify({ precision: 7 }), + query: { + query: 'foo', + }, + }); + }); + + it("won't send precision on the API call if it is not enabled", async () => { + mount({ + query: 'foo', + searchSettings: { + searchField: {}, + boosts: {}, + precision: 7, + precision_enabled: false, }, }); jest.spyOn(RelevanceTuningLogic.actions, 'setSearchResults'); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.ts index 76411a427e791..420ecfe36d7f0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.ts @@ -294,6 +294,7 @@ export const RelevanceTuningLogic = kea< actions.setResultsLoading(true); const filteredBoosts = removeEmptyValueBoosts(boosts); + const precisionSettings = values.isPrecisionTuningEnabled ? { precision } : {}; try { const response = await http.post<{ results: SearchResult[] }>(url, { @@ -303,7 +304,7 @@ export const RelevanceTuningLogic = kea< body: JSON.stringify({ boosts: isEmpty(filteredBoosts) ? undefined : filteredBoosts, search_fields: isEmpty(searchFields) ? undefined : searchFields, - precision, + ...precisionSettings, }), }); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/automatic_crawl_scheduler/automatic_crawl_scheduler_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/automatic_crawl_scheduler/automatic_crawl_scheduler_logic.test.ts index 0b1eceb379282..2327c1c394cee 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/automatic_crawl_scheduler/automatic_crawl_scheduler_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/automatic_crawl_scheduler/automatic_crawl_scheduler_logic.test.ts @@ -32,8 +32,8 @@ describe('AutomaticCrawlSchedulerLogic', () => { expect(AutomaticCrawlSchedulerLogic.values).toEqual({ crawlAutomatically: false, - crawlFrequency: 7, - crawlUnit: CrawlUnits.days, + crawlFrequency: 24, + crawlUnit: CrawlUnits.hours, isSubmitting: false, }); }); @@ -51,8 +51,8 @@ describe('AutomaticCrawlSchedulerLogic', () => { expect(AutomaticCrawlSchedulerLogic.values).toMatchObject({ crawlAutomatically: false, - crawlFrequency: 7, - crawlUnit: CrawlUnits.days, + crawlFrequency: 24, + crawlUnit: CrawlUnits.hours, }); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/automatic_crawl_scheduler/automatic_crawl_scheduler_logic.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/automatic_crawl_scheduler/automatic_crawl_scheduler_logic.ts index 736027540dc37..51452dbbd581a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/automatic_crawl_scheduler/automatic_crawl_scheduler_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/automatic_crawl_scheduler/automatic_crawl_scheduler_logic.ts @@ -22,8 +22,8 @@ export interface AutomaticCrawlSchedulerLogicValues { } const DEFAULT_VALUES: Pick = { - crawlFrequency: 7, - crawlUnit: CrawlUnits.days, + crawlFrequency: 24, + crawlUnit: CrawlUnits.hours, }; export interface AutomaticCrawlSchedulerLogicActions { diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/generate_api_key_panel.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/generate_api_key_panel.tsx index 50259cc0c53cb..be81b8a12131e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/generate_api_key_panel.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/generate_api_key_panel.tsx @@ -54,7 +54,7 @@ export const GenerateApiKeyPanel: React.FC = () => { )} - + diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/overview.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/overview.tsx index 691ecd973a910..7267f52680b2b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/overview.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/overview.tsx @@ -51,9 +51,15 @@ export const SearchIndexOverview: React.FC = () => { } /> )} - {isApi && } + {isApi && ( + <> + + + + )} {isCrawler && ( <> + diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/total_stats.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/total_stats.tsx index 4324a99ac5a2a..318fa3f988941 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/total_stats.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/total_stats.tsx @@ -13,8 +13,6 @@ import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiStat, EuiStatProps } from '@ela import { i18n } from '@kbn/i18n'; -import { CustomFormattedTimestamp } from '../../../shared/custom_formatted_timestamp/custom_formatted_timestamp'; - import { OverviewLogic } from './overview.logic'; interface TotalStatsProps { @@ -26,9 +24,6 @@ interface TotalStatsProps { export const TotalStats: React.FC = ({ ingestionType, additionalItems = [] }) => { const { indexData, isSuccess } = useValues(OverviewLogic); const documentCount = indexData?.total.docs.count ?? 0; - const lastUpdated = ( - - ); const isLoading = !isSuccess; const stats: EuiStatProps[] = [ { @@ -51,16 +46,6 @@ export const TotalStats: React.FC = ({ ingestionType, additiona isLoading, title: documentCount, }, - { - description: i18n.translate( - 'xpack.enterpriseSearch.content.searchIndex.totalStats.lastUpdatedCardLabel', - { - defaultMessage: 'Last updated', - } - ), - isLoading, - title: lastUpdated, - }, ...additionalItems, ]; diff --git a/x-pack/plugins/fleet/.storybook/context/http.ts b/x-pack/plugins/fleet/.storybook/context/http.ts index ff5b36a82aa66..70a766aca92e4 100644 --- a/x-pack/plugins/fleet/.storybook/context/http.ts +++ b/x-pack/plugins/fleet/.storybook/context/http.ts @@ -93,6 +93,14 @@ export const getHttp = (basepath = BASE_PATH) => { }; } + if (path.match('/api/fleet/agent_download_sources')) { + return { + items: [ + { name: 'Default Download Source', is_default: true, host: 'https://www.example.com' }, + ], + }; + } + action(path)(`UNSUPPORTED ROUTE: GET ${path}`); return {}; }) as HttpHandler, diff --git a/x-pack/plugins/fleet/public/applications/fleet/app.tsx b/x-pack/plugins/fleet/public/applications/fleet/app.tsx index ca8083fb51325..8af6db71106b3 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/app.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/app.tsx @@ -27,7 +27,7 @@ import type { FleetConfigType, FleetStartServices } from '../../plugin'; import { PackageInstallProvider } from '../integrations/hooks'; -import { useAuthz, useFlyoutContext } from './hooks'; +import { useAuthz, useFleetStatus, useFlyoutContext } from './hooks'; import { ConfigContext, @@ -304,6 +304,7 @@ const FleetTopNav = memo( export const AppRoutes = memo( ({ setHeaderActionMenu }: { setHeaderActionMenu: AppMountParameters['setHeaderActionMenu'] }) => { const flyoutContext = useFlyoutContext(); + const fleetStatus = useFleetStatus(); return ( <> @@ -361,7 +362,11 @@ export const AppRoutes = memo( {flyoutContext.isEnrollmentFlyoutOpen && ( flyoutContext.closeEnrollmentFlyout()} /> diff --git a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/steps/get_started.tsx b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/steps/get_started.tsx index 50e9b6b72002c..79acb26802499 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/steps/get_started.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/steps/get_started.tsx @@ -22,6 +22,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; +import { css } from '@emotion/react'; import { useLink } from '../../../hooks'; @@ -97,7 +98,11 @@ const GettingStartedStepContent: React.FunctionComponent<{ - + = ({ tags }) => { return ( <> {tags.length > MAX_TAGS_TO_DISPLAY ? ( - <> - {tags.join(', ')}}> + + {tags.join(', ')}} + > {take(tags, 3).map(truncateTag).join(', ')} + {tags.length - MAX_TAGS_TO_DISPLAY} more - + ) : ( {tags.map((tag, index) => ( diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/download_source_table/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/download_source_table/index.tsx index 87034bf900fda..c4b196bbaf15f 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/download_source_table/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/download_source_table/index.tsx @@ -7,7 +7,7 @@ import React, { useMemo } from 'react'; import styled from 'styled-components'; -import { EuiBasicTable, EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiCheckbox } from '@elastic/eui'; +import { EuiBasicTable, EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiIcon } from '@elastic/eui'; import type { EuiBasicTableColumn } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -75,13 +75,8 @@ export const DownloadSourceTable: React.FunctionComponent ( - undefined} - /> - ), + render: (downloadSource: DownloadSource) => + downloadSource.is_default ? : null, width: '200px', name: i18n.translate('xpack.fleet.settings.downloadSourcesTable.defaultColumnTitle', { defaultMessage: 'Default', diff --git a/x-pack/plugins/fleet/public/applications/integrations/app.tsx b/x-pack/plugins/fleet/public/applications/integrations/app.tsx index fb0d7f625488a..ad037652a78a3 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/app.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/app.tsx @@ -20,7 +20,12 @@ import { KibanaThemeProvider } from '@kbn/kibana-react-plugin/public'; import type { FleetConfigType, FleetStartServices } from '../../plugin'; -import { ConfigContext, FleetStatusProvider, KibanaVersionContext } from '../../hooks'; +import { + ConfigContext, + FleetStatusProvider, + KibanaVersionContext, + useFleetStatus, +} from '../../hooks'; import { FleetServerFlyout } from '../fleet/components'; @@ -110,6 +115,7 @@ export const IntegrationsAppContext: React.FC<{ export const AppRoutes = memo(() => { const flyoutContext = useFlyoutContext(); + const fleetStatus = useFleetStatus(); return ( <> @@ -142,7 +148,11 @@ export const AppRoutes = memo(() => { {flyoutContext.isEnrollmentFlyoutOpen && ( flyoutContext.closeEnrollmentFlyout()} /> diff --git a/x-pack/plugins/fleet/public/hooks/use_flyout_context.tsx b/x-pack/plugins/fleet/public/hooks/use_flyout_context.tsx index 0ddc358ab2fbf..3bec5db51aeb6 100644 --- a/x-pack/plugins/fleet/public/hooks/use_flyout_context.tsx +++ b/x-pack/plugins/fleet/public/hooks/use_flyout_context.tsx @@ -27,7 +27,9 @@ export const FlyoutContextProvider: React.FunctionComponent = ({ children }) => setIsEnrollmentFlyoutOpen(true), + openEnrollmentFlyout: () => { + setIsEnrollmentFlyoutOpen(true); + }, closeEnrollmentFlyout: () => setIsEnrollmentFlyoutOpen(false), isFleetServerFlyoutOpen, openFleetServerFlyout: () => setIsFleetServerFlyoutOpen(true), diff --git a/x-pack/plugins/fleet/server/plugin.ts b/x-pack/plugins/fleet/server/plugin.ts index 961d318be2c59..188963da09880 100644 --- a/x-pack/plugins/fleet/server/plugin.ts +++ b/x-pack/plugins/fleet/server/plugin.ts @@ -53,6 +53,7 @@ import { PACKAGES_SAVED_OBJECT_TYPE, ASSETS_SAVED_OBJECT_TYPE, PRECONFIGURATION_DELETION_RECORD_SAVED_OBJECT_TYPE, + DOWNLOAD_SOURCE_SAVED_OBJECT_TYPE, } from './constants'; import { registerSavedObjects, registerEncryptedSavedObjects } from './saved_objects'; import { @@ -141,6 +142,7 @@ const allSavedObjectTypes = [ PACKAGES_SAVED_OBJECT_TYPE, ASSETS_SAVED_OBJECT_TYPE, PRECONFIGURATION_DELETION_RECORD_SAVED_OBJECT_TYPE, + DOWNLOAD_SOURCE_SAVED_OBJECT_TYPE, ]; /** diff --git a/x-pack/plugins/fleet/server/services/agents/upgrade.ts b/x-pack/plugins/fleet/server/services/agents/upgrade.ts index 9ec85f1fe69fb..efe363b2b46b8 100644 --- a/x-pack/plugins/fleet/server/services/agents/upgrade.ts +++ b/x-pack/plugins/fleet/server/services/agents/upgrade.ts @@ -8,6 +8,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/server'; import moment from 'moment'; import pMap from 'p-map'; +import uuid from 'uuid/v4'; import type { Agent, BulkActionResult, FleetServerAgentAction, CurrentUpgrade } from '../../types'; import { @@ -100,6 +101,7 @@ export async function sendUpgradeAgentsActions( } } } else if ('kuery' in options) { + const actionId = uuid(); return await processAgentsInBatches( esClient, { @@ -108,7 +110,14 @@ export async function sendUpgradeAgentsActions( batchSize: options.batchSize, }, async (agents: Agent[], skipSuccess: boolean) => - await upgradeBatch(soClient, esClient, agents, outgoingErrors, options, skipSuccess) + await upgradeBatch( + soClient, + esClient, + agents, + outgoingErrors, + { ...options, actionId }, + skipSuccess + ) ); } @@ -121,6 +130,7 @@ async function upgradeBatch( givenAgents: Agent[], outgoingErrors: Record, options: ({ agents: Agent[] } | GetAgentsOptions) & { + actionId?: string; version: string; sourceUri?: string | undefined; force?: boolean; @@ -183,6 +193,7 @@ async function upgradeBatch( ); await createAgentAction(esClient, { + id: options.actionId, created_at: now, data, ack_data: data, diff --git a/x-pack/plugins/fleet/server/services/download_source.test.ts b/x-pack/plugins/fleet/server/services/download_source.test.ts index 07f450d2254e4..209a2f0313a0c 100644 --- a/x-pack/plugins/fleet/server/services/download_source.test.ts +++ b/x-pack/plugins/fleet/server/services/download_source.test.ts @@ -33,7 +33,7 @@ function mockDownloadSourceSO(id: string, attributes: any = {}) { }; } -function getMockedSoClient(options: { defaultDownloadSourceId?: string } = {}) { +function getMockedSoClient(options: { defaultDownloadSourceId?: string; sameName?: boolean } = {}) { const soClient = savedObjectsClientMock.create(); soClient.get.mockImplementation(async (type: string, id: string) => { @@ -95,6 +95,25 @@ function getMockedSoClient(options: { defaultDownloadSourceId?: string } = {}) { }; } + if ( + options.sameName && + findOptions.searchFields && + findOptions.searchFields.includes('name') && + findOptions + ) { + return { + page: 1, + per_page: 10, + saved_objects: [ + { + score: 0, + ...(await soClient.get(DOWNLOAD_SOURCE_SAVED_OBJECT_TYPE, 'download-source-test')), + }, + ], + total: 1, + }; + } + return { page: 1, per_page: 10, @@ -102,12 +121,13 @@ function getMockedSoClient(options: { defaultDownloadSourceId?: string } = {}) { total: 0, }; }); + mockedAppContextService.getInternalUserSOClient.mockReturnValue(soClient); return soClient; } -describe('Download Service Service', () => { +describe('Download Service', () => { beforeEach(() => { mockedAgentPolicyService.list.mockClear(); mockedAgentPolicyService.hasAPMIntegration.mockClear(); @@ -256,4 +276,24 @@ describe('Download Service Service', () => { expect(defaultId).toEqual('existing-default-download-source'); }); }); + + describe('requireUniqueName', () => { + it('throws an error if the name already exists', () => { + const soClient = getMockedSoClient({ + defaultDownloadSourceId: 'download-source-test', + sameName: true, + }); + expect( + async () => await downloadSourceService.requireUniqueName(soClient, { name: 'Test' }) + ).rejects.toThrow(`Download Source 'download-source-test' already exists with name 'Test'`); + }); + it('does not throw if the name is unique', () => { + const soClient = getMockedSoClient({ + defaultDownloadSourceId: 'download-source-test', + }); + expect( + async () => await downloadSourceService.requireUniqueName(soClient, { name: 'Test' }) + ).not.toThrow(); + }); + }); }); diff --git a/x-pack/plugins/fleet/server/services/download_source.ts b/x-pack/plugins/fleet/server/services/download_source.ts index 7a6df1d67a7f8..b4261008e5c37 100644 --- a/x-pack/plugins/fleet/server/services/download_source.ts +++ b/x-pack/plugins/fleet/server/services/download_source.ts @@ -13,11 +13,12 @@ import { } from '../constants'; import type { DownloadSource, DownloadSourceAttributes, DownloadSourceBase } from '../types'; -import { DownloadSourceError } from '../errors'; +import { DownloadSourceError, IngestManagerError } from '../errors'; import { SO_SEARCH_LIMIT } from '../../common'; import { agentPolicyService } from './agent_policy'; import { appContextService } from './app_context'; +import { escapeSearchQueryPhrase } from './saved_object'; function savedObjectToDownloadSource(so: SavedObject) { const { source_id: sourceId, ...attributes } = so.attributes; @@ -66,6 +67,11 @@ class DownloadSourceService { ): Promise { const data: DownloadSourceAttributes = downloadSource; + await this.requireUniqueName(soClient, { + name: downloadSource.name, + id: options?.id, + }); + // default should be only one if (data.is_default) { const defaultDownloadSourceId = await this.getDefaultDownloadSourceId(soClient); @@ -96,6 +102,13 @@ class DownloadSourceService { ) { const updateData: Partial = newData; + if (newData.name) { + await this.requireUniqueName(soClient, { + name: newData.name, + id, + }); + } + if (updateData.is_default) { const defaultDownloadSourceId = await this.getDefaultDownloadSourceId(soClient); @@ -164,6 +177,31 @@ class DownloadSourceService { return defaultDS; } + public async requireUniqueName( + soClient: SavedObjectsClientContract, + downloadSource: { name: string; id?: string } + ) { + const results = await soClient.find({ + type: DOWNLOAD_SOURCE_SAVED_OBJECT_TYPE, + searchFields: ['name'], + search: escapeSearchQueryPhrase(downloadSource.name), + }); + const idsWithName = results.total && results.saved_objects.map(({ id }) => id); + + if (Array.isArray(idsWithName)) { + const isEditingSelf = downloadSource?.id && idsWithName.includes(downloadSource.id); + if (!downloadSource.id || !isEditingSelf) { + const isSingle = idsWithName.length === 1; + + const existClause = isSingle + ? `Download Source '${idsWithName[0]}' already exists` + : `Download Sources '${idsWithName.join(',')}' already exist`; + + throw new IngestManagerError(`${existClause} with name '${downloadSource.name}'`); + } + } + } + private async _getDefaultDownloadSourceSO(soClient: SavedObjectsClientContract) { return await soClient.find({ type: DOWNLOAD_SOURCE_SAVED_OBJECT_TYPE, diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.test.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.test.ts index 5e3ba27a5357b..d69fd167ee117 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.test.ts @@ -4,8 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { loggerMock } from '@kbn/logging-mocks'; import { getArchiveEntry } from '../../archive/cache'; diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/transform.test.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/transform.test.ts index 74e49031861c1..3155380b6c365 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/transform.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/transform.test.ts @@ -24,8 +24,7 @@ import { loggerMock } from '@kbn/logging-mocks'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { savedObjectsClientMock } from '@kbn/core/server/saved_objects/service/saved_objects_client.mock'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { getInstallation, getInstallationObject } from '../../packages'; import type { Installation, RegistryPackage } from '../../../../types'; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_form/steps/step_review.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_form/steps/step_review.tsx index da25af901020a..159f25ab010b7 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_form/steps/step_review.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_form/steps/step_review.tsx @@ -69,7 +69,7 @@ export const StepReview: React.FunctionComponent = React.memo( } = serializedComponentTemplate; const isFleetDatastreamsVisible = - dataStreams?.length && componentTemplate._meta?.managed_by === MANAGED_BY_FLEET; + Boolean(dataStreams?.length) && componentTemplate._meta?.managed_by === MANAGED_BY_FLEET; const SummaryTab = () => (
@@ -125,7 +125,7 @@ export const StepReview: React.FunctionComponent = React.memo( - {isFleetDatastreamsVisible && ( + {isFleetDatastreamsVisible && dataStreams && ( {/* Datastream mappings */} string }; if (indexPattern.fieldFormatMap && indexPattern.fieldFormatMap[field.name]) { - const FormatType = fieldFormats.getType(indexPattern.fieldFormatMap[field.name].id); + const FormatType = fieldFormats.getType(indexPattern.fieldFormatMap[field.name].id as string); if (FormatType) { formatter = new FormatType( indexPattern.fieldFormatMap[field.name].params, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts b/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts index ce162e5d2ff60..8ca21272a555e 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts @@ -100,6 +100,7 @@ export function convertDataViewIntoLensIndexPattern(dataView: DataView): IndexPa Object.fromEntries( Object.entries(fieldFormatMap).map(([id, format]) => [ id, + // @ts-expect-error FIXME Property 'toJSON' does not exist on type 'SerializedFieldFormat' 'toJSON' in format ? format.toJSON() : format, ]) ), diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/types.ts b/x-pack/plugins/lens/public/indexpattern_datasource/types.ts index d01415b460325..31aa7e3214d73 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/types.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/types.ts @@ -7,7 +7,7 @@ import type { IndexPatternAggRestrictions } from '@kbn/data-plugin/public'; import type { FieldSpec } from '@kbn/data-plugin/common'; -import type { FieldFormatParams } from '@kbn/field-formats-plugin/common'; +import type { FieldFormatMap } from '@kbn/data-views-plugin/common'; import type { DragDropIdentifier } from '../drag_drop/providers'; import type { IncompleteColumn, GenericIndexPatternColumn } from './operations'; import { DragDropOperation } from '../types'; @@ -57,13 +57,7 @@ export interface IndexPattern { title: string; name?: string; timeFieldName?: string; - fieldFormatMap?: Record< - string, - { - id: string; - params: FieldFormatParams; - } - >; + fieldFormatMap?: FieldFormatMap; hasRestrictions: boolean; } diff --git a/x-pack/plugins/licensing/common/register_analytics_context_provider.ts b/x-pack/plugins/licensing/common/register_analytics_context_provider.ts index 60f3fbbb3e603..9a981a73b8c95 100644 --- a/x-pack/plugins/licensing/common/register_analytics_context_provider.ts +++ b/x-pack/plugins/licensing/common/register_analytics_context_provider.ts @@ -19,21 +19,21 @@ export function registerAnalyticsContextProvider( name: 'license info', context$: license$.pipe( map((license) => ({ - license_id: license.uid, - license_status: license.status, - license_type: license.type, + licenseId: license.uid, + licenseStatus: license.status, + licenseType: license.type, })) ), schema: { - license_id: { + licenseId: { type: 'keyword', _meta: { description: 'The license ID', optional: true }, }, - license_status: { + licenseStatus: { type: 'keyword', _meta: { description: 'The license Status (active/invalid/expired)', optional: true }, }, - license_type: { + licenseType: { type: 'keyword', _meta: { description: 'The license Type (basic/standard/gold/platinum/enterprise/trial)', diff --git a/x-pack/plugins/lists/common/exceptions/build_exceptions_filter.test.ts b/x-pack/plugins/lists/common/exceptions/build_exceptions_filter.test.ts index 31d5715512d7b..16bd8a9431b82 100644 --- a/x-pack/plugins/lists/common/exceptions/build_exceptions_filter.test.ts +++ b/x-pack/plugins/lists/common/exceptions/build_exceptions_filter.test.ts @@ -16,6 +16,7 @@ import { buildExistsClause, buildMatchAnyClause, buildMatchClause, + buildMatchWildcardClause, buildNestedClause, createOrClauses, } from '@kbn/securitysolution-list-utils'; @@ -32,6 +33,10 @@ import { getEntryNestedMock, } from '../schemas/types/entry_nested.mock'; import { getExceptionListItemSchemaMock } from '../schemas/response/exception_list_item_schema.mock'; +import { + getEntryMatchWildcardExcludeMock, + getEntryMatchWildcardMock, +} from '../schemas/types/entry_match_wildcard.mock'; // TODO: Port the test over to packages/kbn-securitysolution-list-utils/src/build_exception_filter/index.test.ts once the mocks are ported to kbn @@ -1040,4 +1045,38 @@ describe('build_exceptions_filter', () => { }); }); }); + + describe('buildWildcardClause', () => { + test('it should build wildcard filter when operator is "included"', () => { + const booleanFilter = buildMatchWildcardClause(getEntryMatchWildcardMock()); + + expect(booleanFilter).toEqual({ + bool: { + filter: { + wildcard: { + 'host.name': 'some host name', + }, + }, + }, + }); + }); + + test('it should build boolean filter when operator is "excluded"', () => { + const booleanFilter = buildMatchWildcardClause(getEntryMatchWildcardExcludeMock()); + + expect(booleanFilter).toEqual({ + bool: { + must_not: { + bool: { + filter: { + wildcard: { + 'host.name': 'some host name', + }, + }, + }, + }, + }, + }); + }); + }); }); diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx index d0d931387f0e4..8a30e1aac2510 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx @@ -10,6 +10,7 @@ import { EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui'; import { coreMock } from '@kbn/core/public/mocks'; import { doesNotExistOperator, + doesNotMatchOperator, existsOperator, isInListOperator, isNotInListOperator, @@ -383,6 +384,80 @@ describe('BuilderEntryItem', () => { ).toBeTruthy(); }); + test('it renders field values correctly when operator is "matchesOperator"', () => { + wrapper = mount( + + ); + + expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('ip'); + expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual( + 'matches' + ); + expect(wrapper.find('[data-test-subj="exceptionBuilderEntryFieldWildcard"]').text()).toEqual( + '1234*' + ); + }); + + test('it renders field values correctly when operator is "doesNotMatchOperator"', () => { + wrapper = mount( + + ); + + expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('ip'); + expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual( + 'does not match' + ); + expect(wrapper.find('[data-test-subj="exceptionBuilderEntryFieldWildcard"]').text()).toEqual( + '1234*' + ); + }); + test('it uses "correspondingKeywordField" if it exists', () => { const correspondingKeywordField: FieldSpec = { aggregatable: true, @@ -656,6 +731,47 @@ describe('BuilderEntryItem', () => { ); }); + test('it invokes "onChange" when new value field is entered for wildcard operator', () => { + const mockOnChange = jest.fn(); + wrapper = mount( + + ); + + ( + wrapper.find(EuiComboBox).at(2).props() as unknown as { + onCreateOption: (a: string) => void; + } + ).onCreateOption('5678*'); + + expect(mockOnChange).toHaveBeenCalledWith( + { field: 'ip', id: '123', operator: 'included', type: 'wildcard', value: '5678*' }, + 0 + ); + }); + test('it invokes "setErrorsExist" when user touches value input and leaves empty', async () => { const mockSetErrorExists = jest.fn(); wrapper = mount( diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx index febade31fa4aa..0c57c14380c18 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx @@ -292,6 +292,7 @@ export const BuilderEntryItem: React.FC = ({ ); }; + // eslint-disable-next-line complexity const getFieldValueComboBox = (type: OperatorTypeEnum, isFirst: boolean): JSX.Element => { switch (type) { case OperatorTypeEnum.MATCH: @@ -338,13 +339,16 @@ export const BuilderEntryItem: React.FC = ({ ); case OperatorTypeEnum.WILDCARD: const wildcardValue = typeof entry.value === 'string' ? entry.value : undefined; - let os: OperatingSystem = OperatingSystem.WINDOWS; - if (osTypes) { - [os] = osTypes as OperatingSystem[]; + let actualWarning: React.ReactNode | string | undefined; + if (listType !== 'detection') { + let os: OperatingSystem = OperatingSystem.WINDOWS; + if (osTypes) { + [os] = osTypes as OperatingSystem[]; + } + const warning = validateFilePathInput({ os, value: wildcardValue }); + actualWarning = + warning === FILENAME_WILDCARD_WARNING ? getWildcardWarning(warning) : warning; } - const warning = validateFilePathInput({ os, value: wildcardValue }); - const actualWarning = - warning === FILENAME_WILDCARD_WARNING ? getWildcardWarning(warning) : warning; return ( ; indexPattern.metaFields.forEach((metaField: string) => { if (!this._getTooltipPropertyNames().includes(metaField)) { delete properties[metaField]; diff --git a/x-pack/plugins/maps/public/routes/map_page/saved_map/saved_map.ts b/x-pack/plugins/maps/public/routes/map_page/saved_map/saved_map.ts index c64506eec9056..d746f7af5b7cd 100644 --- a/x-pack/plugins/maps/public/routes/map_page/saved_map/saved_map.ts +++ b/x-pack/plugins/maps/public/routes/map_page/saved_map/saved_map.ts @@ -6,6 +6,7 @@ */ import _ from 'lodash'; +import { METRIC_TYPE } from '@kbn/analytics'; import { i18n } from '@kbn/i18n'; import { EmbeddableStateTransfer } from '@kbn/embeddable-plugin/public'; import { OnSaveProps } from '@kbn/saved-objects-plugin/public'; @@ -40,6 +41,7 @@ import { getIsAllowByValueEmbeddables, getSavedObjectsTagging, getTimeFilter, + getUsageCollection, } from '../../../kibana_services'; import { goToSpecifiedPath } from '../../../render_app'; import { LayerDescriptor } from '../../../../common/descriptor_types'; @@ -50,6 +52,7 @@ import { createBasemapLayerDescriptor } from '../../../classes/layers/create_bas import { whenLicenseInitialized } from '../../../licensed_features'; import { SerializedMapState, SerializedUiState } from './types'; import { setAutoOpenLayerWizardId } from '../../../actions/ui_actions'; +import { LayerStatsCollector } from '../../../../common/telemetry'; function setMapSettingsFromEncodedState(settings: Partial) { const decodedCustomIcons = settings.customIcons @@ -136,6 +139,8 @@ export class SavedMap { } } + this._reportUsage(); + if (this._mapEmbeddableInput && this._mapEmbeddableInput.mapSettings !== undefined) { this._store.dispatch(setMapSettingsFromEncodedState(this._mapEmbeddableInput.mapSettings)); } else if (this._attributes?.mapStateJSON) { @@ -270,6 +275,34 @@ export class SavedMap { : this._attributes!.title; } + private _reportUsage(): void { + const usageCollector = getUsageCollection(); + if (!usageCollector || !this._attributes) { + return; + } + + const layerStatsCollector = new LayerStatsCollector(this._attributes); + + const uiCounterEvents = { + layer: layerStatsCollector.getLayerCounts(), + scaling: layerStatsCollector.getScalingCounts(), + resolution: layerStatsCollector.getResolutionCounts(), + join: layerStatsCollector.getJoinCounts(), + ems_basemap: layerStatsCollector.getBasemapCounts(), + }; + + for (const [eventType, eventTypeMetrics] of Object.entries(uiCounterEvents)) { + for (const [eventName, count] of Object.entries(eventTypeMetrics)) { + usageCollector.reportUiCounter( + APP_ID, + METRIC_TYPE.LOADED, + `${eventType}_${eventName}`, + count + ); + } + } + } + setBreadcrumbs() { if (!this._attributes) { throw new Error('Invalid usage, must await whenReady before calling hasUnsavedChanges'); diff --git a/x-pack/plugins/ml/common/types/fields.ts b/x-pack/plugins/ml/common/types/fields.ts index b63efd4a6a891..3134d470f889f 100644 --- a/x-pack/plugins/ml/common/types/fields.ts +++ b/x-pack/plugins/ml/common/types/fields.ts @@ -97,19 +97,6 @@ export const mlCategory: Field = { aggregatable: false, }; -export interface FieldAggCardinality { - field: string; - percent?: any; -} - -export interface ScriptAggCardinality { - script: any; -} - -export interface AggCardinality { - cardinality: FieldAggCardinality | ScriptAggCardinality; -} - export type RollupFields = Record]>; export type RuntimeMappings = estypes.MappingRuntimeFields; diff --git a/x-pack/plugins/ml/server/index.ts b/x-pack/plugins/ml/server/index.ts index 8a1cfb9590402..fa455e38f5166 100644 --- a/x-pack/plugins/ml/server/index.ts +++ b/x-pack/plugins/ml/server/index.ts @@ -21,7 +21,6 @@ export { UnknownMLCapabilitiesError, InsufficientMLCapabilities, MLPrivilegesUninitialized, - getHistogramsForFields, } from './shared'; export const plugin = (ctx: PluginInitializerContext) => new MlServerPlugin(ctx); diff --git a/x-pack/plugins/ml/server/models/data_visualizer/data_visualizer.ts b/x-pack/plugins/ml/server/models/data_visualizer/data_visualizer.ts index 6946a2fbda90f..6bb6da5b09069 100644 --- a/x-pack/plugins/ml/server/models/data_visualizer/data_visualizer.ts +++ b/x-pack/plugins/ml/server/models/data_visualizer/data_visualizer.ts @@ -8,18 +8,17 @@ import { get, each, last, find } from 'lodash'; import { IScopedClusterClient } from '@kbn/core/server'; -import { KBN_FIELD_TYPES } from '@kbn/data-plugin/server'; import { buildSamplerAggregation, - getAggIntervals, + fetchHistogramsForFields, getSamplerAggregationsResponsePath, } from '@kbn/ml-agg-utils'; -import { stringHash } from '@kbn/ml-string-hash'; +import type { AggCardinality, FieldsForHistograms } from '@kbn/ml-agg-utils'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; import { ML_JOB_FIELD_TYPES } from '../../../common/constants/field_types'; import { getSafeAggregationName } from '../../../common/util/job_utils'; import { buildBaseFilterCriteria } from '../../lib/query_utils'; -import { AggCardinality, RuntimeMappings } from '../../../common/types/fields'; +import { RuntimeMappings } from '../../../common/types/fields'; import { getDatafeedAggregations } from '../../../common/util/datafeed_utils'; import { Datafeed } from '../../../common/types/anomaly_detection_jobs'; @@ -28,8 +27,6 @@ const SAMPLER_TOP_TERMS_SHARD_SIZE = 5000; const AGGREGATABLE_EXISTS_REQUEST_BATCH_SIZE = 200; const FIELDS_REQUEST_BATCH_SIZE = 10; -const MAX_CHART_COLUMNS = 20; - interface FieldData { fieldName: string; existsInDocs: boolean; @@ -46,11 +43,6 @@ export interface Field { cardinality: number; } -export interface HistogramField { - fieldName: string; - type: string; -} - interface Distribution { percentiles: any[]; minPercentile: number; @@ -114,57 +106,6 @@ interface FieldExamples { examples: any[]; } -interface AggHistogram { - histogram: { - field: string; - interval: number; - }; -} - -interface AggTerms { - terms: { - field: string; - size: number; - }; -} - -interface NumericDataItem { - key: number; - key_as_string?: string; - doc_count: number; -} - -interface NumericChartData { - data: NumericDataItem[]; - id: string; - interval: number; - stats: [number, number]; - type: 'numeric'; -} - -interface OrdinalDataItem { - key: string; - key_as_string?: string; - doc_count: number; -} - -interface OrdinalChartData { - type: 'ordinal' | 'boolean'; - cardinality: number; - data: OrdinalDataItem[]; - id: string; -} - -interface UnsupportedChartData { - id: string; - type: 'unsupported'; -} - -type ChartRequestAgg = AggHistogram | AggCardinality | AggTerms; - -// type ChartDataItem = NumericDataItem | OrdinalDataItem; -type ChartData = NumericChartData | OrdinalChartData | UnsupportedChartData; - type BatchStats = | NumericFieldStats | StringFieldStats @@ -173,126 +114,11 @@ type BatchStats = | DocumentCountStats | FieldExamples; -// export for re-use by transforms plugin -export const getHistogramsForFields = async ( - client: IScopedClusterClient, - indexPattern: string, - query: any, - fields: HistogramField[], - samplerShardSize: number, - runtimeMappings?: RuntimeMappings -) => { - const { asCurrentUser } = client; - const aggIntervals = await getAggIntervals( - client.asCurrentUser, - indexPattern, - query, - fields, - samplerShardSize, - runtimeMappings - ); - - const chartDataAggs = fields.reduce((aggs, field) => { - const fieldName = field.fieldName; - const fieldType = field.type; - const id = stringHash(fieldName); - if (fieldType === KBN_FIELD_TYPES.NUMBER || fieldType === KBN_FIELD_TYPES.DATE) { - if (aggIntervals[id] !== undefined) { - aggs[`${id}_histogram`] = { - histogram: { - field: fieldName, - interval: aggIntervals[id].interval !== 0 ? aggIntervals[id].interval : 1, - }, - }; - } - } else if (fieldType === KBN_FIELD_TYPES.STRING || fieldType === KBN_FIELD_TYPES.BOOLEAN) { - if (fieldType === KBN_FIELD_TYPES.STRING) { - aggs[`${id}_cardinality`] = { - cardinality: { - field: fieldName, - }, - }; - } - aggs[`${id}_terms`] = { - terms: { - field: fieldName, - size: MAX_CHART_COLUMNS, - }, - }; - } - return aggs; - }, {} as Record); - - if (Object.keys(chartDataAggs).length === 0) { - return []; - } - - const body = await asCurrentUser.search( - { - index: indexPattern, - size: 0, - body: { - query, - aggs: buildSamplerAggregation(chartDataAggs, samplerShardSize), - size: 0, - ...(isPopulatedObject(runtimeMappings) ? { runtime_mappings: runtimeMappings } : {}), - }, - }, - { maxRetries: 0 } - ); - - const aggsPath = getSamplerAggregationsResponsePath(samplerShardSize); - const aggregations = aggsPath.length > 0 ? get(body.aggregations, aggsPath) : body.aggregations; - - const chartsData: ChartData[] = fields.map((field): ChartData => { - const fieldName = field.fieldName; - const fieldType = field.type; - const id = stringHash(field.fieldName); - - if (fieldType === KBN_FIELD_TYPES.NUMBER || fieldType === KBN_FIELD_TYPES.DATE) { - if (aggIntervals[id] === undefined) { - return { - type: 'numeric', - data: [], - interval: 0, - stats: [0, 0], - id: fieldName, - }; - } - - return { - data: aggregations[`${id}_histogram`].buckets, - interval: aggIntervals[id].interval, - stats: [aggIntervals[id].min, aggIntervals[id].max], - type: 'numeric', - id: fieldName, - }; - } else if (fieldType === KBN_FIELD_TYPES.STRING || fieldType === KBN_FIELD_TYPES.BOOLEAN) { - return { - type: fieldType === KBN_FIELD_TYPES.STRING ? 'ordinal' : 'boolean', - cardinality: - fieldType === KBN_FIELD_TYPES.STRING ? aggregations[`${id}_cardinality`].value : 2, - data: aggregations[`${id}_terms`].buckets, - id: fieldName, - }; - } - - return { - type: 'unsupported', - id: fieldName, - }; - }); - - return chartsData; -}; - export class DataVisualizer { - private _client: IScopedClusterClient; private _asCurrentUser: IScopedClusterClient['asCurrentUser']; constructor(client: IScopedClusterClient) { this._asCurrentUser = client.asCurrentUser; - this._client = client; } // Obtains overall stats on the fields in the supplied index pattern, returning an object @@ -388,12 +214,12 @@ export class DataVisualizer { async getHistogramsForFields( indexPattern: string, query: any, - fields: HistogramField[], + fields: FieldsForHistograms, samplerShardSize: number, runtimeMappings?: RuntimeMappings ): Promise { - return await getHistogramsForFields( - this._client, + return await fetchHistogramsForFields( + this._asCurrentUser, indexPattern, query, fields, diff --git a/x-pack/plugins/ml/server/models/data_visualizer/index.ts b/x-pack/plugins/ml/server/models/data_visualizer/index.ts index 55ddc76cde500..b2df993bac302 100644 --- a/x-pack/plugins/ml/server/models/data_visualizer/index.ts +++ b/x-pack/plugins/ml/server/models/data_visualizer/index.ts @@ -5,4 +5,4 @@ * 2.0. */ -export { getHistogramsForFields, DataVisualizer } from './data_visualizer'; +export { DataVisualizer } from './data_visualizer'; diff --git a/x-pack/plugins/ml/server/models/fields_service/fields_service.ts b/x-pack/plugins/ml/server/models/fields_service/fields_service.ts index e1485ed0d2e9b..4eaa1165d398a 100644 --- a/x-pack/plugins/ml/server/models/fields_service/fields_service.ts +++ b/x-pack/plugins/ml/server/models/fields_service/fields_service.ts @@ -9,10 +9,10 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import Boom from '@hapi/boom'; import { IScopedClusterClient } from '@kbn/core/server'; import { duration } from 'moment'; +import type { AggCardinality } from '@kbn/ml-agg-utils'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; import { parseInterval } from '../../../common/util/parse_interval'; import { initCardinalityFieldsCache } from './fields_aggs_cache'; -import { AggCardinality } from '../../../common/types/fields'; import { isValidAggregationField } from '../../../common/util/validation_utils'; import { getDatafeedAggregations } from '../../../common/util/datafeed_utils'; import { Datafeed, IndicesOptions } from '../../../common/types/anomaly_detection_jobs'; diff --git a/x-pack/plugins/ml/server/routes/data_visualizer.ts b/x-pack/plugins/ml/server/routes/data_visualizer.ts index 88131afd20c08..5a71c76bd49ef 100644 --- a/x-pack/plugins/ml/server/routes/data_visualizer.ts +++ b/x-pack/plugins/ml/server/routes/data_visualizer.ts @@ -6,9 +6,9 @@ */ import { IScopedClusterClient } from '@kbn/core/server'; +import { FieldsForHistograms } from '@kbn/ml-agg-utils'; import { wrapError } from '../client/error_wrapper'; import { DataVisualizer } from '../models/data_visualizer'; -import { HistogramField } from '../models/data_visualizer/data_visualizer'; import { dataVisualizerFieldHistogramsSchema, indexPatternSchema, @@ -20,7 +20,7 @@ function getHistogramsForFields( client: IScopedClusterClient, indexPattern: string, query: any, - fields: HistogramField[], + fields: FieldsForHistograms, samplerShardSize: number, runtimeMappings: RuntimeMappings ) { diff --git a/x-pack/plugins/ml/server/shared.ts b/x-pack/plugins/ml/server/shared.ts index 8760dfb991ab5..170edc97cc383 100644 --- a/x-pack/plugins/ml/server/shared.ts +++ b/x-pack/plugins/ml/server/shared.ts @@ -9,4 +9,3 @@ export * from '../common/types/anomalies'; export * from '../common/types/anomaly_detection_jobs'; export * from './lib/capabilities/errors'; export type { ModuleSetupPayload } from './shared_services/providers/modules'; -export { getHistogramsForFields } from './models/data_visualizer'; diff --git a/x-pack/plugins/monitoring/server/lib/alerts/fetch_ccr_read_exceptions.test.ts b/x-pack/plugins/monitoring/server/lib/alerts/fetch_ccr_read_exceptions.test.ts index c6f63b0a8a63c..23de6bd101673 100644 --- a/x-pack/plugins/monitoring/server/lib/alerts/fetch_ccr_read_exceptions.test.ts +++ b/x-pack/plugins/monitoring/server/lib/alerts/fetch_ccr_read_exceptions.test.ts @@ -5,8 +5,7 @@ * 2.0. */ -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { fetchCCRReadExceptions } from './fetch_ccr_read_exceptions'; jest.mock('../../static_globals', () => ({ diff --git a/x-pack/plugins/monitoring/server/lib/alerts/fetch_cluster_health.test.ts b/x-pack/plugins/monitoring/server/lib/alerts/fetch_cluster_health.test.ts index 1c369c159595a..d87792f347eb0 100644 --- a/x-pack/plugins/monitoring/server/lib/alerts/fetch_cluster_health.test.ts +++ b/x-pack/plugins/monitoring/server/lib/alerts/fetch_cluster_health.test.ts @@ -6,8 +6,7 @@ */ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { fetchClusterHealth } from './fetch_cluster_health'; jest.mock('../../static_globals', () => ({ diff --git a/x-pack/plugins/monitoring/server/lib/alerts/fetch_cpu_usage_node_stats.test.ts b/x-pack/plugins/monitoring/server/lib/alerts/fetch_cpu_usage_node_stats.test.ts index af90f99eb8288..5d7505c492da4 100644 --- a/x-pack/plugins/monitoring/server/lib/alerts/fetch_cpu_usage_node_stats.test.ts +++ b/x-pack/plugins/monitoring/server/lib/alerts/fetch_cpu_usage_node_stats.test.ts @@ -6,8 +6,7 @@ */ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { fetchCpuUsageNodeStats } from './fetch_cpu_usage_node_stats'; jest.mock('../../static_globals', () => ({ diff --git a/x-pack/plugins/monitoring/server/lib/alerts/fetch_memory_usage_node_stats.test.ts b/x-pack/plugins/monitoring/server/lib/alerts/fetch_memory_usage_node_stats.test.ts index d717edf9feb43..06227c53b25fa 100644 --- a/x-pack/plugins/monitoring/server/lib/alerts/fetch_memory_usage_node_stats.test.ts +++ b/x-pack/plugins/monitoring/server/lib/alerts/fetch_memory_usage_node_stats.test.ts @@ -5,8 +5,7 @@ * 2.0. */ -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { fetchMemoryUsageNodeStats } from './fetch_memory_usage_node_stats'; jest.mock('../../static_globals', () => ({ diff --git a/x-pack/plugins/monitoring/server/lib/alerts/fetch_missing_monitoring_data.test.ts b/x-pack/plugins/monitoring/server/lib/alerts/fetch_missing_monitoring_data.test.ts index 90cfbc96617cb..a0c5e1b247243 100644 --- a/x-pack/plugins/monitoring/server/lib/alerts/fetch_missing_monitoring_data.test.ts +++ b/x-pack/plugins/monitoring/server/lib/alerts/fetch_missing_monitoring_data.test.ts @@ -5,8 +5,7 @@ * 2.0. */ -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { fetchMissingMonitoringData } from './fetch_missing_monitoring_data'; jest.mock('../../static_globals', () => ({ diff --git a/x-pack/plugins/monitoring/server/lib/alerts/fetch_nodes_from_cluster_stats.test.ts b/x-pack/plugins/monitoring/server/lib/alerts/fetch_nodes_from_cluster_stats.test.ts index 12c49f89aa487..fe03ffec6d137 100644 --- a/x-pack/plugins/monitoring/server/lib/alerts/fetch_nodes_from_cluster_stats.test.ts +++ b/x-pack/plugins/monitoring/server/lib/alerts/fetch_nodes_from_cluster_stats.test.ts @@ -5,8 +5,7 @@ * 2.0. */ -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { fetchNodesFromClusterStats } from './fetch_nodes_from_cluster_stats'; jest.mock('../../static_globals', () => ({ diff --git a/x-pack/plugins/monitoring_collection/server/lib/get_es_cluster_uuid.test.ts b/x-pack/plugins/monitoring_collection/server/lib/get_es_cluster_uuid.test.ts index 1e60b49181dec..8b28221947a2d 100644 --- a/x-pack/plugins/monitoring_collection/server/lib/get_es_cluster_uuid.test.ts +++ b/x-pack/plugins/monitoring_collection/server/lib/get_es_cluster_uuid.test.ts @@ -4,8 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; + +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { getESClusterUuid } from '.'; describe('getESClusterUuid', () => { diff --git a/x-pack/plugins/monitoring_collection/server/routes/api/v1/dynamic_route/get_metrics_by_type.test.ts b/x-pack/plugins/monitoring_collection/server/routes/api/v1/dynamic_route/get_metrics_by_type.test.ts index edc6c6cef7c8e..92ff711006a25 100644 --- a/x-pack/plugins/monitoring_collection/server/routes/api/v1/dynamic_route/get_metrics_by_type.test.ts +++ b/x-pack/plugins/monitoring_collection/server/routes/api/v1/dynamic_route/get_metrics_by_type.test.ts @@ -8,8 +8,7 @@ import { registerDynamicRoute } from '.'; import { KibanaRequest, KibanaResponseFactory, ServiceStatusLevels } from '@kbn/core/server'; import { httpServerMock, httpServiceMock } from '@kbn/core/server/mocks'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; beforeEach(() => { jest.resetAllMocks(); diff --git a/x-pack/plugins/rule_registry/server/alert_data_client/tests/bulk_update.test.ts b/x-pack/plugins/rule_registry/server/alert_data_client/tests/bulk_update.test.ts index 3f9143ac7922b..bf3e1e9d91994 100644 --- a/x-pack/plugins/rule_registry/server/alert_data_client/tests/bulk_update.test.ts +++ b/x-pack/plugins/rule_registry/server/alert_data_client/tests/bulk_update.test.ts @@ -14,8 +14,7 @@ import { } from '@kbn/rule-data-utils'; import { AlertsClient, ConstructorOptions } from '../alerts_client'; import { loggingSystemMock } from '@kbn/core/server/mocks'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { alertingAuthorizationMock } from '@kbn/alerting-plugin/server/authorization/alerting_authorization.mock'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { AlertingAuthorizationEntity } from '@kbn/alerting-plugin/server'; diff --git a/x-pack/plugins/rule_registry/server/alert_data_client/tests/find_alerts.test.ts b/x-pack/plugins/rule_registry/server/alert_data_client/tests/find_alerts.test.ts index 00c034b980109..bdb278cb2a3ba 100644 --- a/x-pack/plugins/rule_registry/server/alert_data_client/tests/find_alerts.test.ts +++ b/x-pack/plugins/rule_registry/server/alert_data_client/tests/find_alerts.test.ts @@ -13,8 +13,7 @@ import { } from '@kbn/rule-data-utils'; import { AlertsClient, ConstructorOptions } from '../alerts_client'; import { loggingSystemMock } from '@kbn/core/server/mocks'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { alertingAuthorizationMock } from '@kbn/alerting-plugin/server/authorization/alerting_authorization.mock'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { AlertingAuthorizationEntity } from '@kbn/alerting-plugin/server'; diff --git a/x-pack/plugins/rule_registry/server/alert_data_client/tests/get.test.ts b/x-pack/plugins/rule_registry/server/alert_data_client/tests/get.test.ts index a9bfe02443f73..58a9e2cec235f 100644 --- a/x-pack/plugins/rule_registry/server/alert_data_client/tests/get.test.ts +++ b/x-pack/plugins/rule_registry/server/alert_data_client/tests/get.test.ts @@ -14,8 +14,7 @@ import { } from '@kbn/rule-data-utils'; import { AlertsClient, ConstructorOptions } from '../alerts_client'; import { loggingSystemMock } from '@kbn/core/server/mocks'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { alertingAuthorizationMock } from '@kbn/alerting-plugin/server/authorization/alerting_authorization.mock'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { AlertingAuthorizationEntity } from '@kbn/alerting-plugin/server'; diff --git a/x-pack/plugins/rule_registry/server/alert_data_client/tests/update.test.ts b/x-pack/plugins/rule_registry/server/alert_data_client/tests/update.test.ts index 785926656b825..ef2cc30c891e7 100644 --- a/x-pack/plugins/rule_registry/server/alert_data_client/tests/update.test.ts +++ b/x-pack/plugins/rule_registry/server/alert_data_client/tests/update.test.ts @@ -13,8 +13,7 @@ import { } from '@kbn/rule-data-utils'; import { AlertsClient, ConstructorOptions } from '../alerts_client'; import { loggingSystemMock } from '@kbn/core/server/mocks'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { alertingAuthorizationMock } from '@kbn/alerting-plugin/server/authorization/alerting_authorization.mock'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { AlertingAuthorizationEntity } from '@kbn/alerting-plugin/server'; diff --git a/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/pdfmaker.ts b/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/pdfmaker.ts index 7dd964594ca53..7dc71bb6bb920 100644 --- a/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/pdfmaker.ts +++ b/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/pdfmaker.ts @@ -33,6 +33,7 @@ export class PdfMaker { private worker?: Worker; private pageCount: number = 0; + private transferList: ArrayBuffer[] = []; protected workerModulePath: string; @@ -136,11 +137,15 @@ export class PdfMaker { this.logger.debug(`Adding image to PDF. Image size: ${image.byteLength}`); // prettier-ignore const size = this.layout.getPdfImageSize(); const img = { - image: `data:image/png;base64,${image.toString('base64')}`, + // The typings are incomplete for the image property. + // It's possible to pass a Buffer as the image data. + // @see https://github.com/bpampuch/pdfmake/blob/0.2/src/printer.js#L654 + image, alignment: 'center' as 'center', height: size.height, width: size.width, - }; + } as unknown as ContentImage; + this.transferList.push(image.buffer); if (this.layout.useReportingBranding) { return this.addBrandedImage(img, opts); @@ -232,7 +237,7 @@ export class PdfMaker { const generatePdfRequest: GeneratePdfRequest = { data: this.getGeneratePdfRequestData(), }; - myPort.postMessage(generatePdfRequest); + myPort.postMessage(generatePdfRequest, this.transferList); }); } finally { await this.cleanupWorker(); diff --git a/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/worker.ts b/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/worker.ts index 983cebca7d6ae..98c10598703ae 100644 --- a/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/worker.ts +++ b/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/worker.ts @@ -92,7 +92,15 @@ async function execute({ data: { layout, logo, title, content } }: GeneratePdfRe const printer = new Printer(fonts); const docDefinition = _.assign(getTemplate(layout, logo, title, tableBorderWidth, assetPath), { - content, + content: _.cloneDeepWith(content, (value) => + // The `pdfkit` library is using `Buffer.from(new Uint8Array(src))` construction to cast the image source. + // According to the Node.js docs, it will create a copy of the source `ArrayBuffer` which should be avoided. + // @see https://nodejs.org/api/buffer.html#static-method-bufferfrombuffer + // @see https://github.com/foliojs-fork/pdfkit/blob/master/lib/image.js#L16 + value instanceof Uint8Array + ? Buffer.from(value.buffer, value.byteOffset, value.byteLength) + : undefined + ), }); const pdfDoc = printer.createPdfKitDocument(docDefinition, { diff --git a/x-pack/plugins/security/public/account_management/user_profile/user_profile.test.tsx b/x-pack/plugins/security/public/account_management/user_profile/user_profile.test.tsx index c0c90c6421ab2..fdaeeed66fb63 100644 --- a/x-pack/plugins/security/public/account_management/user_profile/user_profile.test.tsx +++ b/x-pack/plugins/security/public/account_management/user_profile/user_profile.test.tsx @@ -6,6 +6,7 @@ */ import { act, renderHook } from '@testing-library/react-hooks'; +import { mount } from 'enzyme'; import type { FunctionComponent } from 'react'; import React from 'react'; @@ -14,10 +15,11 @@ import { coreMock, scopedHistoryMock, themeServiceMock } from '@kbn/core/public/ import { UserProfileAPIClient } from '..'; import type { UserData } from '../../../common'; import { mockAuthenticatedUser } from '../../../common/model/authenticated_user.mock'; +import { UserAvatar } from '../../components'; import { UserAPIClient } from '../../management'; import { securityMock } from '../../mocks'; import { Providers } from '../account_management_app'; -import { useUserProfileForm } from './user_profile'; +import { UserProfile, useUserProfileForm } from './user_profile'; const user = mockAuthenticatedUser(); const coreStart = coreMock.createStart(); @@ -181,4 +183,52 @@ describe('useUserProfileForm', () => { expect(result.current.initialValues.user.full_name).toEqual('Another Name'); }); + + describe('User Avatar Form', () => { + it('should display if the User is not a cloud user', () => { + const data: UserData = {}; + + const nonCloudUser = mockAuthenticatedUser({ elastic_cloud_user: false }); + + const testWrapper = mount( + + + + ); + + expect(testWrapper.exists(UserAvatar)).toBeTruthy(); + }); + + it('should not display if the User is a cloud user', () => { + const data: UserData = {}; + + const cloudUser = mockAuthenticatedUser({ elastic_cloud_user: true }); + + const testWrapper = mount( + + + + ); + + expect(testWrapper.exists(UserAvatar)).toBeFalsy(); + }); + }); }); diff --git a/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx b/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx index cc42f10da39b9..bc95fae5b1c68 100644 --- a/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx +++ b/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx @@ -439,6 +439,8 @@ export const UserProfile: FunctionComponent = ({ user, data }) const canChangeDetails = canUserChangeDetails(user, services.application.capabilities); + const isCloudUser = user.elastic_cloud_user; + const rightSideItems = [ { title: ( @@ -559,7 +561,7 @@ export const UserProfile: FunctionComponent = ({ user, data }) >
- + {isCloudUser ? null : } setShowChangePasswordForm(true)} diff --git a/x-pack/plugins/security/public/nav_control/nav_control_component.test.tsx b/x-pack/plugins/security/public/nav_control/nav_control_component.test.tsx index 7b44fb0893362..298f71d01dd88 100644 --- a/x-pack/plugins/security/public/nav_control/nav_control_component.test.tsx +++ b/x-pack/plugins/security/public/nav_control/nav_control_component.test.tsx @@ -173,10 +173,10 @@ describe('SecurityNavControl', () => { expect(wrapper.prop('isOpen')).toEqual(false); }); - it('should render additional user menu links registered by other plugins', async () => { + it('should render additional user menu links registered by other plugins and should render the default Edit Profile link as the first link when no custom profile link is provided', async () => { const wrapper = shallow( { "items": Array [ Object { "data-test-subj": "profileLink", - "href": "", + "href": "edit-profile-link", "icon": , "name": , "onClick": [Function], }, @@ -258,10 +254,10 @@ describe('SecurityNavControl', () => { `); }); - it('should render custom profile link registered by other plugins', async () => { + it('should render custom profile link registered by other plugins and not render default Edit Profile link', async () => { const wrapper = shallow( { />, "name": "link3", }, - Object { - "data-test-subj": "profileLink", - "href": "", - "icon": , - "name": , - "onClick": [Function], - }, Object { "data-test-subj": "logoutLink", "href": "", diff --git a/x-pack/plugins/security/public/nav_control/nav_control_component.tsx b/x-pack/plugins/security/public/nav_control/nav_control_component.tsx index 2f462aaba4bc6..74d29fbb9f87b 100644 --- a/x-pack/plugins/security/public/nav_control/nav_control_component.tsx +++ b/x-pack/plugins/security/public/nav_control/nav_control_component.tsx @@ -79,7 +79,6 @@ export const SecurityNavControl: FunctionComponent = ({ ); - const isAnonymous = currentUser.value ? isUserAnonymous(currentUser.value) : false; const items: EuiContextMenuPanelItemDescriptor[] = []; if (userMenuLinks.length) { const userMenuLinkMenuItems = userMenuLinks @@ -93,17 +92,18 @@ export const SecurityNavControl: FunctionComponent = ({ items.push(...userMenuLinkMenuItems); } - if (!isAnonymous) { - const hasCustomProfileLinks = userMenuLinks.some(({ setAsProfile }) => setAsProfile === true); + const isAnonymous = currentUser.value ? isUserAnonymous(currentUser.value) : false; + const hasCustomProfileLinks = userMenuLinks.some(({ setAsProfile }) => setAsProfile === true); + + if (!isAnonymous && !hasCustomProfileLinks) { const profileMenuItem: EuiContextMenuPanelItemDescriptor = { name: ( ), - icon: , + icon: , href: editProfileUrl, onClick: () => { setIsPopoverOpen(false); @@ -112,11 +112,7 @@ export const SecurityNavControl: FunctionComponent = ({ }; // Set this as the first link if there is no user-defined profile link - if (!hasCustomProfileLinks) { - items.unshift(profileMenuItem); - } else { - items.push(profileMenuItem); - } + items.unshift(profileMenuItem); } items.push({ diff --git a/x-pack/plugins/security/server/routes/analytics/authentication_type.test.ts b/x-pack/plugins/security/server/routes/analytics/authentication_type.test.ts index 3ea35308347a1..5a298421815e4 100644 --- a/x-pack/plugins/security/server/routes/analytics/authentication_type.test.ts +++ b/x-pack/plugins/security/server/routes/analytics/authentication_type.test.ts @@ -19,6 +19,7 @@ import { routeDefinitionParamsMock } from '../index.mock'; import { defineRecordAnalyticsOnAuthTypeRoutes } from './authentication_type'; const FAKE_TIMESTAMP = 1637665318135; + function getMockContext( licenseCheckResult: { state: string; message?: string } = { state: 'valid' } ) { @@ -34,6 +35,7 @@ describe('POST /internal/security/analytics/_record_auth_type', () => { let routeHandler: RequestHandler; let routeParamsMock: DeeplyMockedKeys; + beforeEach(() => { routeParamsMock = routeDefinitionParamsMock.create(); defineRecordAnalyticsOnAuthTypeRoutes(routeParamsMock); @@ -49,6 +51,10 @@ describe('POST /internal/security/analytics/_record_auth_type', () => { const response = await routeHandler(getMockContext(), request, kibanaResponseFactory); expect(response.status).toBe(204); + expect(routeParamsMock.logger.warn).toBeCalledWith( + 'Cannot record authentication type: current user could not be retrieved.' + ); + expect(routeParamsMock.analyticsService.reportAuthenticationTypeEvent).not.toHaveBeenCalled(); }); @@ -294,11 +300,13 @@ describe('POST /internal/security/analytics/_record_auth_type', () => { routeParamsMock.getAuthenticationService.mockReturnValue(mockAuthc); const response = await routeHandler(getMockContext(), request, kibanaResponseFactory); + expect(response.status).toBe(200); expect(response.payload).toEqual({ timestamp: FAKE_TIMESTAMP, signature: 'f4f6b485690816127c33d5aa13cd6cd12c9892641ba23b5d58e5c6590cd43db0', }); + routeParamsMock.analyticsService.reportAuthenticationTypeEvent.mockClear(); initialTimestamp = response.payload.timestamp; @@ -312,13 +320,13 @@ describe('POST /internal/security/analytics/_record_auth_type', () => { }); const response = await routeHandler(getMockContext(), request, kibanaResponseFactory); + expect(response.status).toBe(200); expect(response.payload).toEqual({ timestamp: initialTimestamp, signature: '46d5841ad21d29ca6c7c1c639adc6294c176c394adb0b40dfc05797cfe29218e', }); expect(response.payload.signature).not.toEqual(initialSignature); - expect(routeParamsMock.analyticsService.reportAuthenticationTypeEvent).toHaveBeenCalledTimes( 1 ); @@ -329,4 +337,68 @@ describe('POST /internal/security/analytics/_record_auth_type', () => { }); }); }); + + describe('logApiKeyWithInteractiveUserDeprecated', () => { + it('should log a deprecation warning if API key is being used for access via a web browser', async () => { + const request = httpServerMock.createKibanaRequest({ + headers: { authorization: 'ApiKey xxxx' }, + }); + + const mockAuthc = authenticationServiceMock.createStart(); + + mockAuthc.getCurrentUser.mockReturnValue( + mockAuthenticatedUser({ + authentication_provider: { type: 'http', name: '__http__' }, + }) + ); + + routeParamsMock.getAuthenticationService.mockReturnValue(mockAuthc); + + const response = await routeHandler(getMockContext(), request, kibanaResponseFactory); + + expect(response.status).toBe(200); + expect(routeParamsMock.analyticsService.reportAuthenticationTypeEvent).toHaveBeenCalledTimes( + 1 + ); + expect(routeParamsMock.analyticsService.reportAuthenticationTypeEvent).toHaveBeenCalledWith({ + authenticationProviderType: 'http', + authenticationRealmType: 'native', + httpAuthenticationScheme: 'ApiKey', + }); + expect(routeParamsMock.logger.warn).toHaveBeenCalledTimes(1); + expect(routeParamsMock.logger.warn).toBeCalledWith( + 'API keys are intended for programmatic access. Do not use API keys to authenticate access via a web browser.', + { tags: ['deprecation'] } + ); + }); + + it('should not log a deprecation warning if other http auth scheme is being used for access via a web browser', async () => { + const request = httpServerMock.createKibanaRequest({ + headers: { authorization: 'Basic' }, + }); + + const mockAuthc = authenticationServiceMock.createStart(); + + mockAuthc.getCurrentUser.mockReturnValue( + mockAuthenticatedUser({ + authentication_provider: { type: 'http', name: '__http__' }, + }) + ); + + routeParamsMock.getAuthenticationService.mockReturnValue(mockAuthc); + + const response = await routeHandler(getMockContext(), request, kibanaResponseFactory); + + expect(response.status).toBe(200); + expect(routeParamsMock.analyticsService.reportAuthenticationTypeEvent).toHaveBeenCalledTimes( + 1 + ); + expect(routeParamsMock.analyticsService.reportAuthenticationTypeEvent).toHaveBeenCalledWith({ + authenticationProviderType: 'http', + authenticationRealmType: 'native', + httpAuthenticationScheme: 'Basic', + }); + expect(routeParamsMock.logger.warn).toHaveBeenCalledTimes(0); + }); + }); }); diff --git a/x-pack/plugins/security/server/routes/analytics/authentication_type.ts b/x-pack/plugins/security/server/routes/analytics/authentication_type.ts index c3246667c1aa7..f2bf76c71b1ab 100644 --- a/x-pack/plugins/security/server/routes/analytics/authentication_type.ts +++ b/x-pack/plugins/security/server/routes/analytics/authentication_type.ts @@ -8,6 +8,7 @@ import { createHash } from 'crypto'; import { schema } from '@kbn/config-schema'; +import type { Logger } from '@kbn/logging'; import type { RouteDefinitionParams } from '..'; import type { AuthenticationTypeAnalyticsEvent } from '../../analytics'; @@ -74,6 +75,11 @@ export function defineRecordAnalyticsOnAuthTypeRoutes({ previouslyRegisteredSignature !== signature ) { analyticsService.reportAuthenticationTypeEvent(authTypeEventToReport); + + logApiKeyWithInteractiveUserDeprecated( + authTypeEventToReport.httpAuthenticationScheme, + logger + ); } else { timestamp = previousRegistrationTimestamp; } @@ -88,3 +94,23 @@ export function defineRecordAnalyticsOnAuthTypeRoutes({ }) ); } + +/** + * API Key authentication by interactive users is deprecated, this method logs a deprecation warning. + * + * @param httpAuthenticationScheme A string representing the authentication type event's scheme (ApiKey, etc.) by an interactive user. + * @param logger A reference to the Logger to log the deprecation message. + */ +function logApiKeyWithInteractiveUserDeprecated( + httpAuthenticationScheme: string = '', + logger: Logger +): void { + const isUsingApiKey = httpAuthenticationScheme?.toLowerCase() === 'apikey'; + + if (isUsingApiKey) { + logger.warn( + `API keys are intended for programmatic access. Do not use API keys to authenticate access via a web browser.`, + { tags: ['deprecation'] } + ); + } +} diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item_card/exception_item_card_conditions.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item_card/exception_item_card_conditions.tsx index b64dc2f81bd07..1bcc3080a548c 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item_card/exception_item_card_conditions.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item_card/exception_item_card_conditions.tsx @@ -35,6 +35,7 @@ const OPERATOR_TYPE_LABELS_INCLUDED = Object.freeze({ const OPERATOR_TYPE_LABELS_EXCLUDED = Object.freeze({ [ListOperatorTypeEnum.MATCH_ANY]: i18n.CONDITION_OPERATOR_TYPE_NOT_MATCH_ANY, [ListOperatorTypeEnum.MATCH]: i18n.CONDITION_OPERATOR_TYPE_NOT_MATCH, + [ListOperatorTypeEnum.WILDCARD]: i18n.CONDITION_OPERATOR_TYPE_WILDCARD_DOES_NOT_MATCH, }); const EuiFlexGroupNested = styled(EuiFlexGroup)` diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item_card/translations.ts b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item_card/translations.ts index 8d345c23fbf09..39435467c0473 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item_card/translations.ts +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item_card/translations.ts @@ -69,6 +69,13 @@ export const CONDITION_OPERATOR_TYPE_WILDCARD_MATCHES = i18n.translate( } ); +export const CONDITION_OPERATOR_TYPE_WILDCARD_DOES_NOT_MATCH = i18n.translate( + 'xpack.securitySolution.exceptions.exceptionItem.conditions.wildcardDoesNotMatchOperator', + { + defaultMessage: 'DOES NOT MATCH', + } +); + export const CONDITION_OPERATOR_TYPE_NESTED = i18n.translate( 'xpack.securitySolution.exceptions.exceptionItem.conditions.nestedOperator', { diff --git a/x-pack/plugins/security_solution/public/network/containers/tls/index.test.tsx b/x-pack/plugins/security_solution/public/network/containers/tls/index.test.tsx index f6899475b4647..db1c028b74fb3 100644 --- a/x-pack/plugins/security_solution/public/network/containers/tls/index.test.tsx +++ b/x-pack/plugins/security_solution/public/network/containers/tls/index.test.tsx @@ -8,28 +8,77 @@ import { act, renderHook } from '@testing-library/react-hooks'; import { TestProviders } from '../../../common/mock'; import { ID, useNetworkTls } from '.'; -import { NetworkType } from '../../store/model'; +import { useSearchStrategy } from '../../../common/containers/use_search_strategy'; +import { networkModel } from '../../store'; import { FlowTargetSourceDest } from '../../../../common/search_strategy'; +jest.mock('../../../common/containers/use_search_strategy', () => ({ + useSearchStrategy: jest.fn(), +})); +const mockUseSearchStrategy = useSearchStrategy as jest.Mock; +const mockSearch = jest.fn(); + +const props = { + endDate: '2020-07-08T08:20:18.966Z', + flowTarget: FlowTargetSourceDest.source, + id: ID, + indexNames: ['auditbeat-*'], + ip: '139.177.197.217', + skip: false, + startDate: '2020-07-07T08:20:18.966Z', + type: networkModel.NetworkType.page, +}; + describe('useNetworkTls', () => { + beforeEach(() => { + jest.clearAllMocks(); + mockUseSearchStrategy.mockReturnValue({ + loading: false, + result: { + edges: [], + totalCount: -1, + pageInfo: { + activePage: 0, + fakeTotalCount: 0, + showMorePagesIndicator: false, + }, + }, + search: mockSearch, + refetch: jest.fn(), + inspect: {}, + }); + }); + + it('runs search', () => { + renderHook(() => useNetworkTls(props), { + wrapper: TestProviders, + }); + + expect(mockSearch).toHaveBeenCalled(); + }); + + it('does not run search when skip = true', () => { + const localProps = { + ...props, + skip: true, + }; + renderHook(() => useNetworkTls(localProps), { + wrapper: TestProviders, + }); + + expect(mockSearch).not.toHaveBeenCalled(); + }); + it('skip = true will cancel any running request', () => { - const abortSpy = jest.spyOn(AbortController.prototype, 'abort'); const localProps = { - docValueFields: [], - flowTarget: FlowTargetSourceDest.source, - startDate: '2020-07-07T08:20:18.966Z', - endDate: '2020-07-08T08:20:18.966Z', - id: `${ID}-${NetworkType.page}`, - indexNames: ['cool'], - ip: '1.1.1.1', - type: NetworkType.page, - skip: false, + ...props, }; const { rerender } = renderHook(() => useNetworkTls(localProps), { wrapper: TestProviders, }); localProps.skip = true; act(() => rerender()); - expect(abortSpy).toHaveBeenCalledTimes(4); + expect(mockUseSearchStrategy).toHaveBeenCalledTimes(3); + expect(mockUseSearchStrategy.mock.calls[2][0].abort).toEqual(true); }); }); diff --git a/x-pack/plugins/security_solution/public/network/containers/tls/index.tsx b/x-pack/plugins/security_solution/public/network/containers/tls/index.tsx index 1609b76612b76..9d13900619a08 100644 --- a/x-pack/plugins/security_solution/public/network/containers/tls/index.tsx +++ b/x-pack/plugins/security_solution/public/network/containers/tls/index.tsx @@ -5,16 +5,12 @@ * 2.0. */ -import { noop } from 'lodash/fp'; -import { useState, useEffect, useCallback, useMemo, useRef } from 'react'; +import { useState, useEffect, useCallback, useMemo } from 'react'; import deepEqual from 'fast-deep-equal'; -import { Subscription } from 'rxjs'; -import { isCompleteResponse, isErrorResponse } from '@kbn/data-plugin/common'; import type { ESTermQuery } from '../../../../common/typed_json'; import type { inputsModel } from '../../../common/store'; import { useDeepEqualSelector } from '../../../common/hooks/use_selector'; -import { useKibana } from '../../../common/lib/kibana'; import { createFilter } from '../../../common/containers/helpers'; import { generateTablePaginationOptions } from '../../../common/components/paginated_table/helpers'; import type { networkModel } from '../../store'; @@ -26,9 +22,8 @@ import type { import { NetworkQueries } from '../../../../common/search_strategy/security_solution/network'; import * as i18n from './translations'; -import { getInspectResponse } from '../../../helpers'; import type { FlowTargetSourceDest, PageInfoPaginated } from '../../../../common/search_strategy'; -import { useAppToasts } from '../../../common/hooks/use_app_toasts'; +import { useSearchStrategy } from '../../../common/containers/use_search_strategy'; export const ID = 'networkTlsQuery'; @@ -70,17 +65,12 @@ export const useNetworkTls = ({ const { activePage, limit, sort } = useDeepEqualSelector((state) => getTlsSelector(state, type, flowTarget) ); - const { data } = useKibana().services; - const refetch = useRef(noop); - const abortCtrl = useRef(new AbortController()); - const searchSubscription$ = useRef(new Subscription()); - const [loading, setLoading] = useState(false); - const [networkTlsRequest, setHostRequest] = useState(null); + const [networkTlsRequest, setNetworkTlsRequest] = useState(null); const wrappedLoadMore = useCallback( (newActivePage: number) => { - setHostRequest((prevRequest) => { + setNetworkTlsRequest((prevRequest) => { if (!prevRequest) { return prevRequest; } @@ -94,79 +84,55 @@ export const useNetworkTls = ({ [limit] ); - const [networkTlsResponse, setNetworkTlsResponse] = useState({ - tls: [], - id: ID, - inspect: { - dsl: [], - response: [], + const { + loading, + result: response, + search, + refetch, + inspect, + } = useSearchStrategy({ + factoryQueryType: NetworkQueries.tls, + initialResult: { + edges: [], + totalCount: -1, + pageInfo: { + activePage: 0, + fakeTotalCount: 0, + showMorePagesIndicator: false, + }, }, - isInspected: false, - loadPage: wrappedLoadMore, - pageInfo: { - activePage: 0, - fakeTotalCount: 0, - showMorePagesIndicator: false, - }, - refetch: refetch.current, - totalCount: -1, + errorMessage: i18n.FAIL_NETWORK_TLS, + abort: skip, }); - const { addError, addWarning } = useAppToasts(); - - const networkTlsSearch = useCallback( - (request: NetworkTlsRequestOptions | null) => { - if (request == null || skip) { - return; - } - - const asyncSearch = async () => { - abortCtrl.current = new AbortController(); - setLoading(true); - - searchSubscription$.current = data.search - .search(request, { - strategy: 'securitySolutionSearchStrategy', - abortSignal: abortCtrl.current.signal, - }) - .subscribe({ - next: (response) => { - if (isCompleteResponse(response)) { - setLoading(false); - setNetworkTlsResponse((prevResponse) => ({ - ...prevResponse, - tls: response.edges, - inspect: getInspectResponse(response, prevResponse.inspect), - pageInfo: response.pageInfo, - refetch: refetch.current, - totalCount: response.totalCount, - })); - searchSubscription$.current.unsubscribe(); - } else if (isErrorResponse(response)) { - setLoading(false); - addWarning(i18n.ERROR_NETWORK_TLS); - searchSubscription$.current.unsubscribe(); - } - }, - error: (msg) => { - setLoading(false); - addError(msg, { - title: i18n.FAIL_NETWORK_TLS, - }); - searchSubscription$.current.unsubscribe(); - }, - }); - }; - searchSubscription$.current.unsubscribe(); - abortCtrl.current.abort(); - asyncSearch(); - refetch.current = asyncSearch; - }, - [data.search, addError, addWarning, skip] + const networkTlsResponse = useMemo( + () => ({ + endDate, + tls: response.edges, + id, + inspect, + isInspected: false, + loadPage: wrappedLoadMore, + pageInfo: response.pageInfo, + refetch, + startDate, + totalCount: response.totalCount, + }), + [ + endDate, + id, + inspect, + refetch, + response.edges, + response.pageInfo, + response.totalCount, + startDate, + wrappedLoadMore, + ] ); useEffect(() => { - setHostRequest((prevRequest) => { + setNetworkTlsRequest((prevRequest) => { const myRequest = { ...(prevRequest ?? {}), defaultIndex: indexNames, @@ -190,20 +156,10 @@ export const useNetworkTls = ({ }, [activePage, indexNames, endDate, filterQuery, limit, startDate, sort, flowTarget, ip, id]); useEffect(() => { - networkTlsSearch(networkTlsRequest); - return () => { - searchSubscription$.current.unsubscribe(); - abortCtrl.current.abort(); - }; - }, [networkTlsRequest, networkTlsSearch]); - - useEffect(() => { - if (skip) { - setLoading(false); - searchSubscription$.current.unsubscribe(); - abortCtrl.current.abort(); + if (!skip && networkTlsRequest) { + search(networkTlsRequest); } - }, [skip]); + }, [networkTlsRequest, search, skip]); return [loading, networkTlsResponse]; }; diff --git a/x-pack/plugins/security_solution/public/overview/containers/overview_network/index.test.tsx b/x-pack/plugins/security_solution/public/overview/containers/overview_network/index.test.tsx index 23bfea8ad55bd..c842fb0a51cae 100644 --- a/x-pack/plugins/security_solution/public/overview/containers/overview_network/index.test.tsx +++ b/x-pack/plugins/security_solution/public/overview/containers/overview_network/index.test.tsx @@ -4,25 +4,67 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - import { act, renderHook } from '@testing-library/react-hooks'; import { TestProviders } from '../../../common/mock'; import { useNetworkOverview } from '.'; +import { useSearchStrategy } from '../../../common/containers/use_search_strategy'; + +jest.mock('../../../common/containers/use_search_strategy', () => ({ + useSearchStrategy: jest.fn(), +})); +const mockUseSearchStrategy = useSearchStrategy as jest.Mock; +const mockSearch = jest.fn(); + +const defaultProps = { + endDate: '2020-07-08T08:20:18.966Z', + indexNames: ['fakebeat-*'], + skip: false, + startDate: '2020-07-07T08:20:18.966Z', +}; describe('useNetworkOverview', () => { + beforeEach(() => { + jest.clearAllMocks(); + mockUseSearchStrategy.mockReturnValue({ + loading: false, + result: { + overviewNetwork: {}, + }, + search: mockSearch, + refetch: jest.fn(), + inspect: {}, + }); + }); + + it('runs search', () => { + renderHook(() => useNetworkOverview(defaultProps), { + wrapper: TestProviders, + }); + + expect(mockSearch).toHaveBeenCalled(); + }); + + it('does not run search when skip = true', () => { + const props = { + ...defaultProps, + skip: true, + }; + renderHook(() => useNetworkOverview(props), { + wrapper: TestProviders, + }); + + expect(mockSearch).not.toHaveBeenCalled(); + }); it('skip = true will cancel any running request', () => { - const abortSpy = jest.spyOn(AbortController.prototype, 'abort'); - const localProps = { - startDate: '2020-07-07T08:20:18.966Z', - endDate: '2020-07-08T08:20:18.966Z', - indexNames: ['cool'], - skip: false, + const props = { + ...defaultProps, }; - const { rerender } = renderHook(() => useNetworkOverview(localProps), { + const { rerender } = renderHook(() => useNetworkOverview(props), { wrapper: TestProviders, }); - localProps.skip = true; + props.skip = true; act(() => rerender()); - expect(abortSpy).toHaveBeenCalledTimes(4); + expect(mockUseSearchStrategy).toHaveBeenCalledTimes(2); + expect(mockUseSearchStrategy.mock.calls[1][0].abort).toEqual(true); }); }); diff --git a/x-pack/plugins/security_solution/public/overview/containers/overview_network/index.tsx b/x-pack/plugins/security_solution/public/overview/containers/overview_network/index.tsx index 3d8f4af168244..cc2997495ea41 100644 --- a/x-pack/plugins/security_solution/public/overview/containers/overview_network/index.tsx +++ b/x-pack/plugins/security_solution/public/overview/containers/overview_network/index.tsx @@ -5,25 +5,16 @@ * 2.0. */ -import { noop } from 'lodash/fp'; -import { useCallback, useEffect, useRef, useState } from 'react'; -import deepEqual from 'fast-deep-equal'; -import { Subscription } from 'rxjs'; +import { useEffect, useMemo } from 'react'; -import { isCompleteResponse, isErrorResponse } from '@kbn/data-plugin/common'; -import type { - NetworkOverviewRequestOptions, - NetworkOverviewStrategyResponse, -} from '../../../../common/search_strategy/security_solution'; +import type { NetworkOverviewStrategyResponse } from '../../../../common/search_strategy/security_solution'; import { NetworkQueries } from '../../../../common/search_strategy/security_solution'; -import { useKibana } from '../../../common/lib/kibana'; import type { inputsModel } from '../../../common/store/inputs'; import { createFilter } from '../../../common/containers/helpers'; import type { ESQuery } from '../../../../common/typed_json'; -import { getInspectResponse } from '../../../helpers'; import type { InspectResponse } from '../../../types'; import * as i18n from './translations'; -import { useAppToasts } from '../../../common/hooks/use_app_toasts'; +import { useSearchStrategy } from '../../../common/containers/use_search_strategy'; export const ID = 'overviewNetworkQuery'; @@ -50,109 +41,53 @@ export const useNetworkOverview = ({ skip = false, startDate, }: UseNetworkOverview): [boolean, NetworkOverviewArgs] => { - const { data } = useKibana().services; - const refetch = useRef(noop); - const abortCtrl = useRef(new AbortController()); - const searchSubscription$ = useRef(new Subscription()); - const [loading, setLoading] = useState(false); - const [overviewNetworkRequest, setNetworkRequest] = - useState(null); - - const [overviewNetworkResponse, setNetworkOverviewResponse] = useState({ - overviewNetwork: {}, - id: ID, - inspect: { - dsl: [], - response: [], + const { + loading, + result: response, + search, + refetch, + inspect, + } = useSearchStrategy({ + factoryQueryType: NetworkQueries.overview, + initialResult: { + overviewNetwork: {}, }, - isInspected: false, - refetch: refetch.current, + errorMessage: i18n.FAIL_NETWORK_OVERVIEW, + abort: skip, }); - const { addError, addWarning } = useAppToasts(); - - const overviewNetworkSearch = useCallback( - (request: NetworkOverviewRequestOptions | null) => { - if (request == null || skip) { - return; - } - const asyncSearch = async () => { - abortCtrl.current = new AbortController(); - setLoading(true); - - searchSubscription$.current = data.search - .search(request, { - strategy: 'securitySolutionSearchStrategy', - abortSignal: abortCtrl.current.signal, - }) - .subscribe({ - next: (response) => { - if (isCompleteResponse(response)) { - setLoading(false); - setNetworkOverviewResponse((prevResponse) => ({ - ...prevResponse, - overviewNetwork: response.overviewNetwork, - inspect: getInspectResponse(response, prevResponse.inspect), - refetch: refetch.current, - })); - searchSubscription$.current.unsubscribe(); - } else if (isErrorResponse(response)) { - setLoading(false); - addWarning(i18n.ERROR_NETWORK_OVERVIEW); - searchSubscription$.current.unsubscribe(); - } - }, - error: (msg) => { - setLoading(false); - addError(msg, { - title: i18n.FAIL_NETWORK_OVERVIEW, - }); - searchSubscription$.current.unsubscribe(); - }, - }); - }; - searchSubscription$.current.unsubscribe(); - abortCtrl.current.abort(); - asyncSearch(); - refetch.current = asyncSearch; - }, - [data.search, addError, addWarning, skip] + const overviewNetworkResponse = useMemo( + () => ({ + endDate, + overviewNetwork: response.overviewNetwork, + id: ID, + inspect, + isInspected: false, + refetch, + startDate, + }), + [endDate, inspect, refetch, response.overviewNetwork, startDate] ); - useEffect(() => { - setNetworkRequest((prevRequest) => { - const myRequest = { - ...(prevRequest ?? {}), - defaultIndex: indexNames, - factoryQueryType: NetworkQueries.overview, - filterQuery: createFilter(filterQuery), - timerange: { - interval: '12h', - from: startDate, - to: endDate, - }, - }; - if (!deepEqual(prevRequest, myRequest)) { - return myRequest; - } - return prevRequest; - }); - }, [indexNames, endDate, filterQuery, startDate]); - - useEffect(() => { - overviewNetworkSearch(overviewNetworkRequest); - return () => { - searchSubscription$.current.unsubscribe(); - abortCtrl.current.abort(); - }; - }, [overviewNetworkRequest, overviewNetworkSearch]); + const overviewNetworkRequest = useMemo( + () => ({ + defaultIndex: indexNames, + factoryQueryType: NetworkQueries.overview, + filterQuery: createFilter(filterQuery), + timerange: { + interval: '12h', + from: startDate, + to: endDate, + }, + }), + [endDate, filterQuery, indexNames, startDate] + ); useEffect(() => { - if (skip) { - searchSubscription$.current.unsubscribe(); - abortCtrl.current.abort(); + if (!skip) { + search(overviewNetworkRequest); } - }, [skip]); + }, [overviewNetworkRequest, search, skip]); return [loading, overviewNetworkResponse]; }; diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/metadata/check_metadata_transforms_task.test.ts b/x-pack/plugins/security_solution/server/endpoint/lib/metadata/check_metadata_transforms_task.test.ts index e9c088d17e00a..84d124a398a93 100644 --- a/x-pack/plugins/security_solution/server/endpoint/lib/metadata/check_metadata_transforms_task.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/lib/metadata/check_metadata_transforms_task.test.ts @@ -19,8 +19,7 @@ import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; import type { TaskManagerSetupContract } from '@kbn/task-manager-plugin/server'; import { TaskStatus } from '@kbn/task-manager-plugin/server'; import type { CoreSetup } from '@kbn/core/server'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import type { ElasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import type { ElasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { TRANSFORM_STATES } from '../../../../common/constants'; import { METADATA_TRANSFORMS_PATTERN } from '../../../../common/endpoint/constants'; import type { RunResult } from '@kbn/task-manager-plugin/server/task'; diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/metadata.test.ts b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/metadata.test.ts index 36ae8d9f95af3..5746e1e93f9bb 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/metadata.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/metadata.test.ts @@ -57,8 +57,7 @@ import { AgentNotFoundError } from '@kbn/fleet-plugin/server'; import type { ClusterClientMock, ScopedClusterClientMock, - // eslint-disable-next-line @kbn/eslint/no-restricted-paths -} from '@kbn/core/server/elasticsearch/client/mocks'; +} from '@kbn/core-elasticsearch-client-server-mocks'; import { EndpointHostNotFoundError } from '../../services/metadata'; import { FleetAgentGenerator } from '../../../../common/endpoint/data_generators/fleet_agent_generator'; import { createMockAgentClient, createMockPackageService } from '@kbn/fleet-plugin/server/mocks'; diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/policy/handlers.test.ts b/x-pack/plugins/security_solution/server/endpoint/routes/policy/handlers.test.ts index 7cd02dace23ea..a9a7c7c4837e3 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/policy/handlers.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/policy/handlers.test.ts @@ -31,8 +31,7 @@ import { import type { Agent } from '@kbn/fleet-plugin/common/types/models'; import type { AgentClient, AgentService } from '@kbn/fleet-plugin/server/services'; import { get } from 'lodash'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import type { ScopedClusterClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import type { ScopedClusterClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; describe('test policy response handler', () => { let endpointAppContextService: EndpointAppContextService; diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/mocks.ts b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/mocks.ts index 5fa55f9a3cbba..814dd457347ab 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/mocks.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/mocks.ts @@ -7,8 +7,7 @@ import type { SavedObjectsClientContract } from '@kbn/core/server'; import { savedObjectsClientMock, elasticsearchServiceMock } from '@kbn/core/server/mocks'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import type { ElasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import type { ElasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; // Because mocks are for testing only, should be ok to import the FleetArtifactsClient directly // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { FleetArtifactsClient } from '@kbn/fleet-plugin/server/services'; diff --git a/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts b/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts index adc41b3ec7df8..2e7d606e10f5d 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts @@ -8,8 +8,7 @@ import type { EndpointMetadataServiceTestContextMock } from './mocks'; import { createEndpointMetadataServiceTestContextMock } from './mocks'; import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import type { ElasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import type { ElasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { legacyMetadataSearchResponseMock, unitedMetadataSearchResponseMock, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/privileges/read_privileges_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/privileges/read_privileges_route.test.ts index 002b4c2264eee..40c82c255c1f5 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/privileges/read_privileges_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/privileges/read_privileges_route.test.ts @@ -8,8 +8,7 @@ import { readPrivilegesRoute } from './read_privileges_route'; import { serverMock, requestContextMock } from '../__mocks__'; import { getPrivilegeRequest, getMockPrivilegesResult } from '../__mocks__/request_responses'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; describe('read_privileges route', () => { let server: ReturnType; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.test.ts index f56a1a4be67d3..6c6cfde2cbaa8 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.test.ts @@ -18,8 +18,7 @@ import { addPrepackedRulesRoute, createPrepackagedRules } from './add_prepackage import { listMock } from '@kbn/lists-plugin/server/mocks'; import type { ExceptionListClient } from '@kbn/lists-plugin/server'; import { installPrepackagedTimelines } from '../../../timeline/routes/prepackaged_timelines/install_prepackaged_timelines'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { getQueryRuleParams } from '../../schemas/rule_schemas.mock'; import { legacyMigrate } from '../../rules/utils'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_bulk_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_bulk_route.test.ts index 8b23aca24c791..c845f2e0a381c 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_bulk_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_bulk_route.test.ts @@ -20,8 +20,7 @@ import { import { requestContextMock, serverMock, requestMock } from '../__mocks__'; import { createRulesBulkRoute } from './create_rules_bulk_route'; import { getCreateRulesSchemaMock } from '../../../../../common/detection_engine/schemas/request/rule_schemas.mock'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { getQueryRuleParams } from '../../schemas/rule_schemas.mock'; import { loggingSystemMock } from '@kbn/core/server/mocks'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_route.test.ts index 163a6b8e43229..658461f148cb8 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_route.test.ts @@ -20,8 +20,7 @@ import { buildMlAuthz } from '../../../machine_learning/authz'; import { requestContextMock, serverMock, requestMock } from '../__mocks__'; import { createRulesRoute } from './create_rules_route'; import { getCreateRulesSchemaMock } from '../../../../../common/detection_engine/schemas/request/rule_schemas.mock'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { getQueryRuleParams } from '../../schemas/rule_schemas.mock'; jest.mock('../../../machine_learning/authz', () => mockMlAuthzFactory.create()); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.test.ts index 578ba7786780b..bf83471631a8c 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.test.ts @@ -25,8 +25,7 @@ import { ruleIdsToNdJsonString, rulesToNdJsonString, } from '../../../../../common/detection_engine/schemas/request/import_rules_schema.mock'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { getQueryRuleParams } from '../../schemas/rule_schemas.mock'; jest.mock('../../../machine_learning/authz', () => mockMlAuthzFactory.create()); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/create_query_alert_type.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/create_query_alert_type.test.ts index 91d92a4d076ef..4a6b6b3c9d867 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/create_query_alert_type.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/create_query_alert_type.test.ts @@ -5,8 +5,7 @@ * 2.0. */ -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { allowedExperimentalValues } from '../../../../../common/experimental_features'; import { createQueryAlertType } from './create_query_alert_type'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threshold.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threshold.test.ts index e21e8ae21d91f..79966e6d9887f 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threshold.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threshold.test.ts @@ -7,8 +7,7 @@ import dateMath from '@kbn/datemath'; import { loggingSystemMock } from '@kbn/core/server/mocks'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import type { RuleExecutorServicesMock } from '@kbn/alerting-plugin/server/mocks'; import { alertsMock } from '@kbn/alerting-plugin/server/mocks'; import { thresholdExecutor } from './threshold'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.test.ts index 88f12f7157683..bcc70e3fb735f 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.test.ts @@ -24,8 +24,7 @@ import type { BulkCreate, BulkResponse, RuleRangeTuple, WrapHits } from './types import type { SearchListItemArraySchema } from '@kbn/securitysolution-io-ts-list-types'; import { getSearchListItemResponseMock } from '@kbn/lists-plugin/common/schemas/response/search_list_item_schema.mock'; import { getRuleRangeTuples } from './utils'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { getCompleteRuleMock, getQueryRuleParams } from '../schemas/rule_schemas.mock'; import { bulkCreateFactory } from '../rule_types/factories/bulk_create_factory'; import { wrapHitsFactory } from '../rule_types/factories/wrap_hits_factory'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/single_search_after.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/single_search_after.test.ts index f2411b8a981bc..b75eb81eb4163 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/single_search_after.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/single_search_after.test.ts @@ -14,8 +14,7 @@ import { singleSearchAfter } from './single_search_after'; import type { RuleExecutorServicesMock } from '@kbn/alerting-plugin/server/mocks'; import { alertsMock } from '@kbn/alerting-plugin/server/mocks'; import { buildRuleMessageFactory } from './rule_messages'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; const buildRuleMessage = buildRuleMessageFactory({ id: 'fake id', diff --git a/x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type.test.ts b/x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type.test.ts index 8e54a9ac9da8f..ad3c96c69cde3 100644 --- a/x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type.test.ts +++ b/x-pack/plugins/stack_alerts/server/alert_types/es_query/rule_type.test.ts @@ -18,8 +18,7 @@ import { getRuleType } from './rule_type'; import { EsQueryRuleParams, EsQueryRuleState } from './rule_type_params'; import { ActionContext } from './action_context'; import { ESSearchResponse, ESSearchRequest } from '@kbn/core/types/elasticsearch'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { elasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { coreMock } from '@kbn/core/server/mocks'; import { ActionGroupId, ConditionMetAlertInstanceId } from './constants'; import { OnlyEsQueryRuleParams, OnlySearchSourceRuleParams } from './types'; diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/ping_histogram.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/ping_histogram.tsx index c3f9f5086ec9b..1a7ae71482621 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/ping_histogram.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/ping_histogram.tsx @@ -220,12 +220,12 @@ export const PingHistogramComponent: React.FC = ({ -

+

-

+
{showAnalyzeButton && ( diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_header.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_header.tsx index 8968f6c6bea47..146f4315c42c7 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_header.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_header.tsx @@ -20,12 +20,12 @@ export const MonitorListHeader: React.FC = () => { -
+

-

+
diff --git a/x-pack/plugins/synthetics/server/legacy_uptime/lib/requests/helper.ts b/x-pack/plugins/synthetics/server/legacy_uptime/lib/requests/helper.ts index 315b0bd3d0f96..96de0a435ee72 100644 --- a/x-pack/plugins/synthetics/server/legacy_uptime/lib/requests/helper.ts +++ b/x-pack/plugins/synthetics/server/legacy_uptime/lib/requests/helper.ts @@ -6,8 +6,7 @@ */ import { AggregationsAggregate } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { ElasticsearchClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import type { ElasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { elasticsearchServiceMock, savedObjectsClientMock } from '@kbn/core/server/mocks'; import { createUptimeESClient, UptimeESClient } from '../lib'; diff --git a/x-pack/plugins/transform/server/routes/api/field_histograms.ts b/x-pack/plugins/transform/server/routes/api/field_histograms.ts index c9623f262b5e0..700b7433af994 100644 --- a/x-pack/plugins/transform/server/routes/api/field_histograms.ts +++ b/x-pack/plugins/transform/server/routes/api/field_histograms.ts @@ -5,12 +5,13 @@ * 2.0. */ +import { fetchHistogramsForFields } from '@kbn/ml-agg-utils'; + import { dataViewTitleSchema, DataViewTitleSchema } from '../../../common/api_schemas/common'; import { fieldHistogramsRequestSchema, FieldHistogramsRequestSchema, } from '../../../common/api_schemas/field_histograms'; -import { getHistogramsForFields } from '../../shared_imports'; import { RouteDependencies } from '../../types'; import { addBasePath } from '..'; @@ -33,8 +34,8 @@ export function registerFieldHistogramsRoutes({ router, license }: RouteDependen try { const esClient = (await ctx.core).elasticsearch.client; - const resp = await getHistogramsForFields( - esClient, + const resp = await fetchHistogramsForFields( + esClient.asCurrentUser, dataViewTitle, query, fields, diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index ddc14eb55173e..e9f20b6333da4 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -24135,7 +24135,6 @@ "xpack.security.management.users.usersTitle": "Utilisateurs", "xpack.security.management.usersTitle": "Utilisateurs", "xpack.security.navControlComponent.accountMenuAriaLabel": "Menu Compte", - "xpack.security.navControlComponent.editProfileLinkText": "{profileOverridden, select, true{Préférences} other{Profil}}", "xpack.security.navControlComponent.loginLinkText": "Connexion", "xpack.security.navControlComponent.logoutLinkText": "Déconnexion", "xpack.security.overwrittenSession.continueAsUserText": "Continuer en tant que {username}", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 0caf8c69cd81f..2f88cbf583584 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -24120,7 +24120,6 @@ "xpack.security.management.users.usersTitle": "ユーザー", "xpack.security.management.usersTitle": "ユーザー", "xpack.security.navControlComponent.accountMenuAriaLabel": "アカウントメニュー", - "xpack.security.navControlComponent.editProfileLinkText": "{profileOverridden, select, true{設定} other{プロファイル}}", "xpack.security.navControlComponent.loginLinkText": "ログイン", "xpack.security.navControlComponent.logoutLinkText": "ログアウト", "xpack.security.overwrittenSession.continueAsUserText": "{username} として続行", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 921ca2a48b925..073efb7030708 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -24146,7 +24146,6 @@ "xpack.security.management.users.usersTitle": "用户", "xpack.security.management.usersTitle": "用户", "xpack.security.navControlComponent.accountMenuAriaLabel": "帐户菜单", - "xpack.security.navControlComponent.editProfileLinkText": "{profileOverridden, select, true{首选项} other{配置文件}}", "xpack.security.navControlComponent.loginLinkText": "登录", "xpack.security.navControlComponent.logoutLinkText": "注销", "xpack.security.overwrittenSession.continueAsUserText": "作为 {username} 继续", diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.test.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.test.ts index c17cc160a6ce1..3afe9b3b54bad 100644 --- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.test.ts +++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.test.ts @@ -7,8 +7,7 @@ import { SavedObjectsErrorHelpers } from '@kbn/core/server'; import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { ScopedClusterClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import type { ScopedClusterClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import moment from 'moment'; import { diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts index 062782560ef2b..ae979ddcf9d22 100644 --- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts +++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts @@ -10,8 +10,7 @@ import { BehaviorSubject } from 'rxjs'; import { TransportResult } from '@elastic/elasticsearch'; import { Logger } from '@kbn/core/server'; import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { ScopedClusterClientMock } from '@kbn/core/server/elasticsearch/client/mocks'; +import type { ScopedClusterClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { ReindexOperation, diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/actions_telemetry.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/actions_telemetry.ts index bf2bc67789529..f61e59ee420ba 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/actions_telemetry.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/actions_telemetry.ts @@ -19,7 +19,8 @@ export default function createActionsTelemetryTests({ getService }: FtrProviderC const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); - describe('actions telemetry', () => { + // FLAKY: https://github.com/elastic/kibana/issues/136152 + describe.skip('actions telemetry', () => { const alwaysFiringRuleId: { [key: string]: string } = {}; before(async () => { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/alerting_telemetry.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/alerting_telemetry.ts index 9231fefd3277f..c73081e61117a 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/alerting_telemetry.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/alerting_telemetry.ts @@ -27,7 +27,8 @@ export default function createAlertingTelemetryTests({ getService }: FtrProvider const esTestIndexTool = new ESTestIndexTool(es, retry); const esArchiver = getService('esArchiver'); - describe('alerting telemetry', () => { + // FLAKY: https://github.com/elastic/kibana/issues/136679 + describe.skip('alerting telemetry', () => { const alwaysFiringRuleId: { [key: string]: string } = {}; before(async () => { diff --git a/x-pack/test/api_integration/apis/aiops/explain_log_rate_spikes.ts b/x-pack/test/api_integration/apis/aiops/explain_log_rate_spikes.ts index 82a6ca42fce83..f096541f1a7fd 100644 --- a/x-pack/test/api_integration/apis/aiops/explain_log_rate_spikes.ts +++ b/x-pack/test/api_integration/apis/aiops/explain_log_rate_spikes.ts @@ -34,11 +34,12 @@ export default ({ getService }: FtrProviderContext) => { }; const expected = { - chunksLength: 8, - actionsLength: 7, + chunksLength: 12, + actionsLength: 11, noIndexChunksLength: 4, noIndexActionsLength: 3, - actionFilter: 'add_change_points', + changePointFilter: 'add_change_points', + histogramFilter: 'add_change_points_histogram', errorFilter: 'error', changePoints: [ { @@ -60,6 +61,7 @@ export default ({ getService }: FtrProviderContext) => { normalizedScore: 0.7661649691018979, }, ], + histogramLength: 20, }; describe('POST /internal/aiops/explain_log_rate_spikes', () => { @@ -100,7 +102,7 @@ export default ({ getService }: FtrProviderContext) => { expect(typeof d.type).to.be('string'); }); - const addChangePointsActions = data.filter((d) => d.type === expected.actionFilter); + const addChangePointsActions = data.filter((d) => d.type === expected.changePointFilter); expect(addChangePointsActions.length).to.greaterThan(0); const changePoints = addChangePointsActions @@ -120,6 +122,15 @@ export default ({ getService }: FtrProviderContext) => { expect(cp.doc_count).to.equal(ecp.doc_count); expect(cp.bg_count).to.equal(ecp.bg_count); }); + + const histogramActions = data.filter((d) => d.type === expected.histogramFilter); + const histograms = histogramActions.flatMap((d) => d.payload); + // for each change point we should get a histogram + expect(histogramActions.length).to.be(changePoints.length); + // each histogram should have a length of 20 items. + histograms.forEach((h, index) => { + expect(h.histogram.length).to.be(20); + }); }); it('should return data in chunks with streaming', async () => { @@ -148,7 +159,7 @@ export default ({ getService }: FtrProviderContext) => { } expect(data.length).to.be(expected.actionsLength); - const addChangePointsActions = data.filter((d) => d.type === expected.actionFilter); + const addChangePointsActions = data.filter((d) => d.type === expected.changePointFilter); expect(addChangePointsActions.length).to.greaterThan(0); const changePoints = addChangePointsActions @@ -168,6 +179,15 @@ export default ({ getService }: FtrProviderContext) => { expect(cp.doc_count).to.equal(ecp.doc_count); expect(cp.bg_count).to.equal(ecp.bg_count); }); + + const histogramActions = data.filter((d) => d.type === expected.histogramFilter); + const histograms = histogramActions.flatMap((d) => d.payload); + // for each change point we should get a histogram + expect(histogramActions.length).to.be(changePoints.length); + // each histogram should have a length of 20 items. + histograms.forEach((h, index) => { + expect(h.histogram.length).to.be(20); + }); } }); diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group8/exception_operators_data_types/keyword.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group8/exception_operators_data_types/keyword.ts index 1e004c259e441..e73a942ab69d5 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/group8/exception_operators_data_types/keyword.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group8/exception_operators_data_types/keyword.ts @@ -593,5 +593,173 @@ export default ({ getService }: FtrProviderContext) => { expect(hits).to.eql(['word four', 'word one', 'word three', 'word two']); }); }); + + describe('"matches wildcard" operator', () => { + it('should return 0 alerts if wildcard matches all words', async () => { + const rule = getRuleForSignalTesting(['keyword']); + const { id } = await createRuleWithExceptionEntries(supertest, log, rule, [ + [ + { + field: 'keyword', + operator: 'included', + type: 'wildcard', + // Filter out all 4 words + value: 'word *', + }, + ], + ]); + await waitForRuleSuccessOrStatus(supertest, log, id); + const signalsOpen = await getSignalsById(supertest, log, id); + const hits = signalsOpen.hits.hits.map((hit) => hit._source?.keyword).sort(); + expect(hits).to.eql([]); + }); + + it('should return 1 alert if wildcard exceptions match one, two, and three', async () => { + const rule = getRuleForSignalTesting(['keyword']); + const { id } = await createRuleWithExceptionEntries(supertest, log, rule, [ + [ + { + field: 'keyword', + operator: 'included', + type: 'wildcard', + value: 'word one', + }, + ], + [ + { + field: 'keyword', + operator: 'included', + type: 'wildcard', + // Filter out both "word two" and "word three" + value: 'word t*', + }, + ], + ]); + await waitForRuleSuccessOrStatus(supertest, log, id); + await waitForSignalsToBePresent(supertest, log, 1, [id]); + const signalsOpen = await getSignalsById(supertest, log, id); + const hits = signalsOpen.hits.hits.map((hit) => hit._source?.keyword).sort(); + expect(hits).to.eql(['word four']); + }); + + it('should return 3 alerts if one is set as an exception', async () => { + const rule = getRuleForSignalTesting(['keyword']); + const { id } = await createRuleWithExceptionEntries(supertest, log, rule, [ + [ + { + field: 'keyword', + operator: 'included', + type: 'wildcard', + // Without * or ? in the value, it should work the same as the "is" operator + value: 'word one', + }, + ], + ]); + await waitForRuleSuccessOrStatus(supertest, log, id); + await waitForSignalsToBePresent(supertest, log, 3, [id]); + const signalsOpen = await getSignalsById(supertest, log, id); + const hits = signalsOpen.hits.hits.map((hit) => hit._source?.keyword).sort(); + expect(hits).to.eql(['word four', 'word three', 'word two']); + }); + + it('should return 4 alerts if the wildcard matches nothing', async () => { + const rule = getRuleForSignalTesting(['keyword']); + const { id } = await createRuleWithExceptionEntries(supertest, log, rule, [ + [ + { + field: 'keyword', + operator: 'included', + type: 'wildcard', + value: 'word a*', + }, + ], + ]); + await waitForRuleSuccessOrStatus(supertest, log, id); + await waitForSignalsToBePresent(supertest, log, 4, [id]); + const signalsOpen = await getSignalsById(supertest, log, id); + const hits = signalsOpen.hits.hits.map((hit) => hit._source?.keyword).sort(); + expect(hits).to.eql(['word four', 'word one', 'word three', 'word two']); + }); + }); + + describe('"does not match wildcard" operator', () => { + it('should return 4 results if excluded wildcard matches all 4 words', async () => { + const rule = getRuleForSignalTesting(['keyword']); + const { id } = await createRuleWithExceptionEntries(supertest, log, rule, [ + [ + { + field: 'keyword', + operator: 'excluded', + type: 'wildcard', + // Filter out everything except things matching 'word *' + value: 'word *', + }, + ], + ]); + await waitForRuleSuccessOrStatus(supertest, log, id); + await waitForSignalsToBePresent(supertest, log, 4, [id]); + const signalsOpen = await getSignalsById(supertest, log, id); + const hits = signalsOpen.hits.hits.map((hit) => hit._source?.keyword).sort(); + expect(hits).to.eql(['word four', 'word one', 'word three', 'word two']); + }); + + it('should filter in 2 keywords if using a wildcard exception', async () => { + const rule = getRuleForSignalTesting(['keyword']); + const { id } = await createRuleWithExceptionEntries(supertest, log, rule, [ + [ + { + field: 'keyword', + operator: 'excluded', + type: 'wildcard', + // Filter out everything except things matching 'word t*' + value: 'word t*', + }, + ], + ]); + await waitForRuleSuccessOrStatus(supertest, log, id); + await waitForSignalsToBePresent(supertest, log, 2, [id]); + const signalsOpen = await getSignalsById(supertest, log, id); + const hits = signalsOpen.hits.hits.map((hit) => hit._source?.keyword).sort(); + expect(hits).to.eql(['word three', 'word two']); + }); + + it('should return 1 alert if "word one" is excluded', async () => { + const rule = getRuleForSignalTesting(['keyword']); + const { id } = await createRuleWithExceptionEntries(supertest, log, rule, [ + [ + { + field: 'keyword', + operator: 'excluded', + type: 'wildcard', + // Without * or ? in the value, it should work the same as the "is not" operator + value: 'word one', + }, + ], + ]); + await waitForRuleSuccessOrStatus(supertest, log, id); + await waitForSignalsToBePresent(supertest, log, 1, [id]); + const signalsOpen = await getSignalsById(supertest, log, id); + const hits = signalsOpen.hits.hits.map((hit) => hit._source?.keyword).sort(); + expect(hits).to.eql(['word one']); + }); + + it('should return 0 alerts if it cannot find what it is excluding', async () => { + const rule = getRuleForSignalTesting(['keyword']); + const { id } = await createRuleWithExceptionEntries(supertest, log, rule, [ + [ + { + field: 'keyword', + operator: 'excluded', + type: 'wildcard', + value: 'word a*', + }, + ], + ]); + await waitForRuleSuccessOrStatus(supertest, log, id); + const signalsOpen = await getSignalsById(supertest, log, id); + const hits = signalsOpen.hits.hits.map((hit) => hit._source?.keyword).sort(); + expect(hits).to.eql([]); + }); + }); }); }; diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group8/exception_operators_data_types/keyword_array.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group8/exception_operators_data_types/keyword_array.ts index b43cc818ec01d..3aff8c152a9a6 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/group8/exception_operators_data_types/keyword_array.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group8/exception_operators_data_types/keyword_array.ts @@ -633,5 +633,134 @@ export default ({ getService }: FtrProviderContext) => { ]); }); }); + + describe('"matches wildcard" operator', () => { + it('should filter 1 single keyword if it is set as an exception', async () => { + const rule = getRuleForSignalTesting(['keyword_as_array']); + const { id } = await createRuleWithExceptionEntries(supertest, log, rule, [ + [ + { + field: 'keyword', + operator: 'included', + type: 'wildcard', + value: 'word o*', + }, + ], + ]); + await waitForRuleSuccessOrStatus(supertest, log, id); + await waitForSignalsToBePresent(supertest, log, 3, [id]); + const signalsOpen = await getSignalsById(supertest, log, id); + const hits = signalsOpen.hits.hits.map((hit) => hit._source?.keyword).sort(); + expect(hits).to.eql([ + [], + ['word eight', 'word nine', 'word ten'], + ['word five', null, 'word six', 'word seven'], + ]); + }); + + it('should filter 2 keyword if both are set as exceptions', async () => { + const rule = getRuleForSignalTesting(['keyword_as_array']); + const { id } = await createRuleWithExceptionEntries(supertest, log, rule, [ + [ + { + field: 'keyword', + operator: 'included', + type: 'wildcard', + value: 'word t*', + }, + ], + ]); + await waitForRuleSuccessOrStatus(supertest, log, id); + await waitForSignalsToBePresent(supertest, log, 2, [id]); + const signalsOpen = await getSignalsById(supertest, log, id); + const hits = signalsOpen.hits.hits.map((hit) => hit._source?.keyword).sort(); + expect(hits).to.eql([[], ['word five', null, 'word six', 'word seven']]); + }); + + it('should filter 3 keyword if all 3 are set as exceptions', async () => { + const rule = getRuleForSignalTesting(['keyword_as_array']); + const { id } = await createRuleWithExceptionEntries(supertest, log, rule, [ + [ + { + field: 'keyword', + operator: 'included', + type: 'wildcard', + value: 'word *', + }, + ], + ]); + await waitForRuleSuccessOrStatus(supertest, log, id); + await waitForSignalsToBePresent(supertest, log, 1, [id]); + const signalsOpen = await getSignalsById(supertest, log, id); + const hits = signalsOpen.hits.hits.map((hit) => hit._source?.keyword).sort(); + expect(hits.flat(Number.MAX_SAFE_INTEGER)).to.eql([]); + }); + }); + + describe('"does not match wildcard" operator', () => { + it('should filter 1 single keyword if it is set as an exception', async () => { + const rule = getRuleForSignalTesting(['keyword_as_array']); + const { id } = await createRuleWithExceptionEntries(supertest, log, rule, [ + [ + { + field: 'keyword', + operator: 'excluded', + type: 'wildcard', + value: 'word o*', + }, + ], + ]); + await waitForRuleSuccessOrStatus(supertest, log, id); + await waitForSignalsToBePresent(supertest, log, 1, [id]); + const signalsOpen = await getSignalsById(supertest, log, id); + const hits = signalsOpen.hits.hits.map((hit) => hit._source?.keyword).sort(); + expect(hits).to.eql([['word one', 'word two', 'word three', 'word four']]); + }); + + it('should filter 2 keyword if both are set as exceptions', async () => { + const rule = getRuleForSignalTesting(['keyword_as_array']); + const { id } = await createRuleWithExceptionEntries(supertest, log, rule, [ + [ + { + field: 'keyword', + operator: 'excluded', + type: 'wildcard', + value: 'word t*', + }, + ], + ]); + await waitForRuleSuccessOrStatus(supertest, log, id); + await waitForSignalsToBePresent(supertest, log, 2, [id]); + const signalsOpen = await getSignalsById(supertest, log, id); + const hits = signalsOpen.hits.hits.map((hit) => hit._source?.keyword).sort(); + expect(hits).to.eql([ + ['word eight', 'word nine', 'word ten'], + ['word one', 'word two', 'word three', 'word four'], + ]); + }); + + it('should filter 3 keyword if all 3 are set as exceptions', async () => { + const rule = getRuleForSignalTesting(['keyword_as_array']); + const { id } = await createRuleWithExceptionEntries(supertest, log, rule, [ + [ + { + field: 'keyword', + operator: 'excluded', + type: 'wildcard', + value: 'word *', + }, + ], + ]); + await waitForRuleSuccessOrStatus(supertest, log, id); + await waitForSignalsToBePresent(supertest, log, 3, [id]); + const signalsOpen = await getSignalsById(supertest, log, id); + const hits = signalsOpen.hits.hits.map((hit) => hit._source?.keyword).sort(); + expect(hits).to.eql([ + ['word eight', 'word nine', 'word ten'], + ['word five', null, 'word six', 'word seven'], + ['word one', 'word two', 'word three', 'word four'], + ]); + }); + }); }); }; diff --git a/x-pack/test/functional/page_objects/lens_page.ts b/x-pack/test/functional/page_objects/lens_page.ts index c440c25784290..24395c59317a8 100644 --- a/x-pack/test/functional/page_objects/lens_page.ts +++ b/x-pack/test/functional/page_objects/lens_page.ts @@ -1268,8 +1268,8 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont dispatchEvent(target, dropEvent, dragStartEvent.dataTransfer); const dragEndEvent = createEvent('dragend'); dispatchEvent(origin, dragEndEvent, dropEvent.dataTransfer); - }, 100) - }, 100); + }, 200) + }, 200); `, dragging, draggedOver, diff --git a/x-pack/test/reporting_api_integration/reporting_and_security/__snapshots__/download_csv_dashboard.snap b/x-pack/test/reporting_api_integration/reporting_and_security/__snapshots__/download_csv_dashboard.snap index fae0f3b32c5b9..43649d0ed7552 100644 --- a/x-pack/test/reporting_api_integration/reporting_and_security/__snapshots__/download_csv_dashboard.snap +++ b/x-pack/test/reporting_api_integration/reporting_and_security/__snapshots__/download_csv_dashboard.snap @@ -177,11 +177,11 @@ jwMtOW0BH63Xcmy432HJ,ecommerce,-,Men's Clothing,Men's Clothing,EUR,Jackson,Jacks `; exports[`Reporting APIs CSV Generation from SearchSource unquoted values Exports CSV with almost all fields when using fieldsFromSource 1`] = ` -"_id,_index,_score,category,currency,customer_first_name,customer_full_name,customer_gender,customer_id,customer_last_name,customer_phone,day_of_week,day_of_week_i,email,geoip,manufacturer,order_date,order_id,products,products.created_on,sku,taxful_total_price,taxless_total_price,total_quantity,total_unique_products,type,user -9AMtOW0BH63Xcmy432DJ,ecommerce,-,Men's Clothing,EUR,Boris,Boris Bradley,MALE,36,Bradley,-,Wednesday,2,boris@bradley-family.zzz,{\\"continent_name\\":\\"Europe\\",\\"country_iso_code\\":\\"GB\\",\\"location\\":{\\"lat\\":51.5,\\"lon\\":-0.1}},Microlutions, Elitelligence,Jun 25, 2019 @ 00:00:00.000,568397,{\\"_id\\":\\"sold_product_568397_24419\\",\\"base_price\\":32.99,\\"base_unit_price\\":32.99,\\"category\\":\\"Men's Clothing\\",\\"created_on\\":\\"2016-12-14T00:00:00+00:00\\",\\"discount_amount\\":0,\\"discount_percentage\\":0,\\"manufacturer\\":\\"Microlutions\\",\\"min_price\\":17.48,\\"price\\":32.99,\\"product_id\\":24419,\\"product_name\\":\\"Cargo trousers - oliv\\",\\"quantity\\":1,\\"sku\\":\\"ZO0112101121\\",\\"tax_amount\\":0,\\"taxful_price\\":32.99,\\"taxless_price\\":32.99,\\"unit_discount_amount\\":0}, {\\"_id\\":\\"sold_product_568397_20207\\",\\"base_price\\":28.99,\\"base_unit_price\\":28.99,\\"category\\":\\"Men's Clothing\\",\\"created_on\\":\\"2016-12-14T00:00:00+00:00\\",\\"discount_amount\\":0,\\"discount_percentage\\":0,\\"manufacturer\\":\\"Elitelligence\\",\\"min_price\\":13.92,\\"price\\":28.99,\\"product_id\\":20207,\\"product_name\\":\\"Trousers - black\\",\\"quantity\\":1,\\"sku\\":\\"ZO0530405304\\",\\"tax_amount\\":0,\\"taxful_price\\":28.99,\\"taxless_price\\":28.99,\\"unit_discount_amount\\":0},Dec 14, 2016 @ 00:00:00.000, Dec 14, 2016 @ 00:00:00.000,ZO0112101121, ZO0530405304,61.98,61.98,2,2,order,boris -9QMtOW0BH63Xcmy432DJ,ecommerce,-,Men's Clothing,EUR,Oliver,Oliver Hubbard,MALE,7,Hubbard,-,Wednesday,2,oliver@hubbard-family.zzz,{\\"continent_name\\":\\"Europe\\",\\"country_iso_code\\":\\"GB\\",\\"location\\":{\\"lat\\":51.5,\\"lon\\":-0.1}},Spritechnologies, Microlutions,Jun 25, 2019 @ 00:00:00.000,568044,{\\"_id\\":\\"sold_product_568044_12799\\",\\"base_price\\":14.99,\\"base_unit_price\\":14.99,\\"category\\":\\"Men's Clothing\\",\\"created_on\\":\\"2016-12-14T00:00:00+00:00\\",\\"discount_amount\\":0,\\"discount_percentage\\":0,\\"manufacturer\\":\\"Spritechnologies\\",\\"min_price\\":6.9,\\"price\\":14.99,\\"product_id\\":12799,\\"product_name\\":\\"Undershirt - dark grey multicolor\\",\\"quantity\\":1,\\"sku\\":\\"ZO0630406304\\",\\"tax_amount\\":0,\\"taxful_price\\":14.99,\\"taxless_price\\":14.99,\\"unit_discount_amount\\":0}, {\\"_id\\":\\"sold_product_568044_18008\\",\\"base_price\\":16.99,\\"base_unit_price\\":16.99,\\"category\\":\\"Men's Clothing\\",\\"created_on\\":\\"2016-12-14T00:00:00+00:00\\",\\"discount_amount\\":0,\\"discount_percentage\\":0,\\"manufacturer\\":\\"Microlutions\\",\\"min_price\\":8.83,\\"price\\":16.99,\\"product_id\\":18008,\\"product_name\\":\\"Long sleeved top - purple\\",\\"quantity\\":1,\\"sku\\":\\"ZO0120201202\\",\\"tax_amount\\":0,\\"taxful_price\\":16.99,\\"taxless_price\\":16.99,\\"unit_discount_amount\\":0},Dec 14, 2016 @ 00:00:00.000, Dec 14, 2016 @ 00:00:00.000,ZO0630406304, ZO0120201202,31.98,31.98,2,2,order,oliver -OAMtOW0BH63Xcmy432HJ,ecommerce,-,Women's Accessories,EUR,Betty,Betty Reese,FEMALE,44,Reese,-,Wednesday,2,betty@reese-family.zzz,{\\"city_name\\":\\"New York\\",\\"continent_name\\":\\"North America\\",\\"country_iso_code\\":\\"US\\",\\"location\\":{\\"lat\\":40.7,\\"lon\\":-74},\\"region_name\\":\\"New York\\"},Pyramidustries,Jun 25, 2019 @ 00:00:00.000,568229,{\\"_id\\":\\"sold_product_568229_24991\\",\\"base_price\\":11.99,\\"base_unit_price\\":11.99,\\"category\\":\\"Women's Accessories\\",\\"created_on\\":\\"2016-12-14T00:00:00+00:00\\",\\"discount_amount\\":0,\\"discount_percentage\\":0,\\"manufacturer\\":\\"Pyramidustries\\",\\"min_price\\":6.35,\\"price\\":11.99,\\"product_id\\":24991,\\"product_name\\":\\"Scarf - rose/white\\",\\"quantity\\":1,\\"sku\\":\\"ZO0192201922\\",\\"tax_amount\\":0,\\"taxful_price\\":11.99,\\"taxless_price\\":11.99,\\"unit_discount_amount\\":0}, {\\"_id\\":\\"sold_product_568229_12039\\",\\"base_price\\":10.99,\\"base_unit_price\\":10.99,\\"category\\":\\"Women's Accessories\\",\\"created_on\\":\\"2016-12-14T00:00:00+00:00\\",\\"discount_amount\\":0,\\"discount_percentage\\":0,\\"manufacturer\\":\\"Pyramidustries\\",\\"min_price\\":5.82,\\"price\\":10.99,\\"product_id\\":12039,\\"product_name\\":\\"Scarf - nude/black/turquoise\\",\\"quantity\\":1,\\"sku\\":\\"ZO0192801928\\",\\"tax_amount\\":0,\\"taxful_price\\":10.99,\\"taxless_price\\":10.99,\\"unit_discount_amount\\":0},Dec 14, 2016 @ 00:00:00.000, Dec 14, 2016 @ 00:00:00.000,ZO0192201922, ZO0192801928,22.98,22.98,2,2,order,betty -OQMtOW0BH63Xcmy432HJ,ecommerce,-,Men's Clothing, Men's Accessories,EUR,Recip,Recip Salazar,MALE,10,Salazar,-,Wednesday,2,recip@salazar-family.zzz,{\\"city_name\\":\\"Istanbul\\",\\"continent_name\\":\\"Asia\\",\\"country_iso_code\\":\\"TR\\",\\"location\\":{\\"lat\\":41,\\"lon\\":29},\\"region_name\\":\\"Istanbul\\"},Elitelligence,Jun 25, 2019 @ 00:00:00.000,568292,{\\"_id\\":\\"sold_product_568292_23627\\",\\"base_price\\":24.99,\\"base_unit_price\\":24.99,\\"category\\":\\"Men's Clothing\\",\\"created_on\\":\\"2016-12-14T00:00:00+00:00\\",\\"discount_amount\\":0,\\"discount_percentage\\":0,\\"manufacturer\\":\\"Elitelligence\\",\\"min_price\\":12.49,\\"price\\":24.99,\\"product_id\\":23627,\\"product_name\\":\\"Slim fit jeans - grey\\",\\"quantity\\":1,\\"sku\\":\\"ZO0534205342\\",\\"tax_amount\\":0,\\"taxful_price\\":24.99,\\"taxless_price\\":24.99,\\"unit_discount_amount\\":0}, {\\"_id\\":\\"sold_product_568292_11149\\",\\"base_price\\":10.99,\\"base_unit_price\\":10.99,\\"category\\":\\"Men's Accessories\\",\\"created_on\\":\\"2016-12-14T00:00:00+00:00\\",\\"discount_amount\\":0,\\"discount_percentage\\":0,\\"manufacturer\\":\\"Elitelligence\\",\\"min_price\\":5.06,\\"price\\":10.99,\\"product_id\\":11149,\\"product_name\\":\\"Sunglasses - black\\",\\"quantity\\":1,\\"sku\\":\\"ZO0599605996\\",\\"tax_amount\\":0,\\"taxful_price\\":10.99,\\"taxless_price\\":10.99,\\"unit_discount_amount\\":0},Dec 14, 2016 @ 00:00:00.000, Dec 14, 2016 @ 00:00:00.000,ZO0534205342, ZO0599605996,35.98,35.98,2,2,order,recip +"_id,_index,_score,category,currency,customer_first_name,customer_full_name,customer_gender,customer_id,customer_last_name,customer_phone,day_of_week,day_of_week_i,email,geoip.city_name,geoip.continent_name,geoip.country_iso_code,geoip.location,geoip.region_name,manufacturer,order_date,order_id,products,products.created_on,sku,taxful_total_price,taxless_total_price,total_quantity,total_unique_products,type,user +9AMtOW0BH63Xcmy432DJ,ecommerce,-,Men's Clothing,EUR,Boris,Boris Bradley,MALE,36,Bradley,-,Wednesday,2,boris@bradley-family.zzz,-,Europe,GB,POINT (-0.1 51.5),-,Microlutions, Elitelligence,Jun 25, 2019 @ 00:00:00.000,568397,{\\"_id\\":\\"sold_product_568397_24419\\",\\"base_price\\":32.99,\\"base_unit_price\\":32.99,\\"category\\":\\"Men's Clothing\\",\\"created_on\\":\\"2016-12-14T00:00:00+00:00\\",\\"discount_amount\\":0,\\"discount_percentage\\":0,\\"manufacturer\\":\\"Microlutions\\",\\"min_price\\":17.48,\\"price\\":32.99,\\"product_id\\":24419,\\"product_name\\":\\"Cargo trousers - oliv\\",\\"quantity\\":1,\\"sku\\":\\"ZO0112101121\\",\\"tax_amount\\":0,\\"taxful_price\\":32.99,\\"taxless_price\\":32.99,\\"unit_discount_amount\\":0}, {\\"_id\\":\\"sold_product_568397_20207\\",\\"base_price\\":28.99,\\"base_unit_price\\":28.99,\\"category\\":\\"Men's Clothing\\",\\"created_on\\":\\"2016-12-14T00:00:00+00:00\\",\\"discount_amount\\":0,\\"discount_percentage\\":0,\\"manufacturer\\":\\"Elitelligence\\",\\"min_price\\":13.92,\\"price\\":28.99,\\"product_id\\":20207,\\"product_name\\":\\"Trousers - black\\",\\"quantity\\":1,\\"sku\\":\\"ZO0530405304\\",\\"tax_amount\\":0,\\"taxful_price\\":28.99,\\"taxless_price\\":28.99,\\"unit_discount_amount\\":0},Dec 14, 2016 @ 00:00:00.000, Dec 14, 2016 @ 00:00:00.000,ZO0112101121, ZO0530405304,61.98,61.98,2,2,order,boris +9QMtOW0BH63Xcmy432DJ,ecommerce,-,Men's Clothing,EUR,Oliver,Oliver Hubbard,MALE,7,Hubbard,-,Wednesday,2,oliver@hubbard-family.zzz,-,Europe,GB,POINT (-0.1 51.5),-,Spritechnologies, Microlutions,Jun 25, 2019 @ 00:00:00.000,568044,{\\"_id\\":\\"sold_product_568044_12799\\",\\"base_price\\":14.99,\\"base_unit_price\\":14.99,\\"category\\":\\"Men's Clothing\\",\\"created_on\\":\\"2016-12-14T00:00:00+00:00\\",\\"discount_amount\\":0,\\"discount_percentage\\":0,\\"manufacturer\\":\\"Spritechnologies\\",\\"min_price\\":6.9,\\"price\\":14.99,\\"product_id\\":12799,\\"product_name\\":\\"Undershirt - dark grey multicolor\\",\\"quantity\\":1,\\"sku\\":\\"ZO0630406304\\",\\"tax_amount\\":0,\\"taxful_price\\":14.99,\\"taxless_price\\":14.99,\\"unit_discount_amount\\":0}, {\\"_id\\":\\"sold_product_568044_18008\\",\\"base_price\\":16.99,\\"base_unit_price\\":16.99,\\"category\\":\\"Men's Clothing\\",\\"created_on\\":\\"2016-12-14T00:00:00+00:00\\",\\"discount_amount\\":0,\\"discount_percentage\\":0,\\"manufacturer\\":\\"Microlutions\\",\\"min_price\\":8.83,\\"price\\":16.99,\\"product_id\\":18008,\\"product_name\\":\\"Long sleeved top - purple\\",\\"quantity\\":1,\\"sku\\":\\"ZO0120201202\\",\\"tax_amount\\":0,\\"taxful_price\\":16.99,\\"taxless_price\\":16.99,\\"unit_discount_amount\\":0},Dec 14, 2016 @ 00:00:00.000, Dec 14, 2016 @ 00:00:00.000,ZO0630406304, ZO0120201202,31.98,31.98,2,2,order,oliver +OAMtOW0BH63Xcmy432HJ,ecommerce,-,Women's Accessories,EUR,Betty,Betty Reese,FEMALE,44,Reese,-,Wednesday,2,betty@reese-family.zzz,New York,North America,US,POINT (-74 40.7),New York,Pyramidustries,Jun 25, 2019 @ 00:00:00.000,568229,{\\"_id\\":\\"sold_product_568229_24991\\",\\"base_price\\":11.99,\\"base_unit_price\\":11.99,\\"category\\":\\"Women's Accessories\\",\\"created_on\\":\\"2016-12-14T00:00:00+00:00\\",\\"discount_amount\\":0,\\"discount_percentage\\":0,\\"manufacturer\\":\\"Pyramidustries\\",\\"min_price\\":6.35,\\"price\\":11.99,\\"product_id\\":24991,\\"product_name\\":\\"Scarf - rose/white\\",\\"quantity\\":1,\\"sku\\":\\"ZO0192201922\\",\\"tax_amount\\":0,\\"taxful_price\\":11.99,\\"taxless_price\\":11.99,\\"unit_discount_amount\\":0}, {\\"_id\\":\\"sold_product_568229_12039\\",\\"base_price\\":10.99,\\"base_unit_price\\":10.99,\\"category\\":\\"Women's Accessories\\",\\"created_on\\":\\"2016-12-14T00:00:00+00:00\\",\\"discount_amount\\":0,\\"discount_percentage\\":0,\\"manufacturer\\":\\"Pyramidustries\\",\\"min_price\\":5.82,\\"price\\":10.99,\\"product_id\\":12039,\\"product_name\\":\\"Scarf - nude/black/turquoise\\",\\"quantity\\":1,\\"sku\\":\\"ZO0192801928\\",\\"tax_amount\\":0,\\"taxful_price\\":10.99,\\"taxless_price\\":10.99,\\"unit_discount_amount\\":0},Dec 14, 2016 @ 00:00:00.000, Dec 14, 2016 @ 00:00:00.000,ZO0192201922, ZO0192801928,22.98,22.98,2,2,order,betty +OQMtOW0BH63Xcmy432HJ,ecommerce,-,Men's Clothing, Men's Accessories,EUR,Recip,Recip Salazar,MALE,10,Salazar,-,Wednesday,2,recip@salazar-family.zzz,Istanbul,Asia,TR,POINT (29 41),Istanbul,Elitelligence,Jun 25, 2019 @ 00:00:00.000,568292,{\\"_id\\":\\"sold_product_568292_23627\\",\\"base_price\\":24.99,\\"base_unit_price\\":24.99,\\"category\\":\\"Men's Clothing\\",\\"created_on\\":\\"2016-12-14T00:00:00+00:00\\",\\"discount_amount\\":0,\\"discount_percentage\\":0,\\"manufacturer\\":\\"Elitelligence\\",\\"min_price\\":12.49,\\"price\\":24.99,\\"product_id\\":23627,\\"product_name\\":\\"Slim fit jeans - grey\\",\\"quantity\\":1,\\"sku\\":\\"ZO0534205342\\",\\"tax_amount\\":0,\\"taxful_price\\":24.99,\\"taxless_price\\":24.99,\\"unit_discount_amount\\":0}, {\\"_id\\":\\"sold_product_568292_11149\\",\\"base_price\\":10.99,\\"base_unit_price\\":10.99,\\"category\\":\\"Men's Accessories\\",\\"created_on\\":\\"2016-12-14T00:00:00+00:00\\",\\"discount_amount\\":0,\\"discount_percentage\\":0,\\"manufacturer\\":\\"Elitelligence\\",\\"min_price\\":5.06,\\"price\\":10.99,\\"product_id\\":11149,\\"product_name\\":\\"Sunglasses - black\\",\\"quantity\\":1,\\"sku\\":\\"ZO0599605996\\",\\"tax_amount\\":0,\\"taxful_price\\":10.99,\\"taxless_price\\":10.99,\\"unit_discount_amount\\":0},Dec 14, 2016 @ 00:00:00.000, Dec 14, 2016 @ 00:00:00.000,ZO0534205342, ZO0599605996,35.98,35.98,2,2,order,recip " `; diff --git a/x-pack/test/reporting_functional/reporting_and_timeout/index.ts b/x-pack/test/reporting_functional/reporting_and_timeout/index.ts index 9e06e18072846..38880a1b29757 100644 --- a/x-pack/test/reporting_functional/reporting_and_timeout/index.ts +++ b/x-pack/test/reporting_functional/reporting_and_timeout/index.ts @@ -52,8 +52,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // allow minor visual differences: https://github.com/elastic/kibana/issues/135309#issuecomment-1169095186 expect(await compareImages.checkIfPngsMatch(pngSessionFilePath, baselineAPng)).to.be.lessThan( - 0.011 - ); + 0.015 + ); // this factor of difference allows passing whether or not the page has loaded things like the loading graphics and titlebars }); }); } diff --git a/yarn.lock b/yarn.lock index 92b8154ca5f8a..e22315ea78ae7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -104,7 +104,7 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/core@>=7.9.0", "@babel/core@^7.1.0", "@babel/core@^7.12.10", "@babel/core@^7.12.3", "@babel/core@^7.16.0", "@babel/core@^7.17.9", "@babel/core@^7.7.5": +"@babel/core@^7.1.0", "@babel/core@^7.12.10", "@babel/core@^7.12.3", "@babel/core@^7.16.0", "@babel/core@^7.17.9", "@babel/core@^7.7.5": version "7.17.9" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.9.tgz#6bae81a06d95f4d0dec5bb9d74bbc1f58babdcfe" integrity sha512-5ug+SfZCpDAkVp9SFIZAzlW18rlzsOcJGaetCjkySnrXXDUw9AR8cDUm1iByTmdWM6yxX6/zycaV76w3YTF2gw== @@ -1255,6 +1255,11 @@ dependencies: "@cspotcode/source-map-consumer" "0.8.0" +"@csstools/selector-specificity@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@csstools/selector-specificity/-/selector-specificity-2.0.1.tgz#b6b8d81780b9a9f6459f4bfe9226ac6aefaefe87" + integrity sha512-aG20vknL4/YjQF9BSV7ts4EWm/yrjagAN7OWBNmlbEOUiu0llj4OGrFoOKK3g2vey4/p2omKCoHrWtPxSwV3HA== + "@cypress/browserify-preprocessor@3.0.2": version "3.0.2" resolved "https://registry.yarnpkg.com/@cypress/browserify-preprocessor/-/browserify-preprocessor-3.0.2.tgz#1dbecae394937aed47a3524cad47086c2ded8c50" @@ -3163,6 +3168,30 @@ version "0.0.0" uid "" +"@kbn/core-elasticsearch-client-server-internal@link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server-internal": + version "0.0.0" + uid "" + +"@kbn/core-elasticsearch-client-server-mocks@link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server-mocks": + version "0.0.0" + uid "" + +"@kbn/core-elasticsearch-client-server@link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server": + version "0.0.0" + uid "" + +"@kbn/core-elasticsearch-server-internal@link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server-internal": + version "0.0.0" + uid "" + +"@kbn/core-elasticsearch-server-mocks@link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server-mocks": + version "0.0.0" + uid "" + +"@kbn/core-elasticsearch-server@link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server": + version "0.0.0" + uid "" + "@kbn/core-environment-server-internal@link:bazel-bin/packages/core/environment/core-environment-server-internal": version "0.0.0" uid "" @@ -5749,21 +5778,6 @@ resolve-from "^5.0.0" store2 "^2.12.0" -"@stylelint/postcss-css-in-js@^0.37.2": - version "0.37.2" - resolved "https://registry.yarnpkg.com/@stylelint/postcss-css-in-js/-/postcss-css-in-js-0.37.2.tgz#7e5a84ad181f4234a2480803422a47b8749af3d2" - integrity sha512-nEhsFoJurt8oUmieT8qy4nk81WRHmJynmVwn/Vts08PL9fhgIsMhk1GId5yAN643OzqEEb5S/6At2TZW7pqPDA== - dependencies: - "@babel/core" ">=7.9.0" - -"@stylelint/postcss-markdown@^0.36.2": - version "0.36.2" - resolved "https://registry.yarnpkg.com/@stylelint/postcss-markdown/-/postcss-markdown-0.36.2.tgz#0a540c4692f8dcdfc13c8e352c17e7bfee2bb391" - integrity sha512-2kGbqUVJUGE8dM+bMzXG/PYUWKkjLIkRLWNh39OaADkiabDRdw8ATFCgbMz5xdIcvwspPAluSL7uY+ZiTWdWmQ== - dependencies: - remark "^13.0.0" - unist-util-find-all-after "^3.0.2" - "@szmarczak/http-timer@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" @@ -6898,6 +6912,30 @@ version "0.0.0" uid "" +"@types/kbn__core-elasticsearch-client-server-internal@link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server-internal/npm_module_types": + version "0.0.0" + uid "" + +"@types/kbn__core-elasticsearch-client-server-mocks@link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/npm_module_types": + version "0.0.0" + uid "" + +"@types/kbn__core-elasticsearch-client-server@link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server/npm_module_types": + version "0.0.0" + uid "" + +"@types/kbn__core-elasticsearch-server-internal@link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server-internal/npm_module_types": + version "0.0.0" + uid "" + +"@types/kbn__core-elasticsearch-server-mocks@link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server-mocks/npm_module_types": + version "0.0.0" + uid "" + +"@types/kbn__core-elasticsearch-server@link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server/npm_module_types": + version "0.0.0" + uid "" + "@types/kbn__core-environment-server-internal@link:bazel-bin/packages/core/environment/core-environment-server-internal/npm_module_types": version "0.0.0" uid "" @@ -7778,10 +7816,10 @@ dependencies: "@types/node" "*" -"@types/pdfmake@^0.1.19": - version "0.1.19" - resolved "https://registry.yarnpkg.com/@types/pdfmake/-/pdfmake-0.1.19.tgz#d0b9fbf87777ccb56701995d62edeb9b37d52579" - integrity sha512-wcz8QeFUP8VWPwLjWDKX9pp3HcamdQd94vSdK2jHqz/U/srCNQAmhcLSAybuUqwemDKncMnhLTjQq5gjrfc7Yg== +"@types/pdfmake@^0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@types/pdfmake/-/pdfmake-0.2.0.tgz#93d59d3d6f9cbd9ce5c3a8c01d90a0f81368d3ff" + integrity sha512-D4TTyCGiGvm/LZuH8IfUFOiVIuab9jqKslEzDAkwwBHMxTwDxZZJIW9FgLX8s/qRvUwGS2nYd7kOEisjx/604g== dependencies: "@types/node" "*" "@types/pdfkit" "*" @@ -9720,18 +9758,17 @@ attr-accept@^2.2.2: resolved "https://registry.yarnpkg.com/attr-accept/-/attr-accept-2.2.2.tgz#646613809660110749e92f2c10833b70968d929b" integrity sha512-7prDjvt9HmqiZ0cl5CRjtS84sEyhsHP2coDkaZKRKVfCDo9s7iw7ChVmar78Gu9pC4SoR/28wFu/G5JJhTnqEg== -autoprefixer@^9.7.4: - version "9.8.5" - resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.8.5.tgz#2c225de229ddafe1d1424c02791d0c3e10ccccaa" - integrity sha512-C2p5KkumJlsTHoNv9w31NrBRgXhf6eCMteJuHZi2xhkgC+5Vm40MEtCKPhc0qdgAOhox0YPy1SQHTAky05UoKg== +autoprefixer@^10.4.7: + version "10.4.7" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.7.tgz#1db8d195f41a52ca5069b7593be167618edbbedf" + integrity sha512-ypHju4Y2Oav95SipEcCcI5J7CGPuvz8oat7sUtYj3ClK44bldfvtvcxK6IEK++7rqB7YchDGzweZIBG+SD0ZAA== dependencies: - browserslist "^4.12.0" - caniuse-lite "^1.0.30001097" - colorette "^1.2.0" + browserslist "^4.20.3" + caniuse-lite "^1.0.30001335" + fraction.js "^4.2.0" normalize-range "^0.1.2" - num2fraction "^1.2.2" - postcss "^7.0.32" - postcss-value-parser "^4.1.0" + picocolors "^1.0.0" + postcss-value-parser "^4.2.0" autoprefixer@^9.8.6: version "9.8.6" @@ -10105,6 +10142,11 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= +balanced-match@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-2.0.0.tgz#dc70f920d78db8b858535795867bf48f820633d9" + integrity sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA== + base64-js@1.3.1, base64-js@^1.0.2, base64-js@^1.1.2, base64-js@^1.2.0, base64-js@^1.3.0, base64-js@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" @@ -10340,7 +10382,7 @@ braces@^2.3.1: split-string "^3.0.2" to-regex "^3.0.1" -braces@^3.0.1, braces@~3.0.2: +braces@^3.0.2, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -10600,16 +10642,15 @@ browserify@^17.0.0: vm-browserify "^1.0.0" xtend "^4.0.0" -browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.17.5, browserslist@^4.17.6, browserslist@^4.19.1: - version "4.19.1" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.19.1.tgz#4ac0435b35ab655896c31d53018b6dd5e9e4c9a3" - integrity sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A== +browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.17.5, browserslist@^4.17.6, browserslist@^4.19.1, browserslist@^4.20.3: + version "4.21.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.0.tgz#7ab19572361a140ecd1e023e2c1ed95edda0cefe" + integrity sha512-UQxE0DIhRB5z/zDz9iA03BOfxaN2+GQdBYH/2WrSIWEUrnpzTPJbhqt+umq6r3acaPRTW1FNTkrcp0PXgtFkvA== dependencies: - caniuse-lite "^1.0.30001286" - electron-to-chromium "^1.4.17" - escalade "^3.1.1" - node-releases "^2.0.1" - picocolors "^1.0.0" + caniuse-lite "^1.0.30001358" + electron-to-chromium "^1.4.164" + node-releases "^2.0.5" + update-browserslist-db "^1.0.0" bser@^2.0.0: version "2.0.0" @@ -10929,10 +10970,10 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001097, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001286: - version "1.0.30001335" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001335.tgz" - integrity sha512-ddP1Tgm7z2iIxu6QTtbZUv6HJxSaV/PZeSrWFZtbY4JZ69tOeNhBCl3HyRQgeNZKE5AOn1kpV7fhljigy0Ty3w== +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001335, caniuse-lite@^1.0.30001358: + version "1.0.30001359" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001359.tgz#a1c1cbe1c2da9e689638813618b4219acbd4925e" + integrity sha512-Xln/BAsPzEuiVLgJ2/45IaqD9jShtk3Y33anKb4+yLwQzws3+v6odKfpgES/cDEaZMLzSChpIGdbOYtH9MyuHw== canvg@^3.0.9: version "3.0.9" @@ -11528,7 +11569,12 @@ color@^4.2.1, color@^4.2.3: color-convert "^2.0.1" color-string "^1.9.0" -colorette@^1.2.0, colorette@^1.2.1, colorette@^1.2.2: +colord@^2.9.2: + version "2.9.2" + resolved "https://registry.yarnpkg.com/colord/-/colord-2.9.2.tgz#25e2bacbbaa65991422c07ea209e2089428effb1" + integrity sha512-Uqbg+J445nc1TKn4FoDPS6ZZqAvEDnwrH42yo8B40JSOgSLxMZ/gt3h4nmCtPLQeXhjJJkqBx7SCY35WnIixaQ== + +colorette@^1.2.1, colorette@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== @@ -11826,11 +11872,16 @@ cookie-signature@1.0.6: resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= -cookie@0.4.0, cookie@^0.4.0: +cookie@0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== +cookie@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" + integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== + cookiejar@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.1.tgz#41ad57b1b555951ec171412a81942b1e8200d34a" @@ -11934,16 +11985,6 @@ cors@^2.8.4: object-assign "^4" vary "^1" -cosmiconfig@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-4.0.0.tgz#760391549580bbd2df1e562bc177b13c290972dc" - integrity sha512-6e5vDdrXZD+t5v0L8CrurPeybg4Fmf+FCSYxXKYVAqLUtyCSbuyqE059d0kDthTNRzKVjL7QMgNpEUlsoYH3iQ== - dependencies: - is-directory "^0.3.1" - js-yaml "^3.9.0" - parse-json "^4.0.0" - require-from-string "^2.0.1" - cosmiconfig@^5.0.0, cosmiconfig@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" @@ -11965,10 +12006,10 @@ cosmiconfig@^6.0.0: path-type "^4.0.0" yaml "^1.7.2" -cosmiconfig@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.0.tgz#ef9b44d773959cae63ddecd122de23853b60f8d3" - integrity sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA== +cosmiconfig@^7.0.0, cosmiconfig@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d" + integrity sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ== dependencies: "@types/parse-json" "^4.0.0" import-fresh "^3.2.1" @@ -12178,6 +12219,11 @@ css-declaration-sorter@^4.0.1: postcss "^7.0.1" timsort "^0.3.0" +css-functions-list@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/css-functions-list/-/css-functions-list-3.1.0.tgz#cf5b09f835ad91a00e5959bcfc627cd498e1321b" + integrity sha512-/9lCvYZaUbBGvYUgYGFJ4dcYiyqdhSjG7IPVluoV8A1ILjkF7ilmhp1OGUz8n+nmBcu0RNrQAzgD8B6FJbrt2w== + css-in-js-utils@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/css-in-js-utils/-/css-in-js-utils-2.0.1.tgz#3b472b398787291b47cfe3e44fecfdd9e914ba99" @@ -13017,7 +13063,7 @@ debug@3.X, debug@^3.0.0, debug@^3.1.0, debug@^3.1.1, debug@^3.2.5, debug@^3.2.7: dependencies: ms "^2.1.1" -debug@4, debug@4.3.3, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0, debug@^4.3.1, debug@^4.3.2: +debug@4, debug@4.3.3, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: version "4.3.3" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== @@ -13639,7 +13685,7 @@ domain-browser@^1.1.1, domain-browser@^1.2.0: resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== -domelementtype@1, domelementtype@^1.3.1: +domelementtype@1: version "1.3.1" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== @@ -13670,13 +13716,6 @@ domhandler@2.1: dependencies: domelementtype "1" -domhandler@^2.3.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" - integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA== - dependencies: - domelementtype "1" - domhandler@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-3.0.0.tgz#51cd13efca31da95bbb0c5bee3a48300e333b3e9" @@ -13706,7 +13745,7 @@ domutils@1.5.1: dom-serializer "0" domelementtype "1" -domutils@^1.5.1, domutils@^1.7.0: +domutils@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg== @@ -13889,10 +13928,10 @@ elastic-apm-http-client@11.0.1: semver "^6.3.0" stream-chopper "^3.0.1" -elastic-apm-node@^3.36.0: - version "3.36.0" - resolved "https://registry.yarnpkg.com/elastic-apm-node/-/elastic-apm-node-3.36.0.tgz#8f2cb5eac1653eb8abc88e32851a57fc32fb1064" - integrity sha512-4BDfLjfBHDQbXOyj8Ef//w31Cpvzh8z/tofNDPRDUsqpp/Nkt7KFNmHKgVCMxYi9e3Sd/2Mj+K4CoIuSriW9+Q== +elastic-apm-node@^3.37.0: + version "3.37.0" + resolved "https://registry.yarnpkg.com/elastic-apm-node/-/elastic-apm-node-3.37.0.tgz#475cdd38f6c51992952fa00e9be86f01c0e03eb5" + integrity sha512-WjfhMXK3l3aMO/vOSD4LFn9ActPrujOqjQUO4vEFQu5+HGNJIYW+zT4Mqvq0dIZAsdaat0NX/dzzAkBHaQu21Q== dependencies: "@elastic/ecs-pino-format" "^1.2.0" "@opentelemetry/api" "^1.1.0" @@ -13900,7 +13939,7 @@ elastic-apm-node@^3.36.0: async-cache "^1.1.0" async-value-promise "^1.1.1" basic-auth "^2.0.1" - cookie "^0.4.0" + cookie "^0.5.0" core-util-is "^1.0.2" elastic-apm-http-client "11.0.1" end-of-stream "^1.4.4" @@ -13936,10 +13975,10 @@ elasticsearch@^16.4.0: chalk "^1.0.0" lodash "^4.17.10" -electron-to-chromium@^1.4.17: - version "1.4.66" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.66.tgz#d7453d363dcd7b06ed1757adcde34d724e27b367" - integrity sha512-f1RXFMsvwufWLwYUxTiP7HmjprKXrqEWHiQkjAYa9DJeVIlZk5v8gBGcaV+FhtXLly6C1OTVzQY+2UQrACiLlg== +electron-to-chromium@^1.4.164: + version "1.4.172" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.172.tgz#87335795a3dc19e7b6dd5af291038477d81dc6b1" + integrity sha512-yDoFfTJnqBAB6hSiPvzmsBJSrjOXJtHSJoqJdI/zSIh7DYupYnIOHt/bbPw/WE31BJjNTybDdNAs21gCMnTh0Q== elegant-spinner@^1.0.1: version "1.0.1" @@ -14064,7 +14103,7 @@ enquirer@^2.3.5, enquirer@^2.3.6: dependencies: ansi-colors "^4.1.1" -entities@^1.1.1, entities@^1.1.2: +entities@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== @@ -15099,13 +15138,14 @@ faker@^5.1.0: resolved "https://registry.yarnpkg.com/faker/-/faker-5.1.0.tgz#e10fa1dec4502551aee0eb771617a7e7b94692e8" integrity sha512-RrWKFSSA/aNLP0g3o2WW1Zez7/MnMr7xkiZmoCfAGZmdkDQZ6l2KtuXHN5XjdvpRjDl8+3vf+Rrtl06Z352+Mw== -fancy-log@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.2.tgz#f41125e3d84f2e7d89a43d06d958c8f78be16be1" - integrity sha1-9BEl49hPLn2JpD0G2VjI94vha+E= +fancy-log@^1.3.2, fancy-log@^1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.3.tgz#dbc19154f558690150a23953a0adbd035be45fc7" + integrity sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw== dependencies: ansi-gray "^0.1.1" color-support "^1.1.3" + parse-node-version "^1.0.0" time-stamp "^1.0.0" fast-deep-equal@^2.0.1, fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3, fast-deep-equal@~3.1.3: @@ -15123,7 +15163,7 @@ fast-equals@^2.0.0: resolved "https://registry.yarnpkg.com/fast-equals/-/fast-equals-2.0.0.tgz#bef2c423af3939f2c54310df54c57e64cd2adefc" integrity sha512-u6RBd8cSiLLxAiC04wVsLV6GBFDOXcTCgWkd3wEoFXgidPSoAJENqC9m7Jb2vewSvjBIfXV6icKeh3GTKfIaXA== -fast-glob@3.2.7, fast-glob@^3.0.3, fast-glob@^3.1.1, fast-glob@^3.2.2, fast-glob@^3.2.4: +fast-glob@3.2.7, fast-glob@^3.2.9: version "3.2.7" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q== @@ -15146,7 +15186,7 @@ fast-glob@^2.2.6: merge2 "^1.2.3" micromatch "^3.1.10" -fast-glob@^3.2.7: +fast-glob@^3.0.3, fast-glob@^3.1.1, fast-glob@^3.2.11, fast-glob@^3.2.2, fast-glob@^3.2.7: version "3.2.11" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== @@ -15329,13 +15369,6 @@ figures@^3.2.0: dependencies: escape-string-regexp "^1.0.5" -file-entry-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.0.tgz#7921a89c391c6d93efec2169ac6bf300c527ea0a" - integrity sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA== - dependencies: - flat-cache "^3.0.4" - file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" @@ -15736,6 +15769,11 @@ fp-ts@^2.3.1: resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-2.8.6.tgz#1a0e6c3f29f5b0fbfa3120f034ea266aa73c811b" integrity sha512-fGGpKf/Jy3UT4s16oM+hr/8F5QXFcZ+20NAvaZXH5Y5jsiLPMDCaNqffXq0z1Kr6ZUJj0346cH9tq+cI2SoJ4w== +fraction.js@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.2.0.tgz#448e5109a313a3527f5a3ab2119ec4cf0e0e2950" + integrity sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA== + fragment-cache@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" @@ -16343,7 +16381,7 @@ globby@10.0.0: merge2 "^1.2.3" slash "^3.0.0" -globby@11.0.4, globby@^11.0.1, globby@^11.0.2, globby@^11.0.3, globby@^11.0.4: +globby@11.0.4: version "11.0.4" resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== @@ -16369,6 +16407,18 @@ globby@^10.0.1: merge2 "^1.2.3" slash "^3.0.0" +globby@^11.0.1, globby@^11.0.2, globby@^11.0.3, globby@^11.0.4, globby@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^3.0.0" + globby@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" @@ -16415,13 +16465,6 @@ glogg@^1.0.0: dependencies: sparkles "^1.0.0" -gonzales-pe@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/gonzales-pe/-/gonzales-pe-4.3.0.tgz#fe9dec5f3c557eead09ff868c65826be54d067b3" - integrity sha512-otgSPpUmdWJ43VXyiNgEYE4luzHCL2pz4wQ0OnDluC6Eg4Ko3Vexy/SrSynglw/eR+OhkzmqFCZa/OFa/RgAOQ== - dependencies: - minimist "^1.2.5" - google-protobuf@^3.6.1: version "3.19.4" resolved "https://registry.yarnpkg.com/google-protobuf/-/google-protobuf-3.19.4.tgz#8d32c3e34be9250956f28c0fb90955d13f311888" @@ -16575,15 +16618,14 @@ gulp-gzip@^1.4.2: stream-to-array "^2.3.0" through2 "^2.0.3" -gulp-postcss@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/gulp-postcss/-/gulp-postcss-8.0.0.tgz#8d3772cd4d27bca55ec8cb4c8e576e3bde4dc550" - integrity sha512-Wtl6vH7a+8IS/fU5W9IbOpcaLqKxd5L1DUOzaPmlnCbX1CrG0aWdwVnC3Spn8th0m8D59YbysV5zPUe1n/GJYg== +gulp-postcss@^9.0.1: + version "9.0.1" + resolved "https://registry.yarnpkg.com/gulp-postcss/-/gulp-postcss-9.0.1.tgz#d43caa2f2ce1018f889f7c1296faf82e9928b66f" + integrity sha512-9QUHam5JyXwGUxaaMvoFQVT44tohpEFpM8xBdPfdwTYGM0AItS1iTQz0MpsF8Jroh7GF5Jt2GVPaYgvy8qD2Fw== dependencies: - fancy-log "^1.3.2" + fancy-log "^1.3.3" plugin-error "^1.0.1" - postcss "^7.0.2" - postcss-load-config "^2.0.0" + postcss-load-config "^3.0.0" vinyl-sourcemaps-apply "^0.2.1" gulp-sourcemaps@2.6.5: @@ -17107,10 +17149,10 @@ html-minifier-terser@^5.0.1, html-minifier-terser@^5.1.1: relateurl "^0.2.7" terser "^4.6.3" -html-tags@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-3.1.0.tgz#7b5e6f7e665e9fb41f30007ed9e0d41e97fb2140" - integrity sha512-1qYz89hW3lFDEazhjW0yVAV87lw8lVkrJocr72XmBkMKsoSVJCQx3W8BXsC7hO2qAt8BoVjYjtAcZ9perqGnNg== +html-tags@^3.1.0, html-tags@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-3.2.0.tgz#dbb3518d20b726524e4dd43de397eb0a95726961" + integrity sha512-vy7ClnArOZwCnqZgvv+ddgHgJiAFXe3Ge9ML5/mBctVJoUoYPCdxVucOywjDARn6CVoh3dRSFdPHy2sX80L0Wg== html-to-react@^1.3.4: version "1.4.8" @@ -17154,18 +17196,6 @@ htmlescape@^1.1.0: resolved "https://registry.yarnpkg.com/htmlescape/-/htmlescape-1.1.1.tgz#3a03edc2214bca3b66424a3e7959349509cb0351" integrity sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E= -htmlparser2@^3.10.0: - version "3.10.1" - resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" - integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ== - dependencies: - domelementtype "^1.3.1" - domhandler "^2.3.0" - domutils "^1.5.1" - entities "^1.1.1" - inherits "^2.0.1" - readable-stream "^3.1.1" - htmlparser2@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-4.1.0.tgz#9a4ef161f2e4625ebf7dfbe6c0a2f52d18a59e78" @@ -17412,10 +17442,10 @@ ignore@^4.0.3, ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.0.5, ignore@^5.1.1, ignore@^5.1.4, ignore@^5.1.8: - version "5.1.8" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" - integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== +ignore@^5.0.5, ignore@^5.1.1, ignore@^5.1.4, ignore@^5.1.8, ignore@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" + integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== image-q@^1.1.1: version "1.1.1" @@ -17439,13 +17469,6 @@ immer@^9.0.1, immer@^9.0.6: resolved "https://registry.yarnpkg.com/immer/-/immer-9.0.6.tgz#7a96bf2674d06c8143e327cbf73539388ddf1a73" integrity sha512-G95ivKpy+EvVAnAab4fVa4YGYn24J1SpEktnJX7JJ45Bd7xqME/SCplFzYFmTbrkwZbQ4xJK1xMTUYBkN6pWsQ== -import-cwd@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-2.1.0.tgz#aa6cf36e722761285cb371ec6519f53e2435b0a9" - integrity sha1-qmzzbnInYShcs3HsZRn1PiQ1sKk= - dependencies: - import-from "^2.1.0" - import-fresh@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" @@ -17462,13 +17485,6 @@ import-fresh@^3.0.0, import-fresh@^3.1.0, import-fresh@^3.2.1: parent-module "^1.0.0" resolve-from "^4.0.0" -import-from@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/import-from/-/import-from-2.1.0.tgz#335db7f2a7affd53aaa471d4b8021dee36b7f3b1" - integrity sha1-M1238qev/VOqpHHUuAId7ja387E= - dependencies: - resolve-from "^3.0.0" - import-lazy@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" @@ -19319,7 +19335,7 @@ js-tokens@^4.0.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@3.14.1, js-yaml@^3.13.1, js-yaml@^3.14.1, js-yaml@^3.9.0: +js-yaml@3.14.1, js-yaml@^3.13.1, js-yaml@^3.14.1: version "3.14.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== @@ -19728,10 +19744,10 @@ klona@^2.0.4: resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.4.tgz#7bb1e3affb0cb8624547ef7e8f6708ea2e39dfc0" integrity sha512-ZRbnvdg/NxqzC7L9Uyqzf4psi1OM4Cuc+sJAkQPjO6XkQIJTNbfK2Rsmbw8fx1p2mkZdp2FZYo2+LwXYY/uwIA== -known-css-properties@^0.20.0: - version "0.20.0" - resolved "https://registry.yarnpkg.com/known-css-properties/-/known-css-properties-0.20.0.tgz#0570831661b47dd835293218381166090ff60e96" - integrity sha512-URvsjaA9ypfreqJ2/ylDr5MUERhJZ+DhguoWRr2xgS5C7aGCalXo+ewL+GixgKBfhT2vuL02nbIgNGqVWgTOYw== +known-css-properties@^0.25.0: + version "0.25.0" + resolved "https://registry.yarnpkg.com/known-css-properties/-/known-css-properties-0.25.0.tgz#6ebc4d4b412f602e5cfbeb4086bd544e34c0a776" + integrity sha512-b0/9J1O9Jcyik1GC6KC42hJ41jKwdO/Mq8Mdo5sYN+IuRTXs2YFHZC3kZSx6ueusqa95x3wLYe/ytKjbAfGixA== kuler@^2.0.0: version "2.0.0" @@ -19882,6 +19898,11 @@ liftoff@^3.1.0: rechoir "^0.6.2" resolve "^1.1.7" +lilconfig@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.4.tgz#f4507d043d7058b380b6a8f5cb7bcd4b34cee082" + integrity sha512-bfTIN7lEsiooCocSISTWXkiWJkRqtL9wYtYy+8EK3Y41qh3mpwPU0ycTOgjdY9ErwXCc8QyrQp82bdL0Xkm9yA== + lines-and-columns@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" @@ -20341,7 +20362,7 @@ long@^5.2.0: resolved "https://registry.yarnpkg.com/long/-/long-5.2.0.tgz#2696dadf4b4da2ce3f6f6b89186085d94d52fd61" integrity sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w== -longest-streak@^2.0.0, longest-streak@^2.0.1: +longest-streak@^2.0.1: version "2.0.4" resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-2.0.4.tgz#b8599957da5b5dab64dee3fe316fa774597d90e4" integrity sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg== @@ -20680,17 +20701,6 @@ mdast-util-definitions@^4.0.0: dependencies: unist-util-visit "^2.0.0" -mdast-util-from-markdown@^0.8.0: - version "0.8.4" - resolved "https://registry.yarnpkg.com/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.4.tgz#2882100c1b9fc967d3f83806802f303666682d32" - integrity sha512-jj891B5pV2r63n2kBTFh8cRI2uR9LQHsXG1zSDqfhXkIlDzrTcIlbB5+5aaYEkl8vOPIOPLf8VT7Ere1wWTMdw== - dependencies: - "@types/mdast" "^3.0.0" - mdast-util-to-string "^2.0.0" - micromark "~2.11.0" - parse-entities "^2.0.0" - unist-util-stringify-position "^2.0.0" - mdast-util-to-hast@10.0.1, mdast-util-to-hast@^10.0.0: version "10.0.1" resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-10.0.1.tgz#0cfc82089494c52d46eb0e3edb7a4eb2aea021eb" @@ -20705,28 +20715,11 @@ mdast-util-to-hast@10.0.1, mdast-util-to-hast@^10.0.0: unist-util-position "^3.0.0" unist-util-visit "^2.0.0" -mdast-util-to-markdown@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.1.tgz#0e07d3f871e056bffc38a0cf50c7298b56d9e0d6" - integrity sha512-4qJtZ0qdyYeexAXoOZiU0uHIFVncJAmCkHkSluAsvDaVWODtPyNEo9I1ns0T4ulxu2EHRH5u/bt1cV0pdHCX+A== - dependencies: - "@types/unist" "^2.0.0" - longest-streak "^2.0.0" - mdast-util-to-string "^2.0.0" - parse-entities "^2.0.0" - repeat-string "^1.0.0" - zwitch "^1.0.0" - mdast-util-to-string@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz#27055500103f51637bd07d01da01eb1967a43527" integrity sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A== -mdast-util-to-string@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz#b8cfe6a713e1091cb5b728fc48885a4767f8b97b" - integrity sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w== - mdn-data@2.0.14: version "2.0.14" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50" @@ -20819,23 +20812,6 @@ memory-fs@^0.5.0: errno "^0.1.3" readable-stream "^2.0.1" -meow@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/meow/-/meow-8.0.0.tgz#1aa10ee61046719e334ffdc038bb5069250ec99a" - integrity sha512-nbsTRz2fwniJBFgUkcdISq8y/q9n9VbiHYbfwklFh5V4V2uAcxtKQkDc0yCLPM/kP0d+inZBewn3zJqewHE7kg== - dependencies: - "@types/minimist" "^1.2.0" - camelcase-keys "^6.2.2" - decamelize-keys "^1.1.0" - hard-rejection "^2.1.0" - minimist-options "4.1.0" - normalize-package-data "^3.0.0" - read-pkg-up "^7.0.1" - redent "^3.0.0" - trim-newlines "^3.0.0" - type-fest "^0.18.0" - yargs-parser "^20.2.3" - meow@^9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/meow/-/meow-9.0.0.tgz#cd9510bc5cac9dee7d03c73ee1f9ad959f4ea364" @@ -20871,7 +20847,7 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -merge2@^1.2.3, merge2@^1.3.0: +merge2@^1.2.3, merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== @@ -20891,14 +20867,6 @@ microevent.ts@~0.1.1: resolved "https://registry.yarnpkg.com/microevent.ts/-/microevent.ts-0.1.1.tgz#70b09b83f43df5172d0205a63025bce0f7357fa0" integrity sha512-jo1OfR4TaEwd5HOrt5+tAZ9mqT4jmpNAusXtyfNzqVm9uiSYFZlKM1wYL4oU7azZW/PxQW53wM0S6OR1JHNa2g== -micromark@~2.11.0: - version "2.11.2" - resolved "https://registry.yarnpkg.com/micromark/-/micromark-2.11.2.tgz#e8b6a05f54697d2d3d27fc89600c6bc40dd05f35" - integrity sha512-IXuP76p2uj8uMg4FQc1cRE7lPCLsfAXuEfdjtdO55VRiFO1asrCSQ5g43NmPqFtRwzEnEhafRVzn2jg0UiKArQ== - dependencies: - debug "^4.0.0" - parse-entities "^2.0.0" - micromatch@3.1.10, micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -20918,13 +20886,13 @@ micromatch@3.1.10, micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4: snapdragon "^0.8.1" to-regex "^3.0.2" -micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" - integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== +micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.5: + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== dependencies: - braces "^3.0.1" - picomatch "^2.2.3" + braces "^3.0.2" + picomatch "^2.3.1" microseconds@0.2.0: version "0.2.0" @@ -21448,7 +21416,7 @@ nanoid@3.3.3: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25" integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w== -nanoid@^3.1.23: +nanoid@^3.1.23, nanoid@^3.3.4: version "3.3.4" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== @@ -21728,10 +21696,10 @@ node-preload@^0.2.1: dependencies: process-on-spawn "^1.0.0" -node-releases@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5" - integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA== +node-releases@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.5.tgz#280ed5bc3eba0d96ce44897d8aee478bfb3d9666" + integrity sha512-U9h1NLROZTq9uE1SNffn6WuPDg8icmi3ns4rEl/oTfIle4iLjTliCzgTsbaIFMq/Xn078/lfY/BL0GWZ+psK4Q== node-sass@7.0.1: version "7.0.1" @@ -21834,11 +21802,6 @@ normalize-range@^0.1.2: resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" integrity sha1-LRDAa9/TEuqXd2laTShDlFa3WUI= -normalize-selector@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/normalize-selector/-/normalize-selector-0.2.0.tgz#d0b145eb691189c63a78d201dc4fdb1293ef0c03" - integrity sha1-0LFF62kRicY6eNIB3E/bEpPvDAM= - normalize-url@^3.0.0: version "3.3.0" resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559" @@ -22712,6 +22675,11 @@ parse-ms@^2.1.0: resolved "https://registry.yarnpkg.com/parse-ms/-/parse-ms-2.1.0.tgz#348565a753d4391fa524029956b172cb7753097d" integrity sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA== +parse-node-version@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parse-node-version/-/parse-node-version-1.0.1.tgz#e2b5dbede00e7fa9bc363607f53327e8b073189b" + integrity sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA== + parse-passwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" @@ -22903,10 +22871,10 @@ pdfjs-dist@^2.13.216: dependencies: web-streams-polyfill "^3.2.0" -pdfmake@^0.2.4: - version "0.2.4" - resolved "https://registry.yarnpkg.com/pdfmake/-/pdfmake-0.2.4.tgz#7d58d64b59f8e9b9ed0b2494b17a9d94c575825b" - integrity sha512-EM39waHUe/Dg1W9C3XqYbpx6tfhYyU14JHZlI1HaW0AUEY32GbkRBjDLGWo9f7z/k3ea6k1p9yyDrflnvtZS1A== +pdfmake@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/pdfmake/-/pdfmake-0.2.5.tgz#48b17670d69dae3860a5d8721ff12f7988140613" + integrity sha512-NlayjehMtuZEdw2Lyipf/MxOCR2vATZQ7jn8cH0/dHwsNb+mqof9/6SW4jZT5p+So4qz+0mD21KG81+dDQSEhA== dependencies: "@foliojs-fork/linebreak" "^1.1.1" "@foliojs-fork/pdfkit" "^0.13.0" @@ -22963,10 +22931,10 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" - integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.0, picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== pify@^2.0.0, pify@^2.2.0: version "2.3.0" @@ -23282,37 +23250,13 @@ postcss-flexbugs-fixes@^4.2.1: dependencies: postcss "^7.0.26" -postcss-html@^0.36.0: - version "0.36.0" - resolved "https://registry.yarnpkg.com/postcss-html/-/postcss-html-0.36.0.tgz#b40913f94eaacc2453fd30a1327ad6ee1f88b204" - integrity sha512-HeiOxGcuwID0AFsNAL0ox3mW6MHH5cstWN1Z3Y+n6H+g12ih7LHdYxWwEA/QmrebctLjo79xz9ouK3MroHwOJw== - dependencies: - htmlparser2 "^3.10.0" - -postcss-less@^3.1.4: - version "3.1.4" - resolved "https://registry.yarnpkg.com/postcss-less/-/postcss-less-3.1.4.tgz#369f58642b5928ef898ffbc1a6e93c958304c5ad" - integrity sha512-7TvleQWNM2QLcHqvudt3VYjULVB49uiW6XzEUFmvwHzvsOEF5MwBrIXZDJQvJNFGjJQTzSzZnDoCJ8h/ljyGXA== - dependencies: - postcss "^7.0.14" - -postcss-load-config@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-2.0.0.tgz#f1312ddbf5912cd747177083c5ef7a19d62ee484" - integrity sha512-V5JBLzw406BB8UIfsAWSK2KSwIJ5yoEIVFb4gVkXci0QdKgA24jLmHZ/ghe/GgX0lJ0/D1uUK1ejhzEY94MChQ== - dependencies: - cosmiconfig "^4.0.0" - import-cwd "^2.0.0" - -postcss-loader@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-3.0.0.tgz#6b97943e47c72d845fa9e03f273773d4e8dd6c2d" - integrity sha512-cLWoDEY5OwHcAjDnkyRQzAXfs2jrKjXpO/HQFcc5b5u/r7aa471wdmChmwfnv7x2u840iat/wi0lQ5nbRgSkUA== +postcss-load-config@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-3.1.1.tgz#2f53a17f2f543d9e63864460af42efdac0d41f87" + integrity sha512-c/9XYboIbSEUZpiD1UQD0IKiUe8n9WHYV7YFe7X7J+ZwCsEKkUJSFWjS9hBU1RR9THR7jMXst8sxiqP0jjo2mg== dependencies: - loader-utils "^1.1.0" - postcss "^7.0.0" - postcss-load-config "^2.0.0" - schema-utils "^1.0.0" + lilconfig "^2.0.4" + yaml "^1.10.2" postcss-loader@^4.2.0: version "4.3.0" @@ -23515,12 +23459,10 @@ postcss-ordered-values@^4.1.2: postcss "^7.0.0" postcss-value-parser "^3.0.0" -postcss-prefix-selector@^1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/postcss-prefix-selector/-/postcss-prefix-selector-1.7.2.tgz#3adeed903985734298f19d8f5e0b657f9d90d43c" - integrity sha512-ddmzjWNmGs7E/nyolJ021/Gk6oBLRQLyyXKGV4Mu+Y0gquo+XlXSDP0/Y2J8C/cad/GLyftf2H0XtuDFQZxN3w== - dependencies: - postcss "^7.0.0" +postcss-prefix-selector@^1.16.0: + version "1.16.0" + resolved "https://registry.yarnpkg.com/postcss-prefix-selector/-/postcss-prefix-selector-1.16.0.tgz#ad5b56f9a73a2c090ca7161049632c9d89bcb404" + integrity sha512-rdVMIi7Q4B0XbXqNUEI+Z4E+pueiu/CS5E6vRCQommzdQ/sgsS4dK42U7GX8oJR+TJOtT+Qv3GkNo6iijUMp3Q== postcss-reduce-initial@^4.0.3: version "4.0.3" @@ -23547,27 +23489,15 @@ postcss-resolve-nested-selector@^0.1.1: resolved "https://registry.yarnpkg.com/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz#29ccbc7c37dedfac304e9fff0bf1596b3f6a0e4e" integrity sha1-Kcy8fDfe36wwTp//C/FZaz9qDk4= -postcss-safe-parser@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-safe-parser/-/postcss-safe-parser-4.0.2.tgz#a6d4e48f0f37d9f7c11b2a581bf00f8ba4870b96" - integrity sha512-Uw6ekxSWNLCPesSv/cmqf2bY/77z11O7jZGPax3ycZMFU/oi2DMH9i89AdHc1tRwFg/arFoEwX0IS3LCUxJh1g== - dependencies: - postcss "^7.0.26" - -postcss-sass@^0.4.4: - version "0.4.4" - resolved "https://registry.yarnpkg.com/postcss-sass/-/postcss-sass-0.4.4.tgz#91f0f3447b45ce373227a98b61f8d8f0785285a3" - integrity sha512-BYxnVYx4mQooOhr+zer0qWbSPYnarAy8ZT7hAQtbxtgVf8gy+LSLT/hHGe35h14/pZDTw1DsxdbrwxBN++H+fg== - dependencies: - gonzales-pe "^4.3.0" - postcss "^7.0.21" +postcss-safe-parser@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/postcss-safe-parser/-/postcss-safe-parser-6.0.0.tgz#bb4c29894171a94bc5c996b9a30317ef402adaa1" + integrity sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ== -postcss-scss@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/postcss-scss/-/postcss-scss-2.1.1.tgz#ec3a75fa29a55e016b90bf3269026c53c1d2b383" - integrity sha512-jQmGnj0hSGLd9RscFw9LyuSVAa5Bl1/KBPqG1NQw9w8ND55nY4ZEsdlVuYJvLPpV+y0nwTV5v/4rHPzZRihQbA== - dependencies: - postcss "^7.0.6" +postcss-scss@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/postcss-scss/-/postcss-scss-4.0.4.tgz#aa8f60e19ee18259bc193db9e4b96edfce3f3b1f" + integrity sha512-aBBbVyzA8b3hUL0MGrpydxxXKXFZc5Eqva0Q3V9qsBOLEMsjb6w49WfpsoWzpEgcqJGW4t7Rio8WXVU9Gd8vWg== postcss-selector-parser@^3.0.0: version "3.1.2" @@ -23578,23 +23508,12 @@ postcss-selector-parser@^3.0.0: indexes-of "^1.0.1" uniq "^1.0.1" -postcss-selector-parser@^6.0.0, postcss-selector-parser@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.2.tgz#934cf799d016c83411859e09dcecade01286ec5c" - integrity sha512-36P2QR59jDTOAiIkqEprfJDsoNrvwFei3eCqKd1Y0tUsBimsq39BLp7RD+JWny3WgB1zGhJX8XVePwm9k4wdBg== - dependencies: - cssesc "^3.0.0" - indexes-of "^1.0.1" - uniq "^1.0.1" - -postcss-selector-parser@^6.0.4: - version "6.0.4" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.4.tgz#56075a1380a04604c38b063ea7767a129af5c2b3" - integrity sha512-gjMeXBempyInaBqpp8gODmwZ52WaYsVOsfr4L4lDQ7n3ncD6mEyySiDtgzCT+NYC0mmeOLvtsF8iaEf0YT6dBw== +postcss-selector-parser@^6.0.0, postcss-selector-parser@^6.0.10, postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.6: + version "6.0.10" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz#79b61e2c0d1bfc2602d549e11d0876256f8df88d" + integrity sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w== dependencies: cssesc "^3.0.0" - indexes-of "^1.0.1" - uniq "^1.0.1" util-deprecate "^1.0.2" postcss-svgo@^4.0.3: @@ -23606,11 +23525,6 @@ postcss-svgo@^4.0.3: postcss-value-parser "^3.0.0" svgo "^1.0.0" -postcss-syntax@^0.36.2: - version "0.36.2" - resolved "https://registry.yarnpkg.com/postcss-syntax/-/postcss-syntax-0.36.2.tgz#f08578c7d95834574e5593a82dfbfa8afae3b51c" - integrity sha512-nBRg/i7E3SOHWxF3PpF5WnJM/jQ1YpY9000OaVXlAQj6Zp/kIqJxEDWIZ67tAd7NLuk7zqN4yqe9nc0oNAOs1w== - postcss-unique-selectors@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-4.0.1.tgz#9446911f3289bfd64c6d680f073c03b1f9ee4bac" @@ -23625,21 +23539,12 @@ postcss-value-parser@^3.0.0: resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz#9ff822547e2893213cf1c30efa51ac5fd1ba8281" integrity sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ== -postcss-value-parser@^4.0.0, postcss-value-parser@^4.0.2, postcss-value-parser@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz#443f6a20ced6481a2bda4fa8532a6e55d789a2cb" - integrity sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ== - -postcss@^7.0.0, postcss@^7.0.14, postcss@^7.0.16, postcss@^7.0.2, postcss@^7.0.21, postcss@^7.0.26, postcss@^7.0.32, postcss@^7.0.5, postcss@^7.0.6: - version "7.0.32" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.32.tgz#4310d6ee347053da3433db2be492883d62cec59d" - integrity sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw== - dependencies: - chalk "^2.4.2" - source-map "^0.6.1" - supports-color "^6.1.0" +postcss-value-parser@^4.0.0, postcss-value-parser@^4.0.2, postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" + integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== -postcss@^7.0.1, postcss@^7.0.27, postcss@^7.0.35, postcss@^7.0.36: +postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.16, postcss@^7.0.26, postcss@^7.0.27, postcss@^7.0.32, postcss@^7.0.36, postcss@^7.0.5, postcss@^7.0.6: version "7.0.39" resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.39.tgz#9624375d965630e2e1f2c02a935c82a59cb48309" integrity sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA== @@ -23647,6 +23552,15 @@ postcss@^7.0.1, postcss@^7.0.27, postcss@^7.0.35, postcss@^7.0.36: picocolors "^0.2.1" source-map "^0.6.1" +postcss@^8.4.14: + version "8.4.14" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf" + integrity sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig== + dependencies: + nanoid "^3.3.4" + picocolors "^1.0.0" + source-map-js "^1.0.2" + potpack@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/potpack/-/potpack-1.0.2.tgz#23b99e64eb74f5741ffe7656b5b5c4ddce8dfc14" @@ -24608,11 +24522,6 @@ react-is@^18.0.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.1.0.tgz#61aaed3096d30eacf2a2127118b5b41387d32a67" integrity sha512-Fl7FuabXsJnV5Q1qIOQwx/sagGF18kogb4gpfcG4gjLBWO0WDiiz1ko/ExayuxE7InyQkBLkxRFG5oxY6Uu3Kg== -react-lib-adler32@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/react-lib-adler32/-/react-lib-adler32-1.0.3.tgz#63df1aed274eabcc1c5067077ea281ec30888ba7" - integrity sha512-AqFqdt4cP0RPffHNjVHZ7tyIgnoSzNxgFhG8XKMXCtA1dZ72gTPO4iYFwWDKHqvE8sHS14rhltQTdbXU5G4BFA== - react-lifecycles-compat@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" @@ -25574,13 +25483,6 @@ remark-parse@^5.0.0: vfile-location "^2.0.0" xtend "^4.0.1" -remark-parse@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-9.0.0.tgz#4d20a299665880e4f4af5d90b7c7b8a935853640" - integrity sha512-geKatMwSzEXKHuzBNU1z676sGcDcFoChMK38TgdHJNAYfFtsfHDQG7MoJAjs6sgYMqyLduCYWDIWZIxiPeafEw== - dependencies: - mdast-util-from-markdown "^0.8.0" - remark-rehype@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/remark-rehype/-/remark-rehype-8.0.0.tgz#5a8afc8262a59d205fba21dafb27a673fb3b92fa" @@ -25624,22 +25526,6 @@ remark-stringify@^8.0.3: unherit "^1.0.4" xtend "^4.0.1" -remark-stringify@^9.0.0: - version "9.0.1" - resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-9.0.1.tgz#576d06e910548b0a7191a71f27b33f1218862894" - integrity sha512-mWmNg3ZtESvZS8fv5PTvaPckdL4iNlCHTt8/e/8oN08nArHRHjNZMKzA/YW3+p7/lYqIw4nx1XsjCBo/AxNChg== - dependencies: - mdast-util-to-markdown "^0.6.0" - -remark@^13.0.0: - version "13.0.0" - resolved "https://registry.yarnpkg.com/remark/-/remark-13.0.0.tgz#d15d9bf71a402f40287ebe36067b66d54868e425" - integrity sha512-HDz1+IKGtOyWN+QgBiAT0kn+2s6ovOxHyPAFGKVE81VSzJ+mq7RwHFledEvB5F1p4iJvOah/LOKdFuzvRnNLCA== - dependencies: - remark-parse "^9.0.0" - remark-stringify "^9.0.0" - unified "^9.1.0" - remove-accents@0.4.2: version "0.4.2" resolved "https://registry.yarnpkg.com/remove-accents/-/remove-accents-0.4.2.tgz#0a43d3aaae1e80db919e07ae254b285d9e1c7bb5" @@ -25780,7 +25666,7 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= -require-from-string@^2.0.1, require-from-string@^2.0.2: +require-from-string@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== @@ -26880,6 +26766,11 @@ source-list-map@^2.0.0: resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== +source-map-js@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" + integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== + source-map-resolve@^0.5.0, source-map-resolve@^0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" @@ -27606,13 +27497,6 @@ strip-json-comments@~2.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= -style-it@^2.1.3: - version "2.1.3" - resolved "https://registry.yarnpkg.com/style-it/-/style-it-2.1.3.tgz#ab6b5e109a1e946d58639f8cd05aa52df7ef1ab1" - integrity sha512-QVpYgFoJXhxiuBEok05YTx0WB4AbGkIiMWuCEPLTjFf3tCeB15eqhqMOjJeIsXqZ8REvgsqVuL2u7eoYg0mXJw== - dependencies: - react-lib-adler32 "^1.0.3" - style-loader@^1.1.3, style-loader@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.3.0.tgz#828b4a3b3b7e7aa5847ce7bae9e874512114249e" @@ -27658,70 +27542,62 @@ stylehacks@^4.0.0: postcss "^7.0.0" postcss-selector-parser "^3.0.0" -stylelint-scss@^3.18.0: - version "3.18.0" - resolved "https://registry.yarnpkg.com/stylelint-scss/-/stylelint-scss-3.18.0.tgz#8f06371c223909bf3f62e839548af1badeed31e9" - integrity sha512-LD7+hv/6/ApNGt7+nR/50ft7cezKP2HM5rI8avIdGaUWre3xlHfV4jKO/DRZhscfuN+Ewy9FMhcTq0CcS0C/SA== +stylelint-scss@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/stylelint-scss/-/stylelint-scss-4.3.0.tgz#638800faf823db11fff60d537c81051fe74c90fa" + integrity sha512-GvSaKCA3tipzZHoz+nNO7S02ZqOsdBzMiCx9poSmLlb3tdJlGddEX/8QzCOD8O7GQan9bjsvLMsO5xiw6IhhIQ== dependencies: - lodash "^4.17.15" + lodash "^4.17.21" postcss-media-query-parser "^0.2.3" postcss-resolve-nested-selector "^0.1.1" - postcss-selector-parser "^6.0.2" + postcss-selector-parser "^6.0.6" postcss-value-parser "^4.1.0" -stylelint@13.8.0: - version "13.8.0" - resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-13.8.0.tgz#446765dbe25e3617f819a0165956faf2563ddc23" - integrity sha512-iHH3dv3UI23SLDrH4zMQDjLT9/dDIz/IpoFeuNxZmEx86KtfpjDOscxLTFioQyv+2vQjPlRZnK0UoJtfxLICXQ== +stylelint@^14.9.1: + version "14.9.1" + resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-14.9.1.tgz#6494ed38f148b1e75b402d678a3b6a8aae86dfda" + integrity sha512-RdAkJdPiLqHawCSnu21nE27MjNXaVd4WcOHA4vK5GtIGjScfhNnaOuWR2wWdfKFAvcWQPOYe311iveiVKSmwsA== dependencies: - "@stylelint/postcss-css-in-js" "^0.37.2" - "@stylelint/postcss-markdown" "^0.36.2" - autoprefixer "^9.8.6" - balanced-match "^1.0.0" - chalk "^4.1.0" - cosmiconfig "^7.0.0" - debug "^4.2.0" + "@csstools/selector-specificity" "^2.0.1" + balanced-match "^2.0.0" + colord "^2.9.2" + cosmiconfig "^7.0.1" + css-functions-list "^3.1.0" + debug "^4.3.4" execall "^2.0.0" - fast-glob "^3.2.4" + fast-glob "^3.2.11" fastest-levenshtein "^1.0.12" - file-entry-cache "^6.0.0" + file-entry-cache "^6.0.1" get-stdin "^8.0.0" global-modules "^2.0.0" - globby "^11.0.1" + globby "^11.1.0" globjoin "^0.1.4" - html-tags "^3.1.0" - ignore "^5.1.8" + html-tags "^3.2.0" + ignore "^5.2.0" import-lazy "^4.0.0" imurmurhash "^0.1.4" - known-css-properties "^0.20.0" - lodash "^4.17.20" - log-symbols "^4.0.0" + is-plain-object "^5.0.0" + known-css-properties "^0.25.0" mathml-tag-names "^2.1.3" - meow "^8.0.0" - micromatch "^4.0.2" - normalize-selector "^0.2.0" - postcss "^7.0.35" - postcss-html "^0.36.0" - postcss-less "^3.1.4" + meow "^9.0.0" + micromatch "^4.0.5" + normalize-path "^3.0.0" + picocolors "^1.0.0" + postcss "^8.4.14" postcss-media-query-parser "^0.2.3" postcss-resolve-nested-selector "^0.1.1" - postcss-safe-parser "^4.0.2" - postcss-sass "^0.4.4" - postcss-scss "^2.1.1" - postcss-selector-parser "^6.0.4" - postcss-syntax "^0.36.2" - postcss-value-parser "^4.1.0" + postcss-safe-parser "^6.0.0" + postcss-selector-parser "^6.0.10" + postcss-value-parser "^4.2.0" resolve-from "^5.0.0" - slash "^3.0.0" - specificity "^0.4.1" - string-width "^4.2.0" - strip-ansi "^6.0.0" + string-width "^4.2.3" + strip-ansi "^6.0.1" style-search "^0.1.0" - sugarss "^2.0.0" + supports-hyperlinks "^2.2.0" svg-tags "^1.0.0" - table "^6.0.3" - v8-compile-cache "^2.2.0" - write-file-atomic "^3.0.3" + table "^6.8.0" + v8-compile-cache "^2.3.0" + write-file-atomic "^4.0.1" stylis@3.5.0: version "3.5.0" @@ -27745,13 +27621,6 @@ success-symbol@^0.1.0: resolved "https://registry.yarnpkg.com/success-symbol/-/success-symbol-0.1.0.tgz#24022e486f3bf1cdca094283b769c472d3b72897" integrity sha1-JAIuSG878c3KCUKDt2nEctO3KJc= -sugarss@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/sugarss/-/sugarss-2.0.0.tgz#ddd76e0124b297d40bf3cca31c8b22ecb43bc61d" - integrity sha512-WfxjozUk0UVA4jm+U1d736AUpzSrNsQcIbyOkoE364GrtWmIrFdk5lksEupgWMD4VaT/0kVx1dobpiDumSgmJQ== - dependencies: - postcss "^7.0.2" - superagent@3.8.2: version "3.8.2" resolved "https://registry.yarnpkg.com/superagent/-/superagent-3.8.2.tgz#e4a11b9d047f7d3efeb3bbe536d9ec0021d16403" @@ -27840,10 +27709,10 @@ supports-hyperlinks@^1.0.1: has-flag "^2.0.0" supports-color "^5.0.0" -supports-hyperlinks@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.1.0.tgz#f663df252af5f37c5d49bbd7eeefa9e0b9e59e47" - integrity sha512-zoE5/e+dnEijk6ASB6/qrK+oYdm2do1hjoLWrqUC/8WEIW1gbxFcKuBof7sW8ArN6e+AYvsE8HBGiVRWL/F5CA== +supports-hyperlinks@^2.0.0, supports-hyperlinks@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz#4f77b42488765891774b70c79babd87f9bd594bb" + integrity sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ== dependencies: has-flag "^4.0.0" supports-color "^7.0.0" @@ -27931,17 +27800,16 @@ tabbable@^5.2.1: resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-5.2.1.tgz#e3fda7367ddbb172dcda9f871c0fdb36d1c4cd9c" integrity sha512-40pEZ2mhjaZzK0BnI+QGNjJO8UYx9pP5v7BGe17SORTO0OEuuaAwQTkAp8whcZvqon44wKFOikD+Al11K3JICQ== -table@^6.0.3, table@^6.0.9: - version "6.7.1" - resolved "https://registry.yarnpkg.com/table/-/table-6.7.1.tgz#ee05592b7143831a8c94f3cee6aae4c1ccef33e2" - integrity sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg== +table@^6.0.9, table@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/table/-/table-6.8.0.tgz#87e28f14fa4321c3377ba286f07b79b281a3b3ca" + integrity sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA== dependencies: ajv "^8.0.1" - lodash.clonedeep "^4.5.0" lodash.truncate "^4.4.2" slice-ansi "^4.0.0" - string-width "^4.2.0" - strip-ansi "^6.0.0" + string-width "^4.2.3" + strip-ansi "^6.0.1" tapable@^1.0.0, tapable@^1.1.3: version "1.1.3" @@ -28950,7 +28818,7 @@ unified@^6.1.5: x-is-function "^1.0.4" x-is-string "^0.1.0" -unified@^9.1.0, unified@^9.2.0, unified@^9.2.1: +unified@^9.2.0, unified@^9.2.1: version "9.2.1" resolved "https://registry.yarnpkg.com/unified/-/unified-9.2.1.tgz#ae18d5674c114021bfdbdf73865ca60f410215a3" integrity sha512-juWjuI8Z4xFg8pJbnEZ41b5xjGUWGHqXALmBZ3FC3WX0PIx1CZBIIJ6mXbYMcf6Yw4Fi0rFUTA1cdz/BglbOhA== @@ -29023,13 +28891,6 @@ unist-builder@2.0.3, unist-builder@^2.0.0: resolved "https://registry.yarnpkg.com/unist-builder/-/unist-builder-2.0.3.tgz#77648711b5d86af0942f334397a33c5e91516436" integrity sha512-f98yt5pnlMWlzP539tPc4grGMsFaQQlP/vM396b00jngsiINumNmsY8rkXjfoi1c6QaM8nQ3vaGDuoKWbe/1Uw== -unist-util-find-all-after@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/unist-util-find-all-after/-/unist-util-find-all-after-3.0.2.tgz#fdfecd14c5b7aea5e9ef38d5e0d5f774eeb561f6" - integrity sha512-xaTC/AGZ0rIM2gM28YVRAFPIZpzbpDtU3dRmp7EXlNVA8ziQc4hY3H7BHXM1J49nEmiqc3svnqMReW+PGqbZKQ== - dependencies: - unist-util-is "^4.0.0" - unist-util-generated@^1.0.0: version "1.1.5" resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-1.1.5.tgz#1e903e68467931ebfaea386dae9ea253628acd42" @@ -29184,6 +29045,14 @@ untildify@^4.0.0: resolved "https://registry.yarnpkg.com/untildify/-/untildify-4.0.0.tgz#2bc947b953652487e4600949fb091e3ae8cd919b" integrity sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw== +update-browserslist-db@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.4.tgz#dbfc5a789caa26b1db8990796c2c8ebbce304824" + integrity sha512-jnmO2BEGUjsMOe/Fg9u0oczOe/ppIDZPebzccl1yDWGLFP16Pa1/RM5wEoKYPG2zstNcDuAStejyxsOuKINdGA== + dependencies: + escalade "^3.1.1" + picocolors "^1.0.0" + update-notifier@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-0.5.0.tgz#07b5dc2066b3627ab3b4f530130f7eddda07a4cc" @@ -29457,10 +29326,10 @@ v8-compile-cache-lib@^3.0.0: resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.0.tgz#0582bcb1c74f3a2ee46487ceecf372e46bce53e8" integrity sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA== -v8-compile-cache@^2.0.3, v8-compile-cache@^2.1.1, v8-compile-cache@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz#9471efa3ef9128d2f7c6a7ca39c4dd6b5055b132" - integrity sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q== +v8-compile-cache@^2.0.3, v8-compile-cache@^2.1.1, v8-compile-cache@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" + integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== v8-to-istanbul@^7.0.0: version "7.0.0" @@ -30618,7 +30487,7 @@ write-file-atomic@^1.1.2: imurmurhash "^0.1.4" slide "^1.1.5" -write-file-atomic@^3.0.0, write-file-atomic@^3.0.3: +write-file-atomic@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== @@ -30628,6 +30497,14 @@ write-file-atomic@^3.0.0, write-file-atomic@^3.0.3: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" +write-file-atomic@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.1.tgz#9faa33a964c1c85ff6f849b80b42a88c2c537c8f" + integrity sha512-nSKUxgAbyioruk6hU87QzVbY279oYT6uiwgDoujth2ju4mJ+TZau7SQBhtbTmUyuNYTuXnSyRn66FV0+eCgcrQ== + dependencies: + imurmurhash "^0.1.4" + signal-exit "^3.0.7" + ws@7.4.6, ws@^7.2.3: version "7.4.6" resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" @@ -30791,10 +30668,10 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yaml@^1.10.0, yaml@^1.7.2: - version "1.10.0" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.0.tgz#3b593add944876077d4d683fee01081bd9fff31e" - integrity sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg== +yaml@^1.10.0, yaml@^1.10.2, yaml@^1.7.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" + integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== yargs-parser@20.2.4, yargs-parser@^20.2.3: version "20.2.4"