From adc9ab9c52602d5550e2cdb526c7a717fa2811af Mon Sep 17 00:00:00 2001 From: Walter Rafelsberger Date: Thu, 28 Sep 2023 11:49:13 +0200 Subject: [PATCH 01/61] [ML] AIOps: Enable `event_generating_elements_should_be_instrumented` eslint rule. (#167317) Implements #153108. This enables the `@kbn/telemetry/event_generating_elements_should_be_instrumented` eslint rule for the `aiops` plugin to enforce `data-test-subj` attributes on actionable EUI components so they are auto-instrumented by telemetry. The ids were first auto-created using `node scripts/eslint --fix x-pack/plugins/aiops` and then adapted. --- .eslintrc.js | 1 + .../components/change_point_detection/fields_config.tsx | 3 +++ .../change_point_detection/max_series_control.tsx | 1 + .../log_categorization/category_table/table_header.tsx | 2 ++ .../log_categorization/loading_categorization.tsx | 7 ++++++- .../log_categorization/log_categorization_page.tsx | 7 ++++++- .../sampling_menu/random_sampler_range_slider.tsx | 1 + .../log_categorization/sampling_menu/sampling_menu.tsx | 1 + .../log_rate_analysis/log_rate_analysis_results.tsx | 6 +++++- 9 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 6657ba3cb1f01..4e46336ec70ae 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -908,6 +908,7 @@ module.exports = { }, { files: [ + 'x-pack/plugins/aiops/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/apm/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/exploratory_view/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/infra/**/*.{js,mjs,ts,tsx}', diff --git a/x-pack/plugins/aiops/public/components/change_point_detection/fields_config.tsx b/x-pack/plugins/aiops/public/components/change_point_detection/fields_config.tsx index 45b2ccc1c097a..c07af22a5f16a 100644 --- a/x-pack/plugins/aiops/public/components/change_point_detection/fields_config.tsx +++ b/x-pack/plugins/aiops/public/components/change_point_detection/fields_config.tsx @@ -356,6 +356,7 @@ const FieldPanel: FC = ({ = ({ !prevState)} aria-label={i18n.translate('xpack.aiops.changePointDetection.expandConfigLabel', { @@ -480,6 +482,7 @@ const FieldPanel: FC = ({ id={`panelContextMenu_${panelIndex}`} button={ = ({ <> openInDiscover(QUERY_MODE.INCLUDE)} iconType="plusInCircle" @@ -61,6 +62,7 @@ export const TableHeader: FC = ({ openInDiscover(QUERY_MODE.EXCLUDE)} iconType="minusInCircle" diff --git a/x-pack/plugins/aiops/public/components/log_categorization/loading_categorization.tsx b/x-pack/plugins/aiops/public/components/log_categorization/loading_categorization.tsx index 77ba11fd46cc5..208302083fd0c 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/loading_categorization.tsx +++ b/x-pack/plugins/aiops/public/components/log_categorization/loading_categorization.tsx @@ -43,7 +43,12 @@ export const LoadingCategorization: FC = ({ onClose }) => ( - onClose()}>Cancel + onClose()} + > + Cancel + diff --git a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_page.tsx b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_page.tsx index 5ccdca64d1036..bfa609bb5dd21 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_page.tsx +++ b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_page.tsx @@ -324,7 +324,12 @@ export const LogCategorizationPage: FC = () => { /> ) : ( - cancelRequest()}>Cancel + cancelRequest()} + > + Cancel + )} diff --git a/x-pack/plugins/aiops/public/components/log_categorization/sampling_menu/random_sampler_range_slider.tsx b/x-pack/plugins/aiops/public/components/log_categorization/sampling_menu/random_sampler_range_slider.tsx index 4f2b62729ca46..2cd70b35d139e 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/sampling_menu/random_sampler_range_slider.tsx +++ b/x-pack/plugins/aiops/public/components/log_categorization/sampling_menu/random_sampler_range_slider.tsx @@ -92,6 +92,7 @@ export const RandomSamplerRangeSlider = ({ data-test-subj="dvRandomSamplerProbabilityRange" append={ { if (setSamplingProbability && isDefined(samplingProbabilityInput)) { diff --git a/x-pack/plugins/aiops/public/components/log_categorization/sampling_menu/sampling_menu.tsx b/x-pack/plugins/aiops/public/components/log_categorization/sampling_menu/sampling_menu.tsx index e4d18f6dbc260..c4e16d4fabbe6 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/sampling_menu/sampling_menu.tsx +++ b/x-pack/plugins/aiops/public/components/log_categorization/sampling_menu/sampling_menu.tsx @@ -118,6 +118,7 @@ export const SamplingMenu: FC = ({ randomSampler, reload }) => { id="aiopsSamplingOptions" button={ setShowSamplingOptionsPopover(!showSamplingOptionsPopover)} iconSide="right" iconType="arrowDown" diff --git a/x-pack/plugins/aiops/public/components/log_rate_analysis/log_rate_analysis_results.tsx b/x-pack/plugins/aiops/public/components/log_rate_analysis/log_rate_analysis_results.tsx index f1b1a6d38de12..a62db054d4d52 100644 --- a/x-pack/plugins/aiops/public/components/log_rate_analysis/log_rate_analysis_results.tsx +++ b/x-pack/plugins/aiops/public/components/log_rate_analysis/log_rate_analysis_results.tsx @@ -409,7 +409,11 @@ export const LogRateAnalysisResults: FC = ({ )} {overrides !== undefined ? (

- startHandler(true)}> + startHandler(true)} + > Date: Thu, 28 Sep 2023 11:54:36 +0200 Subject: [PATCH 02/61] Change GPCTL dashboard link (#167466) --- .github/workflows/create-deploy-tag.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-deploy-tag.yml b/.github/workflows/create-deploy-tag.yml index abe2e131165ec..85e226d384cc2 100644 --- a/.github/workflows/create-deploy-tag.yml +++ b/.github/workflows/create-deploy-tag.yml @@ -102,7 +102,7 @@ jobs: "", "", " (use Elastic Cloud Staging VPN)", - "", + "", "" ] - name: Post Slack failure message From c48cc24617df8ebcf78b1d4847bdcbca11e974e8 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Thu, 28 Sep 2023 12:06:00 +0200 Subject: [PATCH 03/61] [kbn/journeys] fixes to run journeys against ESS cluster (#166923) ## Summary I had to change `waitForRender` since `page.waitForFunction` tries to run a script on page and it is not working due to CSP settings on Cloud. Instead of injecting a script, we use a classical API to find elements/attributes in the DOM. Since `PUT /internal/core/_settings` is merged in 8.11.0, journeys run on Cloud with on-fly labels update is supported starting deployments 8.11.0+. I added error message for 404 code just in case someone runs it on earlier version. `many_fields_discover` journey was update since on Cloud the data view used by scenario is not selected by default. How it works: Create a deployment with QAF and re-configure it for journey run: ``` export EC_DEPLOYMENT_NAME=my-run-8.11 qaf elastic-cloud deployments create --stack-version 8.11.0-SNAPSHOT --environment staging --region gcp-us-central1 qaf elastic-cloud deployments configure-for-performance-journeys ``` Run any journey, e.g. many_fields_discover ``` TEST_CLOUD=1 TEST_ES_URL=https://username:pswd@es_url:443 TEST_KIBANA_URL=https://username:pswd@kibana-ur_url node scripts/functional_test_runner --config x-pack/performance/journeys/many_fields_discover.ts ``` You should see a log about labels being updated: ``` Updating telemetry & APM labels: {"testJobId":"local-a3272047-6724-44d1-9a61-5c79781b06a1","testBuildId":"local-d8edbace-f441-4ba9-ac83-5909be3acf2a","journeyName":"many_fields_discover","ftrConfig":"x-pack/performance/journeys/many_fields_discover.ts"} ``` And then able to find APM logs for the journey in [Ops](https://kibana-ops-e2e-perf.kb.us-central1.gcp.cloud.es.io:9243/app/apm/services?comparisonEnabled=true&environment=ENVIRONMENT_ALL&kuery=labels.testJobId%20%3A%20%22local-d79a878c-cc7a-423b-b884-c9b6b1a8d781%22&latencyAggregationType=avg&offset=1d&rangeFrom=now-24h%2Fh&rangeTo=now&serviceGroup=&transactionType=request) cluster --- .../running_performance_journey_in_cloud.mdx | 29 +++++++++-- packages/kbn-journeys/journey/journey.ts | 15 ++---- .../journey/journey_ftr_config.ts | 4 +- .../journey/journey_ftr_harness.ts | 36 +++++++------ packages/kbn-journeys/services/auth.ts | 14 ++---- packages/kbn-journeys/services/es.ts | 20 ++++++++ .../services/ftr_context_provider.ts | 13 +++++ packages/kbn-journeys/services/index.ts | 28 +++++++++++ packages/kbn-journeys/services/page/index.ts | 5 +- .../kbn-journeys/services/page/kibana_page.ts | 50 +++++++++++-------- .../journeys/many_fields_discover.ts | 6 ++- 11 files changed, 159 insertions(+), 61 deletions(-) create mode 100644 packages/kbn-journeys/services/es.ts create mode 100644 packages/kbn-journeys/services/ftr_context_provider.ts create mode 100644 packages/kbn-journeys/services/index.ts diff --git a/dev_docs/tutorials/performance/running_performance_journey_in_cloud.mdx b/dev_docs/tutorials/performance/running_performance_journey_in_cloud.mdx index 3f8b373afad39..6ab160ac93328 100644 --- a/dev_docs/tutorials/performance/running_performance_journey_in_cloud.mdx +++ b/dev_docs/tutorials/performance/running_performance_journey_in_cloud.mdx @@ -11,7 +11,7 @@ tags: ['kibana', 'onboarding', 'setup', 'performance', 'development', 'telemetry As a way to better understand user experience with Kibana in cloud, we support running performance journeys against Cloud deployments. The process takes a few steps: -- Create a cloud deployment +- Create a cloud deployment (8.11.0+ is supported) - Re-configure deployment with APM enabled and reporting metrics to the monitoring cluster - Create a user with `superuser` role to run tests with - Checkout the branch that matches your cloud deployment version @@ -35,7 +35,7 @@ Navigate to `Advanced Edit` page and change `Deployment Configuration` by adding ``` "user_settings_override_json": { "tracing.apm.enabled": "true", - "tracing.apm.environment": "development", + "tracing.apm.agent.environment": "development", "tracing.apm.agent.service_name": "elasticsearch", "tracing.apm.agent.server_url": "", "tracing.apm.agent.metrics_interval": "120s", @@ -50,6 +50,7 @@ Navigate to `Advanced Edit` page and change `Deployment Configuration` by adding ``` "user_settings_override_json": { + "coreApp.allowDynamicConfigOverrides": true, "elastic.apm.active": true, "elastic.apm.breakdownMetrics": false, "elastic.apm.captureBody": "all", @@ -74,8 +75,28 @@ Note: DEPLOYMENT_ID and YOUR_JOURNEY_NAME values are optional labels to find the Save changes and make sure cluster is restarted successfully. +### Use QAF to prepare the deployment +The quickest way to prepare ESS deployment is to use [QAF](https://github.com/elastic/qaf): + +- Make sure to add `~/.elastic/cloud.json` and ~/.elastic/cloud-admin.json with Cloud API (to create deployment) & Cloud Admin API (to modify it) keys +``` +{ + "api_key": { + "production": "", + "staging": "", + "qa": "" + } +} +``` +- Create deployment and modify it +``` +export EC_DEPLOYMENT_NAME=kibana-perf-8.11 +qaf elastic-cloud deployments create --stack-version 8.11.0-SNAPSHOT --environment staging --region gcp-us-central1 +qaf elastic-cloud deployments configure-for-performance-journeys +``` + ### Run the journey -Make sure you have created user with `superuser` role and the Kibana repo branch is matching your deployment version. +Make sure the Kibana repo branch is matching your deployment version. Set env variables to run FTR against your cloud deployment: ``` @@ -90,4 +111,6 @@ Run your journey with the command: node scripts/functional_test_runner.js --config x-pack/performance/journeys/$YOUR_JOURNEY_NAME.ts` ``` +APM & Telemetry labels will be updated on the fly and metrics/traces should be available in Telemetry Staging and kibana-ops-e2e-perf cluster. + diff --git a/packages/kbn-journeys/journey/journey.ts b/packages/kbn-journeys/journey/journey.ts index 7952b8ee7408d..bf3de796265f9 100644 --- a/packages/kbn-journeys/journey/journey.ts +++ b/packages/kbn-journeys/journey/journey.ts @@ -12,14 +12,9 @@ import { Page } from 'playwright'; import callsites from 'callsites'; import { ToolingLog } from '@kbn/tooling-log'; import { FtrConfigProvider } from '@kbn/test'; -import { - FtrProviderContext, - KibanaServer, - Es, - RetryService, -} from '@kbn/ftr-common-functional-services'; - -import { Auth } from '../services/auth'; +import { FtrProviderContext } from '../services/ftr_context_provider'; +import { Es, KibanaServer, Retry, Auth } from '../services'; + import { InputDelays } from '../services/input_delays'; import { KibanaUrl } from '../services/kibana_url'; @@ -37,7 +32,7 @@ export interface BaseStepCtx { kbnUrl: KibanaUrl; kibanaServer: KibanaServer; es: Es; - retry: RetryService; + retry: Retry; auth: Auth; } @@ -141,7 +136,7 @@ export class Journey { getService('kibanaServer'), getService('es'), getService('retry'), - new Auth(getService('config'), getService('log'), getService('kibanaServer')), + getService('auth'), this.config ).initMochaSuite(this.#steps); } diff --git a/packages/kbn-journeys/journey/journey_ftr_config.ts b/packages/kbn-journeys/journey/journey_ftr_config.ts index 1abc141c7bbae..b60f6fa191978 100644 --- a/packages/kbn-journeys/journey/journey_ftr_config.ts +++ b/packages/kbn-journeys/journey/journey_ftr_config.ts @@ -11,7 +11,7 @@ import Path from 'path'; import { v4 as uuidV4 } from 'uuid'; import { REPO_ROOT } from '@kbn/repo-info'; import type { FtrConfigProviderContext, FtrConfigProvider } from '@kbn/test'; -import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; +import { services } from '../services'; import { AnyStep } from './journey'; import { JourneyConfig } from './journey_config'; @@ -66,7 +66,7 @@ export function makeFtrConfigProvider( bail: true, }, - services: commonFunctionalServices, + services, pageObjects: {}, servicesRequiredForTestAnalysis: ['performance', 'journeyConfig'], diff --git a/packages/kbn-journeys/journey/journey_ftr_harness.ts b/packages/kbn-journeys/journey/journey_ftr_harness.ts index 9df84821de032..0f649e7a1de27 100644 --- a/packages/kbn-journeys/journey/journey_ftr_harness.ts +++ b/packages/kbn-journeys/journey/journey_ftr_harness.ts @@ -9,20 +9,19 @@ import Url from 'url'; import { inspect, format } from 'util'; import { setTimeout } from 'timers/promises'; - import * as Rx from 'rxjs'; import apmNode from 'elastic-apm-node'; import playwright, { ChromiumBrowser, Page, BrowserContext, CDPSession, Request } from 'playwright'; import { asyncMap, asyncForEach } from '@kbn/std'; import { ToolingLog } from '@kbn/tooling-log'; import { Config } from '@kbn/test'; -import { EsArchiver, KibanaServer, Es, RetryService } from '@kbn/ftr-common-functional-services'; import { ELASTIC_HTTP_VERSION_HEADER, X_ELASTIC_INTERNAL_ORIGIN_REQUEST, } from '@kbn/core-http-common'; -import { Auth } from '../services/auth'; +import { AxiosError } from 'axios'; +import { Auth, Es, EsArchiver, KibanaServer, Retry } from '../services'; import { getInputDelays } from '../services/input_delays'; import { KibanaUrl } from '../services/kibana_url'; @@ -40,7 +39,7 @@ export class JourneyFtrHarness { private readonly esArchiver: EsArchiver, private readonly kibanaServer: KibanaServer, private readonly es: Es, - private readonly retry: RetryService, + private readonly retry: Retry, private readonly auth: Auth, private readonly journeyConfig: JourneyConfig ) { @@ -63,15 +62,24 @@ export class JourneyFtrHarness { private async updateTelemetryAndAPMLabels(labels: { [k: string]: string }) { this.log.info(`Updating telemetry & APM labels: ${JSON.stringify(labels)}`); - await this.kibanaServer.request({ - path: '/internal/core/_settings', - method: 'PUT', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '1', - [X_ELASTIC_INTERNAL_ORIGIN_REQUEST]: 'ftr', - }, - body: { telemetry: { labels } }, - }); + try { + await this.kibanaServer.request({ + path: '/internal/core/_settings', + method: 'PUT', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '1', + [X_ELASTIC_INTERNAL_ORIGIN_REQUEST]: 'ftr', + }, + body: { telemetry: { labels } }, + }); + } catch (error) { + const statusCode = (error as AxiosError).response?.status; + if (statusCode === 404) { + throw new Error( + `Failed to update labels, supported Kibana version is 8.11.0+ and must be started with "coreApp.allowDynamicConfigOverrides:true"` + ); + } else throw error; + } } private async setupApm() { @@ -385,7 +393,7 @@ export class JourneyFtrHarness { } const isServerlessProject = !!this.config.get('serverless'); - const kibanaPage = getNewPageObject(isServerlessProject, page, this.log); + const kibanaPage = getNewPageObject(isServerlessProject, page, this.log, this.retry); this.#_ctx = this.journeyConfig.getExtendedStepCtx({ kibanaPage, diff --git a/packages/kbn-journeys/services/auth.ts b/packages/kbn-journeys/services/auth.ts index 2a2a9719bd49b..1bc015d9f81cc 100644 --- a/packages/kbn-journeys/services/auth.ts +++ b/packages/kbn-journeys/services/auth.ts @@ -10,9 +10,7 @@ import Url from 'url'; import { format } from 'util'; import axios, { AxiosResponse } from 'axios'; -import { ToolingLog } from '@kbn/tooling-log'; -import { Config } from '@kbn/test'; -import { KibanaServer } from '@kbn/ftr-common-functional-services'; +import { FtrService } from './ftr_context_provider'; export interface Credentials { username: string; @@ -22,12 +20,10 @@ export interface Credentials { function extractCookieValue(authResponse: AxiosResponse) { return authResponse.headers['set-cookie']?.[0].toString().split(';')[0].split('sid=')[1] ?? ''; } -export class Auth { - constructor( - private readonly config: Config, - private readonly log: ToolingLog, - private readonly kibanaServer: KibanaServer - ) {} +export class AuthService extends FtrService { + private readonly config = this.ctx.getService('config'); + private readonly log = this.ctx.getService('log'); + private readonly kibanaServer = this.ctx.getService('kibanaServer'); public async login(credentials?: Credentials) { const baseUrl = new URL( diff --git a/packages/kbn-journeys/services/es.ts b/packages/kbn-journeys/services/es.ts new file mode 100644 index 0000000000000..16ca3079a2ab0 --- /dev/null +++ b/packages/kbn-journeys/services/es.ts @@ -0,0 +1,20 @@ +/* + * 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 { Client } from '@elastic/elasticsearch'; + +import { createEsClientForFtrConfig, ProvidedType } from '@kbn/test'; +import { FtrProviderContext } from './ftr_context_provider'; + +export function EsProvider({ getService }: FtrProviderContext): Client { + const config = getService('config'); + + return createEsClientForFtrConfig(config); +} + +export type Es = ProvidedType; diff --git a/packages/kbn-journeys/services/ftr_context_provider.ts b/packages/kbn-journeys/services/ftr_context_provider.ts new file mode 100644 index 0000000000000..7dd5038ef3f19 --- /dev/null +++ b/packages/kbn-journeys/services/ftr_context_provider.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. + */ + +import { GenericFtrProviderContext, GenericFtrService } from '@kbn/test'; +import { services } from '.'; + +export type FtrProviderContext = GenericFtrProviderContext; +export class FtrService extends GenericFtrService {} diff --git a/packages/kbn-journeys/services/index.ts b/packages/kbn-journeys/services/index.ts new file mode 100644 index 0000000000000..93611e5d5a3f8 --- /dev/null +++ b/packages/kbn-journeys/services/index.ts @@ -0,0 +1,28 @@ +/* + * 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 { commonFunctionalServices, RetryService } from '@kbn/ftr-common-functional-services'; +import { EsArchiverProvider } from '@kbn/ftr-common-functional-services/services/es_archiver'; +import { KibanaServerProvider } from '@kbn/ftr-common-functional-services/services/kibana_server'; +import { ProvidedType } from '@kbn/test'; +import { EsProvider } from './es'; +import { AuthService } from './auth'; + +export const services = { + es: EsProvider, + kibanaServer: commonFunctionalServices.kibanaServer, + esArchiver: commonFunctionalServices.esArchiver, + retry: commonFunctionalServices.retry, + auth: AuthService, +}; + +export type EsArchiver = ProvidedType; +export type KibanaServer = ProvidedType; +export type Es = ProvidedType; +export type Auth = AuthService; +export type Retry = RetryService; diff --git a/packages/kbn-journeys/services/page/index.ts b/packages/kbn-journeys/services/page/index.ts index 6a809eb7480f6..6e0aaafcfdc27 100644 --- a/packages/kbn-journeys/services/page/index.ts +++ b/packages/kbn-journeys/services/page/index.ts @@ -8,9 +8,10 @@ import { ToolingLog } from '@kbn/tooling-log'; import { Page } from 'playwright'; +import { Retry } from '..'; import { KibanaPage } from './kibana_page'; import { ProjectPage } from './project_page'; -export function getNewPageObject(isServerless: boolean, page: Page, log: ToolingLog) { - return isServerless ? new ProjectPage(page, log) : new KibanaPage(page, log); +export function getNewPageObject(isServerless: boolean, page: Page, log: ToolingLog, retry: Retry) { + return isServerless ? new ProjectPage(page, log, retry) : new KibanaPage(page, log, retry); } diff --git a/packages/kbn-journeys/services/page/kibana_page.ts b/packages/kbn-journeys/services/page/kibana_page.ts index 72e595601473a..170e009d0cd29 100644 --- a/packages/kbn-journeys/services/page/kibana_page.ts +++ b/packages/kbn-journeys/services/page/kibana_page.ts @@ -9,6 +9,7 @@ import { subj } from '@kbn/test-subj-selector'; import { ToolingLog } from '@kbn/tooling-log'; import { Page } from 'playwright'; +import { Retry } from '..'; interface WaitForRenderArgs { expectedItemsCount: number; @@ -19,10 +20,12 @@ interface WaitForRenderArgs { export class KibanaPage { readonly page: Page; readonly log: ToolingLog; + readonly retry: Retry; - constructor(page: Page, log: ToolingLog) { + constructor(page: Page, log: ToolingLog, retry: Retry) { this.page = page; this.log = log; + this.retry = retry; } async waitForHeader() { @@ -36,25 +39,32 @@ export class KibanaPage { } async waitForRender({ expectedItemsCount, itemLocator, checkAttribute }: WaitForRenderArgs) { - try { - await this.page.waitForFunction( - function renderCompleted(args: WaitForRenderArgs) { - const renderingItems = Array.from(document.querySelectorAll(args.itemLocator)); - const allItemsLoaded = renderingItems.length === args.expectedItemsCount; - return allItemsLoaded - ? renderingItems.every((e) => e.getAttribute(args.checkAttribute) === 'true') - : false; - }, - { expectedItemsCount, itemLocator, checkAttribute } - ); - } catch (err) { - const loaded = await this.page.$$(itemLocator); - const rendered = await this.page.$$(`${itemLocator}[${checkAttribute}="true"]`); - this.log.error( - `'waitForRendering' failed: loaded - ${loaded.length}, rendered - ${rendered.length}, expected count - ${expectedItemsCount}` - ); - throw err; - } + // we can't use `page.waitForFunction` because of CSP while testing on Cloud + await this.retry.waitFor( + `rendering of ${expectedItemsCount} elements with selector ${itemLocator} is completed`, + async () => { + const renderingItems = await this.page.$$(itemLocator); + if (renderingItems.length === expectedItemsCount) { + // all components are loaded, checking if all are rendered + const renderStatuses = await Promise.all( + renderingItems.map(async (item) => { + return (await item.getAttribute(checkAttribute)) === 'true'; + }) + ); + const rendered = renderStatuses.filter((isRendered) => isRendered === true); + this.log.debug( + `waitForRender: ${rendered.length} out of ${expectedItemsCount} are rendered...` + ); + return rendered.length === expectedItemsCount; + } else { + // not all components are loaded yet + this.log.debug( + `waitForRender: ${renderingItems.length} out of ${expectedItemsCount} are loaded...` + ); + return false; + } + } + ); } async waitForVisualizations(count: number) { diff --git a/x-pack/performance/journeys/many_fields_discover.ts b/x-pack/performance/journeys/many_fields_discover.ts index a37207f6e092d..2a801dea4478f 100644 --- a/x-pack/performance/journeys/many_fields_discover.ts +++ b/x-pack/performance/journeys/many_fields_discover.ts @@ -13,7 +13,11 @@ export const journey = new Journey({ esArchives: ['test/functional/fixtures/es_archiver/many_fields'], }) .step('Go to Discover Page', async ({ page, kbnUrl, kibanaPage }) => { - await page.goto(kbnUrl.get(`/app/discover`)); + await page.goto( + kbnUrl.get( + `/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:60000),time:(from:now-15m,to:now))&_a=(columns:!(),filters:!(),index:'35796250-bb09-11ec-a8e4-a9868e049a39',interval:auto,query:(language:kuery,query:''),sort:!())` + ) + ); await kibanaPage.waitForHeader(); await page.waitForSelector('[data-test-subj="discoverDocTable"][data-render-complete="true"]'); await page.waitForSelector(subj('globalLoadingIndicator-hidden')); From 046718c18f39d87a45846a2e7f48138d5581e13b Mon Sep 17 00:00:00 2001 From: James Gowdy Date: Thu, 28 Sep 2023 11:09:25 +0100 Subject: [PATCH 04/61] [Transforms] Fixing use full data button (#167404) Fixing bug introduced by a merge clash between https://github.com/elastic/kibana/pull/166622 and https://github.com/elastic/kibana/pull/166651 The `hideFrozenDataTierChoice` prop is no longer available in the `FullTimeRangeSelector` component and so the transforms plugin needs to set `showFrozenDataTierChoice` in the data picker context. --- .../components/full_time_range_selector.tsx | 27 ++++++++++++------- .../components/wizard/wizard.tsx | 7 +++-- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/x-pack/packages/ml/date_picker/src/components/full_time_range_selector.tsx b/x-pack/packages/ml/date_picker/src/components/full_time_range_selector.tsx index 20e4ca43e233b..5b2a9d880c1b8 100644 --- a/x-pack/packages/ml/date_picker/src/components/full_time_range_selector.tsx +++ b/x-pack/packages/ml/date_picker/src/components/full_time_range_selector.tsx @@ -109,7 +109,9 @@ export const FullTimeRangeSelector: FC = (props) => toasts, http, query, - showFrozenDataTierChoice ? frozenDataPreference === FROZEN_TIER_PREFERENCE.EXCLUDE : false, + showFrozenDataTierChoice === false + ? false + : frozenDataPreference === FROZEN_TIER_PREFERENCE.EXCLUDE, apiPath ); if (typeof callback === 'function' && fullTimeRange !== undefined) { @@ -192,9 +194,16 @@ export const FullTimeRangeSelector: FC = (props) => [sortOptions, frozenDataPreference, setPreference] ); - const buttonTooltip = useMemo( - () => - frozenDataPreference === FROZEN_TIER_PREFERENCE.EXCLUDE ? ( + const buttonTooltip = useMemo(() => { + if (showFrozenDataTierChoice === false) { + return ( + + ); + } else { + return frozenDataPreference === FROZEN_TIER_PREFERENCE.EXCLUDE ? ( = (props) => id="xpack.ml.datePicker.fullTimeRangeSelector.useFullDataIncludingFrozenButtonTooltip" defaultMessage="Use full range of data including frozen data tier, which might have slower search results." /> - ), - [frozenDataPreference] - ); + ); + } + }, [frozenDataPreference, showFrozenDataTierChoice]); return ( @@ -222,7 +231,7 @@ export const FullTimeRangeSelector: FC = (props) => /> - {showFrozenDataTierChoice ? ( + {showFrozenDataTierChoice === false ? null : ( = (props) => {popoverContent} - ) : null} + )} ); }; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx index a26866452ff3f..b8ee028682bae 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx @@ -12,7 +12,7 @@ import { EuiSteps, EuiStepStatus } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { DataView } from '@kbn/data-views-plugin/public'; -import { DatePickerContextProvider } from '@kbn/ml-date-picker'; +import { DatePickerContextProvider, type DatePickerDependencies } from '@kbn/ml-date-picker'; import { Storage } from '@kbn/kibana-utils-plugin/public'; import { StorageContextProvider } from '@kbn/ml-local-storage'; import { UrlStateProvider } from '@kbn/ml-url-state'; @@ -20,6 +20,7 @@ import { UI_SETTINGS } from '@kbn/data-plugin/common'; import type { FieldStatsServices } from '@kbn/unified-field-list/src/components/field_stats'; import type { RuntimeMappings } from '@kbn/ml-runtime-field-utils'; +import { useEnabledFeatures } from '../../../../serverless_context'; import type { TransformConfigUnion } from '../../../../../../common/types/transform'; import { getCreateTransformRequestBody } from '../../../../common'; @@ -106,6 +107,7 @@ export const CreateTransformWizardContext = createContext<{ }); export const Wizard: FC = React.memo(({ cloneConfig, searchItems }) => { + const { showNodeInfo } = useEnabledFeatures(); const appDependencies = useAppDependencies(); const { ml: { FieldStatsFlyoutProvider }, @@ -226,9 +228,10 @@ export const Wizard: FC = React.memo(({ cloneConfig, searchItems }) const stepsConfig = [stepDefine, stepDetails, stepCreate]; - const datePickerDeps = { + const datePickerDeps: DatePickerDependencies = { ...pick(appDependencies, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']), uiSettingsKeys: UI_SETTINGS, + showFrozenDataTierChoice: showNodeInfo, }; const fieldStatsServices: FieldStatsServices = useMemo( From f8dae67d8d9fc0f41d7f4d5317e596a7fe828dfe Mon Sep 17 00:00:00 2001 From: Julia Bardi <90178898+juliaElastic@users.noreply.github.com> Date: Thu, 28 Sep 2023 12:10:39 +0200 Subject: [PATCH 05/61] fix telemetry test (#167471) Closes https://github.com/elastic/kibana/issues/156245 One test agent went from offline to inactive due to inactivity timeout and broke the tests, instead changed the `last_checkin` to now-6m so it stays in offline state. --- .../server/integration_tests/fleet_usage_telemetry.test.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/fleet/server/integration_tests/fleet_usage_telemetry.test.ts b/x-pack/plugins/fleet/server/integration_tests/fleet_usage_telemetry.test.ts index b841c641c3af4..e2e7e9f7887e6 100644 --- a/x-pack/plugins/fleet/server/integration_tests/fleet_usage_telemetry.test.ts +++ b/x-pack/plugins/fleet/server/integration_tests/fleet_usage_telemetry.test.ts @@ -20,8 +20,7 @@ import { waitForFleetSetup } from './helpers'; const logFilePath = path.join(__dirname, 'logs.log'); -// Failing: See https://github.com/elastic/kibana/issues/156245 -describe.skip('fleet usage telemetry', () => { +describe('fleet usage telemetry', () => { let core: any; let esServer: TestElasticsearchUtils; let kbnServer: TestKibanaUtils; @@ -218,7 +217,7 @@ describe.skip('fleet usage telemetry', () => { version: '8.6.0', }, last_checkin_status: 'online', - last_checkin: '2023-09-13T12:26:24Z', + last_checkin: new Date(Date.now() - 1000 * 60 * 6).toISOString(), active: true, policy_id: 'policy2', }, From 3be21c9e562dbc420d394c253995b696bb4e3147 Mon Sep 17 00:00:00 2001 From: Marco Antonio Ghiani Date: Thu, 28 Sep 2023 12:21:35 +0200 Subject: [PATCH 06/61] [Log Explorer] Implement Data Views tab into selector (#166938) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 📓 Summary Closes #166848 This work adds a new tab to navigate Data View from the Log Explorer selector. In this first iteration, when the user selects a data view, we move into discovering preselecting and loading the data view of choice. **N.B.**: this recording is made on a setup where I have no installed integrations, so having the no integrations panel is the expected behaviour. https://github.com/elastic/kibana/assets/34506779/e8d1f622-86fb-4841-b4cc-4a913067d2cc ## Updated selector state machine Screenshot 2023-09-22 at 12 15 44 ## New DataViews state machine Screenshot 2023-09-22 at 12 39 09 --------- Co-authored-by: Marco Antonio Ghiani Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../common/dataset_selection/index.ts | 2 + .../components/dataset_selector/constants.tsx | 23 ++- .../dataset_selector.stories.tsx | 66 +++++++- .../dataset_selector/dataset_selector.tsx | 91 ++++++++-- .../state_machine/state_machine.ts | 80 +++++++-- .../dataset_selector/state_machine/types.ts | 28 ++- .../state_machine/use_dataset_selector.ts | 31 +++- .../sub_components/data_views_panel_title.tsx | 21 +++ .../sub_components/list_status.tsx | 3 +- .../components/dataset_selector/types.ts | 49 ++++-- .../components/dataset_selector/utils.tsx | 18 ++ .../components/log_explorer/log_explorer.tsx | 27 +-- .../custom_dataset_selector.tsx | 44 ++++- .../customizations/log_explorer_profile.tsx | 10 +- .../public/hooks/use_data_views.tsx | 104 ++++++++++++ x-pack/plugins/log_explorer/public/plugin.ts | 5 +- .../public/state_machines/data_views/index.ts | 8 + .../state_machines/data_views/src/defaults.ts | 20 +++ .../state_machines/data_views/src/index.ts | 9 + .../data_views/src/state_machine.ts | 160 ++++++++++++++++++ .../state_machines/data_views/src/types.ts | 101 +++++++++++ x-pack/plugins/log_explorer/public/types.ts | 4 +- .../public/utils/get_data_view_test_subj.ts | 20 +++ .../public/utils/parse_data_view_list_item.ts | 15 ++ .../common/translations.ts | 2 +- .../dataset_selector.ts | 153 ++++++++++++++++- .../observability_log_explorer.ts | 12 ++ .../dataset_selector.ts | 147 +++++++++++++++- 28 files changed, 1161 insertions(+), 92 deletions(-) create mode 100644 x-pack/plugins/log_explorer/public/components/dataset_selector/sub_components/data_views_panel_title.tsx create mode 100644 x-pack/plugins/log_explorer/public/hooks/use_data_views.tsx create mode 100644 x-pack/plugins/log_explorer/public/state_machines/data_views/index.ts create mode 100644 x-pack/plugins/log_explorer/public/state_machines/data_views/src/defaults.ts create mode 100644 x-pack/plugins/log_explorer/public/state_machines/data_views/src/index.ts create mode 100644 x-pack/plugins/log_explorer/public/state_machines/data_views/src/state_machine.ts create mode 100644 x-pack/plugins/log_explorer/public/state_machines/data_views/src/types.ts create mode 100644 x-pack/plugins/log_explorer/public/utils/get_data_view_test_subj.ts create mode 100644 x-pack/plugins/log_explorer/public/utils/parse_data_view_list_item.ts diff --git a/x-pack/plugins/log_explorer/common/dataset_selection/index.ts b/x-pack/plugins/log_explorer/common/dataset_selection/index.ts index 3284610f53bcc..f390f7a89f87c 100644 --- a/x-pack/plugins/log_explorer/common/dataset_selection/index.ts +++ b/x-pack/plugins/log_explorer/common/dataset_selection/index.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { DataViewListItem } from '@kbn/data-views-plugin/common'; import { AllDatasetSelection } from './all_dataset_selection'; import { SingleDatasetSelection } from './single_dataset_selection'; import { UnresolvedDatasetSelection } from './unresolved_dataset_selection'; @@ -14,6 +15,7 @@ export type DatasetSelection = | SingleDatasetSelection | UnresolvedDatasetSelection; export type DatasetSelectionChange = (datasetSelection: DatasetSelection) => void; +export type DataViewSelection = (dataView: DataViewListItem) => void; export const isDatasetSelection = (input: any): input is DatasetSelection => { return ( diff --git a/x-pack/plugins/log_explorer/public/components/dataset_selector/constants.tsx b/x-pack/plugins/log_explorer/public/components/dataset_selector/constants.tsx index 1cbcd6a0f032a..28a5401f98048 100644 --- a/x-pack/plugins/log_explorer/public/components/dataset_selector/constants.tsx +++ b/x-pack/plugins/log_explorer/public/components/dataset_selector/constants.tsx @@ -12,8 +12,10 @@ export const INTEGRATIONS_PANEL_ID = 'dataset-selector-integrations-panel'; export const INTEGRATIONS_TAB_ID = 'dataset-selector-integrations-tab'; export const UNCATEGORIZED_PANEL_ID = 'dataset-selector-uncategorized-panel'; export const UNCATEGORIZED_TAB_ID = 'dataset-selector-uncategorized-tab'; +export const DATA_VIEWS_PANEL_ID = 'dataset-selector-data-views-panel'; +export const DATA_VIEWS_TAB_ID = 'dataset-selector-data-views-tab'; -export const DATA_VIEW_POPOVER_CONTENT_WIDTH = 300; +export const DATA_VIEW_POPOVER_CONTENT_WIDTH = 400; export const showAllLogsLabel = i18n.translate('xpack.logExplorer.datasetSelector.showAllLogs', { defaultMessage: 'Show all logs', @@ -28,6 +30,14 @@ export const uncategorizedLabel = i18n.translate( { defaultMessage: 'Uncategorized' } ); +export const dataViewsLabel = i18n.translate('xpack.logExplorer.datasetSelector.dataViews', { + defaultMessage: 'Data Views', +}); + +export const openDiscoverLabel = i18n.translate('xpack.logExplorer.datasetSelector.openDiscover', { + defaultMessage: 'Opens in Discover', +}); + export const sortOrdersLabel = i18n.translate('xpack.logExplorer.datasetSelector.sortOrders', { defaultMessage: 'Sort directions', }); @@ -43,6 +53,17 @@ export const noDatasetsDescriptionLabel = i18n.translate( } ); +export const noDataViewsLabel = i18n.translate('xpack.logExplorer.datasetSelector.noDataViews', { + defaultMessage: 'No data views found', +}); + +export const noDataViewsDescriptionLabel = i18n.translate( + 'xpack.logExplorer.datasetSelector.noDataViewsDescription', + { + defaultMessage: 'No data views or search results found.', + } +); + export const noIntegrationsLabel = i18n.translate( 'xpack.logExplorer.datasetSelector.noIntegrations', { defaultMessage: 'No integrations found' } diff --git a/x-pack/plugins/log_explorer/public/components/dataset_selector/dataset_selector.stories.tsx b/x-pack/plugins/log_explorer/public/components/dataset_selector/dataset_selector.stories.tsx index 10bc958c8f2ce..82178164994eb 100644 --- a/x-pack/plugins/log_explorer/public/components/dataset_selector/dataset_selector.stories.tsx +++ b/x-pack/plugins/log_explorer/public/components/dataset_selector/dataset_selector.stories.tsx @@ -11,6 +11,7 @@ import React, { useState } from 'react'; import { I18nProvider } from '@kbn/i18n-react'; import type { Meta, Story } from '@storybook/react'; import { IndexPattern } from '@kbn/io-ts-utils'; +import { DataViewListItem } from '@kbn/data-views-plugin/common'; import { AllDatasetSelection, DatasetSelection, @@ -29,6 +30,10 @@ const meta: Meta = { options: [null, { message: 'Failed to fetch data streams' }], control: { type: 'radio' }, }, + dataViewsError: { + options: [null, { message: 'Failed to fetch data data views' }], + control: { type: 'radio' }, + }, integrationsError: { options: [null, { message: 'Failed to fetch data integrations' }], control: { type: 'radio' }, @@ -71,20 +76,39 @@ const DatasetSelectorTemplate: Story = (args) => { const sortedDatasets = search.sortOrder === 'asc' ? filteredDatasets : filteredDatasets.reverse(); + const filteredDataViews = mockDataViews.filter((dataView) => + dataView.name?.includes(search.name as string) + ); + + const sortedDataViews = + search.sortOrder === 'asc' ? filteredDataViews : filteredDataViews.reverse(); + + const { + datasetsError, + dataViewsError, + integrationsError, + isLoadingDataViews, + isLoadingIntegrations, + isLoadingUncategorized, + } = args; + return ( ); }; @@ -92,12 +116,18 @@ const DatasetSelectorTemplate: Story = (args) => { export const Basic = DatasetSelectorTemplate.bind({}); Basic.args = { datasetsError: null, + dataViewsError: null, integrationsError: null, + isLoadingDataViews: false, isLoadingIntegrations: false, - isLoadingStreams: false, + isLoadingUncategorized: false, + isSearchingIntegrations: false, + onDataViewsReload: () => alert('Reload data views...'), + onDataViewSelection: (dataView) => alert(`Navigate to data view "${dataView.name}"`), + onDataViewsTabClick: () => console.log('Load data views...'), onIntegrationsReload: () => alert('Reload integrations...'), - onStreamsEntryClick: () => console.log('Load uncategorized streams...'), - onUnmanagedStreamsReload: () => alert('Reloading streams...'), + onUncategorizedTabClick: () => console.log('Load uncategorized streams...'), + onUncategorizedReload: () => alert('Reloading streams...'), }; const mockIntegrations: Integration[] = [ @@ -477,3 +507,25 @@ const mockDatasets: Dataset[] = [ { name: 'data-load-balancing-logs-*' as IndexPattern }, { name: 'data-scaling-logs-*' as IndexPattern }, ].map((dataset) => Dataset.create(dataset)); + +const mockDataViews: DataViewListItem[] = [ + { + id: 'logs-*', + namespaces: ['default'], + title: 'logs-*', + name: 'logs-*', + }, + { + id: 'metrics-*', + namespaces: ['default'], + title: 'metrics-*', + name: 'metrics-*', + }, + { + id: '7258d186-6430-4b51-bb67-2603cdfb4652', + namespaces: ['default'], + title: 'synthetics-*', + typeMeta: {}, + name: 'synthetics-dashboard', + }, +]; diff --git a/x-pack/plugins/log_explorer/public/components/dataset_selector/dataset_selector.tsx b/x-pack/plugins/log_explorer/public/components/dataset_selector/dataset_selector.tsx index f9e722effc784..10d8b4c046c9a 100644 --- a/x-pack/plugins/log_explorer/public/components/dataset_selector/dataset_selector.tsx +++ b/x-pack/plugins/log_explorer/public/components/dataset_selector/dataset_selector.tsx @@ -10,6 +10,9 @@ import styled from '@emotion/styled'; import { EuiContextMenu, EuiHorizontalRule, EuiTab, EuiTabs } from '@elastic/eui'; import { useIntersectionRef } from '../../hooks/use_intersection_ref'; import { + dataViewsLabel, + DATA_VIEWS_PANEL_ID, + DATA_VIEWS_TAB_ID, DATA_VIEW_POPOVER_CONTENT_WIDTH, integrationsLabel, INTEGRATIONS_PANEL_ID, @@ -25,19 +28,30 @@ import { SelectorActions } from './sub_components/selector_actions'; import { DatasetSelectorProps } from './types'; import { buildIntegrationsTree, + createDataViewsStatusItem, createIntegrationStatusItem, createUncategorizedStatusItem, } from './utils'; +import { getDataViewTestSubj } from '../../utils/get_data_view_test_subj'; +import { DataViewsPanelTitle } from './sub_components/data_views_panel_title'; export function DatasetSelector({ datasets, - datasetsError, datasetSelection, + datasetsError, + dataViews, + dataViewsError, integrations, integrationsError, + isLoadingDataViews, isLoadingIntegrations, - isLoadingStreams, + isLoadingUncategorized, isSearchingIntegrations, + onDataViewSelection, + onDataViewsReload, + onDataViewsSearch, + onDataViewsSort, + onDataViewsTabClick, onIntegrationsLoadMore, onIntegrationsReload, onIntegrationsSearch, @@ -45,10 +59,10 @@ export function DatasetSelector({ onIntegrationsStreamsSearch, onIntegrationsStreamsSort, onSelectionChange, - onStreamsEntryClick, - onUnmanagedStreamsReload, - onUnmanagedStreamsSearch, - onUnmanagedStreamsSort, + onUncategorizedReload, + onUncategorizedSearch, + onUncategorizedSort, + onUncategorizedTabClick, }: DatasetSelectorProps) { const { panelId, @@ -62,21 +76,26 @@ export function DatasetSelector({ searchByName, selectAllLogDataset, selectDataset, + selectDataView, sortByOrder, switchToIntegrationsTab, switchToUncategorizedTab, + switchToDataViewsTab, togglePopover, } = useDatasetSelector({ initialContext: { selection: datasetSelection }, + onDataViewSelection, + onDataViewsSearch, + onDataViewsSort, onIntegrationsLoadMore, onIntegrationsReload, onIntegrationsSearch, onIntegrationsSort, onIntegrationsStreamsSearch, onIntegrationsStreamsSort, - onUnmanagedStreamsSearch, - onUnmanagedStreamsSort, - onUnmanagedStreamsReload, + onUncategorizedSearch, + onUncategorizedSort, + onUncategorizedReload, onSelectionChange, }); @@ -117,8 +136,8 @@ export function DatasetSelector({ createUncategorizedStatusItem({ data: datasets, error: datasetsError, - isLoading: isLoadingStreams, - onRetry: onUnmanagedStreamsReload, + isLoading: isLoadingUncategorized, + onRetry: onUncategorizedReload, }), ]; } @@ -127,7 +146,26 @@ export function DatasetSelector({ name: dataset.title, onClick: () => selectDataset(dataset), })); - }, [datasets, datasetsError, isLoadingStreams, selectDataset, onUnmanagedStreamsReload]); + }, [datasets, datasetsError, isLoadingUncategorized, selectDataset, onUncategorizedReload]); + + const dataViewsItems = useMemo(() => { + if (!dataViews || dataViews.length === 0) { + return [ + createDataViewsStatusItem({ + data: dataViews, + error: dataViewsError, + isLoading: isLoadingDataViews, + onRetry: onDataViewsReload, + }), + ]; + } + + return dataViews.map((dataView) => ({ + 'data-test-subj': getDataViewTestSubj(dataView.title), + name: dataView.name, + onClick: () => selectDataView(dataView), + })); + }, [dataViews, dataViewsError, isLoadingDataViews, selectDataView, onDataViewsReload]); const tabs = [ { @@ -140,11 +178,20 @@ export function DatasetSelector({ id: UNCATEGORIZED_TAB_ID, name: uncategorizedLabel, onClick: () => { - onStreamsEntryClick(); // Lazy-load uncategorized datasets only when accessing the Uncategorized tab + onUncategorizedTabClick(); // Lazy-load uncategorized datasets only when accessing the Uncategorized tab switchToUncategorizedTab(); }, 'data-test-subj': 'datasetSelectorUncategorizedTab', }, + { + id: DATA_VIEWS_TAB_ID, + name: dataViewsLabel, + onClick: () => { + onDataViewsTabClick(); // Lazy-load data views only when accessing the Data Views tab + switchToDataViewsTab(); + }, + 'data-test-subj': 'datasetSelectorDataViewsTab', + }, ]; const tabEntries = tabs.map((tab) => ( @@ -175,7 +222,7 @@ export function DatasetSelector({ search={search} onSearch={searchByName} onSort={sortByOrder} - isLoading={isSearchingIntegrations || isLoadingStreams} + isLoading={isSearchingIntegrations || isLoadingUncategorized} /> {/* For a smoother user experience, we keep each tab content mount and we only show the select one @@ -215,6 +262,22 @@ export function DatasetSelector({ data-test-subj="uncategorizedContextMenu" size="s" /> + {/* Data views tab content */} +

- - - - - - - - - - - - - - - - - - -
- - ) -); diff --git a/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/layouts/host_layout.tsx b/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/layouts/host_layout.tsx deleted file mode 100644 index 41e0204bc7b29..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/layouts/host_layout.tsx +++ /dev/null @@ -1,376 +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 { EuiPanel } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { withTheme } from '@kbn/kibana-react-plugin/common'; -import React from 'react'; -import type { LayoutPropsWithTheme } from '../../types'; -import { ChartSectionVis } from '../chart_section_vis'; -import { GaugesSectionVis } from '../gauges_section_vis'; -import { MetadataDetails } from '../metadata_details'; -import { Section } from '../section'; -import { SubSection } from '../sub_section'; -import { AwsLayoutSection } from './aws_layout_sections'; -import { NginxLayoutSection } from './nginx_layout_sections'; - -export const HostLayout = withTheme( - ({ metrics, onChangeRangeTime, theme }: LayoutPropsWithTheme) => ( - - - -
- - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
- - -
-
- ) -); diff --git a/x-pack/plugins/infra/public/pages/metrics/metric_detail/metric_detail_page.tsx b/x-pack/plugins/infra/public/pages/metrics/metric_detail/metric_detail_page.tsx index 1f049814a23d3..15425ef618049 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metric_detail/metric_detail_page.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metric_detail/metric_detail_page.tsx @@ -42,7 +42,13 @@ export const MetricDetailPage = () => { loading: metadataLoading, cloudId, metadata, - } = useMetadata(nodeId, nodeType, inventoryModel.requiredMetrics, sourceId, parsedTimeRange); + } = useMetadata({ + assetId: nodeId, + assetType: nodeType, + requiredMetrics: inventoryModel.requiredMetrics, + sourceId, + timeRange: parsedTimeRange, + }); const [sideNav, setSideNav] = useState([]); diff --git a/x-pack/plugins/infra/server/routes/node_details/index.ts b/x-pack/plugins/infra/server/routes/node_details/index.ts index cd92c902a110e..56eccbbe160e9 100644 --- a/x-pack/plugins/infra/server/routes/node_details/index.ts +++ b/x-pack/plugins/infra/server/routes/node_details/index.ts @@ -34,30 +34,46 @@ export const initNodeDetailsRoute = (libs: InfraBackendLibs) => { }, }, async (requestContext, request, response) => { - const { nodeId, cloudId, nodeType, metrics, timerange, sourceId } = pipe( - NodeDetailsRequestRT.decode(request.body), - fold(throwErrors(Boom.badRequest), identity) - ); - const soClient = (await requestContext.core).savedObjects.client; - const source = await libs.sources.getSourceConfiguration(soClient, sourceId); - - UsageCollector.countNode(nodeType); - - const options: InfraMetricsRequestOptions = { - nodeIds: { - nodeId, - cloudId, - }, - nodeType, - sourceConfiguration: source.configuration, - metrics, - timerange, - }; - return response.ok({ - body: NodeDetailsMetricDataResponseRT.encode({ - metrics: await libs.metrics.getMetrics(requestContext, options, request), - }), - }); + try { + const { nodeId, cloudId, nodeType, metrics, timerange, sourceId } = pipe( + NodeDetailsRequestRT.decode(request.body), + fold(throwErrors(Boom.badRequest), identity) + ); + const soClient = (await requestContext.core).savedObjects.client; + const source = await libs.sources.getSourceConfiguration(soClient, sourceId); + + UsageCollector.countNode(nodeType); + + const options: InfraMetricsRequestOptions = { + nodeIds: { + nodeId, + cloudId, + }, + nodeType, + sourceConfiguration: source.configuration, + metrics, + timerange, + }; + return response.ok({ + body: NodeDetailsMetricDataResponseRT.encode({ + metrics: await libs.metrics.getMetrics(requestContext, options, request), + }), + }); + } catch (err) { + if (Boom.isBoom(err)) { + return response.customError({ + statusCode: err.output.statusCode, + body: { message: err.output.payload.message }, + }); + } + + return response.customError({ + statusCode: err.statusCode ?? 500, + body: { + message: err.message ?? 'An unexpected error occurred', + }, + }); + } } ); }; diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 260328513d6c1..b468f00d02466 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -18996,25 +18996,6 @@ "xpack.infra.metadataEmbeddable.setFilterByValueTooltip": "Filtrer par valeur", "xpack.infra.metadataEmbeddable.setRemoveFilterTooltip": "Supprimer le filtre", "xpack.infra.metadataEmbeddable.value": "Valeur", - "xpack.infra.metricDetailPage.awsMetricsLayout.cpuUtilSection.percentSeriesLabel": "pour cent", - "xpack.infra.metricDetailPage.awsMetricsLayout.cpuUtilSection.sectionLabel": "Utilisation CPU", - "xpack.infra.metricDetailPage.awsMetricsLayout.diskioBytesSection.readsSeriesLabel": "lit", - "xpack.infra.metricDetailPage.awsMetricsLayout.diskioBytesSection.sectionLabel": "Octets d'E/S sur le disque", - "xpack.infra.metricDetailPage.awsMetricsLayout.diskioBytesSection.writesSeriesLabel": "écrit", - "xpack.infra.metricDetailPage.awsMetricsLayout.diskioOperationsSection.readsSeriesLabel": "lit", - "xpack.infra.metricDetailPage.awsMetricsLayout.diskioOperationsSection.sectionLabel": "Opérations d'E/S sur le disque", - "xpack.infra.metricDetailPage.awsMetricsLayout.diskioOperationsSection.writesSeriesLabel": "écrit", - "xpack.infra.metricDetailPage.awsMetricsLayout.networkBytesSection.rxSeriesLabel": "entrée", - "xpack.infra.metricDetailPage.awsMetricsLayout.networkBytesSection.sectionLabel": "Trafic réseau", - "xpack.infra.metricDetailPage.awsMetricsLayout.networkBytesSection.txSeriesLabel": "sortie", - "xpack.infra.metricDetailPage.awsMetricsLayout.networkPacketsSection.packetsInSeriesLabel": "entrée", - "xpack.infra.metricDetailPage.awsMetricsLayout.networkPacketsSection.packetsOutSeriesLabel": "sortie", - "xpack.infra.metricDetailPage.awsMetricsLayout.networkPacketsSection.sectionLabel": "Paquets réseau (moyenne)", - "xpack.infra.metricDetailPage.awsMetricsLayout.overviewSection.cpuUtilizationSeriesLabel": "Utilisation CPU", - "xpack.infra.metricDetailPage.awsMetricsLayout.overviewSection.networkPacketsInLabel": "Paquets (entrée)", - "xpack.infra.metricDetailPage.awsMetricsLayout.overviewSection.networkPacketsOutLabel": "Paquets (sortie)", - "xpack.infra.metricDetailPage.awsMetricsLayout.overviewSection.sectionLabel": "Aperçu AWS", - "xpack.infra.metricDetailPage.awsMetricsLayout.overviewSection.statusCheckFailedLabel": "La vérification du statut a échoué", "xpack.infra.metricDetailPage.containerMetricsLayout.cpuUsageSection.sectionLabel": "Utilisation CPU", "xpack.infra.metricDetailPage.containerMetricsLayout.diskIoBytesSection.readRateSeriesLabel": "lit", "xpack.infra.metricDetailPage.containerMetricsLayout.diskIoBytesSection.sectionLabel": "ES sur le disque (octets)", @@ -19039,32 +19020,6 @@ "xpack.infra.metricDetailPage.ec2MetricsLayout.diskIOBytesSection.writeLabel": "écrit", "xpack.infra.metricDetailPage.ec2MetricsLayout.networkTrafficSection.sectionLabel": "Trafic réseau", "xpack.infra.metricDetailPage.ec2MetricsLayout.overviewSection.sectionLabel": "Aperçu EC2 AWS", - "xpack.infra.metricDetailPage.hostMetricsLayout.cpuUsageSection.sectionLabel": "Utilisation CPU", - "xpack.infra.metricDetailPage.hostMetricsLayout.layoutLabel": "Hôte", - "xpack.infra.metricDetailPage.hostMetricsLayout.loadSection.fifteenMinuteSeriesLabel": "15 min", - "xpack.infra.metricDetailPage.hostMetricsLayout.loadSection.fiveMinuteSeriesLabel": "5 min", - "xpack.infra.metricDetailPage.hostMetricsLayout.loadSection.oneMinuteSeriesLabel": "1 min", - "xpack.infra.metricDetailPage.hostMetricsLayout.loadSection.sectionLabel": "Charge", - "xpack.infra.metricDetailPage.hostMetricsLayout.memoryUsageSection.sectionLabel": "Utilisation mémoire", - "xpack.infra.metricDetailPage.hostMetricsLayout.networkTrafficSection.networkRxRateSeriesLabel": "entrée", - "xpack.infra.metricDetailPage.hostMetricsLayout.networkTrafficSection.networkTxRateSeriesLabel": "sortie", - "xpack.infra.metricDetailPage.hostMetricsLayout.networkTrafficSection.sectionLabel": "Trafic réseau", - "xpack.infra.metricDetailPage.hostMetricsLayout.overviewSection.cpuUsageSeriesLabel": "Utilisation CPU", - "xpack.infra.metricDetailPage.hostMetricsLayout.overviewSection.inboundRXSeriesLabel": "Entrant (RX)", - "xpack.infra.metricDetailPage.hostMetricsLayout.overviewSection.loadSeriesLabel": "Charge (5 min)", - "xpack.infra.metricDetailPage.hostMetricsLayout.overviewSection.memoryCapacitySeriesLabel": "Utilisation mémoire", - "xpack.infra.metricDetailPage.hostMetricsLayout.overviewSection.outboundTXSeriesLabel": "Sortant (TX)", - "xpack.infra.metricDetailPage.hostMetricsLayout.overviewSection.sectionLabel": "Aperçu de l'hôte", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.nodeCpuCapacitySection.sectionLabel": "Capacité CPU du nœud", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.nodeDiskCapacitySection.sectionLabel": "Capacité du disque du nœud", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.nodeMemoryCapacitySection.sectionLabel": "Capacité de mémoire du nœud", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.nodePodCapacitySection.sectionLabel": "Capacité de pod du nœud", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.overviewSection.cpuUsageSeriesLabel": "Capacité CPU", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.overviewSection.diskCapacitySeriesLabel": "Capacité du disque", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.overviewSection.loadSeriesLabel": "Charge (5 min)", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.overviewSection.memoryUsageSeriesLabel": "Capacité de mémoire", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.overviewSection.podCapacitySeriesLabel": "Capacité de pod", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.overviewSection.sectionLabel": "Aperçu Kubernetes", "xpack.infra.metricDetailPage.nginxMetricsLayout.activeConnectionsSection.sectionLabel": "Connexions actives", "xpack.infra.metricDetailPage.nginxMetricsLayout.hitsSection.sectionLabel": "Résultats", "xpack.infra.metricDetailPage.nginxMetricsLayout.requestRateSection.sectionLabel": "Taux de requêtes", @@ -39848,4 +39803,4 @@ "xpack.painlessLab.walkthroughButtonLabel": "Présentation", "xpack.serverlessObservability.nav.getStarted": "Démarrer" } -} +} \ No newline at end of file diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index db4e8cc674281..7f59456c6bd14 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -19010,25 +19010,6 @@ "xpack.infra.metadataEmbeddable.setFilterByValueTooltip": "値でフィルタリング", "xpack.infra.metadataEmbeddable.setRemoveFilterTooltip": "フィルターを削除", "xpack.infra.metadataEmbeddable.value": "値", - "xpack.infra.metricDetailPage.awsMetricsLayout.cpuUtilSection.percentSeriesLabel": "パーセント", - "xpack.infra.metricDetailPage.awsMetricsLayout.cpuUtilSection.sectionLabel": "CPU 使用状況", - "xpack.infra.metricDetailPage.awsMetricsLayout.diskioBytesSection.readsSeriesLabel": "読み取り", - "xpack.infra.metricDetailPage.awsMetricsLayout.diskioBytesSection.sectionLabel": "ディスク I/O バイト", - "xpack.infra.metricDetailPage.awsMetricsLayout.diskioBytesSection.writesSeriesLabel": "書き込み", - "xpack.infra.metricDetailPage.awsMetricsLayout.diskioOperationsSection.readsSeriesLabel": "読み取り", - "xpack.infra.metricDetailPage.awsMetricsLayout.diskioOperationsSection.sectionLabel": "ディスク I/O オペレーション", - "xpack.infra.metricDetailPage.awsMetricsLayout.diskioOperationsSection.writesSeriesLabel": "書き込み", - "xpack.infra.metricDetailPage.awsMetricsLayout.networkBytesSection.rxSeriesLabel": "in", - "xpack.infra.metricDetailPage.awsMetricsLayout.networkBytesSection.sectionLabel": "ネットワークトラフィック", - "xpack.infra.metricDetailPage.awsMetricsLayout.networkBytesSection.txSeriesLabel": "出", - "xpack.infra.metricDetailPage.awsMetricsLayout.networkPacketsSection.packetsInSeriesLabel": "in", - "xpack.infra.metricDetailPage.awsMetricsLayout.networkPacketsSection.packetsOutSeriesLabel": "出", - "xpack.infra.metricDetailPage.awsMetricsLayout.networkPacketsSection.sectionLabel": "ネットワークパケット(平均)", - "xpack.infra.metricDetailPage.awsMetricsLayout.overviewSection.cpuUtilizationSeriesLabel": "CPU 使用状況", - "xpack.infra.metricDetailPage.awsMetricsLayout.overviewSection.networkPacketsInLabel": "パケット(受信)", - "xpack.infra.metricDetailPage.awsMetricsLayout.overviewSection.networkPacketsOutLabel": "パケット(送信)", - "xpack.infra.metricDetailPage.awsMetricsLayout.overviewSection.sectionLabel": "AWS概要", - "xpack.infra.metricDetailPage.awsMetricsLayout.overviewSection.statusCheckFailedLabel": "ステータス確認失敗", "xpack.infra.metricDetailPage.containerMetricsLayout.cpuUsageSection.sectionLabel": "CPU使用状況", "xpack.infra.metricDetailPage.containerMetricsLayout.diskIoBytesSection.readRateSeriesLabel": "読み取り", "xpack.infra.metricDetailPage.containerMetricsLayout.diskIoBytesSection.sectionLabel": "ディスク IO(バイト)", @@ -19053,32 +19034,6 @@ "xpack.infra.metricDetailPage.ec2MetricsLayout.diskIOBytesSection.writeLabel": "書き込み", "xpack.infra.metricDetailPage.ec2MetricsLayout.networkTrafficSection.sectionLabel": "ネットワークトラフィック", "xpack.infra.metricDetailPage.ec2MetricsLayout.overviewSection.sectionLabel": "Aws EC2概要", - "xpack.infra.metricDetailPage.hostMetricsLayout.cpuUsageSection.sectionLabel": "CPU使用状況", - "xpack.infra.metricDetailPage.hostMetricsLayout.layoutLabel": "ホスト", - "xpack.infra.metricDetailPage.hostMetricsLayout.loadSection.fifteenMinuteSeriesLabel": "15m", - "xpack.infra.metricDetailPage.hostMetricsLayout.loadSection.fiveMinuteSeriesLabel": "5m", - "xpack.infra.metricDetailPage.hostMetricsLayout.loadSection.oneMinuteSeriesLabel": "1m", - "xpack.infra.metricDetailPage.hostMetricsLayout.loadSection.sectionLabel": "読み込み", - "xpack.infra.metricDetailPage.hostMetricsLayout.memoryUsageSection.sectionLabel": "メモリー使用状況", - "xpack.infra.metricDetailPage.hostMetricsLayout.networkTrafficSection.networkRxRateSeriesLabel": "in", - "xpack.infra.metricDetailPage.hostMetricsLayout.networkTrafficSection.networkTxRateSeriesLabel": "出", - "xpack.infra.metricDetailPage.hostMetricsLayout.networkTrafficSection.sectionLabel": "ネットワークトラフィック", - "xpack.infra.metricDetailPage.hostMetricsLayout.overviewSection.cpuUsageSeriesLabel": "CPU使用状況", - "xpack.infra.metricDetailPage.hostMetricsLayout.overviewSection.inboundRXSeriesLabel": "受信(RX)", - "xpack.infra.metricDetailPage.hostMetricsLayout.overviewSection.loadSeriesLabel": "読み込み(5m)", - "xpack.infra.metricDetailPage.hostMetricsLayout.overviewSection.memoryCapacitySeriesLabel": "メモリー使用状況", - "xpack.infra.metricDetailPage.hostMetricsLayout.overviewSection.outboundTXSeriesLabel": "送信(TX)", - "xpack.infra.metricDetailPage.hostMetricsLayout.overviewSection.sectionLabel": "ホスト概要", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.nodeCpuCapacitySection.sectionLabel": "ノード CPU 処理能力", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.nodeDiskCapacitySection.sectionLabel": "ノードディスク容量", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.nodeMemoryCapacitySection.sectionLabel": "ノードメモリー容量", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.nodePodCapacitySection.sectionLabel": "ノードポッド容量", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.overviewSection.cpuUsageSeriesLabel": "CPU 処理能力", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.overviewSection.diskCapacitySeriesLabel": "ディスク容量", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.overviewSection.loadSeriesLabel": "読み込み(5m)", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.overviewSection.memoryUsageSeriesLabel": "メモリー容量", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.overviewSection.podCapacitySeriesLabel": "ポッド容量", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.overviewSection.sectionLabel": "Kubernetes概要", "xpack.infra.metricDetailPage.nginxMetricsLayout.activeConnectionsSection.sectionLabel": "アクティブな接続", "xpack.infra.metricDetailPage.nginxMetricsLayout.hitsSection.sectionLabel": "ヒット数", "xpack.infra.metricDetailPage.nginxMetricsLayout.requestRateSection.sectionLabel": "リクエストレート", @@ -39839,4 +39794,4 @@ "xpack.painlessLab.walkthroughButtonLabel": "実地検証", "xpack.serverlessObservability.nav.getStarted": "使ってみる" } -} +} \ No newline at end of file diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 68e8ae1196d60..8474d0289c239 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -19010,25 +19010,6 @@ "xpack.infra.metadataEmbeddable.setFilterByValueTooltip": "按值筛选", "xpack.infra.metadataEmbeddable.setRemoveFilterTooltip": "移除筛选", "xpack.infra.metadataEmbeddable.value": "值", - "xpack.infra.metricDetailPage.awsMetricsLayout.cpuUtilSection.percentSeriesLabel": "百分比", - "xpack.infra.metricDetailPage.awsMetricsLayout.cpuUtilSection.sectionLabel": "CPU 使用率", - "xpack.infra.metricDetailPage.awsMetricsLayout.diskioBytesSection.readsSeriesLabel": "读取数", - "xpack.infra.metricDetailPage.awsMetricsLayout.diskioBytesSection.sectionLabel": "磁盘 I/O 字节数", - "xpack.infra.metricDetailPage.awsMetricsLayout.diskioBytesSection.writesSeriesLabel": "写入数", - "xpack.infra.metricDetailPage.awsMetricsLayout.diskioOperationsSection.readsSeriesLabel": "读取数", - "xpack.infra.metricDetailPage.awsMetricsLayout.diskioOperationsSection.sectionLabel": "磁盘 I/O 操作数", - "xpack.infra.metricDetailPage.awsMetricsLayout.diskioOperationsSection.writesSeriesLabel": "写入数", - "xpack.infra.metricDetailPage.awsMetricsLayout.networkBytesSection.rxSeriesLabel": "于", - "xpack.infra.metricDetailPage.awsMetricsLayout.networkBytesSection.sectionLabel": "网络流量", - "xpack.infra.metricDetailPage.awsMetricsLayout.networkBytesSection.txSeriesLabel": "传出", - "xpack.infra.metricDetailPage.awsMetricsLayout.networkPacketsSection.packetsInSeriesLabel": "于", - "xpack.infra.metricDetailPage.awsMetricsLayout.networkPacketsSection.packetsOutSeriesLabel": "传出", - "xpack.infra.metricDetailPage.awsMetricsLayout.networkPacketsSection.sectionLabel": "网络数据包(平均值)", - "xpack.infra.metricDetailPage.awsMetricsLayout.overviewSection.cpuUtilizationSeriesLabel": "CPU 使用率", - "xpack.infra.metricDetailPage.awsMetricsLayout.overviewSection.networkPacketsInLabel": "数据包(传入)", - "xpack.infra.metricDetailPage.awsMetricsLayout.overviewSection.networkPacketsOutLabel": "数据包(传出)", - "xpack.infra.metricDetailPage.awsMetricsLayout.overviewSection.sectionLabel": "AWS 概览", - "xpack.infra.metricDetailPage.awsMetricsLayout.overviewSection.statusCheckFailedLabel": "状态检查失败", "xpack.infra.metricDetailPage.containerMetricsLayout.cpuUsageSection.sectionLabel": "CPU 使用率", "xpack.infra.metricDetailPage.containerMetricsLayout.diskIoBytesSection.readRateSeriesLabel": "读取数", "xpack.infra.metricDetailPage.containerMetricsLayout.diskIoBytesSection.sectionLabel": "磁盘 IO(字节)", @@ -19053,32 +19034,6 @@ "xpack.infra.metricDetailPage.ec2MetricsLayout.diskIOBytesSection.writeLabel": "写入数", "xpack.infra.metricDetailPage.ec2MetricsLayout.networkTrafficSection.sectionLabel": "网络流量", "xpack.infra.metricDetailPage.ec2MetricsLayout.overviewSection.sectionLabel": "Aws EC2 概览", - "xpack.infra.metricDetailPage.hostMetricsLayout.cpuUsageSection.sectionLabel": "CPU 使用率", - "xpack.infra.metricDetailPage.hostMetricsLayout.layoutLabel": "主机", - "xpack.infra.metricDetailPage.hostMetricsLayout.loadSection.fifteenMinuteSeriesLabel": "15 分钟", - "xpack.infra.metricDetailPage.hostMetricsLayout.loadSection.fiveMinuteSeriesLabel": "5 分钟", - "xpack.infra.metricDetailPage.hostMetricsLayout.loadSection.oneMinuteSeriesLabel": "1 分钟", - "xpack.infra.metricDetailPage.hostMetricsLayout.loadSection.sectionLabel": "加载", - "xpack.infra.metricDetailPage.hostMetricsLayout.memoryUsageSection.sectionLabel": "内存利用率", - "xpack.infra.metricDetailPage.hostMetricsLayout.networkTrafficSection.networkRxRateSeriesLabel": "于", - "xpack.infra.metricDetailPage.hostMetricsLayout.networkTrafficSection.networkTxRateSeriesLabel": "传出", - "xpack.infra.metricDetailPage.hostMetricsLayout.networkTrafficSection.sectionLabel": "网络流量", - "xpack.infra.metricDetailPage.hostMetricsLayout.overviewSection.cpuUsageSeriesLabel": "CPU 使用率", - "xpack.infra.metricDetailPage.hostMetricsLayout.overviewSection.inboundRXSeriesLabel": "入站 (RX)", - "xpack.infra.metricDetailPage.hostMetricsLayout.overviewSection.loadSeriesLabel": "负载(5 分钟)", - "xpack.infra.metricDetailPage.hostMetricsLayout.overviewSection.memoryCapacitySeriesLabel": "内存利用率", - "xpack.infra.metricDetailPage.hostMetricsLayout.overviewSection.outboundTXSeriesLabel": "出站 (TX)", - "xpack.infra.metricDetailPage.hostMetricsLayout.overviewSection.sectionLabel": "主机概览", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.nodeCpuCapacitySection.sectionLabel": "节点 CPU 容量", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.nodeDiskCapacitySection.sectionLabel": "节点磁盘容量", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.nodeMemoryCapacitySection.sectionLabel": "节点内存容量", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.nodePodCapacitySection.sectionLabel": "节点 Pod 容量", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.overviewSection.cpuUsageSeriesLabel": "CPU 容量", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.overviewSection.diskCapacitySeriesLabel": "磁盘容量", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.overviewSection.loadSeriesLabel": "负载(5 分钟)", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.overviewSection.memoryUsageSeriesLabel": "内存容量", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.overviewSection.podCapacitySeriesLabel": "Pod 容量", - "xpack.infra.metricDetailPage.kubernetesMetricsLayout.overviewSection.sectionLabel": "Kubernetes 概览", "xpack.infra.metricDetailPage.nginxMetricsLayout.activeConnectionsSection.sectionLabel": "活动连接", "xpack.infra.metricDetailPage.nginxMetricsLayout.hitsSection.sectionLabel": "命中数", "xpack.infra.metricDetailPage.nginxMetricsLayout.requestRateSection.sectionLabel": "请求速率", @@ -39833,4 +39788,4 @@ "xpack.painlessLab.walkthroughButtonLabel": "指导", "xpack.serverlessObservability.nav.getStarted": "开始使用" } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/metrics_ui/metrics.ts b/x-pack/test/api_integration/apis/metrics_ui/metrics.ts index 5e0cff513002e..a1e4552df68fe 100644 --- a/x-pack/test/api_integration/apis/metrics_ui/metrics.ts +++ b/x-pack/test/api_integration/apis/metrics_ui/metrics.ts @@ -15,7 +15,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; import { DATES } from './constants'; -const { min, max } = DATES['7.0.0'].hosts; +const { min, max } = DATES['8.0.0'].pods_only; interface NodeDetailsRequest { metrics: InventoryMetric[]; @@ -31,8 +31,8 @@ export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertest'); describe('metrics', () => { - before(() => esArchiver.load('x-pack/test/functional/es_archives/infra/7.0.0/hosts')); - after(() => esArchiver.unload('x-pack/test/functional/es_archives/infra/7.0.0/hosts')); + before(() => esArchiver.load('x-pack/test/functional/es_archives/infra/8.0.0/pods_only')); + after(() => esArchiver.unload('x-pack/test/functional/es_archives/infra/8.0.0/pods_only')); const fetchNodeDetails = async ( body: NodeDetailsRequest @@ -48,14 +48,14 @@ export default function ({ getService }: FtrProviderContext) { it('should basically work', async () => { const data = fetchNodeDetails({ sourceId: 'default', - metrics: ['hostCpuUsage'], + metrics: ['podCpuUsage'], timerange: { to: max, from: min, interval: '>=1m', }, - nodeId: 'demo-stack-mysql-01', - nodeType: 'host', + nodeId: '7d6d7955-f853-42b1-8613-11f52d0d2725', + nodeType: 'pod', }); return data.then((resp) => { if (!resp) { @@ -63,28 +63,28 @@ export default function ({ getService }: FtrProviderContext) { } expect(resp.metrics.length).to.equal(1); const metric = first(resp.metrics) as any; - expect(metric).to.have.property('id', 'hostCpuUsage'); + expect(metric).to.have.property('id', 'podCpuUsage'); expect(metric).to.have.property('series'); const series = first(metric.series) as any; - expect(series).to.have.property('id', 'user'); + expect(series).to.have.property('id', 'cpu'); expect(series).to.have.property('data'); const datapoint = last(series.data) as any; - expect(datapoint).to.have.property('timestamp', 1547571780000); - expect(datapoint).to.have.property('value', 0.0015); + expect(datapoint).to.have.property('timestamp', 1642698890000); + expect(datapoint).to.have.property('value', 0.544); }); }); it('should support multiple metrics', async () => { const data = fetchNodeDetails({ sourceId: 'default', - metrics: ['hostCpuUsage', 'hostLoad'], + metrics: ['podCpuUsage', 'podMemoryUsage'], timerange: { to: max, from: min, interval: '>=1m', }, - nodeId: 'demo-stack-mysql-01', - nodeType: 'host', + nodeId: '7d6d7955-f853-42b1-8613-11f52d0d2725', + nodeType: 'pod', }); return data.then((resp) => { if (!resp) { @@ -95,28 +95,26 @@ export default function ({ getService }: FtrProviderContext) { }); }); - it('should return multiple values for hostSystemOverview metric', () => { + it('should return multiple values for podOverview metric', () => { const data = fetchNodeDetails({ sourceId: 'default', - metrics: ['hostSystemOverview'], + metrics: ['podOverview'], timerange: { to: max, from: min, interval: '>=1m', }, - nodeId: 'demo-stack-mysql-01', - nodeType: 'host', + nodeId: '7d6d7955-f853-42b1-8613-11f52d0d2725', + nodeType: 'pod', }); return data.then((resp) => { if (!resp) { return; } - const hostSystemOverviewMetric = resp.metrics.find( - (metric) => metric.id === 'hostSystemOverview' - ); + const podOverviewMetric = resp.metrics.find((metric) => metric.id === 'podOverview'); - expect(hostSystemOverviewMetric?.series.length).to.be.greaterThan(1); + expect(podOverviewMetric?.series.length).to.be.greaterThan(1); }); }); }); From b90b2114a04c40b0ee5ebe6c533402309e9af60f Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Thu, 28 Sep 2023 13:17:39 +0200 Subject: [PATCH 08/61] Fix TypeScript issue in x-pack/test (#167488) Follow up to #167343 See: https://github.com/elastic/kibana/pull/167343#discussion_r1339688385 --- x-pack/test/fleet_api_integration/apis/fleet_telemetry.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/fleet_api_integration/apis/fleet_telemetry.ts b/x-pack/test/fleet_api_integration/apis/fleet_telemetry.ts index 3f5c414f46ef8..831659929d86d 100644 --- a/x-pack/test/fleet_api_integration/apis/fleet_telemetry.ts +++ b/x-pack/test/fleet_api_integration/apis/fleet_telemetry.ts @@ -10,6 +10,7 @@ import { X_ELASTIC_INTERNAL_ORIGIN_REQUEST, } from '@kbn/core-http-common'; import expect from '@kbn/expect'; +import type { GetAgentsResponse } from '@kbn/fleet-plugin/common'; import { FtrProviderContext } from '../../api_integration/ftr_provider_context'; import { skipIfNoDockerRegistry, generateAgent } from '../helpers'; import { setupFleetAndAgents } from './agents/services'; @@ -130,7 +131,7 @@ export default function (providerContext: FtrProviderContext) { expectedAgentCount: number, attempts: number, _attemptsMade = 0 - ): Promise { + ): Promise { const { body: apiResponse } = await supertest .get(`/api/fleet/agents?showInactive=true`) .set('kbn-xsrf', 'xxxx') From 92a92fff674d3574cc1f374ce1b0fce4ea383b50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loix?= Date: Thu, 28 Sep 2023 12:20:53 +0100 Subject: [PATCH 09/61] [Cloud] ES endpoint discovery (#167122) --- .github/CODEOWNERS | 1 + .i18nrc.json | 1 + docs/setup/connect-to-elasticsearch.asciidoc | 3 +- package.json | 1 + packages/cloud/README.md | 3 + .../deployment_details/deployment_details.tsx | 81 ++++++++++++ .../deployment_details_cloudid_input.tsx | 46 +++++++ .../deployment_details_es_input.tsx | 48 +++++++ .../deployment_details_modal.tsx | 69 ++++++++++ packages/cloud/deployment_details/index.ts | 11 ++ .../cloud/deployment_details/services.tsx | 123 ++++++++++++++++++ packages/cloud/jest.config.js | 13 ++ packages/cloud/kibana.jsonc | 5 + packages/cloud/package.json | 6 + packages/cloud/tsconfig.json | 21 +++ .../src/ui/header/header_help_menu.tsx | 46 +++++-- .../core-chrome-browser/src/nav_controls.ts | 4 +- tsconfig.base.json | 2 + .../cloud_links/kibana.jsonc | 3 + .../maybe_add_cloud_links/endpoints_modal.tsx | 31 +++++ ...help_menu_links.ts => help_menu_links.tsx} | 36 +++++ .../maybe_add_cloud_links.test.ts | 17 +++ .../maybe_add_cloud_links.ts | 7 +- .../cloud_links/public/plugin.test.ts | 35 +++-- .../cloud_links/public/plugin.tsx | 6 +- .../cloud_links/tsconfig.json | 3 + .../header/deployment_details.component.tsx | 102 --------------- .../header/deployment_details.stories.tsx | 55 -------- .../components/header/deployment_details.tsx | 47 +++++-- x-pack/plugins/fleet/tsconfig.json | 1 + .../translations/translations/fr-FR.json | 2 - .../translations/translations/ja-JP.json | 2 - .../translations/translations/zh-CN.json | 2 - x-pack/test/functional_cloud/config.ts | 3 +- .../functional_cloud/tests/cloud_links.ts | 22 ++++ yarn.lock | 4 + 36 files changed, 663 insertions(+), 199 deletions(-) create mode 100644 packages/cloud/README.md create mode 100644 packages/cloud/deployment_details/deployment_details.tsx create mode 100644 packages/cloud/deployment_details/deployment_details_cloudid_input.tsx create mode 100644 packages/cloud/deployment_details/deployment_details_es_input.tsx create mode 100644 packages/cloud/deployment_details/deployment_details_modal.tsx create mode 100644 packages/cloud/deployment_details/index.ts create mode 100644 packages/cloud/deployment_details/services.tsx create mode 100644 packages/cloud/jest.config.js create mode 100644 packages/cloud/kibana.jsonc create mode 100644 packages/cloud/package.json create mode 100644 packages/cloud/tsconfig.json create mode 100644 x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/endpoints_modal.tsx rename x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/{help_menu_links.ts => help_menu_links.tsx} (53%) delete mode 100644 x-pack/plugins/fleet/public/applications/integrations/components/header/deployment_details.component.tsx delete mode 100644 x-pack/plugins/fleet/public/applications/integrations/components/header/deployment_details.stories.tsx diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index be401c26dc0d2..89f769c0f12ec 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -67,6 +67,7 @@ packages/kbn-ci-stats-performance-metrics @elastic/kibana-operations packages/kbn-ci-stats-reporter @elastic/kibana-operations packages/kbn-ci-stats-shipper-cli @elastic/kibana-operations packages/kbn-cli-dev-mode @elastic/kibana-operations +packages/cloud @elastic/kibana-core x-pack/plugins/cloud_integrations/cloud_chat @elastic/kibana-core x-pack/plugins/cloud_integrations/cloud_chat_provider @elastic/kibana-core x-pack/plugins/cloud_integrations/cloud_data_migration @elastic/platform-onboarding diff --git a/.i18nrc.json b/.i18nrc.json index b5e17c18d3542..4657840019f6c 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -15,6 +15,7 @@ "customIntegrations": "src/plugins/custom_integrations", "customIntegrationsPackage": "packages/kbn-custom-integrations", "dashboard": "src/plugins/dashboard", + "cloud": "packages/cloud", "domDragDrop": "packages/kbn-dom-drag-drop", "controls": "src/plugins/controls", "data": "src/plugins/data", diff --git a/docs/setup/connect-to-elasticsearch.asciidoc b/docs/setup/connect-to-elasticsearch.asciidoc index e271eb6cce5c0..fef9ae71a085b 100644 --- a/docs/setup/connect-to-elasticsearch.asciidoc +++ b/docs/setup/connect-to-elasticsearch.asciidoc @@ -54,8 +54,9 @@ Details for each programming language library that Elastic provides are in the https://www.elastic.co/guide/en/elasticsearch/client/index.html[{es} Client documentation]. If you are running {kib} on our hosted {es} Service, -click *View deployment details* on the *Integrations* view +click *Endpoints* on the *Integrations* view to verify your {es} endpoint and Cloud ID, and create API keys for integration. +Alternatively, the *Endpoints* are also accessible through the top bar help menu. [float] === Add sample data diff --git a/package.json b/package.json index 3b7f8c030fc8f..313ee86a8171d 100644 --- a/package.json +++ b/package.json @@ -173,6 +173,7 @@ "@kbn/chart-expressions-common": "link:src/plugins/chart_expressions/common", "@kbn/chart-icons": "link:packages/kbn-chart-icons", "@kbn/charts-plugin": "link:src/plugins/charts", + "@kbn/cloud": "link:packages/cloud", "@kbn/cloud-chat-plugin": "link:x-pack/plugins/cloud_integrations/cloud_chat", "@kbn/cloud-chat-provider-plugin": "link:x-pack/plugins/cloud_integrations/cloud_chat_provider", "@kbn/cloud-data-migration-plugin": "link:x-pack/plugins/cloud_integrations/cloud_data_migration", diff --git a/packages/cloud/README.md b/packages/cloud/README.md new file mode 100644 index 0000000000000..e387c4b9be959 --- /dev/null +++ b/packages/cloud/README.md @@ -0,0 +1,3 @@ +# @kbn/cloud + +Empty package generated by @kbn/generate diff --git a/packages/cloud/deployment_details/deployment_details.tsx b/packages/cloud/deployment_details/deployment_details.tsx new file mode 100644 index 0000000000000..278709f7b6d32 --- /dev/null +++ b/packages/cloud/deployment_details/deployment_details.tsx @@ -0,0 +1,81 @@ +/* + * 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 React from 'react'; + +import { + EuiForm, + EuiFlexGroup, + EuiFlexItem, + EuiLink, + EuiButtonEmpty, + EuiSpacer, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { useDeploymentDetails } from './services'; +import { DeploymentDetailsEsInput } from './deployment_details_es_input'; +import { DeploymentDetailsCloudIdInput } from './deployment_details_cloudid_input'; + +const hasActiveModifierKey = (event: React.MouseEvent): boolean => { + return event.metaKey || event.altKey || event.ctrlKey || event.shiftKey; +}; + +export const DeploymentDetails = ({ closeModal }: { closeModal?: () => void }) => { + const { cloudId, elasticsearchUrl, managementUrl, learnMoreUrl, navigateToUrl } = + useDeploymentDetails(); + const isInsideModal = !!closeModal; + + if (!cloudId) { + return null; + } + + return ( + + {/* Elastic endpoint */} + {elasticsearchUrl && } + + {/* Cloud ID */} + + + + + {managementUrl && ( + + + {/* eslint-disable-next-line @elastic/eui/href-or-on-click */} + { + if (!hasActiveModifierKey(e)) { + e.preventDefault(); + navigateToUrl(managementUrl); + } + if (closeModal) { + closeModal(); + } + }} + flush="left" + > + {i18n.translate('cloud.deploymentDetails.createManageApiKeysButtonLabel', { + defaultMessage: 'Create and manage API keys', + })} + + + {!isInsideModal && ( + + + {i18n.translate('cloud.deploymentDetails.learnMoreButtonLabel', { + defaultMessage: 'Learn more', + })} + + + )} + + )} + + ); +}; diff --git a/packages/cloud/deployment_details/deployment_details_cloudid_input.tsx b/packages/cloud/deployment_details/deployment_details_cloudid_input.tsx new file mode 100644 index 0000000000000..a749fe4371715 --- /dev/null +++ b/packages/cloud/deployment_details/deployment_details_cloudid_input.tsx @@ -0,0 +1,46 @@ +/* + * 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 React, { type FC } from 'react'; +import { + EuiFormRow, + EuiFieldText, + EuiCopy, + EuiButtonIcon, + EuiFlexGroup, + EuiFlexItem, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +export const DeploymentDetailsCloudIdInput: FC<{ cloudId: string }> = ({ cloudId }) => { + return ( + + + + + + + + {(copy) => ( + + )} + + + + + ); +}; diff --git a/packages/cloud/deployment_details/deployment_details_es_input.tsx b/packages/cloud/deployment_details/deployment_details_es_input.tsx new file mode 100644 index 0000000000000..2998b5bade543 --- /dev/null +++ b/packages/cloud/deployment_details/deployment_details_es_input.tsx @@ -0,0 +1,48 @@ +/* + * 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 React, { type FC } from 'react'; +import { + EuiFormRow, + EuiFieldText, + EuiCopy, + EuiButtonIcon, + EuiFlexGroup, + EuiFlexItem, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +export const DeploymentDetailsEsInput: FC<{ elasticsearchUrl: string }> = ({ + elasticsearchUrl, +}) => { + return ( + + + + + + + + {(copy) => ( + + )} + + + + + ); +}; diff --git a/packages/cloud/deployment_details/deployment_details_modal.tsx b/packages/cloud/deployment_details/deployment_details_modal.tsx new file mode 100644 index 0000000000000..2f3d628c2ca47 --- /dev/null +++ b/packages/cloud/deployment_details/deployment_details_modal.tsx @@ -0,0 +1,69 @@ +/* + * 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 React, { type FC } from 'react'; +import { i18n } from '@kbn/i18n'; +import { + EuiButton, + EuiFlexGroup, + EuiFlexItem, + EuiLink, + EuiModal, + EuiModalBody, + EuiModalFooter, + EuiModalHeader, + EuiModalHeaderTitle, +} from '@elastic/eui'; +import { useDeploymentDetails } from './services'; +import { DeploymentDetails } from './deployment_details'; + +interface Props { + closeModal: () => void; +} + +export const DeploymentDetailsModal: FC = ({ closeModal }) => { + const { learnMoreUrl } = useDeploymentDetails(); + + return ( + { + closeModal(); + }} + style={{ width: 600 }} + data-test-subj="deploymentDetailsModal" + > + + + {i18n.translate('cloud.deploymentDetails.helpMenuLinks.endpoints', { + defaultMessage: 'Endpoints', + })} + + + + + + + + + + {i18n.translate('cloud.deploymentDetails.modal.learnMoreButtonLabel', { + defaultMessage: 'Learn more', + })} + + + + + {i18n.translate('cloud.deploymentDetails.modal.closeButtonLabel', { + defaultMessage: 'Close', + })} + + + + + + ); +}; diff --git a/packages/cloud/deployment_details/index.ts b/packages/cloud/deployment_details/index.ts new file mode 100644 index 0000000000000..2f37291eecd7c --- /dev/null +++ b/packages/cloud/deployment_details/index.ts @@ -0,0 +1,11 @@ +/* + * 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 { DeploymentDetailsKibanaProvider, DeploymentDetailsProvider } from './services'; +export { DeploymentDetails } from './deployment_details'; +export { DeploymentDetailsModal } from './deployment_details_modal'; diff --git a/packages/cloud/deployment_details/services.tsx b/packages/cloud/deployment_details/services.tsx new file mode 100644 index 0000000000000..c4e8be12bb547 --- /dev/null +++ b/packages/cloud/deployment_details/services.tsx @@ -0,0 +1,123 @@ +/* + * 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 React, { FC, useContext } from 'react'; + +export interface DeploymentDetailsContextValue { + cloudId?: string; + elasticsearchUrl?: string; + managementUrl?: string; + learnMoreUrl: string; + navigateToUrl(url: string): Promise; +} + +const DeploymentDetailsContext = React.createContext(null); + +/** + * Abstract external service Provider. + */ +export const DeploymentDetailsProvider: FC = ({ + children, + ...services +}) => { + return ( + + {children} + + ); +}; + +/** + * Kibana-specific service types. + */ +export interface DeploymentDetailsKibanaDependencies { + /** CoreStart contract */ + core: { + application: { + navigateToUrl(url: string): Promise; + }; + }; + /** SharePluginStart contract */ + share: { + url: { + locators: { + get( + id: string + ): undefined | { useUrl: (params: { sectionId: string; appId: string }) => string }; + }; + }; + }; + /** CloudSetup contract */ + cloud: { + isCloudEnabled: boolean; + cloudId?: string; + elasticsearchUrl?: string; + }; + /** DocLinksStart contract */ + docLinks: { + links: { + fleet: { + apiKeysLearnMore: string; + }; + }; + }; +} + +/** + * Kibana-specific Provider that maps to known dependency types. + */ +export const DeploymentDetailsKibanaProvider: FC = ({ + children, + ...services +}) => { + const { + core: { + application: { navigateToUrl }, + }, + cloud: { isCloudEnabled, cloudId, elasticsearchUrl }, + share: { + url: { locators }, + }, + docLinks: { + links: { + fleet: { apiKeysLearnMore }, + }, + }, + } = services; + + const managementUrl = locators + .get('MANAGEMENT_APP_LOCATOR') + ?.useUrl({ sectionId: 'security', appId: 'api_keys' }); + + return ( + + {children} + + ); +}; + +/** + * React hook for accessing pre-wired services. + */ +export function useDeploymentDetails() { + const context = useContext(DeploymentDetailsContext); + + if (!context) { + throw new Error( + 'DeploymentDetailsContext is missing. Ensure your component or React root is wrapped with or .' + ); + } + + return context; +} diff --git a/packages/cloud/jest.config.js b/packages/cloud/jest.config.js new file mode 100644 index 0000000000000..174f01cfc1be6 --- /dev/null +++ b/packages/cloud/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', + rootDir: '../..', + roots: ['/packages/cloud'], +}; diff --git a/packages/cloud/kibana.jsonc b/packages/cloud/kibana.jsonc new file mode 100644 index 0000000000000..e39a0dbe40617 --- /dev/null +++ b/packages/cloud/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-common", + "id": "@kbn/cloud", + "owner": "@elastic/kibana-core" +} diff --git a/packages/cloud/package.json b/packages/cloud/package.json new file mode 100644 index 0000000000000..8e0023dc5c7a3 --- /dev/null +++ b/packages/cloud/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/cloud", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/cloud/tsconfig.json b/packages/cloud/tsconfig.json new file mode 100644 index 0000000000000..c4703bc51cf6c --- /dev/null +++ b/packages/cloud/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/i18n", + ] +} diff --git a/packages/core/chrome/core-chrome-browser-internal/src/ui/header/header_help_menu.tsx b/packages/core/chrome/core-chrome-browser-internal/src/ui/header/header_help_menu.tsx index e1e43d43ab401..5c3d5bb048737 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/ui/header/header_help_menu.tsx +++ b/packages/core/chrome/core-chrome-browser-internal/src/ui/header/header_help_menu.tsx @@ -67,6 +67,7 @@ const buildDefaultContentLinks = ({ defaultMessage: 'Open an issue in GitHub', }), href: docLinks.links.kibana.createGithubIssue, + iconType: 'logoGithub', }, ]; @@ -201,17 +202,40 @@ export class HeaderHelpMenu extends Component { return ( - {defaultContentLinks.map(({ href, title, iconType }, i) => { - const isLast = i === defaultContentLinks.length - 1; - return ( - - - {title} - - {!isLast && } - - ); - })} + {defaultContentLinks.map( + ({ href, title, iconType, onClick: _onClick, dataTestSubj }, i) => { + const isLast = i === defaultContentLinks.length - 1; + + if (href && _onClick) { + throw new Error( + 'Only one of `href` and `onClick` should be provided for the help menu link.' + ); + } + + const hrefProps = href ? { href, target: '_blank' } : {}; + const onClick = () => { + if (!_onClick) return; + _onClick(); + this.closeMenu(); + }; + + return ( + + + {title} + + {!isLast && } + + ); + } + )} ); } diff --git a/packages/core/chrome/core-chrome-browser/src/nav_controls.ts b/packages/core/chrome/core-chrome-browser/src/nav_controls.ts index 39b5d1b3b59b1..22c074862151b 100644 --- a/packages/core/chrome/core-chrome-browser/src/nav_controls.ts +++ b/packages/core/chrome/core-chrome-browser/src/nav_controls.ts @@ -18,8 +18,10 @@ export interface ChromeNavControl { /** @public */ export interface ChromeHelpMenuLink { title: string; - href: string; + href?: string; iconType?: string; + onClick?: () => void; + dataTestSubj?: string; } /** diff --git a/tsconfig.base.json b/tsconfig.base.json index 030b5c9bbed4c..bb2aec9d5819f 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -128,6 +128,8 @@ "@kbn/ci-stats-shipper-cli/*": ["packages/kbn-ci-stats-shipper-cli/*"], "@kbn/cli-dev-mode": ["packages/kbn-cli-dev-mode"], "@kbn/cli-dev-mode/*": ["packages/kbn-cli-dev-mode/*"], + "@kbn/cloud": ["packages/cloud"], + "@kbn/cloud/*": ["packages/cloud/*"], "@kbn/cloud-chat-plugin": ["x-pack/plugins/cloud_integrations/cloud_chat"], "@kbn/cloud-chat-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_chat/*"], "@kbn/cloud-chat-provider-plugin": ["x-pack/plugins/cloud_integrations/cloud_chat_provider"], diff --git a/x-pack/plugins/cloud_integrations/cloud_links/kibana.jsonc b/x-pack/plugins/cloud_integrations/cloud_links/kibana.jsonc index 4b6625f842f79..660f6e64a2446 100644 --- a/x-pack/plugins/cloud_integrations/cloud_links/kibana.jsonc +++ b/x-pack/plugins/cloud_integrations/cloud_links/kibana.jsonc @@ -14,6 +14,9 @@ ], "requiredBundles": [ "kibanaReact" + ], + "requiredPlugins": [ + "share" ] } } diff --git a/x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/endpoints_modal.tsx b/x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/endpoints_modal.tsx new file mode 100644 index 0000000000000..7c6b23d352f1a --- /dev/null +++ b/x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/endpoints_modal.tsx @@ -0,0 +1,31 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React from 'react'; +import type { CoreStart } from '@kbn/core/public'; +import type { DocLinksStart } from '@kbn/core-doc-links-browser'; +import type { CloudStart } from '@kbn/cloud-plugin/public'; +import type { SharePluginStart } from '@kbn/share-plugin/public'; +import { + DeploymentDetailsKibanaProvider, + DeploymentDetailsModal, +} from '@kbn/cloud/deployment_details'; + +interface Props { + closeModal: () => void; + core: CoreStart; + docLinks: DocLinksStart; + cloud: CloudStart; + share: SharePluginStart; +} + +export const EndpointsModal = ({ core, share, cloud, docLinks, closeModal }: Props) => { + return ( + + + + ); +}; diff --git a/x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/help_menu_links.ts b/x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/help_menu_links.tsx similarity index 53% rename from x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/help_menu_links.ts rename to x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/help_menu_links.tsx index 82b0e86e6569a..15270c5876214 100644 --- a/x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/help_menu_links.ts +++ b/x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/help_menu_links.tsx @@ -4,17 +4,32 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import React from 'react'; import { i18n } from '@kbn/i18n'; import { ChromeHelpMenuLink } from '@kbn/core-chrome-browser'; import type { DocLinksStart } from '@kbn/core-doc-links-browser'; +import type { CoreStart } from '@kbn/core/public'; +import type { CloudStart } from '@kbn/cloud-plugin/public'; +import type { SharePluginStart } from '@kbn/share-plugin/public'; +import { toMountPoint } from '@kbn/react-kibana-mount'; + +import { EndpointsModal } from './endpoints_modal'; export const createHelpMenuLinks = ({ docLinks, helpSupportUrl, + core, + cloud, + share, }: { docLinks: DocLinksStart; + core: CoreStart; + cloud: CloudStart; + share: SharePluginStart; helpSupportUrl: string; }) => { + const { overlays } = core; + const helpMenuLinks: ChromeHelpMenuLink[] = [ { title: i18n.translate('xpack.cloudLinks.helpMenuLinks.documentation', { @@ -34,6 +49,27 @@ export const createHelpMenuLinks = ({ }), href: docLinks.links.kibana.feedback, }, + { + title: i18n.translate('xpack.cloudLinks.helpMenuLinks.endpoints', { + defaultMessage: 'Endpoints', + }), + iconType: 'console', + dataTestSubj: 'endpointsHelpLink', + onClick: () => { + const modal = overlays.openModal( + toMountPoint( + modal.close()} + />, + { theme: core.theme, i18n: core.i18n } + ) + ); + }, + }, ]; return helpMenuLinks; diff --git a/x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/maybe_add_cloud_links.test.ts b/x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/maybe_add_cloud_links.test.ts index b9045fdc9a59f..d680d6cce4f4f 100644 --- a/x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/maybe_add_cloud_links.test.ts +++ b/x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/maybe_add_cloud_links.test.ts @@ -8,6 +8,7 @@ import { cloudMock } from '@kbn/cloud-plugin/public/mocks'; import { coreMock } from '@kbn/core/public/mocks'; import { securityMock } from '@kbn/security-plugin/public/mocks'; +import { sharePluginMock } from '@kbn/share-plugin/public/mocks'; import { maybeAddCloudLinks } from './maybe_add_cloud_links'; @@ -18,6 +19,7 @@ describe('maybeAddCloudLinks', () => { maybeAddCloudLinks({ core, security, + share: sharePluginMock.createStartContract(), cloud: { ...cloudMock.createStart(), isCloudEnabled: false }, }); // Since there's a promise, let's wait for the next tick @@ -35,6 +37,7 @@ describe('maybeAddCloudLinks', () => { maybeAddCloudLinks({ security, core, + share: sharePluginMock.createStartContract(), cloud: { ...cloudMock.createStart(), isCloudEnabled: true }, }); // Since there's a promise, let's wait for the next tick @@ -90,6 +93,12 @@ describe('maybeAddCloudLinks', () => { "href": "https://www.elastic.co/products/kibana/feedback?blade=kibanafeedback", "title": "Give feedback", }, + Object { + "dataTestSubj": "endpointsHelpLink", + "iconType": "console", + "onClick": [Function], + "title": "Endpoints", + }, ], ] `); @@ -103,6 +112,7 @@ describe('maybeAddCloudLinks', () => { maybeAddCloudLinks({ security, core, + share: sharePluginMock.createStartContract(), cloud: { ...cloudMock.createStart(), isCloudEnabled: true }, }); // Since there's a promise, let's wait for the next tick @@ -157,6 +167,12 @@ describe('maybeAddCloudLinks', () => { "href": "https://www.elastic.co/products/kibana/feedback?blade=kibanafeedback", "title": "Give feedback", }, + Object { + "dataTestSubj": "endpointsHelpLink", + "iconType": "console", + "onClick": [Function], + "title": "Endpoints", + }, ], ] `); @@ -172,6 +188,7 @@ describe('maybeAddCloudLinks', () => { maybeAddCloudLinks({ security, core, + share: sharePluginMock.createStartContract(), cloud: { ...cloudMock.createStart(), isCloudEnabled: true }, }); // Since there's a promise, let's wait for the next tick diff --git a/x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/maybe_add_cloud_links.ts b/x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/maybe_add_cloud_links.ts index 33fb4df7bfce2..2772c87d124d3 100644 --- a/x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/maybe_add_cloud_links.ts +++ b/x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/maybe_add_cloud_links.ts @@ -11,6 +11,7 @@ import { i18n } from '@kbn/i18n'; import type { CloudStart } from '@kbn/cloud-plugin/public'; import type { CoreStart } from '@kbn/core/public'; import type { SecurityPluginStart } from '@kbn/security-plugin/public'; +import type { SharePluginStart } from '@kbn/share-plugin/public'; import { createUserMenuLinks } from './user_menu_links'; import { createHelpMenuLinks } from './help_menu_links'; @@ -18,9 +19,10 @@ export interface MaybeAddCloudLinksDeps { core: CoreStart; security: SecurityPluginStart; cloud: CloudStart; + share: SharePluginStart; } -export function maybeAddCloudLinks({ core, security, cloud }: MaybeAddCloudLinksDeps): void { +export function maybeAddCloudLinks({ core, security, cloud, share }: MaybeAddCloudLinksDeps): void { const userObservable = defer(() => security.authc.getCurrentUser()).pipe( // Check if user is a cloud user. map((user) => user.elastic_cloud_user), @@ -54,6 +56,9 @@ export function maybeAddCloudLinks({ core, security, cloud }: MaybeAddCloudLinks const helpMenuLinks = createHelpMenuLinks({ docLinks: core.docLinks, helpSupportUrl, + core, + share, + cloud, }); core.chrome.setHelpMenuLinks(helpMenuLinks); diff --git a/x-pack/plugins/cloud_integrations/cloud_links/public/plugin.test.ts b/x-pack/plugins/cloud_integrations/cloud_links/public/plugin.test.ts index d928b7a6f0e8a..d2f987337a440 100644 --- a/x-pack/plugins/cloud_integrations/cloud_links/public/plugin.test.ts +++ b/x-pack/plugins/cloud_integrations/cloud_links/public/plugin.test.ts @@ -11,6 +11,7 @@ import { coreMock } from '@kbn/core/public/mocks'; import { cloudMock } from '@kbn/cloud-plugin/public/mocks'; import { securityMock } from '@kbn/security-plugin/public/mocks'; import { guidedOnboardingMock } from '@kbn/guided-onboarding-plugin/public/mocks'; +import { sharePluginMock } from '@kbn/share-plugin/public/mocks'; describe('Cloud Links Plugin - public', () => { let plugin: CloudLinksPlugin; @@ -40,7 +41,11 @@ describe('Cloud Links Plugin - public', () => { coreStart.http.anonymousPaths.isAnonymous.mockReturnValue(false); const cloud = { ...cloudMock.createStart(), isCloudEnabled: true }; - plugin.start(coreStart, { cloud, guidedOnboarding }); + plugin.start(coreStart, { + cloud, + guidedOnboarding, + share: sharePluginMock.createStartContract(), + }); expect(coreStart.chrome.registerGlobalHelpExtensionMenuLink).toHaveBeenCalledTimes(1); }); @@ -48,14 +53,22 @@ describe('Cloud Links Plugin - public', () => { const coreStart = coreMock.createStart(); coreStart.http.anonymousPaths.isAnonymous.mockReturnValue(true); const cloud = { ...cloudMock.createStart(), isCloudEnabled: true }; - plugin.start(coreStart, { cloud, guidedOnboarding }); + plugin.start(coreStart, { + cloud, + guidedOnboarding, + share: sharePluginMock.createStartContract(), + }); expect(coreStart.chrome.registerGlobalHelpExtensionMenuLink).not.toHaveBeenCalled(); }); test('does not register the Onboarding Setup Guide link when cloud is not enabled', () => { const coreStart = coreMock.createStart(); const cloud = { ...cloudMock.createStart(), isCloudEnabled: false }; - plugin.start(coreStart, { cloud, guidedOnboarding }); + plugin.start(coreStart, { + cloud, + guidedOnboarding, + share: sharePluginMock.createStartContract(), + }); expect(coreStart.chrome.registerGlobalHelpExtensionMenuLink).not.toHaveBeenCalled(); }); }); @@ -72,7 +85,11 @@ describe('Cloud Links Plugin - public', () => { coreStart.http.anonymousPaths.isAnonymous.mockReturnValue(false); const cloud = { ...cloudMock.createStart(), isCloudEnabled: true }; - plugin.start(coreStart, { cloud, guidedOnboarding }); + plugin.start(coreStart, { + cloud, + guidedOnboarding, + share: sharePluginMock.createStartContract(), + }); expect(coreStart.chrome.registerGlobalHelpExtensionMenuLink).not.toHaveBeenCalled(); }); }); @@ -83,7 +100,7 @@ describe('Cloud Links Plugin - public', () => { coreStart.http.anonymousPaths.isAnonymous.mockReturnValue(false); const cloud = { ...cloudMock.createStart(), isCloudEnabled: true }; const security = securityMock.createStart(); - plugin.start(coreStart, { cloud, security }); + plugin.start(coreStart, { cloud, security, share: sharePluginMock.createStartContract() }); expect(maybeAddCloudLinksMock).toHaveBeenCalledTimes(1); }); @@ -91,7 +108,7 @@ describe('Cloud Links Plugin - public', () => { const coreStart = coreMock.createStart(); coreStart.http.anonymousPaths.isAnonymous.mockReturnValue(false); const cloud = { ...cloudMock.createStart(), isCloudEnabled: true }; - plugin.start(coreStart, { cloud }); + plugin.start(coreStart, { cloud, share: sharePluginMock.createStartContract() }); expect(maybeAddCloudLinksMock).toHaveBeenCalledTimes(0); }); @@ -100,7 +117,7 @@ describe('Cloud Links Plugin - public', () => { coreStart.http.anonymousPaths.isAnonymous.mockReturnValue(true); const cloud = { ...cloudMock.createStart(), isCloudEnabled: true }; const security = securityMock.createStart(); - plugin.start(coreStart, { cloud, security }); + plugin.start(coreStart, { cloud, security, share: sharePluginMock.createStartContract() }); expect(maybeAddCloudLinksMock).toHaveBeenCalledTimes(0); }); @@ -108,7 +125,7 @@ describe('Cloud Links Plugin - public', () => { const coreStart = coreMock.createStart(); coreStart.http.anonymousPaths.isAnonymous.mockReturnValue(false); const security = securityMock.createStart(); - plugin.start(coreStart, { security }); + plugin.start(coreStart, { security, share: sharePluginMock.createStartContract() }); expect(maybeAddCloudLinksMock).toHaveBeenCalledTimes(0); }); @@ -117,7 +134,7 @@ describe('Cloud Links Plugin - public', () => { coreStart.http.anonymousPaths.isAnonymous.mockReturnValue(false); const cloud = { ...cloudMock.createStart(), isCloudEnabled: false }; const security = securityMock.createStart(); - plugin.start(coreStart, { cloud, security }); + plugin.start(coreStart, { cloud, security, share: sharePluginMock.createStartContract() }); expect(maybeAddCloudLinksMock).toHaveBeenCalledTimes(0); }); }); diff --git a/x-pack/plugins/cloud_integrations/cloud_links/public/plugin.tsx b/x-pack/plugins/cloud_integrations/cloud_links/public/plugin.tsx index 38b568791b70b..bfebe531276d4 100755 --- a/x-pack/plugins/cloud_integrations/cloud_links/public/plugin.tsx +++ b/x-pack/plugins/cloud_integrations/cloud_links/public/plugin.tsx @@ -11,6 +11,7 @@ import type { CoreStart, Plugin } from '@kbn/core/public'; import type { CloudSetup, CloudStart } from '@kbn/cloud-plugin/public'; import type { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/public'; import type { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public'; +import type { SharePluginStart } from '@kbn/share-plugin/public'; import { maybeAddCloudLinks } from './maybe_add_cloud_links'; interface CloudLinksDepsSetup { @@ -21,6 +22,7 @@ interface CloudLinksDepsSetup { interface CloudLinksDepsStart { cloud?: CloudStart; security?: SecurityPluginStart; + share: SharePluginStart; guidedOnboarding?: GuidedOnboardingPluginStart; } @@ -29,7 +31,7 @@ export class CloudLinksPlugin { public setup() {} - public start(core: CoreStart, { cloud, security, guidedOnboarding }: CloudLinksDepsStart) { + public start(core: CoreStart, { cloud, security, guidedOnboarding, share }: CloudLinksDepsStart) { if (cloud?.isCloudEnabled && !core.http.anonymousPaths.isAnonymous(window.location.pathname)) { if (guidedOnboarding?.guidedOnboardingApi?.isEnabled) { core.chrome.registerGlobalHelpExtensionMenuLink({ @@ -42,11 +44,13 @@ export class CloudLinksPlugin priority: 1000, // We want this link to be at the very top. }); } + if (security) { maybeAddCloudLinks({ core, security, cloud, + share, }); } } diff --git a/x-pack/plugins/cloud_integrations/cloud_links/tsconfig.json b/x-pack/plugins/cloud_integrations/cloud_links/tsconfig.json index f1a67895cdd5e..43f411cadf060 100644 --- a/x-pack/plugins/cloud_integrations/cloud_links/tsconfig.json +++ b/x-pack/plugins/cloud_integrations/cloud_links/tsconfig.json @@ -23,6 +23,9 @@ "@kbn/user-profile-components", "@kbn/core-lifecycle-browser", "@kbn/kibana-react-plugin", + "@kbn/share-plugin", + "@kbn/cloud", + "@kbn/react-kibana-mount", ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/fleet/public/applications/integrations/components/header/deployment_details.component.tsx b/x-pack/plugins/fleet/public/applications/integrations/components/header/deployment_details.component.tsx deleted file mode 100644 index 7e3b414cf0f6d..0000000000000 --- a/x-pack/plugins/fleet/public/applications/integrations/components/header/deployment_details.component.tsx +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import styled from 'styled-components'; - -import { - EuiPopover, - EuiText, - EuiForm, - EuiFormRow, - EuiFieldText, - EuiCopy, - EuiButtonIcon, - EuiFlexGroup, - EuiFlexItem, - EuiButton, - EuiLink, - EuiHeaderLink, -} from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; - -export interface Props { - cloudId: string; - managementUrl?: string; - learnMoreUrl: string; -} - -const Description = styled(EuiText)` - margin-bottom: ${({ theme }) => theme.eui.euiSizeL}; -`; - -export const DeploymentDetails = ({ cloudId, learnMoreUrl, managementUrl }: Props) => { - const [isOpen, setIsOpen] = React.useState(false); - - const button = ( - setIsOpen(!isOpen)} iconType="iInCircle" iconSide="left" isActive> - {i18n.translate('xpack.fleet.integrations.deploymentButton', { - defaultMessage: 'View deployment details', - })} - - ); - - const management = managementUrl ? ( - - - - Create and manage API keys - - - - Learn more - - - - - ) : null; - - return ( - setIsOpen(false)} - button={button} - anchorPosition="downCenter" - > -
- - {i18n.translate('xpack.fleet.integrations.deploymentDescription', { - defaultMessage: - 'Send data to Elastic from your applications by referencing your deployment.', - })} - - - - - - - - - - {(copy) => ( - - )} - - - - - {management} - -
-
- ); -}; diff --git a/x-pack/plugins/fleet/public/applications/integrations/components/header/deployment_details.stories.tsx b/x-pack/plugins/fleet/public/applications/integrations/components/header/deployment_details.stories.tsx deleted file mode 100644 index 5b311b3443e36..0000000000000 --- a/x-pack/plugins/fleet/public/applications/integrations/components/header/deployment_details.stories.tsx +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import type { Meta } from '@storybook/react'; -import { EuiHeader } from '@elastic/eui'; - -import { DeploymentDetails as ConnectedComponent } from './deployment_details'; -import type { Props as PureComponentProps } from './deployment_details.component'; -import { DeploymentDetails as PureComponent } from './deployment_details.component'; - -export default { - title: 'Sections/EPM/Deployment Details', - description: '', - decorators: [ - (storyFn) => { - const sections = [{ items: [] }, { items: [storyFn()] }]; - return ; - }, - ], -} as Meta; - -export const DeploymentDetails = () => { - return ; -}; - -DeploymentDetails.args = { - isCloudEnabled: true, -}; - -DeploymentDetails.argTypes = { - isCloudEnabled: { - type: { - name: 'boolean', - }, - defaultValue: true, - control: { - type: 'boolean', - }, - }, -}; - -export const Component = (props: PureComponentProps) => { - return ; -}; - -Component.args = { - cloudId: 'cloud-id', - learnMoreUrl: 'https://learn-more-url', - managementUrl: 'https://management-url', -}; diff --git a/x-pack/plugins/fleet/public/applications/integrations/components/header/deployment_details.tsx b/x-pack/plugins/fleet/public/applications/integrations/components/header/deployment_details.tsx index 968d596a5f9d5..ea17bc3f201c4 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/components/header/deployment_details.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/components/header/deployment_details.tsx @@ -6,13 +6,18 @@ */ import React from 'react'; +import { i18n } from '@kbn/i18n'; +import { EuiPopover, EuiHeaderLink } from '@elastic/eui'; +import { + DeploymentDetailsKibanaProvider, + DeploymentDetails as DeploymentDetailsComponent, +} from '@kbn/cloud/deployment_details'; import { useStartServices } from '../../hooks'; -import { DeploymentDetails as Component } from './deployment_details.component'; - export const DeploymentDetails = () => { - const { share, cloud, docLinks } = useStartServices(); + const [isOpen, setIsOpen] = React.useState(false); + const { share, cloud, docLinks, application } = useStartServices(); // If the cloud plugin isn't enabled, we can't display the flyout. if (!cloud) { @@ -21,16 +26,36 @@ export const DeploymentDetails = () => { const { isCloudEnabled, cloudId } = cloud; - // If cloud isn't enabled or we don't have a cloudId we can't display the flyout. + // If cloud isn't enabled or we don't have a cloudId we don't render the button. if (!isCloudEnabled || !cloudId) { return null; } - const managementUrl = share.url.locators - .get('MANAGEMENT_APP_LOCATOR') - ?.useUrl({ sectionId: 'security', appId: 'api_keys' }); - - const learnMoreUrl = docLinks.links.fleet.apiKeysLearnMore; - - return ; + const button = ( + setIsOpen(!isOpen)} iconType="iInCircle" iconSide="left" isActive> + {i18n.translate('xpack.fleet.integrations.endpointsButton', { + defaultMessage: 'Endpoints', + })} + + ); + + return ( + + setIsOpen(false)} + button={button} + anchorPosition="downCenter" + > +
+ +
+
+
+ ); }; diff --git a/x-pack/plugins/fleet/tsconfig.json b/x-pack/plugins/fleet/tsconfig.json index b3f8a96417f9a..58cdfa25d1e08 100644 --- a/x-pack/plugins/fleet/tsconfig.json +++ b/x-pack/plugins/fleet/tsconfig.json @@ -101,5 +101,6 @@ "@kbn/core-saved-objects-base-server-internal", "@kbn/core-http-common", "@kbn/dashboard-plugin", + "@kbn/cloud", ] } diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index b468f00d02466..4ae31ffb358ef 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -16425,8 +16425,6 @@ "xpack.fleet.homeIntegration.tutorialModule.noticeText.notePrefix": "Note", "xpack.fleet.initializationErrorMessageTitle": "Initialisation de Fleet impossible", "xpack.fleet.integrations.customInputsLink": "entrées personnalisées", - "xpack.fleet.integrations.deploymentButton": "Voir les détails du déploiement", - "xpack.fleet.integrations.deploymentDescription": "Envoyez des données à Elastic à partir de vos applications en référençant votre déploiement.", "xpack.fleet.integrations.discussForumLink": "forum", "xpack.fleet.integrations.installPackage.uploadedTooltip": "Cette intégration a été installée par le biais d'un chargement et ne peut pas être réinstallée automatiquement. Veuillez la charger à nouveau pour la réinstaller.", "xpack.fleet.integrations.integrationSaved": "Paramètres de l'intégration enregistrés", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 7f59456c6bd14..87e23ff29cb1f 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -16439,8 +16439,6 @@ "xpack.fleet.homeIntegration.tutorialModule.noticeText.notePrefix": "注", "xpack.fleet.initializationErrorMessageTitle": "Fleet を初期化できません", "xpack.fleet.integrations.customInputsLink": "カスタム入力", - "xpack.fleet.integrations.deploymentButton": "デプロイ詳細の表示", - "xpack.fleet.integrations.deploymentDescription": "デプロイを参照し、アプリケーションのデータをElasticに送信します。", "xpack.fleet.integrations.discussForumLink": "フォーラム", "xpack.fleet.integrations.installPackage.uploadedTooltip": "この統合はアップロードによってインストールされたため、自動的に再インストールできません。再インストールするには、もう一度アップロードしてください。", "xpack.fleet.integrations.integrationSaved": "統合設定が保存されました", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 8474d0289c239..6e3c128ec642a 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -16439,8 +16439,6 @@ "xpack.fleet.homeIntegration.tutorialModule.noticeText.notePrefix": "备注", "xpack.fleet.initializationErrorMessageTitle": "无法初始化 Fleet", "xpack.fleet.integrations.customInputsLink": "定制输入", - "xpack.fleet.integrations.deploymentButton": "查看部署详情", - "xpack.fleet.integrations.deploymentDescription": "通过引用部署,将数据从应用程序发送到 Elastic。", "xpack.fleet.integrations.discussForumLink": "论坛", "xpack.fleet.integrations.installPackage.uploadedTooltip": "此集成通过上传进行安装,因此无法自动重新安装。请再次将其上传,以便重新安装。", "xpack.fleet.integrations.integrationSaved": "已保存集成设置", diff --git a/x-pack/test/functional_cloud/config.ts b/x-pack/test/functional_cloud/config.ts index c3203677631a9..df75e83138ed5 100644 --- a/x-pack/test/functional_cloud/config.ts +++ b/x-pack/test/functional_cloud/config.ts @@ -44,7 +44,8 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { serverArgs: [ ...functionalConfig.get('kbnTestServer.serverArgs'), `--plugin-path=${samlIdPPlugin}`, - '--xpack.cloud.id=ftr_fake_cloud_id', + // Note: the base64 string in the cloud.id config contains the ES endpoint required in the functional tests + '--xpack.cloud.id=ftr_fake_cloud_id:aGVsbG8uY29tOjQ0MyRFUzEyM2FiYyRrYm4xMjNhYmM=', '--xpack.cloud.base_url=https://cloud.elastic.co', '--xpack.cloud.deployment_url=/deployments/deploymentId', '--xpack.cloud.organization_url=/organization/organizationId', diff --git a/x-pack/test/functional_cloud/tests/cloud_links.ts b/x-pack/test/functional_cloud/tests/cloud_links.ts index 873cd943ec59d..94f67401c98fd 100644 --- a/x-pack/test/functional_cloud/tests/cloud_links.ts +++ b/x-pack/test/functional_cloud/tests/cloud_links.ts @@ -46,6 +46,28 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await find.byCssSelector('[data-test-subj="cloudOnboardingSetupGuideLink"]') ).to.not.be(null); }); + + it('A button to open a modal to view the CloudID and ES endpoint is added', async () => { + await PageObjects.common.clickAndValidate('helpMenuButton', 'endpointsHelpLink'); + expect(await find.byCssSelector('[data-test-subj="endpointsHelpLink"]')).to.not.be(null); + + // Open the modal + await PageObjects.common.clickAndValidate('endpointsHelpLink', 'deploymentDetailsModal'); + + const esEndpointInput = await find.byCssSelector( + '[data-test-subj="deploymentDetailsEsEndpoint"]' + ); + const esEndpointValue = await esEndpointInput.getAttribute('value'); + expect(esEndpointValue).to.be('https://ES123abc.hello.com:443'); + + const cloudIdInput = await find.byCssSelector( + '[data-test-subj="deploymentDetailsCloudID"]' + ); + const cloudIdInputValue = await cloudIdInput.getAttribute('value'); + expect(cloudIdInputValue).to.be( + 'ftr_fake_cloud_id:aGVsbG8uY29tOjQ0MyRFUzEyM2FiYyRrYm4xMjNhYmM=' + ); + }); }); it('"Manage this deployment" is appended to the nav list', async () => { diff --git a/yarn.lock b/yarn.lock index 41769ceb9a6ef..9c52f8dd23ae4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3243,6 +3243,10 @@ version "0.0.0" uid "" +"@kbn/cloud@link:packages/cloud": + version "0.0.0" + uid "" + "@kbn/code-editor-mocks@link:packages/shared-ux/code_editor/mocks": version "0.0.0" uid "" From 261febcf310552c2280a369f6f740c85bae7d85a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Marcondes?= <55978943+cauemarcondes@users.noreply.github.com> Date: Thu, 28 Sep 2023 12:43:02 +0100 Subject: [PATCH 10/61] [Profiling] fixing TopN functions sorting (#167242) ![sorting](https://github.com/elastic/kibana/assets/55978943/f5ad2b2c-0dff-4517-ac0f-88c9d99d6b2e) --- .../e2e/profiling_views/functions.cy.ts | 78 ++++++++++++ .../components/topn_functions/index.tsx | 73 +++++++----- .../public/components/topn_functions/utils.ts | 111 +++++++++--------- x-pack/plugins/profiling/scripts/test/e2e.js | 6 +- 4 files changed, 178 insertions(+), 90 deletions(-) diff --git a/x-pack/plugins/profiling/e2e/cypress/e2e/profiling_views/functions.cy.ts b/x-pack/plugins/profiling/e2e/cypress/e2e/profiling_views/functions.cy.ts index 7ad922ceb7936..f928db33e2f19 100644 --- a/x-pack/plugins/profiling/e2e/cypress/e2e/profiling_views/functions.cy.ts +++ b/x-pack/plugins/profiling/e2e/cypress/e2e/profiling_views/functions.cy.ts @@ -87,4 +87,82 @@ describe('Functions page', () => { const firstRowSelector = '[data-grid-row-index="0"] [data-test-subj="dataGridRowCell"]'; cy.get(firstRowSelector).eq(2).contains('libjvm.so'); }); + + it('Sorting grid', () => { + cy.intercept('GET', '/internal/profiling/topn/functions?*').as('getTopNFunctions'); + cy.visitKibana('/app/profiling/functions', { rangeFrom, rangeTo }); + cy.wait('@getTopNFunctions'); + [ + { + columnKey: 'rank', + columnIndex: 1, + highRank: 388, + lowRank: 1, + highValue: 388, + lowValue: 1, + }, + { + columnKey: 'samples', + columnIndex: 7, + highRank: 1, + lowRank: 44, + highValue: 28, + lowValue: 1, + }, + { + columnKey: 'selfCPU', + columnIndex: 3, + highRank: 1, + lowRank: 44, + highValue: '5.46%', + lowValue: '0.19%', + }, + { + columnKey: 'totalCPU', + columnIndex: 4, + highRank: 338, + lowRank: 44, + highValue: '10.33%', + lowValue: '0.19%', + }, + { + columnKey: 'annualizedCo2', + columnIndex: 5, + highRank: 1, + lowRank: 44, + highValue: '1.84 lbs / 0.84 kg', + lowValue: '0.07 lbs / 0.03 kg', + }, + { + columnKey: 'annualizedDollarCost', + columnIndex: 6, + highRank: 1, + lowRank: 44, + highValue: '$17.37', + lowValue: '$0.62', + }, + ].forEach(({ columnKey, columnIndex, highRank, highValue, lowRank, lowValue }) => { + cy.get(`[data-test-subj="dataGridHeaderCell-${columnKey}"]`).click(); + cy.contains('Sort High-Low').click(); + const firstRowSelector = '[data-grid-row-index="0"] [data-test-subj="dataGridRowCell"]'; + cy.get(firstRowSelector).eq(1).contains(highRank); + cy.get(firstRowSelector).eq(columnIndex).contains(highValue); + + cy.get(`[data-test-subj="dataGridHeaderCell-${columnKey}"]`).click(); + cy.contains('Sort Low-High').click(); + cy.get(firstRowSelector).eq(1).contains(lowRank); + cy.get(firstRowSelector).eq(columnIndex).contains(lowValue); + }); + + cy.get(`[data-test-subj="dataGridHeaderCell-frame"]`).click(); + cy.contains('Sort Z-A').click(); + const firstRowSelector = '[data-grid-row-index="0"] [data-test-subj="dataGridRowCell"]'; + cy.get(firstRowSelector).eq(1).contains('1'); + cy.get(firstRowSelector).eq(2).contains('vmlinux'); + + cy.get('[data-test-subj="dataGridHeaderCell-frame"]').click(); + cy.contains('Sort A-Z').click(); + cy.get(firstRowSelector).eq(1).contains('371'); + cy.get(firstRowSelector).eq(2).contains('/'); + }); }); diff --git a/x-pack/plugins/profiling/public/components/topn_functions/index.tsx b/x-pack/plugins/profiling/public/components/topn_functions/index.tsx index 7dbc6c38fb0eb..e1318471913d9 100644 --- a/x-pack/plugins/profiling/public/components/topn_functions/index.tsx +++ b/x-pack/plugins/profiling/public/components/topn_functions/index.tsx @@ -16,11 +16,11 @@ import { EuiScreenReaderOnly, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { last } from 'lodash'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; +import { getCalleeFunction, TopNFunctions, TopNFunctionSortField } from '@kbn/profiling-utils'; +import { last, orderBy } from 'lodash'; import React, { forwardRef, Ref, useMemo, useState } from 'react'; import { GridOnScrollProps } from 'react-window'; -import { useUiTracker } from '@kbn/observability-shared-plugin/public'; -import { TopNFunctions, TopNFunctionSortField } from '@kbn/profiling-utils'; import { CPULabelWithHint } from '../cpu_label_with_hint'; import { FrameInformationTooltip } from '../frame_information_window/frame_information_tooltip'; import { LabelWithHint } from '../label_with_hint'; @@ -102,10 +102,33 @@ export const TopNFunctionsGrid = forwardRef( totalSeconds, ]); + const sortedRows = useMemo(() => { + switch (sortField) { + case TopNFunctionSortField.Frame: + return orderBy(rows, (row) => getCalleeFunction(row.frame), sortDirection); + case TopNFunctionSortField.SelfCPU: + return orderBy(rows, (row) => row.selfCPUPerc, sortDirection); + case TopNFunctionSortField.TotalCPU: + return orderBy(rows, (row) => row.totalCPUPerc, sortDirection); + case TopNFunctionSortField.AnnualizedCo2: + return orderBy(rows, (row) => row.impactEstimates?.selfCPU.annualizedCo2, sortDirection); + case TopNFunctionSortField.AnnualizedDollarCost: + return orderBy( + rows, + (row) => row.impactEstimates?.selfCPU.annualizedDollarCost, + sortDirection + ); + default: + return orderBy(rows, sortField, sortDirection); + } + }, [rows, sortDirection, sortField]); + const { columns, leadingControlColumns } = useMemo(() => { const gridColumns: EuiDataGridColumn[] = [ { id: TopNFunctionSortField.Rank, + schema: 'numeric', + actions: { showHide: false }, initialWidth: isDifferentialView ? 50 : 90, displayAsText: i18n.translate('xpack.profiling.functionsView.rankColumnLabel', { defaultMessage: 'Rank', @@ -113,6 +136,7 @@ export const TopNFunctionsGrid = forwardRef( }, { id: TopNFunctionSortField.Frame, + actions: { showHide: false }, displayAsText: i18n.translate('xpack.profiling.functionsView.functionColumnLabel', { defaultMessage: 'Function', }), @@ -120,7 +144,8 @@ export const TopNFunctionsGrid = forwardRef( { id: TopNFunctionSortField.Samples, initialWidth: isDifferentialView ? 100 : 200, - schema: 'samples', + schema: 'numeric', + actions: { showHide: false }, display: ( id)); @@ -249,7 +282,7 @@ export const TopNFunctionsGrid = forwardRef( columnId, setCellProps, }: EuiDataGridCellValueElementProps) { - const data = rows[rowIndex]; + const data = sortedRows[rowIndex]; if (data) { return ( 100 ? 100 : sortedRows.length} renderCellValue={RenderCellValue} - inMemory={{ level: 'sorting' }} sorting={{ columns: [{ id: sortField, direction: sortDirection }], onSort }} leadingControlColumns={leadingControlColumns} pagination={{ @@ -296,29 +328,6 @@ export const TopNFunctionsGrid = forwardRef( virtualizationOptions={{ onScroll, }} - schemaDetectors={[ - { - type: 'samples', - comparator: (a, b, direction) => { - const aNumber = parseFloat(a.replace(/,/g, '')); - const bNumber = parseFloat(b.replace(/,/g, '')); - - if (aNumber < bNumber) { - return direction === 'desc' ? 1 : -1; - } - if (aNumber > bNumber) { - return direction === 'desc' ? -1 : 1; - } - return 0; - }, - detector: (a) => { - return 1; - }, - icon: '', - sortTextAsc: 'Low-High', - sortTextDesc: 'High-Low', - }, - ]} /> {selectedRow && ( topN.CountExclusive > 0) - .slice(0, 100) - .map((topN, i) => { - const comparisonRow = comparisonDataById?.[topN.Id]; - - const scaledSelfCPU = scaleValue({ - value: topN.CountExclusive, - scaleFactor: baselineScaleFactor, - }); - - const totalCPUPerc = (topN.CountInclusive / topNFunctions.TotalCount) * 100; - const selfCPUPerc = (topN.CountExclusive / topNFunctions.TotalCount) * 100; - - const impactEstimates = - totalSeconds > 0 - ? calculateImpactEstimates({ - countExclusive: topN.CountExclusive, - countInclusive: topN.CountInclusive, - totalSamples: topNFunctions.TotalCount, - totalSeconds, - }) - : undefined; - - function calculateDiff() { - if (comparisonTopNFunctions && comparisonRow) { - const comparisonScaledSelfCPU = scaleValue({ - value: comparisonRow.CountExclusive, - scaleFactor: comparisonScaleFactor, - }); - - const scaledDiffSamples = scaledSelfCPU - comparisonScaledSelfCPU; - - return { - rank: topN.Rank - comparisonRow.Rank, - samples: scaledDiffSamples, - selfCPU: comparisonRow.CountExclusive, - totalCPU: comparisonRow.CountInclusive, - selfCPUPerc: - selfCPUPerc - - (comparisonRow.CountExclusive / comparisonTopNFunctions.TotalCount) * 100, - totalCPUPerc: - totalCPUPerc - - (comparisonRow.CountInclusive / comparisonTopNFunctions.TotalCount) * 100, - }; - } - } + return topNFunctions.TopN.filter((topN) => topN.CountExclusive > 0).map((topN, i) => { + const comparisonRow = comparisonDataById?.[topN.Id]; - return { - rank: topN.Rank, - frame: topN.Frame, - samples: scaledSelfCPU, - selfCPUPerc, - totalCPUPerc, - selfCPU: topN.CountExclusive, - totalCPU: topN.CountInclusive, - impactEstimates, - diff: calculateDiff(), - }; + const scaledSelfCPU = scaleValue({ + value: topN.CountExclusive, + scaleFactor: baselineScaleFactor, }); + + const totalCPUPerc = (topN.CountInclusive / topNFunctions.TotalCount) * 100; + const selfCPUPerc = (topN.CountExclusive / topNFunctions.TotalCount) * 100; + + const impactEstimates = + totalSeconds > 0 + ? calculateImpactEstimates({ + countExclusive: topN.CountExclusive, + countInclusive: topN.CountInclusive, + totalSamples: topNFunctions.TotalCount, + totalSeconds, + }) + : undefined; + + function calculateDiff() { + if (comparisonTopNFunctions && comparisonRow) { + const comparisonScaledSelfCPU = scaleValue({ + value: comparisonRow.CountExclusive, + scaleFactor: comparisonScaleFactor, + }); + + const scaledDiffSamples = scaledSelfCPU - comparisonScaledSelfCPU; + + return { + rank: topN.Rank - comparisonRow.Rank, + samples: scaledDiffSamples, + selfCPU: comparisonRow.CountExclusive, + totalCPU: comparisonRow.CountInclusive, + selfCPUPerc: + selfCPUPerc - (comparisonRow.CountExclusive / comparisonTopNFunctions.TotalCount) * 100, + totalCPUPerc: + totalCPUPerc - + (comparisonRow.CountInclusive / comparisonTopNFunctions.TotalCount) * 100, + }; + } + } + + return { + rank: topN.Rank, + frame: topN.Frame, + samples: scaledSelfCPU, + selfCPUPerc, + totalCPUPerc, + selfCPU: topN.CountExclusive, + totalCPU: topN.CountInclusive, + impactEstimates, + diff: calculateDiff(), + }; + }); } export function calculateBaseComparisonDiff({ diff --git a/x-pack/plugins/profiling/scripts/test/e2e.js b/x-pack/plugins/profiling/scripts/test/e2e.js index d5cd56175d223..8a584a84bdc87 100644 --- a/x-pack/plugins/profiling/scripts/test/e2e.js +++ b/x-pack/plugins/profiling/scripts/test/e2e.js @@ -76,7 +76,11 @@ function runTests() { return childProcess.spawnSync('node', spawnArgs, { cwd: e2eDir, - env: { ...process.env, CYPRESS_CLI_ARGS: JSON.stringify(cypressCliArgs) }, + env: { + ...process.env, + CYPRESS_CLI_ARGS: JSON.stringify(cypressCliArgs), + NODE_OPTIONS: '--openssl-legacy-provider', + }, encoding: 'utf8', stdio: 'inherit', }); From 6ab0c68ae67f18f305a8d2eff4ca7ef5ec6f3529 Mon Sep 17 00:00:00 2001 From: Maryam Saeidi Date: Thu, 28 Sep 2023 13:51:20 +0200 Subject: [PATCH 11/61] [AO] Unskip the custom threshold rule executor unit test (#167120) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #162299 Fixes #162540 ## Summary This PR unskips the custom threshold rule executor unit test and removes the warning implementation from the BE. ## 🧪 How to test - Create a custom threshold rule, it should work as before. (Warning implementation logic was already removed from FE; this PR only removes the BE implementation.) --- .../metric_threshold_executor.test.ts | 1 - .../custom_threshold_executor.test.ts | 274 +++++------------- .../custom_threshold_executor.ts | 6 +- .../lib/create_bucket_selector.ts | 31 +- .../custom_threshold/lib/evaluate_rule.ts | 5 +- .../rules/custom_threshold/lib/get_data.ts | 17 +- .../register_custom_threshold_rule_type.ts | 1 - .../lib/rules/custom_threshold/types.ts | 2 - 8 files changed, 73 insertions(+), 264 deletions(-) diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts index 4b618dbd82e85..6eec0c9f28629 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts @@ -131,7 +131,6 @@ const setEvaluationResults = (response: Array>) => { jest.requireMock('./lib/evaluate_rule').evaluateRule.mockImplementation(() => response); }; -// FAILING: https://github.com/elastic/kibana/issues/155534 describe('The metric threshold alert type', () => { describe('querying the entire infrastructure', () => { afterAll(() => clearInstances()); diff --git a/x-pack/plugins/observability/server/lib/rules/custom_threshold/custom_threshold_executor.test.ts b/x-pack/plugins/observability/server/lib/rules/custom_threshold/custom_threshold_executor.test.ts index 4a4640e6e1f2f..d05af5d609b8c 100644 --- a/x-pack/plugins/observability/server/lib/rules/custom_threshold/custom_threshold_executor.test.ts +++ b/x-pack/plugins/observability/server/lib/rules/custom_threshold/custom_threshold_executor.test.ts @@ -11,6 +11,8 @@ import { RuleExecutorServicesMock, alertsMock, } from '@kbn/alerting-plugin/server/mocks'; +import { searchSourceCommonMock } from '@kbn/data-plugin/common/search/search_source/mocks'; +import type { ISearchSource } from '@kbn/data-plugin/common'; import { LifecycleAlertServices } from '@kbn/rule-registry-plugin/server'; import { ruleRegistryMocks } from '@kbn/rule-registry-plugin/server/mocks'; import { @@ -69,6 +71,14 @@ const mockOptions = { executionId: '', startedAt: STARTED_AT_MOCK_DATE, previousStartedAt: null, + params: { + searchConfiguration: { + query: { + query: '', + language: 'kuery', + }, + }, + }, state: { wrapped: initialRuleState, trackedAlerts: { @@ -123,8 +133,7 @@ const setEvaluationResults = (response: Array>) => { jest.requireMock('./lib/evaluate_rule').evaluateRule.mockImplementation(() => response); }; -// FAILING: https://github.com/elastic/kibana/issues/155534 -describe.skip('The metric threshold alert type', () => { +describe('The metric threshold alert type', () => { describe('querying the entire infrastructure', () => { afterAll(() => clearInstances()); const instanceID = '*'; @@ -133,6 +142,7 @@ describe.skip('The metric threshold alert type', () => { ...mockOptions, services, params: { + ...mockOptions.params, sourceId, criteria: [ { @@ -147,7 +157,6 @@ describe.skip('The metric threshold alert type', () => { comparator: Comparator, threshold: number[], shouldFire: boolean = false, - shouldWarn: boolean = false, isNoData: boolean = false ) => setEvaluationResults([ @@ -160,7 +169,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire, - shouldWarn, isNoData, bucketKey: { groupBy0: '*' }, }, @@ -224,7 +232,7 @@ describe.skip('The metric threshold alert type', () => { setResults(Comparator.GT, [0.75], true); await execute(Comparator.GT, [0.75]); const { action } = mostRecentAction(instanceID); - expect(action.group).toBe('*'); + expect(action.group).toBeUndefined(); expect(action.reason).toContain('is 1'); expect(action.reason).toContain('Alert when > 0.75'); expect(action.reason).toContain('test.metric.1'); @@ -237,7 +245,7 @@ describe.skip('The metric threshold alert type', () => { const execute = ( comparator: Comparator, threshold: number[], - groupBy: string[] = ['something'], + groupBy: string[] = ['groupByField'], metric?: string, state?: any ) => @@ -245,6 +253,7 @@ describe.skip('The metric threshold alert type', () => { ...mockOptions, services, params: { + ...mockOptions.params, groupBy, criteria: [ { @@ -270,7 +279,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'a' }, }, @@ -282,7 +290,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'b' }, }, @@ -303,7 +310,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'a' }, }, @@ -315,7 +321,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'b' }, }, @@ -336,7 +341,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'a' }, }, @@ -348,7 +352,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'b' }, }, @@ -369,7 +372,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'a' }, }, @@ -381,15 +383,14 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'b' }, }, }, ]); await execute(Comparator.GT, [0.75]); - expect(mostRecentAction(instanceIdA).action.group).toBe('a'); - expect(mostRecentAction(instanceIdB).action.group).toBe('b'); + expect(mostRecentAction(instanceIdA).action.group).toEqual({ groupByField: 'a' }); + expect(mostRecentAction(instanceIdB).action.group).toEqual({ groupByField: 'b' }); }); test('persists previous groups that go missing, until the groupBy param changes', async () => { setEvaluationResults([ @@ -402,7 +403,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'a' }, }, @@ -414,7 +414,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'b' }, }, @@ -426,7 +425,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'c' }, }, @@ -435,7 +433,7 @@ describe.skip('The metric threshold alert type', () => { const { state: stateResult1 } = await execute( Comparator.GT, [0.75], - ['something'], + ['groupByField'], 'test.metric.2' ); expect(stateResult1.missingGroups).toEqual(expect.arrayContaining([])); @@ -449,7 +447,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'a' }, }, @@ -461,7 +458,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'b' }, }, @@ -473,7 +469,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: null, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: true, bucketKey: { groupBy0: 'c' }, }, @@ -482,7 +477,7 @@ describe.skip('The metric threshold alert type', () => { const { state: stateResult2 } = await execute( Comparator.GT, [0.75], - ['something'], + ['groupByField'], 'test.metric.1', stateResult1 ); @@ -499,7 +494,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'a' }, }, @@ -511,7 +505,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'b' }, }, @@ -520,7 +513,7 @@ describe.skip('The metric threshold alert type', () => { const { state: stateResult3 } = await execute( Comparator.GT, [0.75], - ['something', 'something-else'], + ['groupByField', 'groupByField-else'], 'test.metric.1', stateResult2 ); @@ -538,7 +531,8 @@ describe.skip('The metric threshold alert type', () => { ...mockOptions, services, params: { - groupBy: ['something'], + ...mockOptions.params, + groupBy: ['groupByField'], criteria: [ { ...baseNonCountCriterion, @@ -547,7 +541,12 @@ describe.skip('The metric threshold alert type', () => { metric: metric ?? baseNonCountCriterion.metric, }, ], - filterQuery, + searchConfiguration: { + query: { + query: filterQuery, + language: 'kuery', + }, + }, }, state: state ?? mockOptions.state.wrapped, }); @@ -562,7 +561,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'a' }, }, @@ -574,7 +572,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'b' }, }, @@ -586,7 +583,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'c' }, }, @@ -609,7 +605,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'a' }, }, @@ -621,7 +616,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'b' }, }, @@ -633,7 +627,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: null, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: true, bucketKey: { groupBy0: 'c' }, }, @@ -659,7 +652,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'a' }, }, @@ -671,7 +663,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'b' }, }, @@ -701,6 +692,7 @@ describe.skip('The metric threshold alert type', () => { ...mockOptions, services, params: { + ...mockOptions.params, groupBy, criteria: [ { @@ -731,7 +723,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'host-01' }, context: { @@ -746,7 +737,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'host-02' }, context: { @@ -784,6 +774,7 @@ describe.skip('The metric threshold alert type', () => { ...mockOptions, services, params: { + ...mockOptions.params, groupBy, criteria: [ { @@ -812,7 +803,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: '*' }, }, @@ -838,6 +828,7 @@ describe.skip('The metric threshold alert type', () => { ...mockOptions, services, params: { + ...mockOptions.params, sourceId, groupBy, criteria: [ @@ -866,7 +857,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: '*' }, }, @@ -880,7 +870,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: '*' }, }, @@ -901,7 +890,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: '*' }, }, @@ -923,7 +911,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'a' }, }, @@ -935,7 +922,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'b' }, }, @@ -949,7 +935,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'a' }, }, @@ -961,7 +946,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'b' }, }, @@ -969,7 +953,7 @@ describe.skip('The metric threshold alert type', () => { ]); const instanceIdA = 'a'; const instanceIdB = 'b'; - await execute(Comparator.GT_OR_EQ, [1.0], [3.0], 'something'); + await execute(Comparator.GT_OR_EQ, [1.0], [3.0], 'groupByField'); expect(mostRecentAction(instanceIdA)).toBeAlertAction(); expect(mostRecentAction(instanceIdB)).toBe(undefined); }); @@ -984,7 +968,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: '*' }, }, @@ -998,7 +981,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: '*' }, }, @@ -1027,6 +1009,7 @@ describe.skip('The metric threshold alert type', () => { ...mockOptions, services, params: { + ...mockOptions.params, sourceId, criteria: [ { @@ -1048,7 +1031,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'a' }, }, @@ -1066,7 +1048,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'a' }, }, @@ -1086,8 +1067,9 @@ describe.skip('The metric threshold alert type', () => { ...mockOptions, services, params: { + ...mockOptions.params, sourceId, - groupBy: 'something', + groupBy: 'groupByField', criteria: [ { ...baseCountCriterion, @@ -1112,7 +1094,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'a' }, }, @@ -1124,7 +1105,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'b' }, }, @@ -1143,7 +1123,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'a' }, }, @@ -1155,7 +1134,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'b' }, }, @@ -1175,6 +1153,7 @@ describe.skip('The metric threshold alert type', () => { ...mockOptions, services, params: { + ...mockOptions.params, criteria: [ { ...baseNonCountCriterion, @@ -1197,7 +1176,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: '*' }, }, @@ -1215,7 +1193,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: '*' }, }, @@ -1233,6 +1210,7 @@ describe.skip('The metric threshold alert type', () => { ...mockOptions, services, params: { + ...mockOptions.params, sourceId, criteria: [ { @@ -1256,7 +1234,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: '*' }, }, @@ -1274,7 +1251,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: '*' }, }, @@ -1292,6 +1268,7 @@ describe.skip('The metric threshold alert type', () => { ...mockOptions, services, params: { + ...mockOptions.params, sourceId, criteria: [ { @@ -1315,7 +1292,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: null, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: true, bucketKey: { groupBy0: '*' }, }, @@ -1337,7 +1313,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: null, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: true, bucketKey: { groupBy0: '*' }, }, @@ -1356,6 +1331,7 @@ describe.skip('The metric threshold alert type', () => { ...mockOptions, services, params: { + ...mockOptions.params, sourceId, criteria: [ { @@ -1384,7 +1360,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: null, timestamp: STARTED_AT_MOCK_DATE.toISOString(), shouldFire: false, - shouldWarn: false, isNoData: true, bucketKey: { groupBy0: '*' }, }, @@ -1395,15 +1370,9 @@ describe.skip('The metric threshold alert type', () => { const recentAction = mostRecentAction(instanceID); expect(recentAction.action).toEqual({ alertDetailsUrl: '', - alertState: 'NO DATA', - group: '*', - groupByKeys: undefined, - metric: { condition0: 'test.metric.3', condition1: 'count' }, reason: 'test.metric.3 reported no data in the last 1m', - threshold: { condition0: ['1'], condition1: [30] }, timestamp: STARTED_AT_MOCK_DATE.toISOString(), - value: { condition0: '[NO DATA]', condition1: 0 }, - viewInAppUrl: 'http://localhost:5601/app/metrics/explorer', + value: ['[NO DATA]', 0], tags: [], }); expect(recentAction).toBeNoDataAction(); @@ -1421,7 +1390,8 @@ describe.skip('The metric threshold alert type', () => { ...mockOptions, services, params: { - groupBy: 'something', + ...mockOptions.params, + groupBy: 'groupByField', sourceId: 'default', criteria: [ { @@ -1457,7 +1427,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: null, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: true, bucketKey: { groupBy0: '*' }, }, @@ -1475,7 +1444,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: null, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: true, bucketKey: { groupBy0: '*' }, }, @@ -1493,7 +1461,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1.0, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'a' }, }, @@ -1505,7 +1472,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'b' }, }, @@ -1531,7 +1497,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: null, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: true, bucketKey: { groupBy0: 'a' }, }, @@ -1543,7 +1508,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: null, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: true, bucketKey: { groupBy0: 'b' }, }, @@ -1565,7 +1529,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'a' }, }, @@ -1577,7 +1540,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'b' }, }, @@ -1589,7 +1551,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'c' }, }, @@ -1610,7 +1571,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'a' }, }, @@ -1622,7 +1582,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'b' }, }, @@ -1641,7 +1600,8 @@ describe.skip('The metric threshold alert type', () => { ...mockOptions, services, params: { - groupBy: 'something', + ...mockOptions.params, + groupBy: 'groupByField', sourceId: 'default', criteria: [ { @@ -1673,7 +1633,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: null, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: true, bucketKey: { groupBy0: '*' }, }, @@ -1691,7 +1650,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: null, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: true, bucketKey: { groupBy0: '*' }, }, @@ -1709,7 +1667,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 1, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'a' }, }, @@ -1721,7 +1678,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: 3, timestamp: new Date().toISOString(), shouldFire: true, - shouldWarn: false, isNoData: false, bucketKey: { groupBy0: 'b' }, }, @@ -1745,7 +1701,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: null, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: true, bucketKey: { groupBy0: 'a' }, }, @@ -1757,7 +1712,6 @@ describe.skip('The metric threshold alert type', () => { currentValue: null, timestamp: new Date().toISOString(), shouldFire: false, - shouldWarn: false, isNoData: true, bucketKey: { groupBy0: 'b' }, }, @@ -1770,112 +1724,6 @@ describe.skip('The metric threshold alert type', () => { }); }); }); - - describe('attempting to use a malformed filterQuery', () => { - afterAll(() => clearInstances()); - const instanceID = '*'; - const execute = () => - executor({ - ...mockOptions, - services, - params: { - criteria: [ - { - ...baseNonCountCriterion, - }, - ], - sourceId: 'default', - filterQuery: - 'host.name:(look.there.is.no.space.after.these.parentheses)and uh.oh: "wow that is bad"', - }, - }); - test('reports an error', async () => { - await execute(); - expect(mostRecentAction(instanceID)).toBeErrorAction(); - }); - }); - - describe('querying the entire infrastructure with warning threshold', () => { - afterAll(() => clearInstances()); - const instanceID = '*'; - - const execute = () => - executor({ - ...mockOptions, - services, - params: { - sourceId: 'default', - criteria: [ - { - ...baseNonCountCriterion, - comparator: Comparator.GT, - threshold: [9999], - }, - ], - }, - }); - - const setResults = ({ - comparator = Comparator.GT, - threshold = [9999], - warningComparator = Comparator.GT, - warningThreshold = [2.49], - metric = 'test.metric.1', - currentValue = 7.59, - shouldWarn = false, - }) => - setEvaluationResults([ - { - '*': { - ...baseNonCountCriterion, - comparator, - threshold, - warningComparator, - warningThreshold, - metric, - currentValue, - timestamp: new Date().toISOString(), - shouldFire: false, - shouldWarn, - isNoData: false, - bucketKey: { groupBy0: '*' }, - }, - }, - ]); - - test('warns as expected with the > comparator', async () => { - setResults({ warningThreshold: [2.49], currentValue: 2.5, shouldWarn: true }); - await execute(); - expect(mostRecentAction(instanceID)).toBeWarnAction(); - - setResults({ warningThreshold: [2.49], currentValue: 1.23, shouldWarn: false }); - await execute(); - expect(mostRecentAction(instanceID)).toBe(undefined); - }); - - test('reports expected warning values to the action context', async () => { - setResults({ warningThreshold: [2.49], currentValue: 2.5, shouldWarn: true }); - await execute(); - - const { action } = mostRecentAction(instanceID); - expect(action.group).toBe('*'); - expect(action.reason).toBe('test.metric.1 is 2.5 in the last 1 min. Alert when > 2.49.'); - }); - - test('reports expected warning values to the action context for percentage metric', async () => { - setResults({ - warningThreshold: [0.81], - currentValue: 0.82, - shouldWarn: true, - metric: 'system.cpu.user.pct', - }); - await execute(); - - const { action } = mostRecentAction(instanceID); - expect(action.group).toBe('*'); - expect(action.reason).toBe('system.cpu.user.pct is 82% in the last 1 min. Alert when > 81%.'); - }); - }); }); const mockLibs: any = { @@ -1897,10 +1745,28 @@ const mockLibs: any = { const executor = createMetricThresholdExecutor(mockLibs); const alertsServices = alertsMock.createRuleExecutorServices(); +const mockedIndex = { + id: 'c34a7c79-a88b-4b4a-ad19-72f6d24104e4', + title: 'metrics-fake_hosts', + fieldFormatMap: {}, + typeMeta: {}, + timeFieldName: '@timestamp', +}; +const mockedDataView = { + getIndexPattern: () => 'mockedIndexPattern', + ...mockedIndex, +}; +const mockedSearchSource = { + getField: jest.fn(() => mockedDataView), +} as any as ISearchSource; const services: RuleExecutorServicesMock & LifecycleAlertServices = { ...alertsServices, ...ruleRegistryMocks.createLifecycleAlertServices(alertsServices), + searchSourceClient: { + ...searchSourceCommonMock, + create: jest.fn(() => Promise.resolve(mockedSearchSource)), + }, }; services.savedObjectsClient.get.mockImplementation(async (type: string, sourceId: string) => { if (sourceId === 'alternate') @@ -1957,12 +1823,12 @@ function clearInstances() { interface Action { id: string; - action: { alertState: string }; + action: { reason: string }; } expect.extend({ toBeAlertAction(action?: Action) { - const pass = action?.id === FIRED_ACTIONS.id && action?.action.alertState === 'ALERT'; + const pass = action?.id === FIRED_ACTIONS.id && !action?.action.reason.includes('no data'); const message = () => `expected ${action} to be an ALERT action`; return { message, @@ -1970,21 +1836,13 @@ expect.extend({ }; }, toBeNoDataAction(action?: Action) { - const pass = action?.id === NO_DATA_ACTIONS.id && action?.action.alertState === 'NO DATA'; + const pass = action?.id === NO_DATA_ACTIONS.id && action?.action.reason.includes('no data'); const message = () => `expected ${action} to be a NO DATA action`; return { message, pass, }; }, - toBeErrorAction(action?: Action) { - const pass = action?.id === FIRED_ACTIONS.id && action?.action.alertState === 'ERROR'; - const message = () => `expected ${action} to be an ERROR action`; - return { - message, - pass, - }; - }, }); declare global { @@ -1992,9 +1850,7 @@ declare global { namespace jest { interface Matchers { toBeAlertAction(action?: Action): R; - toBeWarnAction(action?: Action): R; toBeNoDataAction(action?: Action): R; - toBeErrorAction(action?: Action): R; } } } diff --git a/x-pack/plugins/observability/server/lib/rules/custom_threshold/custom_threshold_executor.ts b/x-pack/plugins/observability/server/lib/rules/custom_threshold/custom_threshold_executor.ts index bff471aaea2ec..6f0f146f2a267 100644 --- a/x-pack/plugins/observability/server/lib/rules/custom_threshold/custom_threshold_executor.ts +++ b/x-pack/plugins/observability/server/lib/rules/custom_threshold/custom_threshold_executor.ts @@ -56,7 +56,7 @@ export type MetricThresholdAlertState = AlertState; // no specific instance stat export interface MetricThresholdAlertContext extends Record { alertDetailsUrl: string; - groupings?: object; + group?: object; reason?: string; timestamp: string; // ISO string value?: Array | null; @@ -306,7 +306,7 @@ export const createMetricThresholdExecutor = ({ alertsLocator, basePath.publicBaseUrl ), - groupings: groupByKeysObjectMapping[group], + group: groupByKeysObjectMapping[group], reason, timestamp, value: alertResults.map((result, index) => { @@ -347,7 +347,7 @@ export const createMetricThresholdExecutor = ({ alertsLocator, basePath.publicBaseUrl ), - groupings: groupByKeysObjectForRecovered[recoveredAlertId], + group: groupByKeysObjectForRecovered[recoveredAlertId], timestamp: startedAt.toISOString(), ...additionalContext, }); diff --git a/x-pack/plugins/observability/server/lib/rules/custom_threshold/lib/create_bucket_selector.ts b/x-pack/plugins/observability/server/lib/rules/custom_threshold/lib/create_bucket_selector.ts index 6300bfac703f3..83c84af79eda6 100644 --- a/x-pack/plugins/observability/server/lib/rules/custom_threshold/lib/create_bucket_selector.ts +++ b/x-pack/plugins/observability/server/lib/rules/custom_threshold/lib/create_bucket_selector.ts @@ -7,19 +7,11 @@ import { Aggregators, - Comparator, MetricExpressionParams, } from '../../../../../common/custom_threshold_rule/types'; import { createConditionScript } from './create_condition_script'; import { createLastPeriod } from './wrap_in_period'; -const EMPTY_SHOULD_WARN = { - bucket_script: { - buckets_path: {}, - script: '0', - }, -}; - export const createBucketSelector = ( condition: MetricExpressionParams, alertOnGroupDisappear: boolean = false, @@ -28,7 +20,6 @@ export const createBucketSelector = ( lastPeriodEnd?: number ) => { const hasGroupBy = groupBy != null; - const hasWarn = condition.warningThreshold != null && condition.warningComparator != null; const isPercentile = [Aggregators.P95, Aggregators.P99].includes(condition.aggType); const isCount = condition.aggType === Aggregators.COUNT; const isRate = condition.aggType === Aggregators.RATE; @@ -42,20 +33,6 @@ export const createBucketSelector = ( }]` : "currentPeriod['all']>aggregatedValue"; - const shouldWarn = hasWarn - ? { - bucket_script: { - buckets_path: { - value: bucketPath, - }, - script: createConditionScript( - condition.warningThreshold as number[], - condition.warningComparator as Comparator - ), - }, - } - : EMPTY_SHOULD_WARN; - const shouldTrigger = { bucket_script: { buckets_path: { @@ -66,7 +43,6 @@ export const createBucketSelector = ( }; const aggs: any = { - shouldWarn, shouldTrigger, }; @@ -97,17 +73,16 @@ export const createBucketSelector = ( const evalutionBucketPath = alertOnGroupDisappear && lastPeriodEnd ? { - shouldWarn: 'shouldWarn', shouldTrigger: 'shouldTrigger', missingGroup: 'missingGroup', newOrRecoveredGroup: 'newOrRecoveredGroup', } - : { shouldWarn: 'shouldWarn', shouldTrigger: 'shouldTrigger' }; + : { shouldTrigger: 'shouldTrigger' }; const evaluationScript = alertOnGroupDisappear && lastPeriodEnd - ? '(params.missingGroup != null && params.missingGroup > 0) || (params.shouldWarn != null && params.shouldWarn > 0) || (params.shouldTrigger != null && params.shouldTrigger > 0) || (params.newOrRecoveredGroup != null && params.newOrRecoveredGroup > 0)' - : '(params.shouldWarn != null && params.shouldWarn > 0) || (params.shouldTrigger != null && params.shouldTrigger > 0)'; + ? '(params.missingGroup != null && params.missingGroup > 0) || (params.shouldTrigger != null && params.shouldTrigger > 0) || (params.newOrRecoveredGroup != null && params.newOrRecoveredGroup > 0)' + : '(params.shouldTrigger != null && params.shouldTrigger > 0)'; aggs.evaluation = { bucket_selector: { diff --git a/x-pack/plugins/observability/server/lib/rules/custom_threshold/lib/evaluate_rule.ts b/x-pack/plugins/observability/server/lib/rules/custom_threshold/lib/evaluate_rule.ts index 66007de19b622..33410cbfb9742 100644 --- a/x-pack/plugins/observability/server/lib/rules/custom_threshold/lib/evaluate_rule.ts +++ b/x-pack/plugins/observability/server/lib/rules/custom_threshold/lib/evaluate_rule.ts @@ -28,7 +28,6 @@ export type Evaluation = Omit & { currentValue: number | null; timestamp: string; shouldFire: boolean; - shouldWarn: boolean; isNoData: boolean; bucketKey: Record; context?: AdditionalContext; @@ -91,7 +90,6 @@ export const evaluateRule = async = {}; for (const key of Object.keys(currentValues)) { const result = currentValues[key]; - if (result.trigger || result.warn || result.value === null) { + if (result.trigger || result.value === null) { evaluations[key] = { ...criterion, metric: @@ -114,7 +112,6 @@ export const evaluateRule = async 0) { previous[key] = { trigger: false, - warn: false, value: null, bucketKey: bucket.key, }; @@ -179,7 +172,6 @@ export const getData = async ( previous[key] = { trigger: (shouldTrigger && shouldTrigger.value > 0) || false, - warn: (shouldWarn && shouldWarn.value > 0) || false, value, bucketKey: bucket.key, container: containerList, @@ -210,7 +202,6 @@ export const getData = async ( const { currentPeriod, aggregatedValue: aggregatedValueForRate, - shouldWarn, shouldTrigger, } = aggs.all.buckets.all; @@ -224,20 +215,15 @@ export const getData = async ( : aggregatedValue != null ? getValue(aggregatedValue, params) : null; - // There is an edge case where there is no results and the shouldWarn/shouldTrigger + // There is an edge case where there is no results and the shouldTrigger // bucket scripts will be missing. This is only an issue for document count because // the value will end up being ZERO, for other metrics it will be null. In this case // we need to do the evaluation in Node.js if (aggs.all && params.aggType === Aggregators.COUNT && value === 0) { const trigger = comparatorMap[params.comparator](value, params.threshold); - const warn = - params.warningThreshold && params.warningComparator - ? comparatorMap[params.warningComparator](value, params.warningThreshold) - : false; return { [UNGROUPED_FACTORY_KEY]: { value, - warn, trigger, bucketKey: { groupBy0: UNGROUPED_FACTORY_KEY }, }, @@ -246,7 +232,6 @@ export const getData = async ( return { [UNGROUPED_FACTORY_KEY]: { value, - warn: (shouldWarn && shouldWarn.value > 0) || false, trigger: (shouldTrigger && shouldTrigger.value > 0) || false, bucketKey: { groupBy0: UNGROUPED_FACTORY_KEY }, }, diff --git a/x-pack/plugins/observability/server/lib/rules/custom_threshold/register_custom_threshold_rule_type.ts b/x-pack/plugins/observability/server/lib/rules/custom_threshold/register_custom_threshold_rule_type.ts index a3bd05e4316a8..a6466deb25a47 100644 --- a/x-pack/plugins/observability/server/lib/rules/custom_threshold/register_custom_threshold_rule_type.ts +++ b/x-pack/plugins/observability/server/lib/rules/custom_threshold/register_custom_threshold_rule_type.ts @@ -69,7 +69,6 @@ export function thresholdRuleType( comparator: oneOfLiterals(Object.values(Comparator)), timeUnit: schema.string(), timeSize: schema.number(), - warningComparator: schema.maybe(oneOfLiterals(Object.values(Comparator))), }; const nonCountCriterion = schema.object({ diff --git a/x-pack/plugins/observability/server/lib/rules/custom_threshold/types.ts b/x-pack/plugins/observability/server/lib/rules/custom_threshold/types.ts index e66042bcb648d..cc63f2cd688d3 100644 --- a/x-pack/plugins/observability/server/lib/rules/custom_threshold/types.ts +++ b/x-pack/plugins/observability/server/lib/rules/custom_threshold/types.ts @@ -51,8 +51,6 @@ interface BaseMetricExpressionParams { timeUnit: TimeUnitChar; threshold: number[]; comparator: Comparator; - warningComparator?: Comparator; - warningThreshold?: number[]; } export interface NonCountMetricExpressionParams extends BaseMetricExpressionParams { From b12a42261b768ec3b4858d9e2a0f4a053b643ec5 Mon Sep 17 00:00:00 2001 From: Marco Vettorello Date: Thu, 28 Sep 2023 14:14:58 +0200 Subject: [PATCH 12/61] [Lens] Color mapping for categorical dimensions (#162389) ## Summary This PR introduces the new color mapping feature into Lens. The color mapping feature is introduced as a standalone sharable component available from `@kbn/coloring`. The [README.md](https://github.com/elastic/kibana/blob/ddd216457d66912de43c7688ae99044c2c34bbd2/packages/kbn-coloring/src/shared_components/color_mapping/README.md) file describes the components and the logic behind it. The Color Mapping component is also connected to Lens and is available in the following charts: - XY (you can specify the mappings from a breakdown dimension - Partition (you can specify the mappings from the main slice/group by dimension) - Tag cloud (you can specify the mappings from the tags dimension) This MVP feature will be released under the Tech Preview flag. This PR needs to prove the user experience and the ease of use. UI styles, design improvements and embellishments will be released in subsequent PRs. The current MVP-provided palettes are just a placeholder. I'm coordinating with @gvnmagni for a final set of palettes. close https://github.com/elastic/kibana/issues/155037 close https://github.com/elastic/kibana/issues/6480 fix https://github.com/elastic/kibana/issues/28618 fix https://github.com/elastic/kibana/issues/96044 fix https://github.com/elastic/kibana/issues/101942 fix https://github.com/elastic/kibana/issues/112839 fix https://github.com/elastic/kibana/issues/116634 ## Release note This feature introduces the ability to change and map colors to break down dimensions in Lens. The feature provides an improved way to specify colors and their association with categories by giving the user a predefined set of color choices or customized one that drives the user toward a correct color selection. It provides ways to pick new colors and generate gradients. This feature is in Tech Preview and is enabled by default on every new visualization but can be turned off at will. ![image](https://github.com/elastic/kibana/assets/1421091/d03e59f8-4a6f-4761-ab4c-c53a57c1723a) --- .../shared_components/color_mapping/README.md | 87 +++++ .../__stories__/color_mapping.stories.tsx | 132 +++++++ .../categorical_color_mapping.test.tsx | 115 ++++++ .../categorical_color_mapping.tsx | 97 +++++ .../color/color_handling.test.ts | 294 +++++++++++++++ .../color_mapping/color/color_handling.ts | 164 +++++++++ .../color_mapping/color/color_math.ts | 60 ++++ .../color_mapping/color/rule_matching.ts | 46 +++ .../components/assignment/assignment.tsx | 150 ++++++++ .../components/assignment/match.tsx | 101 ++++++ .../components/assignment/range.tsx | 67 ++++ .../assignment/special_assignment.tsx | 79 ++++ .../components/color_picker/color_picker.tsx | 117 ++++++ .../components/color_picker/color_swatch.tsx | 184 ++++++++++ .../color_picker/palette_colors.tsx | 133 +++++++ .../components/color_picker/rgb_picker.tsx | 144 ++++++++ .../components/container/container.tsx | 252 +++++++++++++ .../components/palette_selector/gradient.tsx | 336 ++++++++++++++++++ .../palette_selector/palette_selector.tsx | 263 ++++++++++++++ .../palette_selector/scale_categorical.tsx | 17 + .../palette_selector/scale_sequential.tsx | 20 ++ .../config/assignment_from_categories.ts | 65 ++++ .../color_mapping/config/assignments.ts | 91 +++++ .../config/default_color_mapping.ts | 79 ++++ .../color_mapping/config/index.ts | 9 + .../color_mapping/config/types.ts | 153 ++++++++ .../shared_components/color_mapping/index.ts | 19 + .../color_mapping/palettes/elastic_brand.ts | 28 ++ .../color_mapping/palettes/eui_amsterdam.ts | 32 ++ .../color_mapping/palettes/index.ts | 37 ++ .../color_mapping/palettes/kibana_legacy.ts | 29 ++ .../color_mapping/palettes/neutral.ts | 23 ++ .../color_mapping/state/color_mapping.ts | 225 ++++++++++++ .../color_mapping/state/selectors.ts | 26 ++ .../color_mapping/state/ui.ts | 55 +++ .../src/shared_components/index.ts | 2 + packages/kbn-coloring/tsconfig.json | 3 +- packages/kbn-optimizer/limits.yml | 4 +- .../common/color_categories.ts | 41 +++ src/plugins/chart_expressions/common/index.ts | 1 + .../chart_expressions/common/tsconfig.json | 2 + .../expression_legacy_metric/kibana.jsonc | 3 +- .../expression_metric/kibana.jsonc | 3 +- .../mosaic_vis_function.test.ts.snap | 1 + .../pie_vis_function.test.ts.snap | 2 + .../treemap_vis_function.test.ts.snap | 1 + .../waffle_vis_function.test.ts.snap | 1 + .../common/expression_functions/i18n.ts | 4 + .../mosaic_vis_function.ts | 5 + .../expression_functions/pie_vis_function.ts | 5 + .../treemap_vis_function.ts | 5 + .../waffle_vis_function.ts | 5 + .../common/types/expression_renderers.ts | 1 + .../utils/colors/color_mapping_accessors.ts | 77 ++++ .../public/utils/layers/get_layers.ts | 106 ++++-- .../tagcloud_function.test.ts.snap | 2 + .../expression_functions/tagcloud_function.ts | 8 + .../common/types/expression_functions.ts | 1 + .../expression_tagcloud/kibana.jsonc | 1 + .../components/tagcloud_component.test.tsx | 2 + .../public/components/tagcloud_component.tsx | 65 +++- .../tagcloud_renderer.tsx | 7 + .../expression_tagcloud/tsconfig.json | 1 + .../common_data_layer_args.ts | 4 + .../common/expression_functions/xy_vis_fn.ts | 1 + .../expression_xy/common/i18n/index.tsx | 4 + .../common/types/expression_functions.ts | 2 + .../__snapshots__/xy_chart.test.tsx.snap | 10 + .../public/components/data_layers.tsx | 3 + .../public/components/xy_chart.tsx | 1 + .../helpers/color/color_mapping_accessor.ts | 49 +++ .../public/helpers/color_assignment.ts | 5 + .../public/helpers/data_layers.tsx | 53 ++- src/plugins/charts/kibana.jsonc | 3 +- .../data/common/search/aggs/buckets/index.ts | 2 +- .../search/aggs/buckets/multi_field_key.ts | 10 + .../snapshots/baseline/partial_test_1.json | 2 +- .../snapshots/baseline/tagcloud_all_data.json | 2 +- .../baseline/tagcloud_empty_data.json | 2 +- .../snapshots/baseline/tagcloud_fontsize.json | 2 +- .../baseline/tagcloud_metric_data.json | 2 +- .../snapshots/baseline/tagcloud_options.json | 2 +- .../snapshots/session/partial_test_1.json | 2 +- .../snapshots/session/tagcloud_all_data.json | 2 +- .../session/tagcloud_empty_data.json | 2 +- .../snapshots/session/tagcloud_fontsize.json | 2 +- .../session/tagcloud_metric_data.json | 2 +- .../snapshots/session/tagcloud_options.json | 2 +- x-pack/plugins/lens/common/types.ts | 3 +- x-pack/plugins/lens/public/app_plugin/app.tsx | 2 +- .../editor_frame/state_helpers.ts | 4 +- .../editor_frame/suggestion_helpers.test.ts | 16 +- .../editor_frame/suggestion_helpers.ts | 8 +- .../workspace_panel/chart_switch.test.tsx | 7 +- .../coloring/palette_panel_container.tsx | 12 +- .../shared_components/palette_picker.tsx | 32 +- x-pack/plugins/lens/public/types.ts | 19 +- .../datatable/components/dimension_editor.tsx | 3 + .../visualizations/gauge/dimension_editor.tsx | 3 + .../visualizations/gauge/visualization.tsx | 2 +- .../heatmap/dimension_editor.tsx | 3 + .../legacy_metric/dimension_editor.tsx | 3 + .../metric/dimension_editor.tsx | 3 + .../visualizations/metric/visualization.tsx | 2 +- .../partition/dimension_editor.tsx | 171 ++++++++- .../partition/suggestions.test.ts | 13 +- .../visualizations/partition/suggestions.ts | 34 +- .../visualizations/partition/to_expression.ts | 4 +- .../partition/visualization.tsx | 57 ++- .../public/visualizations/tagcloud/index.ts | 2 +- .../visualizations/tagcloud/suggestions.ts | 6 + .../tagcloud/tagcloud_visualization.tsx | 42 ++- .../tagcloud/tags_dimension_editor.tsx | 195 +++++++++- .../public/visualizations/tagcloud/types.ts | 3 +- .../public/visualizations/xy/to_expression.ts | 3 +- .../lens/public/visualizations/xy/types.ts | 3 +- .../visualizations/xy/visualization.test.tsx | 23 ++ .../visualizations/xy/visualization.tsx | 43 ++- .../xy/xy_config_panel/dimension_editor.tsx | 185 +++++++++- .../xy_config_panel/xy_config_panel.test.tsx | 5 + .../visualizations/xy/xy_suggestions.test.ts | 33 +- .../visualizations/xy/xy_suggestions.ts | 20 +- x-pack/plugins/lens/tsconfig.json | 1 + .../translations/translations/fr-FR.json | 1 - .../translations/translations/ja-JP.json | 1 - .../translations/translations/zh-CN.json | 1 - .../apps/dashboard/group2/sync_colors.ts | 2 + .../apps/lens/group4/color_mapping.ts | 73 ++++ .../functional/apps/lens/group4/colors.ts | 38 +- .../test/functional/apps/lens/group4/index.ts | 1 + .../test/functional/page_objects/lens_page.ts | 82 ++++- x-pack/test/tsconfig.json | 1 + 132 files changed, 5209 insertions(+), 215 deletions(-) create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/README.md create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/__stories__/color_mapping.stories.tsx create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.test.tsx create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.test.ts create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/color/color_math.ts create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/color/rule_matching.ts create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/assignment.tsx create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/match.tsx create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/range.tsx create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/special_assignment.tsx create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/components/color_picker/color_picker.tsx create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/components/color_picker/color_swatch.tsx create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/components/color_picker/palette_colors.tsx create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/components/color_picker/rgb_picker.tsx create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/components/container/container.tsx create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/gradient.tsx create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/palette_selector.tsx create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/scale_categorical.tsx create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/scale_sequential.tsx create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/config/assignment_from_categories.ts create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/config/assignments.ts create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/config/index.ts create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/config/types.ts create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/index.ts create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/palettes/index.ts create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/state/color_mapping.ts create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/state/selectors.ts create mode 100644 packages/kbn-coloring/src/shared_components/color_mapping/state/ui.ts create mode 100644 src/plugins/chart_expressions/common/color_categories.ts create mode 100644 src/plugins/chart_expressions/expression_partition_vis/public/utils/colors/color_mapping_accessors.ts create mode 100644 src/plugins/chart_expressions/expression_xy/public/helpers/color/color_mapping_accessor.ts create mode 100644 x-pack/test/functional/apps/lens/group4/color_mapping.ts diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/README.md b/packages/kbn-coloring/src/shared_components/color_mapping/README.md new file mode 100644 index 0000000000000..220824ca47820 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/README.md @@ -0,0 +1,87 @@ +# Color Mapping + +This shared component can be used to define a color mapping as an association of one or multiple string values to a color definition. + +This package provides: +- a React component, called `CategoricalColorMapping` that provides a simplified UI (that in general can be hosted in a flyout), that helps the user generate a `ColorMapping.Config` object that descibes the mappings configuration +- a function `getColorFactory` that given a color mapping configuration returns a function that maps a passed category to the corresponding color +- a definition scheme for the color mapping, based on the type `ColorMapping.Config`, that provides an extensible way of describing the link between colors and rules. Collects the minimal information required apply colors based on categories. Together with the `ColorMappingInputData` can be used to get colors in a deterministic way. + + +An example of the configuration is the following: +```ts +const DEFAULT_COLOR_MAPPING_CONFIG: ColorMapping.Config = { + assignmentMode: 'auto', + assignments: [ + { + rule: { + type: 'matchExactly', + values: ['']; + }, + color: { + type: 'categorical', + paletteId: 'eui', + colorIndex: 2, + } + } + ], + specialAssignments: [ + { + rule: { + type: 'other', + }, + color: { + type: 'categorical', + paletteId: 'neutral', + colorIndex: 2 + }, + touched: false, + }, + ], + paletteId: EUIPalette.id, + colorMode: { + type: 'categorical', + }, +}; +``` + +The function `getColorFactory` is a curry function where, given the model, a palette getter, the theme mode (dark/light) and a list of categories, returns a function that can be used to pick the right color based on a given category. + +```ts +function getColorFactory( + model: ColorMapping.Config, + getPaletteFn: (paletteId: string) => ColorMapping.CategoricalPalette, + isDarkMode: boolean, + data: { + type: 'categories'; + categories: Array; + } +): (category: string | string[]) => Color +``` + + + +A `category` can be in the shape of a plain string or an array of strings. Numbers, MultiFieldKey, IP etc needs to be stringified. + + +The `CategoricalColorMapping` React component has the following props: + +```tsx +function CategoricalColorMapping(props: { + /** The initial color mapping model, usually coming from a the visualization saved object */ + model: ColorMapping.Config; + /** A map of paletteId and palette configuration */ + palettes: Map; + /** A data description of what needs to be colored */ + data: ColorMappingInputData; + /** Theme dark mode */ + isDarkMode: boolean; + /** A map between original and formatted tokens used to handle special cases, like the Other bucket and the empty bucket */ + specialTokens: Map; + /** A function called at every change in the model */ + onModelUpdate: (model: ColorMapping.Config) => void; +}) + +``` + +the `onModelUpdate` callback is called everytime a change in the model is applied from within the component. Is not called when the `model` prop is updated. \ No newline at end of file diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/__stories__/color_mapping.stories.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/__stories__/color_mapping.stories.tsx new file mode 100644 index 0000000000000..95f4ff5623ea3 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/__stories__/color_mapping.stories.tsx @@ -0,0 +1,132 @@ +/* + * 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 React, { FC } from 'react'; +import { EuiFlyout, EuiForm } from '@elastic/eui'; +import { ComponentStory } from '@storybook/react'; +import { CategoricalColorMapping, ColorMappingProps } from '../categorical_color_mapping'; +import { AVAILABLE_PALETTES } from '../palettes'; +import { DEFAULT_COLOR_MAPPING_CONFIG } from '../config/default_color_mapping'; + +export default { + title: 'Color Mapping', + component: CategoricalColorMapping, + decorators: [ + (story: Function) => ( + {}} hideCloseButton> + {story()} + + ), + ], +}; + +const Template: ComponentStory> = (args) => ( + +); + +export const Default = Template.bind({}); + +Default.args = { + model: { + ...DEFAULT_COLOR_MAPPING_CONFIG, + assignmentMode: 'manual', + colorMode: { + type: 'gradient', + steps: [ + { + type: 'categorical', + colorIndex: 0, + paletteId: DEFAULT_COLOR_MAPPING_CONFIG.paletteId, + touched: false, + }, + { + type: 'categorical', + colorIndex: 1, + paletteId: DEFAULT_COLOR_MAPPING_CONFIG.paletteId, + touched: false, + }, + { + type: 'categorical', + colorIndex: 2, + paletteId: DEFAULT_COLOR_MAPPING_CONFIG.paletteId, + touched: false, + }, + ], + sort: 'asc', + }, + assignments: [ + { + rule: { + type: 'matchExactly', + values: ['this is', 'a multi-line combobox that is very long and that will be truncated'], + }, + color: { + type: 'gradient', + }, + touched: false, + }, + { + rule: { + type: 'matchExactly', + values: ['b', ['double', 'value']], + }, + color: { + type: 'gradient', + }, + touched: false, + }, + { + rule: { + type: 'matchExactly', + values: ['c'], + }, + color: { + type: 'gradient', + }, + touched: false, + }, + { + rule: { + type: 'matchExactly', + values: [ + 'this is', + 'a multi-line wrap', + 'combo box', + 'test combo', + '3 lines', + ['double', 'value'], + ], + }, + color: { + type: 'gradient', + }, + touched: false, + }, + ], + }, + isDarkMode: false, + data: { + type: 'categories', + categories: [ + 'a', + 'b', + 'c', + 'd', + 'this is', + 'a multi-line wrap', + 'combo box', + 'test combo', + '3 lines', + ], + }, + + palettes: AVAILABLE_PALETTES, + specialTokens: new Map(), + // eslint-disable-next-line no-console + onModelUpdate: (model) => console.log(model), +}; diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.test.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.test.tsx new file mode 100644 index 0000000000000..fe8374d7dcdcd --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.test.tsx @@ -0,0 +1,115 @@ +/* + * 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 React from 'react'; +import { mount } from 'enzyme'; +import { CategoricalColorMapping, ColorMappingInputData } from './categorical_color_mapping'; +import { AVAILABLE_PALETTES } from './palettes'; +import { DEFAULT_COLOR_MAPPING_CONFIG } from './config/default_color_mapping'; +import { MULTI_FIELD_KEY_SEPARATOR } from '@kbn/data-plugin/common'; + +const AUTO_ASSIGN_SWITCH = '[data-test-subj="lns-colorMapping-autoAssignSwitch"]'; +const ASSIGNMENTS_LIST = '[data-test-subj="lns-colorMapping-assignmentsList"]'; +const ASSIGNMENT_ITEM = (i: number) => `[data-test-subj="lns-colorMapping-assignmentsItem${i}"]`; + +describe('color mapping', () => { + it('load a default color mapping', () => { + const dataInput: ColorMappingInputData = { + type: 'categories', + categories: ['categoryA', 'categoryB'], + }; + const onModelUpdateFn = jest.fn(); + const component = mount( + + ); + + expect(component.find(AUTO_ASSIGN_SWITCH).hostNodes().prop('aria-checked')).toEqual(true); + expect(component.find(ASSIGNMENTS_LIST).hostNodes().children().length).toEqual( + dataInput.categories.length + ); + dataInput.categories.forEach((category, index) => { + const assignment = component.find(ASSIGNMENT_ITEM(index)).hostNodes(); + expect(assignment.text()).toEqual(category); + expect(assignment.hasClass('euiComboBox-isDisabled')).toEqual(true); + }); + expect(onModelUpdateFn).not.toBeCalled(); + }); + + it('switch to manual assignments', () => { + const dataInput: ColorMappingInputData = { + type: 'categories', + categories: ['categoryA', 'categoryB'], + }; + const onModelUpdateFn = jest.fn(); + const component = mount( + + ); + component.find(AUTO_ASSIGN_SWITCH).hostNodes().simulate('click'); + expect(onModelUpdateFn).toBeCalledTimes(1); + expect(component.find(AUTO_ASSIGN_SWITCH).hostNodes().prop('aria-checked')).toEqual(false); + expect(component.find(ASSIGNMENTS_LIST).hostNodes().children().length).toEqual( + dataInput.categories.length + ); + dataInput.categories.forEach((category, index) => { + const assignment = component.find(ASSIGNMENT_ITEM(index)).hostNodes(); + expect(assignment.text()).toEqual(category); + expect(assignment.hasClass('euiComboBox-isDisabled')).toEqual(false); + }); + }); + + it('handle special tokens, multi-fields keys and non-trimmed whitespaces', () => { + const dataInput: ColorMappingInputData = { + type: 'categories', + categories: ['__other__', ['fieldA', 'fieldB'], '__empty__', ' with-whitespaces '], + }; + const onModelUpdateFn = jest.fn(); + const component = mount( + + ); + expect(component.find(ASSIGNMENTS_LIST).hostNodes().children().length).toEqual( + dataInput.categories.length + ); + const assignment1 = component.find(ASSIGNMENT_ITEM(0)).hostNodes(); + expect(assignment1.text()).toEqual('Other'); + + const assignment2 = component.find(ASSIGNMENT_ITEM(1)).hostNodes(); + expect(assignment2.text()).toEqual(`fieldA${MULTI_FIELD_KEY_SEPARATOR}fieldB`); + + const assignment3 = component.find(ASSIGNMENT_ITEM(2)).hostNodes(); + expect(assignment3.text()).toEqual('(Empty)'); + + const assignment4 = component.find(ASSIGNMENT_ITEM(3)).hostNodes(); + expect(assignment4.text()).toEqual(' with-whitespaces '); + }); +}); diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx new file mode 100644 index 0000000000000..290c549684f90 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx @@ -0,0 +1,97 @@ +/* + * 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 React from 'react'; +import { Provider } from 'react-redux'; +import { type EnhancedStore, configureStore } from '@reduxjs/toolkit'; +import { isEqual } from 'lodash'; +import { colorMappingReducer, updateModel } from './state/color_mapping'; +import { Container } from './components/container/container'; +import { ColorMapping } from './config'; +import { uiReducer } from './state/ui'; + +/** + * A configuration object that is required to populate correctly the visible categories + * or the ranges in the CategoricalColorMapping component + */ +export type ColorMappingInputData = + | { + type: 'categories'; + /** an ORDERED array of categories rendered in the visualization */ + categories: Array; + } + | { + type: 'ranges'; + min: number; + max: number; + bins: number; + }; + +/** + * The props of the CategoricalColorMapping component + */ +export interface ColorMappingProps { + /** The initial color mapping model, usually coming from a the visualization saved object */ + model: ColorMapping.Config; + /** A map of paletteId and palette configuration */ + palettes: Map; + /** A data description of what needs to be colored */ + data: ColorMappingInputData; + /** Theme dark mode */ + isDarkMode: boolean; + /** A map between original and formatted tokens used to handle special cases, like the Other bucket and the empty bucket */ + specialTokens: Map; + /** A function called at every change in the model */ + onModelUpdate: (model: ColorMapping.Config) => void; +} + +/** + * The React component for mapping categorical values to colors + */ +export class CategoricalColorMapping extends React.Component { + store: EnhancedStore<{ colorMapping: ColorMapping.Config }>; + unsubscribe: () => void; + constructor(props: ColorMappingProps) { + super(props); + // configure the store at mount time + this.store = configureStore({ + preloadedState: { + colorMapping: props.model, + }, + reducer: { + colorMapping: colorMappingReducer, + ui: uiReducer, + }, + }); + // subscribe to store changes to update external tools + this.unsubscribe = this.store.subscribe(() => { + this.props.onModelUpdate(this.store.getState().colorMapping); + }); + } + componentWillUnmount() { + this.unsubscribe(); + } + componentDidUpdate(prevProps: Readonly) { + if (!isEqual(prevProps.model, this.props.model)) { + this.store.dispatch(updateModel(this.props.model)); + } + } + render() { + const { palettes, data, isDarkMode, specialTokens } = this.props; + return ( + + + + ); + } +} diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.test.ts b/packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.test.ts new file mode 100644 index 0000000000000..93896394daf41 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.test.ts @@ -0,0 +1,294 @@ +/* + * 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 { + DEFAULT_COLOR_MAPPING_CONFIG, + DEFAULT_NEUTRAL_PALETTE_INDEX, +} from '../config/default_color_mapping'; +import { getColorFactory } from './color_handling'; +import { getPalette, AVAILABLE_PALETTES } from '../palettes'; +import { + EUIAmsterdamColorBlindPalette, + EUI_AMSTERDAM_PALETTE_COLORS, +} from '../palettes/eui_amsterdam'; +import { NeutralPalette, NEUTRAL_COLOR_DARK, NEUTRAL_COLOR_LIGHT } from '../palettes/neutral'; +import { toHex } from './color_math'; + +import { ColorMapping } from '../config'; + +describe('Color mapping - color generation', () => { + const getPaletteFn = getPalette(AVAILABLE_PALETTES, NeutralPalette); + it('returns EUI light colors from default config', () => { + const colorFactory = getColorFactory(DEFAULT_COLOR_MAPPING_CONFIG, getPaletteFn, false, { + type: 'categories', + categories: ['catA', 'catB', 'catC'], + }); + expect(colorFactory('catA')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[0]); + expect(colorFactory('catB')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[1]); + expect(colorFactory('catC')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[2]); + // if the category is not available in the `categories` list then a default neutral color is used + expect(colorFactory('not_available')).toBe(NEUTRAL_COLOR_LIGHT[DEFAULT_NEUTRAL_PALETTE_INDEX]); + }); + + it('returns max number of colors defined in palette, use other color otherwise', () => { + const twoColorPalette: ColorMapping.CategoricalPalette = { + id: 'twoColors', + name: 'twoColors', + colorCount: 2, + type: 'categorical', + getColor(valueInRange, isDarkMode) { + return ['red', 'blue'][valueInRange]; + }, + }; + + const simplifiedGetPaletteGn = getPalette( + new Map([[twoColorPalette.id, twoColorPalette]]), + NeutralPalette + ); + const colorFactory = getColorFactory( + { + ...DEFAULT_COLOR_MAPPING_CONFIG, + paletteId: twoColorPalette.id, + }, + simplifiedGetPaletteGn, + false, + { + type: 'categories', + categories: ['cat1', 'cat2', 'cat3', 'cat4'], + } + ); + expect(colorFactory('cat1')).toBe('#ff0000'); + expect(colorFactory('cat2')).toBe('#0000ff'); + // return a palette color only up to the max number of color in the palette + expect(colorFactory('cat3')).toBe(NEUTRAL_COLOR_LIGHT[DEFAULT_NEUTRAL_PALETTE_INDEX]); + expect(colorFactory('cat4')).toBe(NEUTRAL_COLOR_LIGHT[DEFAULT_NEUTRAL_PALETTE_INDEX]); + }); + + // currently there is no difference in the two colors, but this could change in the future + // this test will catch the change + it('returns EUI dark colors from default config', () => { + const colorFactory = getColorFactory(DEFAULT_COLOR_MAPPING_CONFIG, getPaletteFn, true, { + type: 'categories', + categories: ['catA', 'catB', 'catC'], + }); + expect(colorFactory('catA')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[0]); + expect(colorFactory('catB')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[1]); + expect(colorFactory('catC')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[2]); + // if the category is not available in the `categories` list then a default neutral color is used + expect(colorFactory('not_available')).toBe(NEUTRAL_COLOR_DARK[DEFAULT_NEUTRAL_PALETTE_INDEX]); + }); + + it('handles special tokens, multi-field categories and non-trimmed whitespaces', () => { + const colorFactory = getColorFactory(DEFAULT_COLOR_MAPPING_CONFIG, getPaletteFn, false, { + type: 'categories', + categories: ['__other__', ['fieldA', 'fieldB'], '__empty__', ' with-whitespaces '], + }); + expect(colorFactory('__other__')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[0]); + expect(colorFactory(['fieldA', 'fieldB'])).toBe(EUI_AMSTERDAM_PALETTE_COLORS[1]); + expect(colorFactory('__empty__')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[2]); + expect(colorFactory(' with-whitespaces ')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[3]); + }); + + it('ignores configured assignments in auto mode', () => { + const colorFactory = getColorFactory( + { + ...DEFAULT_COLOR_MAPPING_CONFIG, + assignments: [ + { + color: { type: 'colorCode', colorCode: 'red' }, + rule: { type: 'matchExactly', values: ['assignmentToIgnore'] }, + touched: false, + }, + ], + }, + getPaletteFn, + false, + { + type: 'categories', + categories: ['catA', 'catB', 'assignmentToIgnore'], + } + ); + expect(colorFactory('catA')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[0]); + expect(colorFactory('catB')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[1]); + expect(colorFactory('assignmentToIgnore')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[2]); + }); + + it('color with auto rule are assigned in order of the configured data input', () => { + const colorFactory = getColorFactory( + { + ...DEFAULT_COLOR_MAPPING_CONFIG, + assignmentMode: 'manual', + assignments: [ + { + color: { type: 'colorCode', colorCode: 'red' }, + rule: { type: 'auto' }, + touched: false, + }, + { + color: { type: 'colorCode', colorCode: 'blue' }, + rule: { type: 'matchExactly', values: ['blueCat'] }, + touched: false, + }, + { + color: { type: 'colorCode', colorCode: 'green' }, + rule: { type: 'auto' }, + touched: false, + }, + ], + }, + getPaletteFn, + false, + { + type: 'categories', + categories: ['blueCat', 'redCat', 'greenCat'], + } + ); + // this matches exactly + expect(colorFactory('blueCat')).toBe('blue'); + // this matches with the first availabe "auto" rule + expect(colorFactory('redCat')).toBe('red'); + // this matches with the second availabe "auto" rule + expect(colorFactory('greenCat')).toBe('green'); + // if the category is not available in the `categories` list then a default neutral color is used + expect(colorFactory('not_available')).toBe(NEUTRAL_COLOR_LIGHT[DEFAULT_NEUTRAL_PALETTE_INDEX]); + }); + + it('returns sequential gradient colors from darker to lighter [desc, lightMode]', () => { + const colorFactory = getColorFactory( + { + ...DEFAULT_COLOR_MAPPING_CONFIG, + colorMode: { + type: 'gradient', + steps: [ + { + type: 'categorical', + paletteId: EUIAmsterdamColorBlindPalette.id, + colorIndex: 0, + touched: false, + }, + ], + sort: 'desc', + }, + }, + getPaletteFn, + false, + { + type: 'categories', + categories: ['cat1', 'cat2', 'cat3'], + } + ); + // this matches exactly with the initial step selected + expect(toHex(colorFactory('cat1'))).toBe(toHex(EUI_AMSTERDAM_PALETTE_COLORS[0])); + expect(toHex(colorFactory('cat2'))).toBe('#93cebc'); + expect(toHex(colorFactory('cat3'))).toBe('#cce8e0'); + }); + + it('returns sequential gradient colors from lighter to darker [asc, lightMode]', () => { + const colorFactory = getColorFactory( + { + ...DEFAULT_COLOR_MAPPING_CONFIG, + colorMode: { + type: 'gradient', + steps: [ + { + type: 'categorical', + paletteId: EUIAmsterdamColorBlindPalette.id, + colorIndex: 0, + touched: false, + }, + ], + sort: 'asc', + }, + }, + getPaletteFn, + false, + { + type: 'categories', + categories: ['cat1', 'cat2', 'cat3'], + } + ); + expect(toHex(colorFactory('cat1'))).toBe('#cce8e0'); + expect(toHex(colorFactory('cat2'))).toBe('#93cebc'); + // this matches exactly with the initial step selected + expect(toHex(colorFactory('cat3'))).toBe(toHex(EUI_AMSTERDAM_PALETTE_COLORS[0])); + }); + + it('returns 2 colors gradient [desc, lightMode]', () => { + const colorFactory = getColorFactory( + { + ...DEFAULT_COLOR_MAPPING_CONFIG, + colorMode: { + type: 'gradient', + steps: [ + { + type: 'categorical', + paletteId: EUIAmsterdamColorBlindPalette.id, + colorIndex: 0, + touched: false, + }, + { + type: 'categorical', + paletteId: EUIAmsterdamColorBlindPalette.id, + colorIndex: 2, + touched: false, + }, + ], + sort: 'desc', + }, + }, + getPaletteFn, + false, + { + type: 'categories', + categories: ['cat1', 'cat2', 'cat3'], + } + ); + expect(toHex(colorFactory('cat1'))).toBe(toHex(EUI_AMSTERDAM_PALETTE_COLORS[0])); // EUI green + expect(toHex(colorFactory('cat2'))).toBe('#a4908f'); // red gray green + expect(toHex(colorFactory('cat3'))).toBe(toHex(EUI_AMSTERDAM_PALETTE_COLORS[2])); // EUI pink + }); + + it('returns divergent gradient [asc, darkMode]', () => { + const colorFactory = getColorFactory( + { + ...DEFAULT_COLOR_MAPPING_CONFIG, + colorMode: { + type: 'gradient', + steps: [ + { + type: 'categorical', + paletteId: EUIAmsterdamColorBlindPalette.id, + colorIndex: 0, + touched: false, + }, + { type: 'categorical', paletteId: NeutralPalette.id, colorIndex: 0, touched: false }, + { + type: 'categorical', + paletteId: EUIAmsterdamColorBlindPalette.id, + colorIndex: 2, + touched: false, + }, + ], + sort: 'asc', // testing in ascending order + }, + }, + getPaletteFn, + true, // testing in dark mode + { + type: 'categories', + categories: ['cat1', 'cat2', 'cat3'], + } + ); + expect(toHex(colorFactory('cat1'))).toBe(toHex(EUI_AMSTERDAM_PALETTE_COLORS[2])); // EUI pink + expect(toHex(colorFactory('cat2'))).toBe(NEUTRAL_COLOR_DARK[0]); // NEUTRAL LIGHT GRAY + expect(toHex(colorFactory('cat3'))).toBe(toHex(EUI_AMSTERDAM_PALETTE_COLORS[0])); // EUI green + expect(toHex(colorFactory('not available cat'))).toBe( + toHex(NEUTRAL_COLOR_DARK[DEFAULT_NEUTRAL_PALETTE_INDEX]) + ); // check the other + }); +}); diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts b/packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts new file mode 100644 index 0000000000000..795f94b740e9b --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts @@ -0,0 +1,164 @@ +/* + * 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 chroma from 'chroma-js'; +import { ColorMapping } from '../config'; +import { changeAlpha, combineColors, getValidColor } from './color_math'; +import { generateAutoAssignmentsForCategories } from '../config/assignment_from_categories'; +import { getPalette } from '../palettes'; +import { ColorMappingInputData } from '../categorical_color_mapping'; +import { ruleMatch } from './rule_matching'; +import { GradientColorMode } from '../config/types'; + +export function getAssignmentColor( + colorMode: ColorMapping.Config['colorMode'], + color: ColorMapping.Config['assignments'][number]['color'], + getPaletteFn: ReturnType, + isDarkMode: boolean, + index: number, + total: number +) { + switch (color.type) { + case 'colorCode': + case 'categorical': + return getColor(color, getPaletteFn, isDarkMode); + case 'gradient': { + if (colorMode.type === 'categorical') { + return 'red'; + } + const colorScale = getGradientColorScale(colorMode, getPaletteFn, isDarkMode); + return total === 0 ? 'red' : total === 1 ? colorScale(0) : colorScale(index / (total - 1)); + } + } +} + +export function getColor( + color: ColorMapping.ColorCode | ColorMapping.CategoricalColor, + getPaletteFn: ReturnType, + isDarkMode: boolean +) { + return color.type === 'colorCode' + ? color.colorCode + : getValidColor(getPaletteFn(color.paletteId).getColor(color.colorIndex, isDarkMode)).hex(); +} + +export function getColorFactory( + model: ColorMapping.Config, + getPaletteFn: ReturnType, + isDarkMode: boolean, + data: ColorMappingInputData +): (category: string | string[]) => string { + const palette = getPaletteFn(model.paletteId); + // generate on-the-fly assignments in auto-mode based on current data. + // This simplify the code by always using assignments, even if there is no real static assigmnets + const assignments = + model.assignmentMode === 'auto' + ? generateAutoAssignmentsForCategories(data, palette, model.colorMode) + : model.assignments; + + // find auto-assigned colors + const autoAssignedColors = + data.type === 'categories' + ? assignments.filter((a) => { + return ( + a.rule.type === 'auto' || (a.rule.type === 'matchExactly' && a.rule.values.length === 0) + ); + }) + : []; + + // find all categories that doesn't match with an assignment + const nonAssignedCategories = + data.type === 'categories' + ? data.categories.filter((category) => { + return !assignments.some(({ rule }) => ruleMatch(rule, category)); + }) + : []; + + return (category: string | string[]) => { + if (typeof category === 'string' || Array.isArray(category)) { + const nonAssignedCategoryIndex = nonAssignedCategories.indexOf(category); + + // return color for a non assigned category + if (nonAssignedCategoryIndex > -1) { + if (nonAssignedCategoryIndex < autoAssignedColors.length) { + const autoAssignmentIndex = assignments.findIndex( + (d) => d === autoAssignedColors[nonAssignedCategoryIndex] + ); + return getAssignmentColor( + model.colorMode, + autoAssignedColors[nonAssignedCategoryIndex].color, + getPaletteFn, + isDarkMode, + autoAssignmentIndex, + assignments.length + ); + } + // if no auto-assign color rule/color is available then use the other color + // TODO: the specialAssignment[0] position is arbitrary, we should fix it better + return getColor(model.specialAssignments[0].color, getPaletteFn, isDarkMode); + } + + // find the assignment where the category matches the rule + const matchingAssignmentIndex = assignments.findIndex(({ rule }) => { + return ruleMatch(rule, category); + }); + + // return the assigned color + if (matchingAssignmentIndex > -1) { + const assignment = assignments[matchingAssignmentIndex]; + return getAssignmentColor( + model.colorMode, + assignment.color, + getPaletteFn, + isDarkMode, + matchingAssignmentIndex, + assignments.length + ); + } + // if no assign color rule/color is available then use the other color + // TODO: the specialAssignment[0] position is arbitrary, we should fix it better + return getColor(model.specialAssignments[0].color, getPaletteFn, isDarkMode); + } else { + const matchingAssignmentIndex = assignments.findIndex(({ rule }) => { + return ruleMatch(rule, category); + }); + + if (matchingAssignmentIndex > -1) { + const assignment = assignments[matchingAssignmentIndex]; + return getAssignmentColor( + model.colorMode, + assignment.color, + getPaletteFn, + isDarkMode, + matchingAssignmentIndex, + assignments.length + ); + } + return getColor(model.specialAssignments[0].color, getPaletteFn, isDarkMode); + } + }; +} + +export function getGradientColorScale( + colorMode: GradientColorMode, + getPaletteFn: ReturnType, + isDarkMode: boolean +): (value: number) => string { + const steps = + colorMode.steps.length === 1 + ? [ + getColor(colorMode.steps[0], getPaletteFn, isDarkMode), + combineColors( + changeAlpha(getColor(colorMode.steps[0], getPaletteFn, isDarkMode), 0.3), + isDarkMode ? 'black' : 'white' + ), + ] + : colorMode.steps.map((d) => getColor(d, getPaletteFn, isDarkMode)); + steps.sort(() => (colorMode.sort === 'asc' ? -1 : 1)); + const scale = chroma.scale(steps).mode('lab'); + return (value: number) => scale(value).hex(); +} diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/color/color_math.ts b/packages/kbn-coloring/src/shared_components/color_mapping/color/color_math.ts new file mode 100644 index 0000000000000..eb9e57d52af55 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/color/color_math.ts @@ -0,0 +1,60 @@ +/* + * 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 chroma from 'chroma-js'; + +export function getValidColor(color: string): chroma.Color { + try { + return chroma(color); + } catch { + return chroma('red'); + } +} + +export function hasEnoughContrast(color: string, isDark: boolean, threshold = 4.5) { + return chroma.contrast(getValidColor(color), isDark ? 'black' : 'white') >= threshold; +} + +export function changeAlpha(color: string, alpha: number) { + const [r, g, b] = getValidColor(color).rgb(); + return `rgba(${r},${g},${b},${alpha})`; +} + +export function toHex(color: string) { + return getValidColor(color).hex().toLowerCase(); +} + +export function isSameColor(color1: string, color2: string) { + return toHex(color1) === toHex(color2); +} + +/** + * Blend a foreground (fg) color with a background (bg) color + */ +export function combineColors(fg: string, bg: string): string { + const [fgR, fgG, fgB, fgA] = getValidColor(fg).rgba(); + const [bgR, bgG, bgB, bgA] = getValidColor(bg).rgba(); + + // combine colors only if foreground has transparency + if (fgA === 1) { + return chroma.rgb(fgR, fgG, fgB).hex(); + } + + // For reference on alpha calculations: + // https://en.wikipedia.org/wiki/Alpha_compositing + const alpha = fgA + bgA * (1 - fgA); + + if (alpha === 0) { + return '#00000000'; + } + + const r = Math.round((fgR * fgA + bgR * bgA * (1 - fgA)) / alpha); + const g = Math.round((fgG * fgA + bgG * bgA * (1 - fgA)) / alpha); + const b = Math.round((fgB * fgA + bgB * bgA * (1 - fgA)) / alpha); + return `rgba(${r}, ${g}, ${b}, ${alpha})`; +} diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/color/rule_matching.ts b/packages/kbn-coloring/src/shared_components/color_mapping/color/rule_matching.ts new file mode 100644 index 0000000000000..7557644154a52 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/color/rule_matching.ts @@ -0,0 +1,46 @@ +/* + * 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 { ColorMapping } from '../config'; + +export function ruleMatch( + rule: ColorMapping.Config['assignments'][number]['rule'], + value: string | number | string[] +) { + switch (rule.type) { + case 'matchExactly': + if (Array.isArray(value)) { + return rule.values.some( + (v) => + Array.isArray(v) && v.length === value.length && v.every((part, i) => part === value[i]) + ); + } + return rule.values.includes(`${value}`); + case 'matchExactlyCI': + return rule.values.some((d) => d.toLowerCase() === `${value}`); + case 'range': + // TODO: color by value not yet possible in all charts in elastic-charts + return typeof value === 'number' ? rangeMatch(rule, value) : false; + default: + return false; + } +} + +export function rangeMatch(rule: ColorMapping.RuleRange, value: number) { + return ( + (rule.min === rule.max && rule.min === value) || + ((rule.minInclusive ? value >= rule.min : value > rule.min) && + (rule.maxInclusive ? value <= rule.max : value < rule.max)) + ); +} + +// TODO: move in some data/table related package +export const SPECIAL_TOKENS_STRING_CONVERTION = new Map([ + ['__other__', 'Other'], + ['', '(empty)'], +]); diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/assignment.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/assignment.tsx new file mode 100644 index 0000000000000..896f2ea392884 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/assignment.tsx @@ -0,0 +1,150 @@ +/* + * 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 React from 'react'; +import { useDispatch } from 'react-redux'; +import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { css } from '@emotion/react'; +import { euiThemeVars } from '@kbn/ui-theme'; +import { + removeAssignment, + updateAssignmentColor, + updateAssignmentRule, +} from '../../state/color_mapping'; +import { ColorMapping } from '../../config'; +import { Range } from './range'; +import { Match } from './match'; +import { getPalette } from '../../palettes'; + +import { ColorMappingInputData } from '../../categorical_color_mapping'; +import { ColorSwatch } from '../color_picker/color_swatch'; + +export function Assignment({ + data, + assignment, + disableDelete, + index, + total, + canPickColor, + editable, + palette, + colorMode, + getPaletteFn, + isDarkMode, + specialTokens, + assignmentValuesCounter, +}: { + data: ColorMappingInputData; + index: number; + total: number; + colorMode: ColorMapping.Config['colorMode']; + assignment: ColorMapping.Config['assignments'][number]; + disableDelete: boolean; + palette: ColorMapping.CategoricalPalette; + getPaletteFn: ReturnType; + canPickColor: boolean; + editable: boolean; + isDarkMode: boolean; + specialTokens: Map; + assignmentValuesCounter: Map; +}) { + const dispatch = useDispatch(); + + return ( + + + { + dispatch(updateAssignmentColor({ assignmentIndex: index, color })); + }} + /> + + + {assignment.rule.type === 'auto' || + assignment.rule.type === 'matchExactly' || + assignment.rule.type === 'matchExactlyCI' ? ( + ) => { + dispatch( + updateAssignmentRule({ + assignmentIndex: index, + rule: values.length === 0 ? { type: 'auto' } : { type: 'matchExactly', values }, + }) + ); + }} + assignmentValuesCounter={assignmentValuesCounter} + /> + ) : assignment.rule.type === 'range' ? ( + { + const rule: ColorMapping.RuleRange = { + type: 'range', + min, + max, + minInclusive, + maxInclusive, + }; + dispatch(updateAssignmentRule({ assignmentIndex: index, rule })); + }} + /> + ) : null} + + + dispatch(removeAssignment(index))} + aria-label={i18n.translate( + 'coloring.colorMapping.assignments.deleteAssignmentButtonLabel', + { + defaultMessage: 'Delete this assignment', + } + )} + color="danger" + css={ + !disableDelete + ? css` + color: ${euiThemeVars.euiTextSubduedColor}; + transition: ${euiThemeVars.euiAnimSpeedFast} ease-in-out; + transition-property: color; + &:hover, + &:focus { + color: ${euiThemeVars.euiColorDangerText}; + } + ` + : undefined + } + /> + + + ); +} diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/match.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/match.tsx new file mode 100644 index 0000000000000..43c5583191cf3 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/match.tsx @@ -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 React from 'react'; +import { EuiComboBox, EuiFlexItem, EuiIcon } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { MULTI_FIELD_KEY_SEPARATOR } from '@kbn/data-plugin/common'; +import { euiThemeVars } from '@kbn/ui-theme'; +import { ColorMapping } from '../../config'; + +export const Match: React.FC<{ + index: number; + editable: boolean; + rule: + | ColorMapping.RuleAuto + | ColorMapping.RuleMatchExactly + | ColorMapping.RuleMatchExactlyCI + | ColorMapping.RuleRegExp; + updateValue: (values: Array) => void; + options: Array; + specialTokens: Map; + assignmentValuesCounter: Map; +}> = ({ index, rule, updateValue, editable, options, specialTokens, assignmentValuesCounter }) => { + const selectedOptions = + rule.type === 'auto' + ? [] + : typeof rule.values === 'string' + ? [ + { + label: rule.values, + value: rule.values, + append: + (assignmentValuesCounter.get(rule.values) ?? 0) > 1 ? ( + + ) : undefined, + }, + ] + : rule.values.map((value) => { + const ruleValues = Array.isArray(value) ? value : [value]; + return { + label: ruleValues.map((v) => specialTokens.get(v) ?? v).join(MULTI_FIELD_KEY_SEPARATOR), + value, + append: + (assignmentValuesCounter.get(value) ?? 0) > 1 ? ( + + ) : undefined, + }; + }); + + const convertedOptions = options.map((value) => { + const ruleValues = Array.isArray(value) ? value : [value]; + return { + label: ruleValues.map((v) => specialTokens.get(v) ?? v).join(MULTI_FIELD_KEY_SEPARATOR), + value, + }; + }); + + return ( + + { + updateValue( + changedOptions.reduce>((acc, option) => { + if (option.value !== undefined) { + acc.push(option.value); + } + return acc; + }, []) + ); + }} + onCreateOption={(label) => { + if (selectedOptions.findIndex((option) => option.label.toLowerCase() === label) === -1) { + updateValue([...selectedOptions, { label, value: label }].map((d) => d.value)); + } + }} + isClearable={false} + compressed + /> + + ); +}; diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/range.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/range.tsx new file mode 100644 index 0000000000000..70f2cf49609e0 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/range.tsx @@ -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 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 React from 'react'; +import { EuiButtonEmpty, EuiFieldNumber, EuiFlexItem } from '@elastic/eui'; +import { ColorMapping } from '../../config'; + +export const Range: React.FC<{ + rule: ColorMapping.RuleRange; + editable: boolean; + updateValue: (min: number, max: number, minInclusive: boolean, maxInclusive: boolean) => void; +}> = ({ rule, updateValue, editable }) => { + const minValid = rule.min <= rule.max; + const maxValid = rule.max >= rule.min; + + return ( + <> + + updateValue(rule.min, rule.max, !rule.minInclusive, rule.maxInclusive)} + > + {rule.minInclusive ? 'GTE' : 'GT'} +
+ } + placeholder="min" + value={rule.min} + isInvalid={!minValid} + disabled={!editable} + onChange={(e) => + updateValue(+e.currentTarget.value, rule.max, rule.minInclusive, rule.maxInclusive) + } + aria-label="The min value" + /> +
+ + updateValue(rule.min, rule.max, rule.minInclusive, !rule.maxInclusive)} + > + {rule.maxInclusive ? 'LTE' : 'LT'} + + } + placeholder="max" + disabled={!editable} + value={rule.max} + onChange={(e) => + updateValue(rule.min, +e.currentTarget.value, rule.minInclusive, rule.maxInclusive) + } + aria-label="The max value" + /> + + + ); +}; diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/special_assignment.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/special_assignment.tsx new file mode 100644 index 0000000000000..29ede59e37f41 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/special_assignment.tsx @@ -0,0 +1,79 @@ +/* + * 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 { EuiFieldText, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { useDispatch } from 'react-redux'; +import React from 'react'; +import { i18n } from '@kbn/i18n'; +import { ColorMapping } from '../../config'; +import { getPalette } from '../../palettes'; +import { ColorSwatch } from '../color_picker/color_swatch'; +import { updateSpecialAssignmentColor } from '../../state/color_mapping'; + +export function SpecialAssignment({ + assignment, + index, + palette, + getPaletteFn, + isDarkMode, + total, +}: { + isDarkMode: boolean; + index: number; + assignment: ColorMapping.Config['specialAssignments'][number]; + palette: ColorMapping.CategoricalPalette; + getPaletteFn: ReturnType; + total: number; +}) { + const dispatch = useDispatch(); + const canPickColor = true; + return ( + + + { + dispatch( + updateSpecialAssignmentColor({ + assignmentIndex: index, + color, + }) + ); + }} + /> + + + + + + ); +} diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/components/color_picker/color_picker.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/components/color_picker/color_picker.tsx new file mode 100644 index 0000000000000..e1e8a08aa6b22 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/components/color_picker/color_picker.tsx @@ -0,0 +1,117 @@ +/* + * 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 React, { useState } from 'react'; +import { + EuiButtonEmpty, + EuiPopoverTitle, + EuiTab, + EuiTabs, + EuiTitle, + EuiHorizontalRule, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { ColorMapping } from '../../config'; +import { getPalette } from '../../palettes'; +import { PaletteColors } from './palette_colors'; +import { RGBPicker } from './rgb_picker'; +import { NeutralPalette } from '../../palettes/neutral'; + +export function ColorPicker({ + palette, + getPaletteFn, + color, + close, + selectColor, + isDarkMode, + deleteStep, +}: { + color: ColorMapping.CategoricalColor | ColorMapping.ColorCode; + getPaletteFn: ReturnType; + palette: ColorMapping.CategoricalPalette; + isDarkMode: boolean; + close: () => void; + selectColor: (color: ColorMapping.CategoricalColor | ColorMapping.ColorCode) => void; + deleteStep?: () => void; +}) { + const [tab, setTab] = useState( + color.type === 'categorical' && + (color.paletteId === palette.id || color.paletteId === NeutralPalette.id) + ? 'palette' + : 'custom' + ); + + return ( +
+ + + setTab('palette')} isSelected={tab === 'palette'}> + + + {i18n.translate('coloring.colorMapping.colorPicker.paletteTabLabel', { + defaultMessage: 'Colors', + })} + + + + setTab('custom')} isSelected={tab === 'custom'}> + + + {i18n.translate('coloring.colorMapping.colorPicker.customTabLabel', { + defaultMessage: 'Custom', + })} + + + + + + {tab === 'palette' ? ( + + ) : ( + + )} + {deleteStep ? ( + <> + + { + close(); + deleteStep(); + }} + style={{ paddingBottom: 8 }} + > + {i18n.translate('coloring.colorMapping.colorPicker.removeGradientColorButtonLabel', { + defaultMessage: 'Remove color step', + })} + + + ) : null} +
+ ); +} diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/components/color_picker/color_swatch.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/components/color_picker/color_swatch.tsx new file mode 100644 index 0000000000000..8ddc56d2476c7 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/components/color_picker/color_swatch.tsx @@ -0,0 +1,184 @@ +/* + * 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 { + EuiColorPickerSwatch, + EuiPopover, + euiShadowSmall, + isColorDark, + useEuiTheme, +} from '@elastic/eui'; +import React from 'react'; +import { useDispatch, useSelector } from 'react-redux'; +import { i18n } from '@kbn/i18n'; +import { css } from '@emotion/react'; +import { ColorPicker } from './color_picker'; +import { getAssignmentColor } from '../../color/color_handling'; +import { ColorMapping } from '../../config'; +import { getPalette } from '../../palettes'; +import { removeGradientColorStep } from '../../state/color_mapping'; + +import { selectColorPickerVisibility } from '../../state/selectors'; +import { colorPickerVisibility, hideColorPickerVisibility } from '../../state/ui'; +import { getValidColor } from '../../color/color_math'; + +interface ColorPickerSwatchProps { + colorMode: ColorMapping.Config['colorMode']; + assignmentColor: + | ColorMapping.Config['assignments'][number]['color'] + | ColorMapping.Config['specialAssignments'][number]['color']; + getPaletteFn: ReturnType; + canPickColor: boolean; + index: number; + total: number; + palette: ColorMapping.CategoricalPalette; + onColorChange: (color: ColorMapping.CategoricalColor | ColorMapping.ColorCode) => void; + swatchShape: 'square' | 'round'; + isDarkMode: boolean; + forType: 'assignment' | 'specialAssignment' | 'gradient'; +} +export const ColorSwatch = ({ + colorMode, + assignmentColor, + getPaletteFn, + canPickColor, + index, + total, + palette, + onColorChange, + swatchShape, + isDarkMode, + forType, +}: ColorPickerSwatchProps) => { + const colorPickerState = useSelector(selectColorPickerVisibility); + const dispatch = useDispatch(); + const colorPickerVisible = + colorPickerState.index === index && + colorPickerState.type === forType && + colorPickerState.visibile; + const colorHex = getAssignmentColor( + colorMode, + assignmentColor, + getPaletteFn, + isDarkMode, + index, + total + ); + const colorIsDark = isColorDark(...getValidColor(colorHex).rgb()); + const euiTheme = useEuiTheme(); + return canPickColor && assignmentColor.type !== 'gradient' ? ( + dispatch(hideColorPickerVisibility())} + anchorPosition="upLeft" + button={ + swatchShape === 'round' ? ( + + ); +} + +function ColorStop({ + colorMode, + step, + index, + currentPalette, + getPaletteFn, + isDarkMode, +}: { + colorMode: ColorMapping.GradientColorMode; + step: ColorMapping.CategoricalColor | ColorMapping.ColorCode; + index: number; + currentPalette: ColorMapping.CategoricalPalette; + getPaletteFn: ReturnType; + isDarkMode: boolean; +}) { + const dispatch = useDispatch(); + return ( + { + dispatch( + updateGradientColorStep({ + index, + color, + }) + ); + }} + forType="gradient" + /> + ); +} diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/palette_selector.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/palette_selector.tsx new file mode 100644 index 0000000000000..a15bdca26ee1c --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/palette_selector.tsx @@ -0,0 +1,263 @@ +/* + * 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 React, { useCallback, useState } from 'react'; +import { useSelector, useDispatch } from 'react-redux'; +import { + EuiButtonGroup, + EuiColorPalettePicker, + EuiConfirmModal, + EuiFlexGroup, + EuiFlexItem, + EuiFormRow, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { ScaleCategoricalIcon } from './scale_categorical'; +import { ScaleSequentialIcon } from './scale_sequential'; + +import { RootState, updatePalette } from '../../state/color_mapping'; +import { ColorMapping } from '../../config'; +import { updateAssignmentsPalette, updateColorModePalette } from '../../config/assignments'; +import { getPalette } from '../../palettes'; + +export function PaletteSelector({ + palettes, + getPaletteFn, + isDarkMode, +}: { + getPaletteFn: ReturnType; + palettes: Map; + isDarkMode: boolean; +}) { + const dispatch = useDispatch(); + const colorMode = useSelector((state: RootState) => state.colorMapping.colorMode); + const model = useSelector((state: RootState) => state.colorMapping); + + const { paletteId } = model; + + const switchPaletteFn = useCallback( + (selectedPaletteId: string, preserveColorChanges: boolean) => { + dispatch( + updatePalette({ + paletteId: selectedPaletteId, + assignments: updateAssignmentsPalette( + model.assignments, + model.assignmentMode, + model.colorMode, + selectedPaletteId, + getPaletteFn, + preserveColorChanges + ), + colorMode: updateColorModePalette( + model.colorMode, + selectedPaletteId, + preserveColorChanges + ), + }) + ); + }, + [getPaletteFn, model, dispatch] + ); + + const updateColorMode = useCallback( + (type: 'gradient' | 'categorical', preserveColorChanges: boolean) => { + const updatedColorMode: ColorMapping.Config['colorMode'] = + type === 'gradient' + ? { + type: 'gradient', + steps: [ + { + type: 'categorical', + paletteId, + colorIndex: 0, + touched: false, + }, + ], + sort: 'desc', + } + : { type: 'categorical' }; + + const assignments = updateAssignmentsPalette( + model.assignments, + model.assignmentMode, + updatedColorMode, + paletteId, + getPaletteFn, + preserveColorChanges + ); + dispatch(updatePalette({ paletteId, assignments, colorMode: updatedColorMode })); + }, + [getPaletteFn, model, dispatch, paletteId] + ); + + const [preserveModalPaletteId, setPreserveModalPaletteId] = useState(null); + + const preserveChangesModal = + preserveModalPaletteId !== null ? ( + { + if (preserveModalPaletteId) switchPaletteFn(preserveModalPaletteId, true); + setPreserveModalPaletteId(null); + }} + onConfirm={() => { + if (preserveModalPaletteId) switchPaletteFn(preserveModalPaletteId, false); + setPreserveModalPaletteId(null); + }} + confirmButtonText={i18n.translate('coloring.colorMapping.colorChangesModal.discardButton', { + defaultMessage: 'Discard changes', + })} + cancelButtonText={i18n.translate('coloring.colorMapping.colorChangesModal.preserveButton', { + defaultMessage: 'Preserve changes', + })} + buttonColor="danger" + defaultFocusedButton="confirm" + > +

+ {i18n.translate('coloring.colorMapping.colorChangesModal.switchPaletteDescription', { + defaultMessage: 'Switching palette will discard all your custom color changes', + })} +

+
+ ) : null; + + const [colorScaleModalId, setColorScaleModalId] = useState<'gradient' | 'categorical' | null>( + null + ); + + const colorScaleModal = + colorScaleModalId !== null ? ( + { + setColorScaleModalId(null); + }} + onConfirm={() => { + if (colorScaleModalId) updateColorMode(colorScaleModalId, false); + setColorScaleModalId(null); + }} + cancelButtonText={i18n.translate( + 'coloring.colorMapping.colorChangesModal.goBackButtonLabel', + { + defaultMessage: 'Go back', + } + )} + confirmButtonText={i18n.translate( + 'coloring.colorMapping.colorChangesModal.discardButtonLabel', + { + defaultMessage: 'Discard changes', + } + )} + defaultFocusedButton="confirm" + buttonColor="danger" + > +

+ {colorScaleModalId === 'categorical' + ? i18n.translate('coloring.colorMapping.colorChangesModal.categoricalModeDescription', { + defaultMessage: `Switching to a categorical mode will discard all your custom color changes`, + }) + : i18n.translate('coloring.colorMapping.colorChangesModal.sequentialModeDescription', { + defaultMessage: `Switching to a sequential mode will discard all your custom color changes`, + })} +

+
+ ) : null; + + return ( + <> + {preserveChangesModal} + {colorScaleModal} + + + + d.name !== 'Neutral') + .map((palette) => ({ + 'data-test-subj': `kbnColoring_ColorMapping_Palette-${palette.id}`, + value: palette.id, + title: palette.name, + palette: Array.from({ length: palette.colorCount }, (_, i) => { + return palette.getColor(i, isDarkMode); + }), + type: 'fixed', + }))} + onChange={(selectedPaletteId) => { + const hasChanges = model.assignments.some((a) => a.touched); + const hasGradientChanges = + model.colorMode.type === 'gradient' && + model.colorMode.steps.some((a) => a.touched); + if (hasChanges || hasGradientChanges) { + setPreserveModalPaletteId(selectedPaletteId); + } else { + switchPaletteFn(selectedPaletteId, false); + } + }} + valueOfSelected={model.paletteId} + selectionDisplay={'palette'} + compressed={true} + /> + + + + + { + const hasChanges = model.assignments.some((a) => a.touched); + const hasGradientChanges = + model.colorMode.type === 'gradient' && + model.colorMode.steps.some((a) => a.touched); + + if (hasChanges || hasGradientChanges) { + setColorScaleModalId(id as 'gradient' | 'categorical'); + } else { + updateColorMode(id as 'gradient' | 'categorical', false); + } + }} + isIconOnly + /> + + + + + ); +} diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/scale_categorical.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/scale_categorical.tsx new file mode 100644 index 0000000000000..f71ed74485365 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/scale_categorical.tsx @@ -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 React from 'react'; + +export function ScaleCategoricalIcon() { + return ( + + + + + ); +} diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/scale_sequential.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/scale_sequential.tsx new file mode 100644 index 0000000000000..ec245f471f307 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/scale_sequential.tsx @@ -0,0 +1,20 @@ +/* + * 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 React from 'react'; + +export function ScaleSequentialIcon() { + return ( + + + + ); +} diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/config/assignment_from_categories.ts b/packages/kbn-coloring/src/shared_components/color_mapping/config/assignment_from_categories.ts new file mode 100644 index 0000000000000..97c4d17c35e4d --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/config/assignment_from_categories.ts @@ -0,0 +1,65 @@ +/* + * 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 { ColorMapping } from '.'; +import { ColorMappingInputData } from '../categorical_color_mapping'; +import { MAX_ASSIGNABLE_COLORS } from '../components/container/container'; + +export function generateAutoAssignmentsForCategories( + data: ColorMappingInputData, + palette: ColorMapping.CategoricalPalette, + colorMode: ColorMapping.Config['colorMode'] +): ColorMapping.Config['assignments'] { + const isCategorical = colorMode.type === 'categorical'; + + const maxColorAssignable = data.type === 'categories' ? data.categories.length : data.bins; + + const assignableColors = isCategorical + ? Math.min(palette.colorCount, maxColorAssignable) + : Math.min(MAX_ASSIGNABLE_COLORS, maxColorAssignable); + + const autoRules: Array = + data.type === 'categories' + ? data.categories.map((c) => ({ type: 'matchExactly', values: [c] })) + : Array.from({ length: data.bins }, (d, i) => { + const step = (data.max - data.min) / data.bins; + return { + type: 'range', + min: data.max - i * step - step, + max: data.max - i * step, + minInclusive: true, + maxInclusive: false, + }; + }); + + const assignments = autoRules + .slice(0, assignableColors) + .map((rule, colorIndex) => { + if (isCategorical) { + return { + rule, + color: { + type: 'categorical', + paletteId: palette.id, + colorIndex, + }, + touched: false, + }; + } else { + return { + rule, + color: { + type: 'gradient', + }, + touched: false, + }; + } + }); + + return assignments; +} diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/config/assignments.ts b/packages/kbn-coloring/src/shared_components/color_mapping/config/assignments.ts new file mode 100644 index 0000000000000..701baa1b1710b --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/config/assignments.ts @@ -0,0 +1,91 @@ +/* + * 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 { ColorMapping } from '.'; +import { MAX_ASSIGNABLE_COLORS } from '../components/container/container'; +import { getPalette, NeutralPalette } from '../palettes'; +import { DEFAULT_NEUTRAL_PALETTE_INDEX } from './default_color_mapping'; + +export function updateAssignmentsPalette( + assignments: ColorMapping.Config['assignments'], + assignmentMode: ColorMapping.Config['assignmentMode'], + colorMode: ColorMapping.Config['colorMode'], + paletteId: string, + getPaletteFn: ReturnType, + preserveColorChanges: boolean +): ColorMapping.Config['assignments'] { + const palette = getPaletteFn(paletteId); + const maxColors = palette.type === 'categorical' ? palette.colorCount : MAX_ASSIGNABLE_COLORS; + return assignmentMode === 'auto' + ? [] + : assignments.map(({ rule, color, touched }, index) => { + if (preserveColorChanges && touched) { + return { rule, color, touched }; + } else { + const newColor: ColorMapping.Config['assignments'][number]['color'] = + colorMode.type === 'categorical' + ? { + type: 'categorical', + paletteId: index < maxColors ? paletteId : NeutralPalette.id, + colorIndex: index < maxColors ? index : 0, + } + : { type: 'gradient' }; + return { + rule, + color: newColor, + touched: false, + }; + } + }); +} + +export function updateColorModePalette( + colorMode: ColorMapping.Config['colorMode'], + paletteId: string, + preserveColorChanges: boolean +): ColorMapping.Config['colorMode'] { + return colorMode.type === 'categorical' + ? colorMode + : { + type: 'gradient', + steps: colorMode.steps.map((step, stepIndex) => { + return preserveColorChanges + ? step + : { type: 'categorical', paletteId, colorIndex: stepIndex, touched: false }; + }), + sort: colorMode.sort, + }; +} + +export function getUnusedColorForNewAssignment( + palette: ColorMapping.CategoricalPalette, + colorMode: ColorMapping.Config['colorMode'], + assignments: ColorMapping.Config['assignments'] +): ColorMapping.Config['assignments'][number]['color'] { + if (colorMode.type === 'categorical') { + // TODO: change the type of color assignment depending on palette + // compute the next unused color index in the palette. + const maxColors = palette.type === 'categorical' ? palette.colorCount : MAX_ASSIGNABLE_COLORS; + const colorIndices = new Set(Array.from({ length: maxColors }, (d, i) => i)); + assignments.forEach(({ color }) => { + if (color.type === 'categorical' && color.paletteId === palette.id) { + colorIndices.delete(color.colorIndex); + } + }); + const paletteForNextUnusedColorIndex = colorIndices.size > 0 ? palette.id : NeutralPalette.id; + const nextUnusedColorIndex = + colorIndices.size > 0 ? [...colorIndices][0] : DEFAULT_NEUTRAL_PALETTE_INDEX; + return { + type: 'categorical', + paletteId: paletteForNextUnusedColorIndex, + colorIndex: nextUnusedColorIndex, + }; + } else { + return { type: 'gradient' }; + } +} diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts b/packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts new file mode 100644 index 0000000000000..e4005770b2883 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts @@ -0,0 +1,79 @@ +/* + * 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 { ColorMapping } from '.'; +import { AVAILABLE_PALETTES, getPalette } from '../palettes'; +import { EUIAmsterdamColorBlindPalette } from '../palettes/eui_amsterdam'; +import { NeutralPalette } from '../palettes/neutral'; +import { getColor, getGradientColorScale } from '../color/color_handling'; + +export const DEFAULT_NEUTRAL_PALETTE_INDEX = 1; + +/** + * The default color mapping used in Kibana, starts with the EUI color palette + */ +export const DEFAULT_COLOR_MAPPING_CONFIG: ColorMapping.Config = { + assignmentMode: 'auto', + assignments: [], + specialAssignments: [ + { + rule: { + type: 'other', + }, + color: { + type: 'categorical', + paletteId: NeutralPalette.id, + colorIndex: DEFAULT_NEUTRAL_PALETTE_INDEX, + }, + touched: false, + }, + ], + paletteId: EUIAmsterdamColorBlindPalette.id, + colorMode: { + type: 'categorical', + }, +}; + +export function getPaletteColors( + isDarkMode: boolean, + colorMappings?: ColorMapping.Config +): string[] { + const colorMappingModel = colorMappings ?? { ...DEFAULT_COLOR_MAPPING_CONFIG }; + const palette = getPalette(AVAILABLE_PALETTES, NeutralPalette)(colorMappingModel.paletteId); + return Array.from({ length: palette.colorCount }, (d, i) => palette.getColor(i, isDarkMode)); +} + +export function getColorsFromMapping( + isDarkMode: boolean, + colorMappings?: ColorMapping.Config +): string[] { + const { colorMode, paletteId, assignmentMode, assignments, specialAssignments } = + colorMappings ?? { + ...DEFAULT_COLOR_MAPPING_CONFIG, + }; + + const getPaletteFn = getPalette(AVAILABLE_PALETTES, NeutralPalette); + if (colorMode.type === 'gradient') { + const colorScale = getGradientColorScale(colorMode, getPaletteFn, isDarkMode); + return Array.from({ length: 6 }, (d, i) => colorScale(i / 6)); + } else { + const palette = getPaletteFn(paletteId); + if (assignmentMode === 'auto') { + return Array.from({ length: palette.colorCount }, (d, i) => palette.getColor(i, isDarkMode)); + } else { + return [ + ...assignments.map((a) => { + return a.color.type === 'gradient' ? '' : getColor(a.color, getPaletteFn, isDarkMode); + }), + ...specialAssignments.map((a) => { + return getColor(a.color, getPaletteFn, isDarkMode); + }), + ].filter((color) => color !== ''); + } + } +} diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/config/index.ts b/packages/kbn-coloring/src/shared_components/color_mapping/config/index.ts new file mode 100644 index 0000000000000..e75687596789e --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/config/index.ts @@ -0,0 +1,9 @@ +/* + * 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 * as ColorMapping from './types'; diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/config/types.ts b/packages/kbn-coloring/src/shared_components/color_mapping/config/types.ts new file mode 100644 index 0000000000000..59cb18435112d --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/config/types.ts @@ -0,0 +1,153 @@ +/* + * 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. + */ + +/** + * A color specified as a CSS color datatype (rgb/a,hex,keywords,lab,lch etc) + */ +export interface ColorCode { + type: 'colorCode'; + colorCode: string; +} + +/** + * An index specified categorical color, coming from paletteId + */ +export interface CategoricalColor { + type: 'categorical'; + paletteId: string; + colorIndex: number; +} + +/** + * Specify that the Color in an Assignment needs to be taken from a gradient defined in the `Config.colorMode` + */ +export interface GradientColor { + type: 'gradient'; +} + +/** + * A special rule that match automatically, in order, all the categories that are not matching a specified rule + */ +export interface RuleAuto { + /* tag */ + type: 'auto'; +} +/** + * A rule that match exactly, case sensitive, with the provided strings + */ +export interface RuleMatchExactly { + /* tag */ + type: 'matchExactly'; + values: Array; +} + +/** + * A Match rule to match the values case insensitive + * @ignore not used yet + */ +export interface RuleMatchExactlyCI { + /* tag */ + type: 'matchExactlyCI'; + values: string[]; +} + +/** + * A range rule, not used yet, but can be used for numerical data assignments + */ +export interface RuleRange { + /* tag */ + type: 'range'; + /** + * The min value of the range + */ + min: number; + /** + * The max value of the range + */ + max: number; + /** + * `true` if the range is left-closed (the `min` value is considered within the range), false otherwise (only values that are + * greater than the `min` are considered within the range) + */ + minInclusive: boolean; + /** + * `true` if the range is right-closed (the `max` value is considered within the range), false otherwise (only values less than + * the `max` are considered within the range) + */ + maxInclusive: boolean; +} +/** + * Regex rule. + * @ignore not used yet + */ +export interface RuleRegExp { + /* tag */ + type: 'regex'; + /** + * TODO: not sure how we can store a regexp + */ + values: string; +} + +/** + * A specific catch-everything-else rule + */ +export interface RuleOthers { + /* tag */ + type: 'other'; +} + +/** + * An assignment is the connection link between a rule and a color + */ +export interface Assignment { + /** + * Describe the rule used to assign the color. + */ + rule: R; + /** + * The color definition + */ + color: C; + + /** + * Specify if the color was changed from the original one + * TODO: rename + */ + touched: boolean; +} + +export interface CategoricalColorMode { + type: 'categorical'; +} +export interface GradientColorMode { + type: 'gradient'; + steps: Array<(CategoricalColor | ColorCode) & { touched: boolean }>; + sort: 'asc' | 'desc'; +} + +export interface Config { + paletteId: string; + colorMode: CategoricalColorMode | GradientColorMode; + assignmentMode: 'auto' | 'manual'; + assignments: Array< + Assignment< + RuleAuto | RuleMatchExactly | RuleMatchExactlyCI | RuleRange | RuleRegExp, + CategoricalColor | ColorCode | GradientColor + > + >; + specialAssignments: Array>; +} + +export interface CategoricalPalette { + id: string; + name: string; + type: 'categorical'; + colorCount: number; + getColor: (valueInRange: number, isDarkMode: boolean) => string; +} diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/index.ts b/packages/kbn-coloring/src/shared_components/color_mapping/index.ts new file mode 100644 index 0000000000000..1b49a2c6a8bf3 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/index.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. + */ + +export { CategoricalColorMapping, type ColorMappingProps } from './categorical_color_mapping'; +export type { ColorMappingInputData } from './categorical_color_mapping'; +export type { ColorMapping } from './config'; +export * from './palettes'; +export * from './color/color_handling'; +export { SPECIAL_TOKENS_STRING_CONVERTION } from './color/rule_matching'; +export { + DEFAULT_COLOR_MAPPING_CONFIG, + getPaletteColors, + getColorsFromMapping, +} from './config/default_color_mapping'; diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts b/packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts new file mode 100644 index 0000000000000..d93440c5ac5e4 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts @@ -0,0 +1,28 @@ +/* + * 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 { ColorMapping } from '../config'; + +export const ELASTIC_BRAND_PALETTE_COLORS = [ + '#20377d', + '#7de2d1', + '#ff957d', + '#f04e98', + '#0077cc', + '#fec514', +]; + +export const ElasticBrandPalette: ColorMapping.CategoricalPalette = { + id: 'elastic_brand_2023', + name: 'Elastic Brand', + colorCount: ELASTIC_BRAND_PALETTE_COLORS.length, + type: 'categorical', + getColor(valueInRange) { + return ELASTIC_BRAND_PALETTE_COLORS[valueInRange]; + }, +}; diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts b/packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts new file mode 100644 index 0000000000000..ec48793e12819 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts @@ -0,0 +1,32 @@ +/* + * 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 { ColorMapping } from '../config'; + +export const EUI_AMSTERDAM_PALETTE_COLORS = [ + '#54b399', + '#6092c0', + '#d36086', + '#9170b8', + '#ca8eae', + '#d6bf57', + '#b9a888', + '#da8b45', + '#aa6556', + '#e7664c', +]; + +export const EUIAmsterdamColorBlindPalette: ColorMapping.CategoricalPalette = { + id: 'eui_amsterdam_color_blind', + name: 'Default', + colorCount: EUI_AMSTERDAM_PALETTE_COLORS.length, + type: 'categorical', + getColor(valueInRange) { + return EUI_AMSTERDAM_PALETTE_COLORS[valueInRange]; + }, +}; diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/palettes/index.ts b/packages/kbn-coloring/src/shared_components/color_mapping/palettes/index.ts new file mode 100644 index 0000000000000..340bbd32f0279 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/palettes/index.ts @@ -0,0 +1,37 @@ +/* + * 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 { ColorMapping } from '../config'; +import { ElasticBrandPalette } from './elastic_brand'; +import { EUIAmsterdamColorBlindPalette } from './eui_amsterdam'; +import { KibanaV7LegacyPalette } from './kibana_legacy'; +import { NeutralPalette } from './neutral'; + +export const AVAILABLE_PALETTES = new Map([ + [EUIAmsterdamColorBlindPalette.id, EUIAmsterdamColorBlindPalette], + [ElasticBrandPalette.id, ElasticBrandPalette], + [KibanaV7LegacyPalette.id, KibanaV7LegacyPalette], + [NeutralPalette.id, NeutralPalette], +]); + +/** + * This function should be instanciated once at the root of the component with the available palettes and + * a choosed default one and shared across components to keep a single point of truth of the available palettes and the default + * one. + */ +export function getPalette( + palettes: Map, + defaultPalette: ColorMapping.CategoricalPalette +): (paletteId: string) => ColorMapping.CategoricalPalette { + return (paletteId) => palettes.get(paletteId) ?? defaultPalette; +} + +export * from './eui_amsterdam'; +export * from './elastic_brand'; +export * from './kibana_legacy'; +export * from './neutral'; diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts b/packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts new file mode 100644 index 0000000000000..9b576e0b05c66 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts @@ -0,0 +1,29 @@ +/* + * 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 { ColorMapping } from '../config'; + +export const KIBANA_V7_LEGACY_PALETTE_COLORS = [ + '#00a69b', + '#57c17b', + '#6f87d8', + '#663db8', + '#bc52bc', + '#9e3533', + '#daa05d', +]; + +export const KibanaV7LegacyPalette: ColorMapping.CategoricalPalette = { + id: 'kibana_v7_legacy', + name: 'Kibana Legacy', + colorCount: KIBANA_V7_LEGACY_PALETTE_COLORS.length, + type: 'categorical', + getColor(valueInRange) { + return KIBANA_V7_LEGACY_PALETTE_COLORS[valueInRange]; + }, +}; diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts b/packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts new file mode 100644 index 0000000000000..5d3d92790843b --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts @@ -0,0 +1,23 @@ +/* + * 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 { ColorMapping } from '../config'; + +const schemeGreys = ['#f2f4fb', '#d4d9e5', '#98a2b3', '#696f7d', '#353642']; +export const NEUTRAL_COLOR_LIGHT = schemeGreys.slice(); +export const NEUTRAL_COLOR_DARK = schemeGreys.slice().reverse(); + +export const NeutralPalette: ColorMapping.CategoricalPalette = { + id: 'neutral', + name: 'Neutral', + colorCount: NEUTRAL_COLOR_LIGHT.length, + type: 'categorical', + getColor(valueInRange, isDarkMode) { + return isDarkMode ? NEUTRAL_COLOR_DARK[valueInRange] : NEUTRAL_COLOR_LIGHT[valueInRange]; + }, +}; diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/state/color_mapping.ts b/packages/kbn-coloring/src/shared_components/color_mapping/state/color_mapping.ts new file mode 100644 index 0000000000000..27588aff2b389 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/state/color_mapping.ts @@ -0,0 +1,225 @@ +/* + * 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 { createSlice } from '@reduxjs/toolkit'; +import type { PayloadAction } from '@reduxjs/toolkit'; +import type { ColorMapping } from '../config'; + +export interface RootState { + colorMapping: ColorMapping.Config; + ui: { + colorPicker: { + index: number; + visibile: boolean; + type: 'gradient' | 'assignment' | 'specialAssignment'; + }; + }; +} + +const initialState: RootState['colorMapping'] = { + assignmentMode: 'auto', + assignments: [], + specialAssignments: [], + paletteId: 'eui', + colorMode: { type: 'categorical' }, +}; + +export const colorMappingSlice = createSlice({ + name: 'colorMapping', + initialState, + reducers: { + updateModel: (state, action: PayloadAction) => { + state.assignmentMode = action.payload.assignmentMode; + state.assignments = [...action.payload.assignments]; + state.specialAssignments = [...action.payload.specialAssignments]; + state.paletteId = action.payload.paletteId; + state.colorMode = { ...action.payload.colorMode }; + }, + updatePalette: ( + state, + action: PayloadAction<{ + assignments: ColorMapping.Config['assignments']; + paletteId: ColorMapping.Config['paletteId']; + colorMode: ColorMapping.Config['colorMode']; + }> + ) => { + state.paletteId = action.payload.paletteId; + state.assignments = [...action.payload.assignments]; + state.colorMode = { ...action.payload.colorMode }; + }, + assignStatically: (state, action: PayloadAction) => { + state.assignmentMode = 'manual'; + state.assignments = [...action.payload]; + }, + assignAutomatically: (state) => { + state.assignmentMode = 'auto'; + state.assignments = []; + }, + + addNewAssignment: ( + state, + action: PayloadAction + ) => { + state.assignments.push({ ...action.payload }); + }, + updateAssignment: ( + state, + action: PayloadAction<{ + assignmentIndex: number; + assignment: ColorMapping.Config['assignments'][number]; + }> + ) => { + state.assignments[action.payload.assignmentIndex] = { + ...action.payload.assignment, + touched: true, + }; + }, + updateAssignmentRule: ( + state, + action: PayloadAction<{ + assignmentIndex: number; + rule: ColorMapping.Config['assignments'][number]['rule']; + }> + ) => { + state.assignments[action.payload.assignmentIndex] = { + ...state.assignments[action.payload.assignmentIndex], + rule: action.payload.rule, + }; + }, + updateAssignmentColor: ( + state, + action: PayloadAction<{ + assignmentIndex: number; + color: ColorMapping.Config['assignments'][number]['color']; + }> + ) => { + state.assignments[action.payload.assignmentIndex] = { + ...state.assignments[action.payload.assignmentIndex], + color: action.payload.color, + touched: true, + }; + }, + + updateSpecialAssignmentColor: ( + state, + action: PayloadAction<{ + assignmentIndex: number; + color: ColorMapping.Config['specialAssignments'][number]['color']; + }> + ) => { + state.specialAssignments[action.payload.assignmentIndex] = { + ...state.specialAssignments[action.payload.assignmentIndex], + color: action.payload.color, + touched: true, + }; + }, + removeAssignment: (state, action: PayloadAction) => { + state.assignments.splice(action.payload, 1); + }, + changeColorMode: (state, action: PayloadAction) => { + state.colorMode = { ...action.payload }; + }, + updateGradientColorStep: ( + state, + action: PayloadAction<{ + index: number; + color: ColorMapping.CategoricalColor | ColorMapping.ColorCode; + }> + ) => { + if (state.colorMode.type !== 'gradient') { + return; + } + + state.colorMode = { + ...state.colorMode, + steps: state.colorMode.steps.map((step, index) => { + return index === action.payload.index + ? { ...action.payload.color, touched: true } + : { ...step, touched: false }; + }), + }; + }, + removeGradientColorStep: (state, action: PayloadAction) => { + if (state.colorMode.type !== 'gradient') { + return; + } + const steps = [...state.colorMode.steps]; + steps.splice(action.payload, 1); + + // this maintain the correct sort direciton depending on which step + // gets removed from the array when only 2 steps are left. + const sort = + state.colorMode.steps.length === 2 + ? state.colorMode.sort === 'desc' + ? action.payload === 0 + ? 'asc' + : 'desc' + : action.payload === 0 + ? 'desc' + : 'asc' + : state.colorMode.sort; + + state.colorMode = { + ...state.colorMode, + steps: [...steps], + sort, + }; + }, + addGradientColorStep: ( + state, + action: PayloadAction<{ + color: ColorMapping.CategoricalColor | ColorMapping.ColorCode; + at: number; + }> + ) => { + if (state.colorMode.type !== 'gradient') { + return; + } + + state.colorMode = { + ...state.colorMode, + steps: [ + ...state.colorMode.steps.slice(0, action.payload.at), + { ...action.payload.color, touched: false }, + ...state.colorMode.steps.slice(action.payload.at), + ], + }; + }, + + changeGradientSortOrder: (state, action: PayloadAction<'asc' | 'desc'>) => { + if (state.colorMode.type !== 'gradient') { + return; + } + + state.colorMode = { + ...state.colorMode, + sort: action.payload, + }; + }, + }, +}); +// Action creators are generated for each case reducer function +export const { + updatePalette, + assignStatically, + assignAutomatically, + addNewAssignment, + updateAssignment, + updateAssignmentColor, + updateSpecialAssignmentColor, + updateAssignmentRule, + removeAssignment, + changeColorMode, + updateGradientColorStep, + removeGradientColorStep, + addGradientColorStep, + changeGradientSortOrder, + updateModel, +} = colorMappingSlice.actions; + +export const colorMappingReducer = colorMappingSlice.reducer; diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/state/selectors.ts b/packages/kbn-coloring/src/shared_components/color_mapping/state/selectors.ts new file mode 100644 index 0000000000000..69bd57d2d852e --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/state/selectors.ts @@ -0,0 +1,26 @@ +/* + * 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 { getPalette } from '../palettes'; +import { RootState } from './color_mapping'; + +export function selectPalette(getPaletteFn: ReturnType) { + return (state: RootState) => getPaletteFn(state.colorMapping.paletteId); +} +export function selectColorMode(state: RootState) { + return state.colorMapping.colorMode; +} +export function selectSpecialAssignments(state: RootState) { + return state.colorMapping.specialAssignments; +} +export function selectIsAutoAssignmentMode(state: RootState) { + return state.colorMapping.assignmentMode === 'auto'; +} +export function selectColorPickerVisibility(state: RootState) { + return state.ui.colorPicker; +} diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/state/ui.ts b/packages/kbn-coloring/src/shared_components/color_mapping/state/ui.ts new file mode 100644 index 0000000000000..632fb31e9dcc5 --- /dev/null +++ b/packages/kbn-coloring/src/shared_components/color_mapping/state/ui.ts @@ -0,0 +1,55 @@ +/* + * 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 PayloadAction, createSlice } from '@reduxjs/toolkit'; +import { RootState } from './color_mapping'; + +const initialState: RootState['ui'] = { + colorPicker: { + index: 0, + visibile: false, + type: 'assignment', + }, +}; + +export const uiSlice = createSlice({ + name: 'colorMapping', + initialState, + reducers: { + colorPickerVisibility: ( + state, + action: PayloadAction<{ + index: number; + type: RootState['ui']['colorPicker']['type']; + visible: boolean; + }> + ) => { + state.colorPicker.visibile = action.payload.visible; + state.colorPicker.index = action.payload.index; + state.colorPicker.type = action.payload.type; + }, + switchColorPickerVisibility: (state) => { + state.colorPicker.visibile = !state.colorPicker.visibile; + }, + showColorPickerVisibility: (state) => { + state.colorPicker.visibile = true; + }, + hideColorPickerVisibility: (state) => { + state.colorPicker.visibile = false; + }, + }, +}); + +export const { + colorPickerVisibility, + switchColorPickerVisibility, + showColorPickerVisibility, + hideColorPickerVisibility, +} = uiSlice.actions; + +export const uiReducer = uiSlice.reducer; diff --git a/packages/kbn-coloring/src/shared_components/index.ts b/packages/kbn-coloring/src/shared_components/index.ts index 546224092e576..242df23b19e53 100644 --- a/packages/kbn-coloring/src/shared_components/index.ts +++ b/packages/kbn-coloring/src/shared_components/index.ts @@ -21,3 +21,5 @@ export const CustomizablePaletteLazy = React.lazy(() => import('./coloring')); * a predefined fallback and error boundary. */ export const CustomizablePalette = withSuspense(CustomizablePaletteLazy); + +export * from './color_mapping'; diff --git a/packages/kbn-coloring/tsconfig.json b/packages/kbn-coloring/tsconfig.json index 54c068f8bd3b6..315e59225601c 100644 --- a/packages/kbn-coloring/tsconfig.json +++ b/packages/kbn-coloring/tsconfig.json @@ -10,7 +10,6 @@ ] }, "include": [ - "**/*.scss", "**/*.ts", "**/*.tsx" ], @@ -21,6 +20,8 @@ "@kbn/utility-types", "@kbn/shared-ux-utility", "@kbn/test-jest-helpers", + "@kbn/data-plugin", + "@kbn/ui-theme", ], "exclude": [ "target/**/*", diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 78bba1df4220a..ec34d257eadc2 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -50,13 +50,13 @@ pageLoadAssetSize: expressionLegacyMetricVis: 23121 expressionMetric: 22238 expressionMetricVis: 23121 - expressionPartitionVis: 26338 + expressionPartitionVis: 28000 expressionRepeatImage: 22341 expressionRevealImage: 25675 expressions: 140958 expressionShape: 34008 expressionTagcloud: 27505 - expressionXY: 39500 + expressionXY: 45000 features: 21723 fieldFormats: 65209 files: 22673 diff --git a/src/plugins/chart_expressions/common/color_categories.ts b/src/plugins/chart_expressions/common/color_categories.ts new file mode 100644 index 0000000000000..0bb8811f2701a --- /dev/null +++ b/src/plugins/chart_expressions/common/color_categories.ts @@ -0,0 +1,41 @@ +/* + * 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 { DatatableRow } from '@kbn/expressions-plugin/common'; +import { isMultiFieldKey } from '@kbn/data-plugin/common'; + +/** + * Get the stringified version of all the categories that needs to be colored in the chart. + * Multifield keys will return as array of string and simple fields (numeric, string) will be returned as a plain unformatted string. + */ +export function getColorCategories( + rows: DatatableRow[], + accessor?: string +): Array { + return accessor + ? rows.reduce<{ keys: Set; categories: Array }>( + (acc, r) => { + const value = r[accessor]; + if (value === undefined) { + return acc; + } + // The categories needs to be stringified in their unformatted version. + // We can't distinguish between a number and a string from a text input and the match should + // work with both numeric field values and string values. + const key = (isMultiFieldKey(value) ? [...value.keys] : [value]).map(String); + const stringifiedKeys = key.join(','); + if (!acc.keys.has(stringifiedKeys)) { + acc.keys.add(stringifiedKeys); + acc.categories.push(key.length === 1 ? key[0] : key); + } + return acc; + }, + { keys: new Set(), categories: [] } + ).categories + : []; +} diff --git a/src/plugins/chart_expressions/common/index.ts b/src/plugins/chart_expressions/common/index.ts index 0983b1ed28d4d..acc3b4d8c88cd 100644 --- a/src/plugins/chart_expressions/common/index.ts +++ b/src/plugins/chart_expressions/common/index.ts @@ -13,3 +13,4 @@ export { isOnAggBasedEditor, } from './utils'; export type { Simplify, MakeOverridesSerializable } from './types'; +export { getColorCategories } from './color_categories'; diff --git a/src/plugins/chart_expressions/common/tsconfig.json b/src/plugins/chart_expressions/common/tsconfig.json index f65660474561b..7ac76523fcb6c 100644 --- a/src/plugins/chart_expressions/common/tsconfig.json +++ b/src/plugins/chart_expressions/common/tsconfig.json @@ -15,5 +15,7 @@ ], "kbn_references": [ "@kbn/core-execution-context-common", + "@kbn/expressions-plugin", + "@kbn/data-plugin", ] } diff --git a/src/plugins/chart_expressions/expression_legacy_metric/kibana.jsonc b/src/plugins/chart_expressions/expression_legacy_metric/kibana.jsonc index 41a9c965a66da..a49ca80a2fcd2 100644 --- a/src/plugins/chart_expressions/expression_legacy_metric/kibana.jsonc +++ b/src/plugins/chart_expressions/expression_legacy_metric/kibana.jsonc @@ -12,7 +12,8 @@ "fieldFormats", "charts", "visualizations", - "presentationUtil" + "presentationUtil", + "data" ], "optionalPlugins": [ "usageCollection" diff --git a/src/plugins/chart_expressions/expression_metric/kibana.jsonc b/src/plugins/chart_expressions/expression_metric/kibana.jsonc index 087583e6fff6f..a53def7de36ee 100644 --- a/src/plugins/chart_expressions/expression_metric/kibana.jsonc +++ b/src/plugins/chart_expressions/expression_metric/kibana.jsonc @@ -12,7 +12,8 @@ "fieldFormats", "charts", "visualizations", - "presentationUtil" + "presentationUtil", + "data" ], "optionalPlugins": [ "usageCollection" diff --git a/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/__snapshots__/mosaic_vis_function.test.ts.snap b/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/__snapshots__/mosaic_vis_function.test.ts.snap index 604368d7ab130..a3cd4f976757b 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/__snapshots__/mosaic_vis_function.test.ts.snap +++ b/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/__snapshots__/mosaic_vis_function.test.ts.snap @@ -71,6 +71,7 @@ Object { "type": "vis_dimension", }, ], + "colorMapping": undefined, "dimensions": Object { "buckets": Array [ Object { diff --git a/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/__snapshots__/pie_vis_function.test.ts.snap b/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/__snapshots__/pie_vis_function.test.ts.snap index 293f86c6bf9ec..edcb2c8fd76e4 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/__snapshots__/pie_vis_function.test.ts.snap +++ b/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/__snapshots__/pie_vis_function.test.ts.snap @@ -61,6 +61,7 @@ Object { "type": "vis_dimension", }, ], + "colorMapping": undefined, "dimensions": Object { "buckets": Array [ Object { @@ -203,6 +204,7 @@ Object { "type": "vis_dimension", }, ], + "colorMapping": undefined, "dimensions": Object { "buckets": Array [ Object { diff --git a/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/__snapshots__/treemap_vis_function.test.ts.snap b/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/__snapshots__/treemap_vis_function.test.ts.snap index f6817eca439cf..17c372547ad79 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/__snapshots__/treemap_vis_function.test.ts.snap +++ b/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/__snapshots__/treemap_vis_function.test.ts.snap @@ -71,6 +71,7 @@ Object { "type": "vis_dimension", }, ], + "colorMapping": undefined, "dimensions": Object { "buckets": Array [ Object { diff --git a/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/__snapshots__/waffle_vis_function.test.ts.snap b/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/__snapshots__/waffle_vis_function.test.ts.snap index 7c74291190a2d..cb1d724053dfe 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/__snapshots__/waffle_vis_function.test.ts.snap +++ b/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/__snapshots__/waffle_vis_function.test.ts.snap @@ -53,6 +53,7 @@ Object { }, "type": "vis_dimension", }, + "colorMapping": undefined, "dimensions": Object { "buckets": Array [ Object { diff --git a/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/i18n.ts b/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/i18n.ts index b312de7bf1583..c74669439b2c3 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/i18n.ts +++ b/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/i18n.ts @@ -122,6 +122,10 @@ export const strings = { i18n.translate('expressionPartitionVis.reusable.function.dimension.splitrow', { defaultMessage: 'Row split', }), + getColorMappingHelp: () => + i18n.translate('expressionPartitionVis.layer.colorMapping.help', { + defaultMessage: 'JSON key-value pairs of the color mapping model', + }), }; export const errors = { diff --git a/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/mosaic_vis_function.ts b/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/mosaic_vis_function.ts index fc863cf73c68c..4a9dff714c8da 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/mosaic_vis_function.ts +++ b/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/mosaic_vis_function.ts @@ -110,6 +110,10 @@ export const mosaicVisFunction = (): MosaicVisExpressionFunctionDefinition => ({ help: strings.getAriaLabelHelp(), required: false, }, + colorMapping: { + types: ['string'], + help: strings.getColorMappingHelp(), + }, }, fn(context, args, handlers) { const maxSupportedBuckets = 2; @@ -146,6 +150,7 @@ export const mosaicVisFunction = (): MosaicVisExpressionFunctionDefinition => ({ splitColumn: args.splitColumn, splitRow: args.splitRow, }, + colorMapping: args.colorMapping, }; if (handlers?.inspectorAdapters?.tables) { diff --git a/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/pie_vis_function.ts b/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/pie_vis_function.ts index 0cf6522456c62..30e8388f1255e 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/pie_vis_function.ts +++ b/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/pie_vis_function.ts @@ -141,6 +141,10 @@ export const pieVisFunction = (): PieVisExpressionFunctionDefinition => ({ help: strings.getAriaLabelHelp(), required: false, }, + colorMapping: { + types: ['string'], + help: strings.getColorMappingHelp(), + }, }, fn(context, args, handlers) { if (args.splitColumn && args.splitRow) { @@ -173,6 +177,7 @@ export const pieVisFunction = (): PieVisExpressionFunctionDefinition => ({ splitColumn: args.splitColumn, splitRow: args.splitRow, }, + colorMapping: args.colorMapping, }; if (handlers?.inspectorAdapters?.tables) { diff --git a/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/treemap_vis_function.ts b/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/treemap_vis_function.ts index 2a5d0a6af7a8a..e0804dd9b0e92 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/treemap_vis_function.ts +++ b/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/treemap_vis_function.ts @@ -115,6 +115,10 @@ export const treemapVisFunction = (): TreemapVisExpressionFunctionDefinition => help: strings.getAriaLabelHelp(), required: false, }, + colorMapping: { + types: ['string'], + help: strings.getColorMappingHelp(), + }, }, fn(context, args, handlers) { const maxSupportedBuckets = 2; @@ -152,6 +156,7 @@ export const treemapVisFunction = (): TreemapVisExpressionFunctionDefinition => splitColumn: args.splitColumn, splitRow: args.splitRow, }, + colorMapping: args.colorMapping, }; if (handlers?.inspectorAdapters?.tables) { diff --git a/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/waffle_vis_function.ts b/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/waffle_vis_function.ts index e4176cf6015c1..6e23513851b1e 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/waffle_vis_function.ts +++ b/src/plugins/chart_expressions/expression_partition_vis/common/expression_functions/waffle_vis_function.ts @@ -114,6 +114,10 @@ export const waffleVisFunction = (): WaffleVisExpressionFunctionDefinition => ({ help: strings.getAriaLabelHelp(), required: false, }, + colorMapping: { + types: ['string'], + help: strings.getColorMappingHelp(), + }, }, fn(context, args, handlers) { if (args.splitColumn && args.splitRow) { @@ -147,6 +151,7 @@ export const waffleVisFunction = (): WaffleVisExpressionFunctionDefinition => ({ splitColumn: args.splitColumn, splitRow: args.splitRow, }, + colorMapping: args.colorMapping, }; if (handlers?.inspectorAdapters?.tables) { diff --git a/src/plugins/chart_expressions/expression_partition_vis/common/types/expression_renderers.ts b/src/plugins/chart_expressions/expression_partition_vis/common/types/expression_renderers.ts index 239253f54491d..00667ace39576 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/common/types/expression_renderers.ts +++ b/src/plugins/chart_expressions/expression_partition_vis/common/types/expression_renderers.ts @@ -61,6 +61,7 @@ interface VisCommonParams { maxLegendLines: number; legendSize?: LegendSize; ariaLabel?: string; + colorMapping?: string; // JSON stringified object of the color mapping } interface VisCommonConfig extends VisCommonParams { diff --git a/src/plugins/chart_expressions/expression_partition_vis/public/utils/colors/color_mapping_accessors.ts b/src/plugins/chart_expressions/expression_partition_vis/public/utils/colors/color_mapping_accessors.ts new file mode 100644 index 0000000000000..ec11fc7605de1 --- /dev/null +++ b/src/plugins/chart_expressions/expression_partition_vis/public/utils/colors/color_mapping_accessors.ts @@ -0,0 +1,77 @@ +/* + * 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 { NodeColorAccessor, PATH_KEY } from '@elastic/charts'; +import { lightenColor } from '@kbn/charts-plugin/public'; +import { MultiFieldKey } from '@kbn/data-plugin/common'; +import { getColorFactory } from '@kbn/coloring'; +import { isMultiFieldKey } from '@kbn/data-plugin/common'; +import { ChartTypes } from '../../../common/types'; + +export function getCategoryKeys(category: string | MultiFieldKey): string | string[] { + return isMultiFieldKey(category) ? category.keys.map(String) : `${category}`; +} + +/** + * Get the color of a specific slice/section in Pie,donut,waffle and treemap. + * These chart type shares the same color assignment mechanism. + */ +const getPieFillColor = + ( + layerIndex: number, + numOfLayers: number, + getColorFn: ReturnType + ): NodeColorAccessor => + (_key, _sortIndex, node) => { + const path = node[PATH_KEY]; + // the category used to color the pie/donut is at the third level of the path + // first two are: small multiple and pie whole center. + const category = getCategoryKeys(path[2].value); + const color = getColorFn(category); + // increase the lightness of the color on each layer. + return lightenColor(color, layerIndex + 1, numOfLayers); + }; + +/** + * Get the color of a section in a Mosaic chart. + * This chart has a slight variation in the way color are applied. Mosaic can represent up to 2 layers, + * described in lens as the horizontal and vertical axes. + * With a single layer the color is simply applied per each category, with 2 layer, the color is applied only + * to the category that describe a row, not by column. + */ +const getMosaicFillColor = + ( + layerIndex: number, + numOfLayers: number, + getColorFn: ReturnType + ): NodeColorAccessor => + (_key, _sortIndex, node) => { + // Special case for 2 layer mosaic where the color is per rows and the columns are not colored + if (numOfLayers === 2 && layerIndex === 0) { + // transparent color will fallback to the kibana/context background + return 'rgba(0,0,0,0)'; + } + const path = node[PATH_KEY]; + + // the category used to color the pie/donut is at the third level of the `path` when using a single layer mosaic + // and are at fourth level of `path` when using 2 layer mosaic + // first two are: small multiple and pie whole center. + const category = getCategoryKeys(numOfLayers === 2 ? path[3].value : path[2].value); + return getColorFn(category); + }; + +export const getPartitionFillColor = ( + chartType: ChartTypes, + layerIndex: number, + numOfLayers: number, + getColorFn: ReturnType +): NodeColorAccessor => { + return chartType === ChartTypes.MOSAIC + ? getMosaicFillColor(layerIndex, numOfLayers, getColorFn) + : getPieFillColor(layerIndex, numOfLayers, getColorFn); +}; diff --git a/src/plugins/chart_expressions/expression_partition_vis/public/utils/layers/get_layers.ts b/src/plugins/chart_expressions/expression_partition_vis/public/utils/layers/get_layers.ts index e4f3e1687e4ad..6f40097809e18 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/public/utils/layers/get_layers.ts +++ b/src/plugins/chart_expressions/expression_partition_vis/public/utils/layers/get_layers.ts @@ -7,16 +7,25 @@ */ import { Datum, PartitionLayer } from '@elastic/charts'; -import type { PaletteRegistry } from '@kbn/coloring'; +import { + PaletteRegistry, + getColorFactory, + getPalette, + AVAILABLE_PALETTES, + NeutralPalette, +} from '@kbn/coloring'; import { i18n } from '@kbn/i18n'; import { FieldFormat } from '@kbn/field-formats-plugin/common'; import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; import type { Datatable, DatatableRow } from '@kbn/expressions-plugin/public'; + +import { getColorCategories } from '@kbn/chart-expressions-common'; import { getDistinctSeries } from '..'; import { BucketColumns, ChartTypes, PartitionVisParams } from '../../../common/types'; import { sortPredicateByType, sortPredicateSaveSourceOrder } from './sort_predicate'; import { byDataColorPaletteMap, getColor } from './get_color'; import { getNodeLabel } from './get_node_labels'; +import { getPartitionFillColor } from '../colors/color_mapping_accessors'; // This is particularly useful in case of a text based languages where // it's no possible to use a missingBucketLabel @@ -62,6 +71,15 @@ export const getLayers = ( const distinctSeries = getDistinctSeries(rows, columns); + // return a fn only if color mapping is available in visParams + const getColorFromMappingFn = getColorFromMappingFactory( + chartType, + columns, + rows, + isDarkMode, + visParams + ); + return columns.map((col, layerIndex) => { return { groupByRollup: (d: Datum) => (col.id ? d[col.id] ?? emptySliceLabel : col.name), @@ -75,26 +93,74 @@ export const getLayers = ( ? sortPredicateSaveSourceOrder() : sortPredicateForType, shape: { - fillColor: (key, sortIndex, node) => - getColor( - chartType, - key, - node, - layerIndex, - isSplitChart, - overwriteColors, - distinctSeries, - { columnsLength: columns.length, rowsLength: rows.length }, - visParams, - palettes, - byDataPalette, - syncColors, - isDarkMode, - formatter, - col, - formatters - ), + // this applies color mapping only if visParams.colorMapping is available + fillColor: getColorFromMappingFn + ? getPartitionFillColor(chartType, layerIndex, columns.length, getColorFromMappingFn) + : (key, sortIndex, node) => + getColor( + chartType, + key, + node, + layerIndex, + isSplitChart, + overwriteColors, + distinctSeries, + { columnsLength: columns.length, rowsLength: rows.length }, + visParams, + palettes, + byDataPalette, + syncColors, + isDarkMode, + formatter, + col, + formatters + ), }, }; }); }; + +/** + * If colorMapping is available, returns a function that accept a string or an array of strings (used in case of multi-field-key) + * and returns a color specified in the provided mapping + */ +function getColorFromMappingFactory( + chartType: ChartTypes, + columns: Array>, + rows: DatatableRow[], + isDarkMode: boolean, + visParams: PartitionVisParams +): undefined | ((category: string | string[]) => string) { + const { colorMapping, dimensions } = visParams; + + if (!colorMapping) { + // return undefined, we will use the legacy color mapping instead + return undefined; + } + // if pie/donut/treemap with no buckets use the default color mode + if ( + (chartType === ChartTypes.DONUT || + chartType === ChartTypes.PIE || + chartType === ChartTypes.TREEMAP) && + (!dimensions.buckets || dimensions.buckets?.length === 0) + ) { + return undefined; + } + // the mosaic configures the main categories in the second column, instead of the first + // as it happens in all the other partition types. + // Independentely from the bucket aggregation used, the categories will always be casted + // as string to make it nicely working with a text input field, avoiding a field + const categories = + chartType === ChartTypes.MOSAIC && columns.length === 2 + ? getColorCategories(rows, columns[1]?.id) + : getColorCategories(rows, columns[0]?.id); + return getColorFactory( + JSON.parse(colorMapping), + getPalette(AVAILABLE_PALETTES, NeutralPalette), + isDarkMode, + { + type: 'categories', + categories, + } + ); +} diff --git a/src/plugins/chart_expressions/expression_tagcloud/common/expression_functions/__snapshots__/tagcloud_function.test.ts.snap b/src/plugins/chart_expressions/expression_tagcloud/common/expression_functions/__snapshots__/tagcloud_function.test.ts.snap index d03cebd680290..15f335df82684 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/common/expression_functions/__snapshots__/tagcloud_function.test.ts.snap +++ b/src/plugins/chart_expressions/expression_tagcloud/common/expression_functions/__snapshots__/tagcloud_function.test.ts.snap @@ -66,6 +66,7 @@ Object { "bucket": Object { "accessor": 1, }, + "colorMapping": undefined, "isPreview": false, "maxFontSize": 72, "metric": Object { @@ -126,6 +127,7 @@ Object { }, "type": "vis_dimension", }, + "colorMapping": undefined, "isPreview": false, "maxFontSize": 72, "metric": Object { diff --git a/src/plugins/chart_expressions/expression_tagcloud/common/expression_functions/tagcloud_function.ts b/src/plugins/chart_expressions/expression_tagcloud/common/expression_functions/tagcloud_function.ts index ec69431cd1735..75148e570331c 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/common/expression_functions/tagcloud_function.ts +++ b/src/plugins/chart_expressions/expression_tagcloud/common/expression_functions/tagcloud_function.ts @@ -51,6 +51,9 @@ const strings = { isPreview: i18n.translate('expressionTagcloud.functions.tagcloud.args.isPreviewHelpText', { defaultMessage: 'Set isPreview to true to avoid showing out of room warnings', }), + colorMapping: i18n.translate('expressionTagcloud.layer.colorMapping.help', { + defaultMessage: 'JSON key-value pairs of the color mapping model', + }), }, dimension: { tags: i18n.translate('expressionTagcloud.functions.tagcloud.dimension.tags', { @@ -146,6 +149,10 @@ export const tagcloudFunction: ExpressionTagcloudFunction = () => { default: false, required: false, }, + colorMapping: { + types: ['string'], + help: argHelp.colorMapping, + }, }, fn(input, args, handlers) { validateAccessor(args.metric, input.columns); @@ -167,6 +174,7 @@ export const tagcloudFunction: ExpressionTagcloudFunction = () => { (handlers.variables?.embeddableTitle as string) ?? handlers.getExecutionContext?.()?.description, isPreview: Boolean(args.isPreview), + colorMapping: args.colorMapping, }; if (handlers?.inspectorAdapters?.tables) { diff --git a/src/plugins/chart_expressions/expression_tagcloud/common/types/expression_functions.ts b/src/plugins/chart_expressions/expression_tagcloud/common/types/expression_functions.ts index 985da788c6ffc..c59e70a5c028d 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/common/types/expression_functions.ts +++ b/src/plugins/chart_expressions/expression_tagcloud/common/types/expression_functions.ts @@ -27,6 +27,7 @@ interface TagCloudCommonParams { metric: ExpressionValueVisDimension | string; bucket?: ExpressionValueVisDimension | string; palette: PaletteOutput; + colorMapping?: string; // JSON stringified object of the color mapping } export interface TagCloudVisConfig extends TagCloudCommonParams { diff --git a/src/plugins/chart_expressions/expression_tagcloud/kibana.jsonc b/src/plugins/chart_expressions/expression_tagcloud/kibana.jsonc index 6c6ce82d321ed..b6bf410e2786f 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/kibana.jsonc +++ b/src/plugins/chart_expressions/expression_tagcloud/kibana.jsonc @@ -8,6 +8,7 @@ "server": true, "browser": true, "requiredPlugins": [ + "data", "expressions", "visualizations", "charts", diff --git a/src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.test.tsx b/src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.test.tsx index 3f9c86778e82d..86c4bc009d931 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.test.tsx +++ b/src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.test.tsx @@ -105,6 +105,7 @@ describe('TagCloudChart', function () { renderComplete: jest.fn(), syncColors: false, visType: 'tagcloud', + isDarkMode: false, }; wrapperPropsWithColumnNames = { @@ -135,6 +136,7 @@ describe('TagCloudChart', function () { renderComplete: jest.fn(), syncColors: false, visType: 'tagcloud', + isDarkMode: false, }; }); diff --git a/src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.tsx b/src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.tsx index adfc3df81f97f..e3532bb17f97e 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.tsx +++ b/src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.tsx @@ -13,11 +13,19 @@ import { EuiIconTip, EuiResizeObserver } from '@elastic/eui'; import { IconChartTagcloud } from '@kbn/chart-icons'; import { Chart, Settings, Wordcloud, RenderChangeListener } from '@elastic/charts'; import { EmptyPlaceholder } from '@kbn/charts-plugin/public'; -import type { PaletteRegistry, PaletteOutput } from '@kbn/coloring'; -import { IInterpreterRenderHandlers } from '@kbn/expressions-plugin/public'; -import { getOverridesFor } from '@kbn/chart-expressions-common'; +import { + PaletteRegistry, + PaletteOutput, + getColorFactory, + getPalette, + AVAILABLE_PALETTES, + NeutralPalette, +} from '@kbn/coloring'; +import { IInterpreterRenderHandlers, DatatableRow } from '@kbn/expressions-plugin/public'; +import { getColorCategories, getOverridesFor } from '@kbn/chart-expressions-common'; import type { AllowedSettingsOverrides, AllowedChartOverrides } from '@kbn/charts-plugin/common'; import { getColumnByAccessor, getFormatByAccessor } from '@kbn/visualizations-plugin/common/utils'; +import { isMultiFieldKey } from '@kbn/data-plugin/common'; import { getFormatService } from '../format_service'; import { TagcloudRendererConfig } from '../../common/types'; import { ScaleOptions, Orientation } from '../../common/constants'; @@ -31,6 +39,7 @@ export type TagCloudChartProps = TagcloudRendererConfig & { renderComplete: IInterpreterRenderHandlers['done']; palettesRegistry: PaletteRegistry; overrides?: AllowedSettingsOverrides & AllowedChartOverrides; + isDarkMode: boolean; }; const calculateWeight = (value: number, x1: number, y1: number, x2: number, y2: number) => @@ -84,9 +93,10 @@ export const TagCloudChart = ({ renderComplete, syncColors, overrides, + isDarkMode, }: TagCloudChartProps) => { const [warning, setWarning] = useState(false); - const { bucket, metric, scale, palette, showLabel, orientation } = visParams; + const { bucket, metric, scale, palette, showLabel, orientation, colorMapping } = visParams; const bucketFormatter = useMemo(() => { return bucket @@ -96,23 +106,35 @@ export const TagCloudChart = ({ const tagCloudData = useMemo(() => { const bucketColumn = bucket ? getColumnByAccessor(bucket, visData.columns)! : null; - const tagColumn = bucket ? bucketColumn!.id : null; + const tagColumn = bucket ? bucketColumn!.id : undefined; const metricColumn = getColumnByAccessor(metric, visData.columns)!.id; const metrics = visData.rows.map((row) => row[metricColumn]); - const values = bucket && tagColumn !== null ? visData.rows.map((row) => row[tagColumn]) : []; + const values = + bucket && tagColumn !== undefined ? visData.rows.map((row) => row[tagColumn]) : []; const maxValue = Math.max(...metrics); const minValue = Math.min(...metrics); + const colorFromMappingFn = getColorFromMappingFactory( + tagColumn, + visData.rows, + isDarkMode, + colorMapping + ); + return visData.rows.map((row) => { - const tag = tagColumn === null ? 'all' : row[tagColumn]; + const tag = tagColumn === undefined ? 'all' : row[tagColumn]; + + const category = isMultiFieldKey(tag) ? tag.keys.map(String) : `${tag}`; return { text: bucketFormatter ? bucketFormatter.convert(tag, 'text') : tag, weight: tag === 'all' || visData.rows.length <= 1 ? 1 : calculateWeight(row[metricColumn], minValue, maxValue, 0, 1) || 0, - color: getColor(palettesRegistry, palette, tag, values, syncColors) || 'rgba(0,0,0,0)', + color: colorFromMappingFn + ? colorFromMappingFn(category) + : getColor(palettesRegistry, palette, tag, values, syncColors) || 'rgba(0,0,0,0)', }; }); }, [ @@ -124,6 +146,8 @@ export const TagCloudChart = ({ syncColors, visData.columns, visData.rows, + colorMapping, + isDarkMode, ]); useEffect(() => { @@ -278,3 +302,28 @@ export const TagCloudChart = ({ // eslint-disable-next-line import/no-default-export export { TagCloudChart as default }; + +/** + * If colorMapping is available, returns a function that accept a string or an array of strings (used in case of multi-field-key) + * and returns a color specified in the provided mapping + */ +function getColorFromMappingFactory( + tagColumn: string | undefined, + rows: DatatableRow[], + isDarkMode: boolean, + colorMapping?: string +): undefined | ((category: string | string[]) => string) { + if (!colorMapping) { + // return undefined, we will use the legacy color mapping instead + return undefined; + } + return getColorFactory( + JSON.parse(colorMapping), + getPalette(AVAILABLE_PALETTES, NeutralPalette), + isDarkMode, + { + type: 'categories', + categories: getColorCategories(rows, tagColumn), + } + ); +} diff --git a/src/plugins/chart_expressions/expression_tagcloud/public/expression_renderers/tagcloud_renderer.tsx b/src/plugins/chart_expressions/expression_tagcloud/public/expression_renderers/tagcloud_renderer.tsx index b3ab496447754..101c40b6b384d 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/public/expression_renderers/tagcloud_renderer.tsx +++ b/src/plugins/chart_expressions/expression_tagcloud/public/expression_renderers/tagcloud_renderer.tsx @@ -67,6 +67,12 @@ export const tagcloudRenderer: ( }; const palettesRegistry = await plugins.charts.palettes.getPalettes(); + let isDarkMode = false; + plugins.charts.theme.darkModeEnabled$ + .subscribe((val) => { + isDarkMode = val.darkMode; + }) + .unsubscribe(); render( @@ -87,6 +93,7 @@ export const tagcloudRenderer: ( fireEvent={handlers.event} syncColors={config.syncColors} overrides={config.overrides} + isDarkMode={isDarkMode} /> )} diff --git a/src/plugins/chart_expressions/expression_tagcloud/tsconfig.json b/src/plugins/chart_expressions/expression_tagcloud/tsconfig.json index 55e81302586b8..b737dfb445f09 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/tsconfig.json +++ b/src/plugins/chart_expressions/expression_tagcloud/tsconfig.json @@ -27,6 +27,7 @@ "@kbn/analytics", "@kbn/chart-expressions-common", "@kbn/chart-icons", + "@kbn/data-plugin", ], "exclude": [ "target/**/*", diff --git a/src/plugins/chart_expressions/expression_xy/common/expression_functions/common_data_layer_args.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/common_data_layer_args.ts index 10f6d5d748b23..b9e2bd6dbac67 100644 --- a/src/plugins/chart_expressions/expression_xy/common/expression_functions/common_data_layer_args.ts +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/common_data_layer_args.ts @@ -94,4 +94,8 @@ export const commonDataLayerArgs: Omit< help: strings.getPaletteHelp(), default: '{palette}', }, + colorMapping: { + types: ['string'], + help: strings.getColorMappingHelp(), + }, }; diff --git a/src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis_fn.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis_fn.ts index 94d788106acb3..03df575b3c653 100644 --- a/src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis_fn.ts +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis_fn.ts @@ -52,6 +52,7 @@ const createDataLayer = (args: XYArgs, table: Datatable): DataLayerConfigResult layerType: LayerTypes.DATA, table: normalizedTable, showLines: args.showLines, + colorMapping: args.colorMapping, ...accessors, }; }; diff --git a/src/plugins/chart_expressions/expression_xy/common/i18n/index.tsx b/src/plugins/chart_expressions/expression_xy/common/i18n/index.tsx index d9fc015c2844c..2446a27e718ce 100644 --- a/src/plugins/chart_expressions/expression_xy/common/i18n/index.tsx +++ b/src/plugins/chart_expressions/expression_xy/common/i18n/index.tsx @@ -209,6 +209,10 @@ export const strings = { i18n.translate('expressionXY.dataLayer.palette.help', { defaultMessage: 'Palette', }), + getColorMappingHelp: () => + i18n.translate('expressionXY.layer.colorMapping.help', { + defaultMessage: 'JSON key-value pairs of the color mapping model', + }), getTableHelp: () => i18n.translate('expressionXY.layers.table.help', { defaultMessage: 'Table', diff --git a/src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts b/src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts index 55fd63786570b..a81128f6e74a7 100644 --- a/src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts +++ b/src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts @@ -136,6 +136,7 @@ export interface DataLayerArgs { isStacked: boolean; isHorizontal: boolean; palette: PaletteOutput; + colorMapping?: string; // JSON stringified object of the color mapping decorations?: DataDecorationConfigResult[]; curveType?: XYCurveType; } @@ -163,6 +164,7 @@ export interface ExtendedDataLayerArgs { isStacked: boolean; isHorizontal: boolean; palette: PaletteOutput; + colorMapping?: string; // palette will always be set on the expression decorations?: DataDecorationConfigResult[]; curveType?: XYCurveType; diff --git a/src/plugins/chart_expressions/expression_xy/public/components/__snapshots__/xy_chart.test.tsx.snap b/src/plugins/chart_expressions/expression_xy/public/components/__snapshots__/xy_chart.test.tsx.snap index fe76259b65889..9bc59b677ed78 100644 --- a/src/plugins/chart_expressions/expression_xy/public/components/__snapshots__/xy_chart.test.tsx.snap +++ b/src/plugins/chart_expressions/expression_xy/public/components/__snapshots__/xy_chart.test.tsx.snap @@ -1099,6 +1099,7 @@ exports[`XYChart component it renders area 1`] = ` }, } } + isDarkMode={false} layers={ Array [ Object { @@ -2107,6 +2108,7 @@ exports[`XYChart component it renders bar 1`] = ` }, } } + isDarkMode={false} layers={ Array [ Object { @@ -3115,6 +3117,7 @@ exports[`XYChart component it renders horizontal bar 1`] = ` }, } } + isDarkMode={false} layers={ Array [ Object { @@ -4123,6 +4126,7 @@ exports[`XYChart component it renders line 1`] = ` }, } } + isDarkMode={false} layers={ Array [ Object { @@ -5131,6 +5135,7 @@ exports[`XYChart component it renders stacked area 1`] = ` }, } } + isDarkMode={false} layers={ Array [ Object { @@ -6139,6 +6144,7 @@ exports[`XYChart component it renders stacked bar 1`] = ` }, } } + isDarkMode={false} layers={ Array [ Object { @@ -7147,6 +7153,7 @@ exports[`XYChart component it renders stacked horizontal bar 1`] = ` }, } } + isDarkMode={false} layers={ Array [ Object { @@ -8381,6 +8388,7 @@ exports[`XYChart component split chart should render split chart if both, splitR }, } } + isDarkMode={false} layers={ Array [ Object { @@ -9622,6 +9630,7 @@ exports[`XYChart component split chart should render split chart if splitColumnA }, } } + isDarkMode={false} layers={ Array [ Object { @@ -10861,6 +10870,7 @@ exports[`XYChart component split chart should render split chart if splitRowAcce }, } } + isDarkMode={false} layers={ Array [ Object { diff --git a/src/plugins/chart_expressions/expression_xy/public/components/data_layers.tsx b/src/plugins/chart_expressions/expression_xy/public/components/data_layers.tsx index 5cabeaee31575..cc6e969a10af9 100644 --- a/src/plugins/chart_expressions/expression_xy/public/components/data_layers.tsx +++ b/src/plugins/chart_expressions/expression_xy/public/components/data_layers.tsx @@ -57,6 +57,7 @@ interface Props { fieldFormats: LayersFieldFormats; uiState?: PersistedState; singleTable?: boolean; + isDarkMode: boolean; } export const DataLayers: FC = ({ @@ -80,6 +81,7 @@ export const DataLayers: FC = ({ fieldFormats, uiState, singleTable, + isDarkMode, }) => { // for singleTable mode we should use y accessors from all layers for creating correct series name and getting color const allYAccessors = layers.flatMap((layer) => layer.accessors); @@ -169,6 +171,7 @@ export const DataLayers: FC = ({ allYAccessors, singleTable, multipleLayersWithSplits, + isDarkMode, }); const index = `${layer.layerId}-${accessorIndex}`; diff --git a/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx b/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx index b8ac9d5cd0bbb..c241e476db5de 100644 --- a/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx +++ b/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx @@ -964,6 +964,7 @@ export function XYChart({ fieldFormats={fieldFormats} uiState={uiState} singleTable={singleTable} + isDarkMode={darkMode} /> )} {referenceLineLayers.length ? ( diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/color/color_mapping_accessor.ts b/src/plugins/chart_expressions/expression_xy/public/helpers/color/color_mapping_accessor.ts new file mode 100644 index 0000000000000..b57f371eab2fd --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/color/color_mapping_accessor.ts @@ -0,0 +1,49 @@ +/* + * 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 { SeriesColorAccessorFn } from '@elastic/charts'; +import { getColorFactory, type ColorMapping, type ColorMappingInputData } from '@kbn/coloring'; +import { MULTI_FIELD_KEY_SEPARATOR } from '@kbn/data-plugin/common'; + +/** + * Return a color accessor function for XY charts depending on the split accessors received. + */ +export function getColorSeriesAccessorFn( + config: ColorMapping.Config, + getPaletteFn: (paletteId: string) => ColorMapping.CategoricalPalette, + isDarkMode: boolean, + mappingData: ColorMappingInputData, + fieldId: string, + specialTokens: Map +): SeriesColorAccessorFn { + // inverse map to handle the conversion between the formatted string and their original format + // for any specified special tokens + const specialHandlingInverseMap: Map = new Map( + [...specialTokens.entries()].map((d) => [d[1], d[0]]) + ); + + const getColor = getColorFactory(config, getPaletteFn, isDarkMode, mappingData); + + return ({ splitAccessors }) => { + const splitValue = splitAccessors.get(fieldId); + // if there isn't a category associated in the split accessor, let's use the default color + if (splitValue === undefined) { + return null; + } + + // category can be also a number, range, ip, multi-field. We need to stringify it to be sure + // we can correctly match it a with user string + // if the separator exist, we de-construct it into a multifieldkey into values. + const categories = `${splitValue}`.split(MULTI_FIELD_KEY_SEPARATOR).map((category) => { + return specialHandlingInverseMap.get(category) ?? category; + }); + // we must keep the array nature of a multi-field key or just use a single string + // This is required because the rule stored are checked differently for single values or multi-values + return getColor(categories.length > 1 ? categories : categories[0]); + }; +} diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/color_assignment.ts b/src/plugins/chart_expressions/expression_xy/public/helpers/color_assignment.ts index 94b187055e6dd..990d1ab93a1bc 100644 --- a/src/plugins/chart_expressions/expression_xy/public/helpers/color_assignment.ts +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/color_assignment.ts @@ -95,6 +95,11 @@ export const getAllSeries = ( return allSeries; }; +/** + * This function joins every data series name available on each layer by the same color palette. + * The returned function `getRank` should return the position of a series name in this unified list by palette. + * + */ export function getColorAssignments( layers: CommonXYLayerConfig[], titles: LayersAccessorsTitles, diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/data_layers.tsx b/src/plugins/chart_expressions/expression_xy/public/helpers/data_layers.tsx index ff76ec511ffc9..1971409ab4223 100644 --- a/src/plugins/chart_expressions/expression_xy/public/helpers/data_layers.tsx +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/data_layers.tsx @@ -16,6 +16,7 @@ import { SeriesName, StackMode, XYChartSeriesIdentifier, + SeriesColorAccessorFn, } from '@elastic/charts'; import { IFieldFormat } from '@kbn/field-formats-plugin/common'; import type { PersistedState } from '@kbn/visualizations-plugin/public'; @@ -23,6 +24,13 @@ import { Datatable } from '@kbn/expressions-plugin/common'; import { getAccessorByDimension } from '@kbn/visualizations-plugin/common/utils'; import type { ExpressionValueVisDimension } from '@kbn/visualizations-plugin/common/expression_functions'; import { PaletteRegistry, SeriesLayer } from '@kbn/coloring'; +import { + getPalette, + AVAILABLE_PALETTES, + NeutralPalette, + SPECIAL_TOKENS_STRING_CONVERTION, +} from '@kbn/coloring'; +import { getColorCategories } from '@kbn/chart-expressions-common'; import { isDataLayer } from '../../common/utils/layer_types_guards'; import { CommonXYDataLayerConfig, CommonXYLayerConfig, XScaleType } from '../../common'; import { AxisModes, SeriesTypes } from '../../common/constants'; @@ -32,6 +40,7 @@ import { ColorAssignments } from './color_assignment'; import { GroupsConfiguration } from './axes_configuration'; import { LayerAccessorsTitles, LayerFieldFormats, LayersFieldFormats } from './layers'; import { getFormat } from './format'; +import { getColorSeriesAccessorFn } from './color/color_mapping_accessor'; type SeriesSpec = LineSeriesProps & BarSeriesProps & AreaSeriesProps; @@ -57,6 +66,7 @@ type GetSeriesPropsFn = (config: { allYAccessors: Array; singleTable?: boolean; multipleLayersWithSplits: boolean; + isDarkMode: boolean; }) => SeriesSpec; type GetSeriesNameFn = ( @@ -399,6 +409,7 @@ export const getSeriesProps: GetSeriesPropsFn = ({ allYAccessors, singleTable, multipleLayersWithSplits, + isDarkMode, }): SeriesSpec => { const { table, isStacked, markSizeAccessor } = layer; const isPercentage = layer.isPercentage; @@ -478,6 +489,34 @@ export const getSeriesProps: GetSeriesPropsFn = ({ ); }; + const colorAccessorFn: SeriesColorAccessorFn = + // if colorMapping exist then we can apply it, if not let's use the legacy coloring method + layer.colorMapping && splitColumnIds.length > 0 + ? getColorSeriesAccessorFn( + JSON.parse(layer.colorMapping), // the color mapping is at this point just a strinfigied JSON + getPalette(AVAILABLE_PALETTES, NeutralPalette), + isDarkMode, + { + type: 'categories', + categories: getColorCategories(table.rows, splitColumnIds[0]), + }, + splitColumnIds[0], + SPECIAL_TOKENS_STRING_CONVERTION + ) + : (series) => + getColor( + series, + { + layer, + colorAssignments, + paletteService, + getSeriesNameFn, + syncColors, + }, + uiState, + singleTable + ); + return { splitSeriesAccessors: splitColumnIds.length ? splitColumnIds : [], stackAccessors: isStacked ? [xColumnId || 'unifiedX'] : [], @@ -497,19 +536,7 @@ export const getSeriesProps: GetSeriesPropsFn = ({ formatter?.id === 'bytes' && scaleType === ScaleType.Linear ? ScaleType.LinearBinary : scaleType, - color: (series) => - getColor( - series, - { - layer, - colorAssignments, - paletteService, - getSeriesNameFn, - syncColors, - }, - uiState, - singleTable - ), + color: colorAccessorFn, groupId: yAxis?.groupId, enableHistogramMode, stackMode, diff --git a/src/plugins/charts/kibana.jsonc b/src/plugins/charts/kibana.jsonc index 6b0e952969329..8c00cd40f4ad3 100644 --- a/src/plugins/charts/kibana.jsonc +++ b/src/plugins/charts/kibana.jsonc @@ -7,7 +7,8 @@ "server": true, "browser": true, "requiredPlugins": [ - "expressions" + "expressions", + "data" ], "extraPublicDirs": [ "common" diff --git a/src/plugins/data/common/search/aggs/buckets/index.ts b/src/plugins/data/common/search/aggs/buckets/index.ts index 31bc7cf9ca544..369e56caf1859 100644 --- a/src/plugins/data/common/search/aggs/buckets/index.ts +++ b/src/plugins/data/common/search/aggs/buckets/index.ts @@ -37,7 +37,7 @@ export * from './significant_text_fn'; export * from './significant_text'; export * from './terms_fn'; export * from './terms'; -export { MultiFieldKey } from './multi_field_key'; +export { MultiFieldKey, isMultiFieldKey, MULTI_FIELD_KEY_SEPARATOR } from './multi_field_key'; export * from './multi_terms_fn'; export * from './multi_terms'; export * from './rare_terms_fn'; diff --git a/src/plugins/data/common/search/aggs/buckets/multi_field_key.ts b/src/plugins/data/common/search/aggs/buckets/multi_field_key.ts index 89ac1f4c00a54..5b02d0d8827f2 100644 --- a/src/plugins/data/common/search/aggs/buckets/multi_field_key.ts +++ b/src/plugins/data/common/search/aggs/buckets/multi_field_key.ts @@ -38,3 +38,13 @@ export class MultiFieldKey { return this[id]; } } + +export function isMultiFieldKey(field: unknown): field is MultiFieldKey { + return field instanceof MultiFieldKey; +} + +/** + * Multi-field key separator used in Visualizations (Lens, AggBased, TSVB). + * This differs from the separator used in the toString method of the MultiFieldKey + */ +export const MULTI_FIELD_KEY_SEPARATOR = ' › '; diff --git a/test/interpreter_functional/snapshots/baseline/partial_test_1.json b/test/interpreter_functional/snapshots/baseline/partial_test_1.json index c7bb37566b0fe..90528b3321d22 100644 --- a/test/interpreter_functional/snapshots/baseline/partial_test_1.json +++ b/test/interpreter_functional/snapshots/baseline/partial_test_1.json @@ -1 +1 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"isPreview":false,"maxFontSize":72,"metric":{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file +{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"colorMapping":null,"isPreview":false,"maxFontSize":72,"metric":{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/tagcloud_all_data.json b/test/interpreter_functional/snapshots/baseline/tagcloud_all_data.json index ac809c756d2cc..4d94b530c86e2 100644 --- a/test/interpreter_functional/snapshots/baseline/tagcloud_all_data.json +++ b/test/interpreter_functional/snapshots/baseline/tagcloud_all_data.json @@ -1 +1 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":1,"format":{"id":"number"},"type":"vis_dimension"},"isPreview":false,"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file +{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":1,"format":{"id":"number"},"type":"vis_dimension"},"colorMapping":null,"isPreview":false,"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/tagcloud_empty_data.json b/test/interpreter_functional/snapshots/baseline/tagcloud_empty_data.json index 6b52c8de57ae5..8c4e9fc5cd523 100644 --- a/test/interpreter_functional/snapshots/baseline/tagcloud_empty_data.json +++ b/test/interpreter_functional/snapshots/baseline/tagcloud_empty_data.json @@ -1 +1 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[],"type":"datatable"},"visParams":{"ariaLabel":null,"isPreview":false,"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file +{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[],"type":"datatable"},"visParams":{"ariaLabel":null,"colorMapping":null,"isPreview":false,"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/tagcloud_fontsize.json b/test/interpreter_functional/snapshots/baseline/tagcloud_fontsize.json index 21e213ebb9c27..f142588711a31 100644 --- a/test/interpreter_functional/snapshots/baseline/tagcloud_fontsize.json +++ b/test/interpreter_functional/snapshots/baseline/tagcloud_fontsize.json @@ -1 +1 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":1,"format":{"id":"number"},"type":"vis_dimension"},"isPreview":false,"maxFontSize":40,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":20,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file +{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":1,"format":{"id":"number"},"type":"vis_dimension"},"colorMapping":null,"isPreview":false,"maxFontSize":40,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":20,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/tagcloud_metric_data.json b/test/interpreter_functional/snapshots/baseline/tagcloud_metric_data.json index afaac18bf342d..291e6b40e6bfd 100644 --- a/test/interpreter_functional/snapshots/baseline/tagcloud_metric_data.json +++ b/test/interpreter_functional/snapshots/baseline/tagcloud_metric_data.json @@ -1 +1 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"isPreview":false,"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file +{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"colorMapping":null,"isPreview":false,"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/tagcloud_options.json b/test/interpreter_functional/snapshots/baseline/tagcloud_options.json index 03f74cc01d3e3..381d3afc54067 100644 --- a/test/interpreter_functional/snapshots/baseline/tagcloud_options.json +++ b/test/interpreter_functional/snapshots/baseline/tagcloud_options.json @@ -1 +1 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":1,"format":{"id":"number"},"type":"vis_dimension"},"isPreview":false,"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":18,"orientation":"multiple","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"log","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file +{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":1,"format":{"id":"number"},"type":"vis_dimension"},"colorMapping":null,"isPreview":false,"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":18,"orientation":"multiple","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"log","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/session/partial_test_1.json b/test/interpreter_functional/snapshots/session/partial_test_1.json index 6e12a10d1e283..90528b3321d22 100644 --- a/test/interpreter_functional/snapshots/session/partial_test_1.json +++ b/test/interpreter_functional/snapshots/session/partial_test_1.json @@ -1 +1 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file +{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"colorMapping":null,"isPreview":false,"maxFontSize":72,"metric":{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/session/tagcloud_all_data.json b/test/interpreter_functional/snapshots/session/tagcloud_all_data.json index cb14c6ea89407..4d94b530c86e2 100644 --- a/test/interpreter_functional/snapshots/session/tagcloud_all_data.json +++ b/test/interpreter_functional/snapshots/session/tagcloud_all_data.json @@ -1 +1 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":1,"format":{"id":"number"},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file +{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":1,"format":{"id":"number"},"type":"vis_dimension"},"colorMapping":null,"isPreview":false,"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/session/tagcloud_empty_data.json b/test/interpreter_functional/snapshots/session/tagcloud_empty_data.json index 0910e67409423..8c4e9fc5cd523 100644 --- a/test/interpreter_functional/snapshots/session/tagcloud_empty_data.json +++ b/test/interpreter_functional/snapshots/session/tagcloud_empty_data.json @@ -1 +1 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[],"type":"datatable"},"visParams":{"ariaLabel":null,"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file +{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[],"type":"datatable"},"visParams":{"ariaLabel":null,"colorMapping":null,"isPreview":false,"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/session/tagcloud_fontsize.json b/test/interpreter_functional/snapshots/session/tagcloud_fontsize.json index 21e213ebb9c27..f142588711a31 100644 --- a/test/interpreter_functional/snapshots/session/tagcloud_fontsize.json +++ b/test/interpreter_functional/snapshots/session/tagcloud_fontsize.json @@ -1 +1 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":1,"format":{"id":"number"},"type":"vis_dimension"},"isPreview":false,"maxFontSize":40,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":20,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file +{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":1,"format":{"id":"number"},"type":"vis_dimension"},"colorMapping":null,"isPreview":false,"maxFontSize":40,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":20,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/session/tagcloud_metric_data.json b/test/interpreter_functional/snapshots/session/tagcloud_metric_data.json index f340c5b653e35..291e6b40e6bfd 100644 --- a/test/interpreter_functional/snapshots/session/tagcloud_metric_data.json +++ b/test/interpreter_functional/snapshots/session/tagcloud_metric_data.json @@ -1 +1 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file +{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"colorMapping":null,"isPreview":false,"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/session/tagcloud_options.json b/test/interpreter_functional/snapshots/session/tagcloud_options.json index ecbafbbc0afba..381d3afc54067 100644 --- a/test/interpreter_functional/snapshots/session/tagcloud_options.json +++ b/test/interpreter_functional/snapshots/session/tagcloud_options.json @@ -1 +1 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":1,"format":{"id":"number"},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":18,"orientation":"multiple","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"log","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file +{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"excludeIsRegex":true,"field":"response.raw","includeIsRegex":true,"missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"emptyAsNull":false},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"meta":{"source":"logstash-*","statistics":{"totalCount":14004},"type":"esaggs"},"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":1,"format":{"id":"number"},"type":"vis_dimension"},"colorMapping":null,"isPreview":false,"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":18,"orientation":"multiple","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"log","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/x-pack/plugins/lens/common/types.ts b/x-pack/plugins/lens/common/types.ts index ff269070a18c2..34baa25120e09 100644 --- a/x-pack/plugins/lens/common/types.ts +++ b/x-pack/plugins/lens/common/types.ts @@ -8,7 +8,7 @@ import type { Filter, FilterMeta } from '@kbn/es-query'; import type { Position } from '@elastic/charts'; import type { $Values } from '@kbn/utility-types'; -import type { CustomPaletteParams, PaletteOutput } from '@kbn/coloring'; +import { CustomPaletteParams, PaletteOutput, ColorMapping } from '@kbn/coloring'; import type { ColorMode } from '@kbn/charts-plugin/common'; import type { LegendSize } from '@kbn/visualizations-plugin/common'; import { CategoryDisplay, LegendDisplay, NumberDisplay, PieChartTypes } from './constants'; @@ -71,6 +71,7 @@ export interface SharedPieLayerState { legendMaxLines?: number; legendSize?: LegendSize; truncateLegend?: boolean; + colorMapping?: ColorMapping.Config; } export type PieLayerState = SharedPieLayerState & { diff --git a/x-pack/plugins/lens/public/app_plugin/app.tsx b/x-pack/plugins/lens/public/app_plugin/app.tsx index 22c5a21ad3377..d68476598ad99 100644 --- a/x-pack/plugins/lens/public/app_plugin/app.tsx +++ b/x-pack/plugins/lens/public/app_plugin/app.tsx @@ -154,7 +154,7 @@ export function App({ useExecutionContext(executionContext, { type: 'application', - id: savedObjectId || 'new', + id: savedObjectId || 'new', // TODO: this doesn't consider when lens is saved by value page: 'editor', }); diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts index 0e677804d5f16..d9cfa8c84c62f 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts @@ -18,6 +18,7 @@ import { type EventAnnotationGroupConfig, EVENT_ANNOTATION_GROUP_TYPE, } from '@kbn/event-annotation-common'; +import { DEFAULT_COLOR_MAPPING_CONFIG } from '@kbn/coloring'; import type { Datasource, DatasourceMap, @@ -289,7 +290,8 @@ export function initializeVisualization({ visualizationMap[visualizationState.activeId]?.initialize( () => '', visualizationState.state, - undefined, + // initialize a new visualization always with the new color mapping + { type: 'colorMapping', value: { ...DEFAULT_COLOR_MAPPING_CONFIG } }, annotationGroups, references ) ?? visualizationState.state diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_helpers.test.ts b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_helpers.test.ts index e86f602465584..235e3b34538b8 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_helpers.test.ts +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_helpers.test.ts @@ -457,7 +457,13 @@ describe('suggestion helpers', () => { it('should pass passed in main palette if specified', () => { const mockVisualization1 = createMockVisualization(); const mockVisualization2 = createMockVisualization(); - const mainPalette: PaletteOutput = { type: 'palette', name: 'mock' }; + const mainPalette: { type: 'legacyPalette'; value: PaletteOutput } = { + type: 'legacyPalette', + value: { + type: 'palette', + name: 'mock', + }, + }; datasourceMap.mock.getDatasourceSuggestionsFromCurrentState.mockReturnValue([ generateSuggestion(0), generateSuggestion(1), @@ -490,7 +496,13 @@ describe('suggestion helpers', () => { it('should query active visualization for main palette if not specified', () => { const mockVisualization1 = createMockVisualization(); const mockVisualization2 = createMockVisualization(); - const mainPalette: PaletteOutput = { type: 'palette', name: 'mock' }; + const mainPalette: { type: 'legacyPalette'; value: PaletteOutput } = { + type: 'legacyPalette', + value: { + type: 'palette', + name: 'mock', + }, + }; mockVisualization1.getMainPalette = jest.fn(() => mainPalette); datasourceMap.mock.getDatasourceSuggestionsFromCurrentState.mockReturnValue([ generateSuggestion(0), diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_helpers.ts b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_helpers.ts index 6679e8b042480..c1032d144ac33 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_helpers.ts +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_helpers.ts @@ -6,12 +6,11 @@ */ import type { Datatable } from '@kbn/expressions-plugin/common'; -import type { PaletteOutput } from '@kbn/coloring'; import type { VisualizeFieldContext } from '@kbn/ui-actions-plugin/public'; import { LayerTypes } from '@kbn/expression-xy-plugin/public'; import type { DragDropIdentifier } from '@kbn/dom-drag-drop'; import { showMemoizedErrorNotification } from '../../lens_ui_errors'; -import type { +import { Visualization, Datasource, TableSuggestion, @@ -21,6 +20,7 @@ import type { VisualizeEditorContext, Suggestion, DatasourceLayers, + SuggestionRequest, } from '../../types'; import type { LayerType } from '../../../common/types'; import { @@ -64,7 +64,7 @@ export function getSuggestions({ visualizeTriggerFieldContext?: VisualizeFieldContext | VisualizeEditorContext; activeData?: Record; dataViews: DataViewsState; - mainPalette?: PaletteOutput; + mainPalette?: SuggestionRequest['mainPalette']; allowMixed?: boolean; }): Suggestion[] { const datasources = Object.entries(datasourceMap).filter( @@ -237,7 +237,7 @@ function getVisualizationSuggestions( datasourceSuggestion: DatasourceSuggestion & { datasourceId: string }, currentVisualizationState: unknown, subVisualizationId?: string, - mainPalette?: PaletteOutput, + mainPalette?: SuggestionRequest['mainPalette'], isFromContext?: boolean, activeData?: Record, allowMixed?: boolean diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.test.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.test.tsx index 5b14bb43dfb16..3e613d5a23e89 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.test.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.test.tsx @@ -519,7 +519,10 @@ describe('chart_switch', () => { it('should query main palette from active chart and pass into suggestions', async () => { const visualizationMap = mockVisualizationMap(); const mockPalette: PaletteOutput = { type: 'palette', name: 'mock' }; - visualizationMap.visA.getMainPalette = jest.fn(() => mockPalette); + visualizationMap.visA.getMainPalette = jest.fn(() => ({ + type: 'legacyPalette', + value: mockPalette, + })); visualizationMap.visB.getSuggestions.mockReturnValueOnce([]); const frame = mockFrame(['a', 'b', 'c']); const currentVisState = {}; @@ -550,7 +553,7 @@ describe('chart_switch', () => { expect(visualizationMap.visB.getSuggestions).toHaveBeenCalledWith( expect.objectContaining({ keptLayerIds: ['a'], - mainPalette: mockPalette, + mainPalette: { type: 'legacyPalette', value: mockPalette }, }) ); }); diff --git a/x-pack/plugins/lens/public/shared_components/coloring/palette_panel_container.tsx b/x-pack/plugins/lens/public/shared_components/coloring/palette_panel_container.tsx index b910354f1f68d..523c98c9d6903 100644 --- a/x-pack/plugins/lens/public/shared_components/coloring/palette_panel_container.tsx +++ b/x-pack/plugins/lens/public/shared_components/coloring/palette_panel_container.tsx @@ -27,8 +27,10 @@ export function PalettePanelContainer({ handleClose, siblingRef, children, + title, }: { isOpen: boolean; + title: string; handleClose: () => void; siblingRef: MutableRefObject; children?: React.ReactElement | React.ReactElement[]; @@ -76,16 +78,12 @@ export function PalettePanelContainer({ -

- - {i18n.translate('xpack.lens.table.palettePanelTitle', { - defaultMessage: 'Color', - })} - -

+ {title} +
diff --git a/x-pack/plugins/lens/public/shared_components/palette_picker.tsx b/x-pack/plugins/lens/public/shared_components/palette_picker.tsx index efd1caba7e4da..51977e551128e 100644 --- a/x-pack/plugins/lens/public/shared_components/palette_picker.tsx +++ b/x-pack/plugins/lens/public/shared_components/palette_picker.tsx @@ -36,28 +36,24 @@ export function PalettePicker({ }); return ( - <> - { - setPalette({ - type: 'palette', - name: newPalette, - }); - }} - valueOfSelected={activePalette?.name || 'default'} - selectionDisplay={'palette'} - /> - + { + setPalette({ + type: 'palette', + name: newPalette, + }); + }} + valueOfSelected={activePalette?.name || 'default'} + selectionDisplay={'palette'} + /> ); } diff --git a/x-pack/plugins/lens/public/types.ts b/x-pack/plugins/lens/public/types.ts index d549fbb71bdcf..0c09d84df9adc 100644 --- a/x-pack/plugins/lens/public/types.ts +++ b/x-pack/plugins/lens/public/types.ts @@ -7,7 +7,7 @@ import type { Ast } from '@kbn/interpreter'; import type { IconType } from '@elastic/eui/src/components/icon/icon'; import type { CoreStart, SavedObjectReference, ResolvedSimpleSavedObject } from '@kbn/core/public'; -import type { PaletteOutput } from '@kbn/coloring'; +import type { ColorMapping, PaletteOutput } from '@kbn/coloring'; import type { TopNavMenuData } from '@kbn/navigation-plugin/public'; import type { MutableRefObject, ReactElement } from 'react'; import type { Filter, TimeRange } from '@kbn/es-query'; @@ -863,7 +863,12 @@ export interface SuggestionRequest { * State is only passed if the visualization is active. */ state?: T; - mainPalette?: PaletteOutput; + /** + * Passing the legacy palette or the new color mapping if available + */ + mainPalette?: + | { type: 'legacyPalette'; value: PaletteOutput } + | { type: 'colorMapping'; value: ColorMapping.Config }; isFromContext?: boolean; /** * The visualization needs to know which table is being suggested @@ -1026,11 +1031,15 @@ export interface Visualization string, nonPersistedState?: T, mainPalette?: PaletteOutput): T; + ( + addNewLayer: () => string, + nonPersistedState?: T, + mainPalette?: SuggestionRequest['mainPalette'] + ): T; ( addNewLayer: () => string, persistedState: P, - mainPalette?: PaletteOutput, + mainPalette?: SuggestionRequest['mainPalette'], annotationGroups?: AnnotationGroups, references?: SavedObjectReference[] ): T; @@ -1042,7 +1051,7 @@ export interface Visualization string[]; - getMainPalette?: (state: T) => undefined | PaletteOutput; + getMainPalette?: (state: T) => undefined | SuggestionRequest['mainPalette']; /** * Supported triggers of this visualization type when embedded somewhere diff --git a/x-pack/plugins/lens/public/visualizations/datatable/components/dimension_editor.tsx b/x-pack/plugins/lens/public/visualizations/datatable/components/dimension_editor.tsx index 09f1bc93d6779..60646bdb8d054 100644 --- a/x-pack/plugins/lens/public/visualizations/datatable/components/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/visualizations/datatable/components/dimension_editor.tsx @@ -253,6 +253,9 @@ export function TableDimensionEditor( siblingRef={props.panelRef} isOpen={isPaletteOpen} handleClose={() => setIsPaletteOpen(!isPaletteOpen)} + title={i18n.translate('xpack.lens.table.colorByRangePanelTitle', { + defaultMessage: 'Color', + })} > setIsPaletteOpen(!isPaletteOpen)} + title={i18n.translate('xpack.lens.table.colorByRangePanelTitle', { + defaultMessage: 'Color', + })} > {activePalette && ( & { paletteService: PaletteRegistry; + isDarkMode: boolean; }; export function DimensionEditor(props: DimensionEditorProps) { @@ -30,10 +52,14 @@ export function DimensionEditor(props: DimensionEditorProps) { value: props.state, onChange: props.setState, }); + const [isPaletteOpen, setIsPaletteOpen] = useState(false); const currentLayer = localState.layers.find((layer) => layer.layerId === props.layerId); - const setConfig = React.useCallback( + const canUseColorMapping = currentLayer && currentLayer.colorMapping ? true : false; + const [useNewColorMapping, setUseNewColorMapping] = useState(canUseColorMapping); + + const setConfig = useCallback( ({ color }) => { if (!currentLayer) { return; @@ -61,6 +87,23 @@ export function DimensionEditor(props: DimensionEditorProps) { [currentLayer, localState, props.accessor, setLocalState] ); + const setColorMapping = useCallback( + (colorMapping?: ColorMapping.Config) => { + setLocalState({ + ...localState, + layers: localState.layers.map((layer) => + layer.layerId === currentLayer?.layerId + ? { + ...layer, + colorMapping, + } + : layer + ), + }); + }, + [localState, currentLayer, setLocalState] + ); + if (!currentLayer) { return null; } @@ -84,17 +127,125 @@ export function DimensionEditor(props: DimensionEditorProps) { }) : undefined; + const colors = getColorsFromMapping(props.isDarkMode, currentLayer.colorMapping); + const table = props.frame.activeData?.[currentLayer.layerId]; + const splitCategories = getColorCategories(table?.rows ?? [], props.accessor); + return ( <> {props.accessor === firstNonCollapsedColumnId && ( - { - setLocalState({ ...props.state, palette: newPalette }); - }} - /> + + + + { + setIsPaletteOpen(!isPaletteOpen); + }} + /> + + + { + setIsPaletteOpen(!isPaletteOpen); + }} + size="xs" + /> + setIsPaletteOpen(!isPaletteOpen)} + title={ + useNewColorMapping + ? i18n.translate('xpack.lens.colorMapping.editColorMappingTitle', { + defaultMessage: 'Edit colors by term mapping', + }) + : i18n.translate('xpack.lens.colorMapping.editColorsTitle', { + defaultMessage: 'Edit colors', + }) + } + > +
+ + + + + {i18n.translate('xpack.lens.colorMapping.tryLabel', { + defaultMessage: 'Use the new Color Mapping feature', + })}{' '} + + {i18n.translate('xpack.lens.colorMapping.techPreviewLabel', { + defaultMessage: 'Tech preview', + })} + + + + } + data-test-subj="lns_colorMappingOrLegacyPalette_switch" + compressed + checked={useNewColorMapping} + onChange={({ target: { checked } }) => { + trackUiCounterEvents( + `color_mapping_switch_${checked ? 'enabled' : 'disabled'}` + ); + setColorMapping( + checked ? { ...DEFAULT_COLOR_MAPPING_CONFIG } : undefined + ); + setUseNewColorMapping(checked); + }} + /> + + + {canUseColorMapping || useNewColorMapping ? ( + setColorMapping(model)} + palettes={AVAILABLE_PALETTES} + data={{ + type: 'categories', + categories: splitCategories, + }} + specialTokens={SPECIAL_TOKENS_STRING_CONVERTION} + /> + ) : ( + { + setLocalState({ ...props.state, palette: newPalette }); + }} + /> + )} + + +
+
+
+
+
)} + {/* TODO: understand how this works */} {showColorPicker && ( { }); it('should keep passed in palette', () => { - const mainPalette: PaletteOutput = { type: 'palette', name: 'mock' }; const results = suggestions({ table: { layerId: 'first', @@ -617,10 +616,13 @@ describe('suggestions', () => { }, state: undefined, keptLayerIds: ['first'], - mainPalette, + mainPalette: { + type: 'legacyPalette', + value: { type: 'palette', name: 'mock' }, + }, }); - expect(results[0].state.palette).toEqual(mainPalette); + expect(results[0].state.palette).toEqual({ type: 'palette', name: 'mock' }); }); it('should keep the layer settings and palette when switching from treemap', () => { @@ -681,6 +683,7 @@ describe('suggestions', () => { legendMaxLines: 1, truncateLegend: true, nestedLegend: true, + colorMapping: DEFAULT_COLOR_MAPPING_CONFIG, }, ], }, @@ -1060,6 +1063,7 @@ describe('suggestions', () => { Object { "allowMultipleMetrics": false, "categoryDisplay": "default", + "colorMapping": undefined, "layerId": "first", "layerType": "data", "legendDisplay": "show", @@ -1169,6 +1173,7 @@ describe('suggestions', () => { "layers": Array [ Object { "categoryDisplay": "default", + "colorMapping": undefined, "layerId": "first", "layerType": "data", "legendDisplay": "show", diff --git a/x-pack/plugins/lens/public/visualizations/partition/suggestions.ts b/x-pack/plugins/lens/public/visualizations/partition/suggestions.ts index f3dea7c54b989..e78c203670aec 100644 --- a/x-pack/plugins/lens/public/visualizations/partition/suggestions.ts +++ b/x-pack/plugins/lens/public/visualizations/partition/suggestions.ts @@ -7,6 +7,7 @@ import { partition } from 'lodash'; import { i18n } from '@kbn/i18n'; +import { DEFAULT_COLOR_MAPPING_CONFIG } from '@kbn/coloring'; import type { SuggestionRequest, TableSuggestionColumn, @@ -131,7 +132,7 @@ export function suggestions({ score: state && !hasCustomSuggestionsExists(state.shape) ? 0.6 : 0.4, state: { shape: newShape, - palette: mainPalette || state?.palette, + palette: mainPalette?.type === 'legacyPalette' ? mainPalette.value : state?.palette, layers: [ state?.layers[0] ? { @@ -140,6 +141,11 @@ export function suggestions({ primaryGroups: groups.map((col) => col.columnId), metrics: metricColumnIds, layerType: layerTypes.DATA, + colorMapping: !mainPalette + ? { ...DEFAULT_COLOR_MAPPING_CONFIG } + : mainPalette?.type === 'colorMapping' + ? mainPalette.value + : state.layers[0].colorMapping, } : { layerId: table.layerId, @@ -150,6 +156,11 @@ export function suggestions({ legendDisplay: LegendDisplay.DEFAULT, nestedLegend: false, layerType: layerTypes.DATA, + colorMapping: !mainPalette + ? { ...DEFAULT_COLOR_MAPPING_CONFIG } + : mainPalette?.type === 'colorMapping' + ? mainPalette.value + : undefined, }, ], }, @@ -196,7 +207,7 @@ export function suggestions({ score: state?.shape === PieChartTypes.TREEMAP ? 0.7 : 0.5, state: { shape: PieChartTypes.TREEMAP, - palette: mainPalette || state?.palette, + palette: mainPalette?.type === 'legacyPalette' ? mainPalette.value : state?.palette, layers: [ state?.layers[0] ? { @@ -209,6 +220,10 @@ export function suggestions({ ? CategoryDisplay.DEFAULT : state.layers[0].categoryDisplay, layerType: layerTypes.DATA, + colorMapping: + mainPalette?.type === 'colorMapping' + ? mainPalette.value + : state.layers[0].colorMapping, } : { layerId: table.layerId, @@ -219,6 +234,7 @@ export function suggestions({ legendDisplay: LegendDisplay.DEFAULT, nestedLegend: false, layerType: layerTypes.DATA, + colorMapping: mainPalette?.type === 'colorMapping' ? mainPalette.value : undefined, }, ], }, @@ -243,7 +259,7 @@ export function suggestions({ score: state?.shape === PieChartTypes.MOSAIC ? 0.7 : 0.5, state: { shape: PieChartTypes.MOSAIC, - palette: mainPalette || state?.palette, + palette: mainPalette?.type === 'legacyPalette' ? mainPalette.value : state?.palette, layers: [ state?.layers[0] ? { @@ -255,6 +271,10 @@ export function suggestions({ categoryDisplay: CategoryDisplay.DEFAULT, layerType: layerTypes.DATA, allowMultipleMetrics: false, + colorMapping: + mainPalette?.type === 'colorMapping' + ? mainPalette.value + : state.layers[0].colorMapping, } : { layerId: table.layerId, @@ -267,6 +287,7 @@ export function suggestions({ nestedLegend: false, layerType: layerTypes.DATA, allowMultipleMetrics: false, + colorMapping: mainPalette?.type === 'colorMapping' ? mainPalette.value : undefined, }, ], }, @@ -290,7 +311,7 @@ export function suggestions({ score: state?.shape === PieChartTypes.WAFFLE ? 0.7 : 0.4, state: { shape: PieChartTypes.WAFFLE, - palette: mainPalette || state?.palette, + palette: mainPalette?.type === 'legacyPalette' ? mainPalette.value : state?.palette, layers: [ state?.layers[0] ? { @@ -301,6 +322,10 @@ export function suggestions({ secondaryGroups: [], categoryDisplay: CategoryDisplay.DEFAULT, layerType: layerTypes.DATA, + colorMapping: + mainPalette?.type === 'colorMapping' + ? mainPalette.value + : state.layers[0].colorMapping, } : { layerId: table.layerId, @@ -311,6 +336,7 @@ export function suggestions({ legendDisplay: LegendDisplay.DEFAULT, nestedLegend: false, layerType: layerTypes.DATA, + colorMapping: mainPalette?.type === 'colorMapping' ? mainPalette.value : undefined, }, ], }, diff --git a/x-pack/plugins/lens/public/visualizations/partition/to_expression.ts b/x-pack/plugins/lens/public/visualizations/partition/to_expression.ts index c592f7d369eb3..29e5fd399d148 100644 --- a/x-pack/plugins/lens/public/visualizations/partition/to_expression.ts +++ b/x-pack/plugins/lens/public/visualizations/partition/to_expression.ts @@ -7,7 +7,7 @@ import type { Ast } from '@kbn/interpreter'; import { Position } from '@elastic/charts'; -import type { PaletteOutput, PaletteRegistry } from '@kbn/coloring'; +import { PaletteOutput, PaletteRegistry } from '@kbn/coloring'; import { buildExpression, buildExpressionFunction } from '@kbn/expressions-plugin/public'; import type { @@ -175,7 +175,6 @@ const generateCommonArguments = ( const datasource = datasourceLayers[layer.layerId]; const columnToLabelMap = getColumnToLabelMap(layer.metrics, datasource); const sortedMetricAccessors = getSortedAccessorsForGroup(datasource, layer, 'metrics'); - return { labels: generateCommonLabelsAstArgs(state, attributes, layer, columnToLabelMap), buckets: operations @@ -200,6 +199,7 @@ const generateCommonArguments = ( layer.truncateLegend ?? getDefaultVisualValuesForLayer(state, datasourceLayers).truncateText, palette: generatePaletteAstArguments(paletteService, state.palette), addTooltip: true, + colorMapping: layer.colorMapping ? JSON.stringify(layer.colorMapping) : undefined, }; }; diff --git a/x-pack/plugins/lens/public/visualizations/partition/visualization.tsx b/x-pack/plugins/lens/public/visualizations/partition/visualization.tsx index 6b4767b9177e5..429089f743c33 100644 --- a/x-pack/plugins/lens/public/visualizations/partition/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/partition/visualization.tsx @@ -8,13 +8,19 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import type { PaletteRegistry } from '@kbn/coloring'; +import { + ColorMapping, + DEFAULT_COLOR_MAPPING_CONFIG, + PaletteRegistry, + getColorsFromMapping, +} from '@kbn/coloring'; import { ThemeServiceStart } from '@kbn/core/public'; import { VIS_EVENT_TO_TRIGGER } from '@kbn/visualizations-plugin/public'; import { EuiSpacer } from '@elastic/eui'; import { PartitionVisConfiguration } from '@kbn/visualizations-plugin/common/convert_to_lens'; import { LayerTypes } from '@kbn/expression-xy-plugin/public'; import { AccessorConfig } from '@kbn/visualization-ui-components'; +import useObservable from 'react-use/lib/useObservable'; import type { FormBasedPersistedState } from '../../datasources/form_based/types'; import type { Visualization, @@ -51,7 +57,7 @@ const metricLabel = i18n.translate('xpack.lens.pie.groupMetricLabelSingular', { defaultMessage: 'Metric', }); -function newLayerState(layerId: string): PieLayerState { +function newLayerState(layerId: string, colorMapping: ColorMapping.Config): PieLayerState { return { layerId, primaryGroups: [], @@ -62,6 +68,7 @@ function newLayerState(layerId: string): PieLayerState { legendDisplay: LegendDisplay.DEFAULT, nestedLegend: false, layerType: LayerTypes.DATA, + colorMapping, }; } @@ -137,7 +144,9 @@ export const getPieVisualization = ({ clearLayer(state) { return { shape: state.shape, - layers: state.layers.map((l) => newLayerState(l.layerId)), + layers: state.layers.map((l) => + newLayerState(l.layerId, { ...DEFAULT_COLOR_MAPPING_CONFIG }) + ), }; }, @@ -156,13 +165,29 @@ export const getPieVisualization = ({ return ( state || { shape: PieChartTypes.DONUT, - layers: [newLayerState(addNewLayer())], - palette: mainPalette, + layers: [ + newLayerState( + addNewLayer(), + mainPalette?.type === 'colorMapping' + ? mainPalette.value + : { ...DEFAULT_COLOR_MAPPING_CONFIG } + ), + ], + palette: mainPalette?.type === 'legacyPalette' ? mainPalette.value : undefined, } ); }, - getMainPalette: (state) => (state ? state.palette : undefined), + getMainPalette: (state) => { + if (!state) { + return undefined; + } + return state.layers.length > 0 && state.layers[0].colorMapping + ? { type: 'colorMapping', value: state.layers[0].colorMapping } + : state.palette + ? { type: 'legacyPalette', value: state.palette } + : undefined; + }, getSuggestions: suggestions, @@ -174,6 +199,19 @@ export const getPieVisualization = ({ const datasource = frame.datasourceLayers[layer.layerId]; + let colors: string[] = []; + kibanaTheme.theme$ + .subscribe({ + next(theme) { + colors = state.layers[0]?.colorMapping + ? getColorsFromMapping(theme.darkMode, state.layers[0].colorMapping) + : paletteService + .get(state.palette?.name || 'default') + .getCategoricalColors(10, state.palette?.params); + }, + }) + .unsubscribe(); + const getPrimaryGroupConfig = (): VisualizationDimensionGroupConfig => { const originalOrder = getSortedAccessorsForGroup(datasource, layer, 'primaryGroups'); // When we add a column it could be empty, and therefore have no order @@ -187,9 +225,7 @@ export const getPieVisualization = ({ accessors.forEach((accessorConfig) => { if (firstNonCollapsedColumnId === accessorConfig.columnId) { accessorConfig.triggerIconType = 'colorBy'; - accessorConfig.palette = paletteService - .get(state.palette?.name || 'default') - .getCategoricalColors(10, state.palette?.params); + accessorConfig.palette = colors; } }); @@ -459,7 +495,8 @@ export const getPieVisualization = ({ }; }, DimensionEditorComponent(props) { - return ; + const isDarkMode = useObservable(kibanaTheme.theme$, { darkMode: false }).darkMode; + return ; }, DimensionEditorDataExtraComponent(props) { return ; diff --git a/x-pack/plugins/lens/public/visualizations/tagcloud/index.ts b/x-pack/plugins/lens/public/visualizations/tagcloud/index.ts index 129d8f4eb545f..e58f8fe673127 100644 --- a/x-pack/plugins/lens/public/visualizations/tagcloud/index.ts +++ b/x-pack/plugins/lens/public/visualizations/tagcloud/index.ts @@ -19,7 +19,7 @@ export class TagcloudVisualization { editorFrame.registerVisualization(async () => { const { getTagcloudVisualization } = await import('../../async_services'); const palettes = await charts.palettes.getPalettes(); - return getTagcloudVisualization({ paletteService: palettes, theme: core.theme }); + return getTagcloudVisualization({ paletteService: palettes, kibanaTheme: core.theme }); }); } } diff --git a/x-pack/plugins/lens/public/visualizations/tagcloud/suggestions.ts b/x-pack/plugins/lens/public/visualizations/tagcloud/suggestions.ts index c85f7b0b28fe2..4a528c99d41ad 100644 --- a/x-pack/plugins/lens/public/visualizations/tagcloud/suggestions.ts +++ b/x-pack/plugins/lens/public/visualizations/tagcloud/suggestions.ts @@ -7,6 +7,7 @@ import { partition } from 'lodash'; import { IconChartTagcloud } from '@kbn/chart-icons'; +import { DEFAULT_COLOR_MAPPING_CONFIG } from '@kbn/coloring'; import type { SuggestionRequest, VisualizationSuggestion } from '../../types'; import type { TagcloudState } from './types'; import { DEFAULT_STATE, TAGCLOUD_LABEL } from './constants'; @@ -48,6 +49,11 @@ export function getSuggestions({ tagAccessor: bucket.columnId, valueAccessor: metrics[0].columnId, ...DEFAULT_STATE, + colorMapping: !mainPalette + ? { ...DEFAULT_COLOR_MAPPING_CONFIG } + : mainPalette?.type === 'colorMapping' + ? mainPalette.value + : undefined, }, }; }); diff --git a/x-pack/plugins/lens/public/visualizations/tagcloud/tagcloud_visualization.tsx b/x-pack/plugins/lens/public/visualizations/tagcloud/tagcloud_visualization.tsx index d1bd1ec337bc0..c9449f2dad178 100644 --- a/x-pack/plugins/lens/public/visualizations/tagcloud/tagcloud_visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/tagcloud/tagcloud_visualization.tsx @@ -16,9 +16,10 @@ import { buildExpressionFunction, ExpressionFunctionTheme, } from '@kbn/expressions-plugin/common'; -import { PaletteRegistry } from '@kbn/coloring'; +import { PaletteRegistry, DEFAULT_COLOR_MAPPING_CONFIG, getColorsFromMapping } from '@kbn/coloring'; import { IconChartTagcloud } from '@kbn/chart-icons'; import { SystemPaletteExpressionFunctionDefinition } from '@kbn/charts-plugin/common'; +import useObservable from 'react-use/lib/useObservable'; import type { OperationMetadata, Visualization } from '../..'; import type { TagcloudState } from './types'; import { getSuggestions } from './suggestions'; @@ -31,10 +32,10 @@ const METRIC_GROUP_ID = 'metric'; export const getTagcloudVisualization = ({ paletteService, - theme, + kibanaTheme, }: { paletteService: PaletteRegistry; - theme: ThemeServiceStart; + kibanaTheme: ThemeServiceStart; }): Visualization => ({ id: 'lnsTagcloud', @@ -89,6 +90,15 @@ export const getTagcloudVisualization = ({ }, }; }, + getMainPalette: (state) => { + if (!state) return; + + return state.colorMapping + ? { type: 'colorMapping', value: state.colorMapping } + : state.palette + ? { type: 'legacyPalette', value: state.palette } + : undefined; + }, triggers: [VIS_EVENT_TO_TRIGGER.filter], @@ -98,11 +108,27 @@ export const getTagcloudVisualization = ({ layerId: addNewLayer(), layerType: LayerTypes.DATA, ...DEFAULT_STATE, + colorMapping: { ...DEFAULT_COLOR_MAPPING_CONFIG }, } ); }, getConfiguration({ state }) { + const canUseColorMapping = state.colorMapping ? true : false; + let colors: string[] = []; + if (canUseColorMapping) { + kibanaTheme.theme$ + .subscribe({ + next(theme) { + colors = getColorsFromMapping(theme.darkMode, state.colorMapping); + }, + }) + .unsubscribe(); + } else { + colors = paletteService + .get(state.palette?.name || 'default') + .getCategoricalColors(10, state.palette?.params); + } return { groups: [ { @@ -116,9 +142,7 @@ export const getTagcloudVisualization = ({ { columnId: state.tagAccessor, triggerIconType: 'colorBy', - palette: paletteService - .get(state.palette?.name || 'default') - .getCategoricalColors(10, state.palette?.params), + palette: colors, }, ] : [], @@ -197,6 +221,7 @@ export const getTagcloudVisualization = ({ ), ]).toAst(), showLabel: state.showLabel, + colorMapping: state.colorMapping ? JSON.stringify(state.colorMapping) : undefined, }).toAst(), ], }; @@ -235,6 +260,7 @@ export const getTagcloudVisualization = ({ ), ]).toAst(), showLabel: false, + colorMapping: state.colorMapping ? JSON.stringify(state.colorMapping) : undefined, }).toAst(), ], }; @@ -266,12 +292,16 @@ export const getTagcloudVisualization = ({ }, DimensionEditorComponent(props) { + const isDarkMode: boolean = useObservable(kibanaTheme.theme$, { darkMode: false }).darkMode; if (props.groupId === TAG_GROUP_ID) { return ( ); } diff --git a/x-pack/plugins/lens/public/visualizations/tagcloud/tags_dimension_editor.tsx b/x-pack/plugins/lens/public/visualizations/tagcloud/tags_dimension_editor.tsx index e91a73982dd38..1728e6240ad9f 100644 --- a/x-pack/plugins/lens/public/visualizations/tagcloud/tags_dimension_editor.tsx +++ b/x-pack/plugins/lens/public/visualizations/tagcloud/tags_dimension_editor.tsx @@ -6,27 +6,196 @@ */ import React from 'react'; -import { PaletteRegistry } from '@kbn/coloring'; +import { + PaletteRegistry, + CategoricalColorMapping, + DEFAULT_COLOR_MAPPING_CONFIG, + ColorMapping, + SPECIAL_TOKENS_STRING_CONVERTION, + PaletteOutput, + AVAILABLE_PALETTES, + getColorsFromMapping, +} from '@kbn/coloring'; +import { i18n } from '@kbn/i18n'; +import { + EuiButtonIcon, + EuiColorPaletteDisplay, + EuiFlexGroup, + EuiFlexItem, + EuiSwitch, + EuiFormRow, + EuiText, + EuiBadge, +} from '@elastic/eui'; +import { useState, MutableRefObject, useCallback } from 'react'; +import { PalettePicker } from '@kbn/coloring/src/shared_components/coloring/palette_picker'; +import { useDebouncedValue } from '@kbn/visualization-ui-components'; +import { getColorCategories } from '@kbn/chart-expressions-common'; import type { TagcloudState } from './types'; -import { PalettePicker } from '../../shared_components'; +import { PalettePanelContainer } from '../../shared_components'; +import { FramePublicAPI } from '../../types'; +import { trackUiCounterEvents } from '../../lens_ui_telemetry'; interface Props { paletteService: PaletteRegistry; state: TagcloudState; setState: (state: TagcloudState) => void; + frame: FramePublicAPI; + panelRef: MutableRefObject; + isDarkMode: boolean; } -export function TagsDimensionEditor(props: Props) { +export function TagsDimensionEditor({ + state, + frame, + setState, + panelRef, + isDarkMode, + paletteService, +}: Props) { + const { inputValue: localState, handleInputChange: setLocalState } = + useDebouncedValue({ + value: state, + onChange: setState, + }); + const [isPaletteOpen, setIsPaletteOpen] = useState(false); + const [useNewColorMapping, setUseNewColorMapping] = useState(state.colorMapping ? true : false); + + const colors = getColorsFromMapping(isDarkMode, state.colorMapping); + const table = frame.activeData?.[state.layerId]; + const splitCategories = getColorCategories(table?.rows ?? [], state.tagAccessor); + + const setColorMapping = useCallback( + (colorMapping?: ColorMapping.Config) => { + setLocalState({ + ...localState, + colorMapping, + }); + }, + [localState, setLocalState] + ); + + const setPalette = useCallback( + (palette: PaletteOutput) => { + setLocalState({ + ...localState, + palette, + colorMapping: undefined, + }); + }, + [localState, setLocalState] + ); + + const canUseColorMapping = state.colorMapping; + return ( - { - props.setState({ - ...props.state, - palette: newPalette, - }); - }} - /> + + + + { + setIsPaletteOpen(!isPaletteOpen); + }} + /> + + + { + setIsPaletteOpen(!isPaletteOpen); + }} + size="xs" + /> + setIsPaletteOpen(!isPaletteOpen)} + title={ + useNewColorMapping + ? i18n.translate('xpack.lens.colorMapping.editColorMappingTitle', { + defaultMessage: 'Edit colors by term mapping', + }) + : i18n.translate('xpack.lens.colorMapping.editColorsTitle', { + defaultMessage: 'Edit colors', + }) + } + > +
+ + + + + {i18n.translate('xpack.lens.colorMapping.tryLabel', { + defaultMessage: 'Use the new Color Mapping feature', + })}{' '} + + {i18n.translate('xpack.lens.colorMapping.techPreviewLabel', { + defaultMessage: 'Tech preview', + })} + + + + } + data-test-subj="lns_colorMappingOrLegacyPalette_switch" + compressed + checked={useNewColorMapping} + onChange={({ target: { checked } }) => { + trackUiCounterEvents( + `color_mapping_switch_${checked ? 'enabled' : 'disabled'}` + ); + setColorMapping(checked ? { ...DEFAULT_COLOR_MAPPING_CONFIG } : undefined); + setUseNewColorMapping(checked); + }} + /> + + + {canUseColorMapping || useNewColorMapping ? ( + setColorMapping(model)} + palettes={AVAILABLE_PALETTES} + data={{ + type: 'categories', + categories: splitCategories, + }} + specialTokens={SPECIAL_TOKENS_STRING_CONVERTION} + /> + ) : ( + { + setPalette(newPalette); + }} + /> + )} + + +
+
+
+
+
); } diff --git a/x-pack/plugins/lens/public/visualizations/tagcloud/types.ts b/x-pack/plugins/lens/public/visualizations/tagcloud/types.ts index c4a6ff1ddb6ad..afc83074c1fa2 100644 --- a/x-pack/plugins/lens/public/visualizations/tagcloud/types.ts +++ b/x-pack/plugins/lens/public/visualizations/tagcloud/types.ts @@ -7,7 +7,7 @@ import { $Values } from '@kbn/utility-types'; import { Datatable } from '@kbn/expressions-plugin/common'; -import type { PaletteOutput } from '@kbn/coloring'; +import { PaletteOutput, ColorMapping } from '@kbn/coloring'; import { Orientation } from '@kbn/expression-tagcloud-plugin/common'; export interface TagcloudState { @@ -19,6 +19,7 @@ export interface TagcloudState { orientation: $Values; palette?: PaletteOutput; showLabel: boolean; + colorMapping?: ColorMapping.Config; } export interface TagcloudConfig extends TagcloudState { diff --git a/x-pack/plugins/lens/public/visualizations/xy/to_expression.ts b/x-pack/plugins/lens/public/visualizations/xy/to_expression.ts index 4e8264a733398..2b80a39fc3b53 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/to_expression.ts +++ b/x-pack/plugins/lens/public/visualizations/xy/to_expression.ts @@ -7,7 +7,7 @@ import { Ast } from '@kbn/interpreter'; import { Position, ScaleType } from '@elastic/charts'; -import type { PaletteRegistry } from '@kbn/coloring'; +import { PaletteRegistry } from '@kbn/coloring'; import { buildExpression, buildExpressionFunction, @@ -511,6 +511,7 @@ const dataLayerToExpression = ( name: 'default', }), ]).toAst(), + colorMapping: layer.colorMapping ? JSON.stringify(layer.colorMapping) : undefined, }); return { diff --git a/x-pack/plugins/lens/public/visualizations/xy/types.ts b/x-pack/plugins/lens/public/visualizations/xy/types.ts index e863f04bcdc05..8961c38b1582a 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/types.ts +++ b/x-pack/plugins/lens/public/visualizations/xy/types.ts @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; import { $Values } from '@kbn/utility-types'; -import type { PaletteOutput } from '@kbn/coloring'; +import type { ColorMapping, PaletteOutput } from '@kbn/coloring'; import type { LegendConfig, AxisExtentConfig, @@ -103,6 +103,7 @@ export interface XYDataLayerConfig { xScaleType?: XScaleType; isHistogram?: boolean; columnToLabel?: string; + colorMapping?: ColorMapping.Config; } export interface XYReferenceLineLayerConfig { diff --git a/x-pack/plugins/lens/public/visualizations/xy/visualization.test.tsx b/x-pack/plugins/lens/public/visualizations/xy/visualization.test.tsx index e89b3a843e8ac..c9d52d43df7ef 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/visualization.test.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/visualization.test.tsx @@ -57,6 +57,7 @@ import { } from './visualization_helpers'; import { cloneDeep } from 'lodash'; import { DataViewsServicePublic } from '@kbn/data-views-plugin/public'; +import { EUIAmsterdamColorBlindPalette } from '@kbn/coloring'; const DATE_HISTORGRAM_COLUMN_ID = 'date_histogram_column'; const exampleAnnotation: EventAnnotationConfig = { @@ -221,8 +222,30 @@ describe('xy_visualization', () => { "layers": Array [ Object { "accessors": Array [], + "colorMapping": Object { + "assignmentMode": "auto", + "assignments": Array [], + "colorMode": Object { + "type": "categorical", + }, + "paletteId": "${EUIAmsterdamColorBlindPalette.id}", + "specialAssignments": Array [ + Object { + "color": Object { + "colorIndex": 1, + "paletteId": "neutral", + "type": "categorical", + }, + "rule": Object { + "type": "other", + }, + "touched": false, + }, + ], + }, "layerId": "l1", "layerType": "data", + "palette": undefined, "position": "top", "seriesType": "bar_stacked", "showGridlines": false, diff --git a/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx b/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx index 9f5f9755d1781..812d74ddcb331 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx @@ -25,6 +25,8 @@ import type { EventAnnotationGroupConfig } from '@kbn/event-annotation-common'; import { isEqual } from 'lodash'; import { type AccessorConfig, DimensionTrigger } from '@kbn/visualization-ui-components'; import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; +import { DEFAULT_COLOR_MAPPING_CONFIG, getColorsFromMapping } from '@kbn/coloring'; +import useObservable from 'react-use/lib/useObservable'; import { generateId } from '../../id_generator'; import { isDraggedDataViewField, @@ -254,7 +256,7 @@ export const getXyVisualization = ({ initialize( addNewLayer, state, - _mainPalette?, + mainPalette?, annotationGroups?: AnnotationGroups, references?: SavedObjectReference[] ) { @@ -276,6 +278,11 @@ export const getXyVisualization = ({ seriesType: defaultSeriesType, showGridlines: false, layerType: LayerTypes.DATA, + palette: mainPalette?.type === 'legacyPalette' ? mainPalette.value : undefined, + colorMapping: + mainPalette?.type === 'colorMapping' + ? mainPalette.value + : { ...DEFAULT_COLOR_MAPPING_CONFIG }, }, ], } @@ -416,6 +423,22 @@ export const getXyVisualization = ({ } ).length < 2; + const canUseColorMapping = layer.colorMapping ? true : false; + let colors: string[] = []; + if (canUseColorMapping) { + kibanaTheme.theme$ + .subscribe({ + next(theme) { + colors = getColorsFromMapping(theme.darkMode, layer.colorMapping); + }, + }) + .unsubscribe(); + } else { + colors = paletteService + .get(dataLayer.palette?.name || 'default') + .getCategoricalColors(10, dataLayer.palette?.params); + } + return { groups: [ { @@ -447,11 +470,7 @@ export const getXyVisualization = ({ { columnId: dataLayer.splitAccessor, triggerIconType: dataLayer.collapseFn ? 'aggregate' : 'colorBy', - palette: dataLayer.collapseFn - ? undefined - : paletteService - .get(dataLayer.palette?.name || 'default') - .getCategoricalColors(10, dataLayer.palette?.params), + palette: dataLayer.collapseFn ? undefined : colors, }, ] : [], @@ -469,7 +488,13 @@ export const getXyVisualization = ({ getMainPalette: (state) => { if (!state || state.layers.length === 0) return; - return getFirstDataLayer(state.layers)?.palette; + const firstDataLayer = getFirstDataLayer(state.layers); + + return firstDataLayer?.colorMapping + ? { type: 'colorMapping', value: firstDataLayer.colorMapping } + : firstDataLayer?.palette + ? { type: 'legacyPalette', value: firstDataLayer.palette } + : undefined; }, getDropProps(dropProps) { @@ -641,13 +666,15 @@ export const getXyVisualization = ({ formatFactory: fieldFormats.deserialize, paletteService, }; + + const darkMode: boolean = useObservable(kibanaTheme.theme$, { darkMode: false }).darkMode; const layer = props.state.layers.find((l) => l.layerId === props.layerId)!; const dimensionEditor = isReferenceLayer(layer) ? ( ) : isAnnotationsLayer(layer) ? ( ) : ( - + ); return dimensionEditor; diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/dimension_editor.tsx b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/dimension_editor.tsx index 94c7a326ccbb4..44114e8d560ed 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/dimension_editor.tsx @@ -5,21 +5,45 @@ * 2.0. */ -import React, { useCallback, useMemo } from 'react'; +import React, { useCallback, useMemo, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { EuiButtonGroup, EuiFormRow, htmlIdGenerator } from '@elastic/eui'; -import type { PaletteRegistry } from '@kbn/coloring'; import { useDebouncedValue } from '@kbn/visualization-ui-components'; import { ColorPicker } from '@kbn/visualization-ui-components'; + +import { + EuiBadge, + EuiButtonGroup, + EuiButtonIcon, + EuiColorPaletteDisplay, + EuiFlexGroup, + EuiFlexItem, + EuiFormRow, + EuiSpacer, + EuiSwitch, + EuiText, + htmlIdGenerator, +} from '@elastic/eui'; +import { + PaletteRegistry, + ColorMapping, + DEFAULT_COLOR_MAPPING_CONFIG, + CategoricalColorMapping, + PaletteOutput, + SPECIAL_TOKENS_STRING_CONVERTION, + AVAILABLE_PALETTES, + getColorsFromMapping, +} from '@kbn/coloring'; +import { getColorCategories } from '@kbn/chart-expressions-common'; import type { VisualizationDimensionEditorProps } from '../../../types'; import { State, XYState, XYDataLayerConfig, YConfig, YAxisMode } from '../types'; import { FormatFactory } from '../../../../common/types'; import { getSeriesColor, isHorizontalChart } from '../state_helpers'; -import { PalettePicker } from '../../../shared_components'; +import { PalettePanelContainer, PalettePicker } from '../../../shared_components'; import { getDataLayers } from '../visualization_helpers'; import { CollapseSetting } from '../../../shared_components/collapse_setting'; import { getSortedAccessors } from '../to_expression'; import { getColorAssignments, getAssignedColorConfig } from '../color_assignment'; +import { trackUiCounterEvents } from '../../../lens_ui_telemetry'; type UnwrapArray = T extends Array ? P : T; @@ -43,11 +67,16 @@ export function DataDimensionEditor( props: VisualizationDimensionEditorProps & { formatFactory: FormatFactory; paletteService: PaletteRegistry; + darkMode: boolean; } ) { - const { state, setState, layerId, accessor } = props; + const { state, layerId, accessor, darkMode } = props; const index = state.layers.findIndex((l) => l.layerId === layerId); const layer = state.layers[index] as XYDataLayerConfig; + const canUseColorMapping = layer.colorMapping ? true : false; + + const [isPaletteOpen, setIsPaletteOpen] = useState(false); + const [useNewColorMapping, setUseNewColorMapping] = useState(canUseColorMapping); const { inputValue: localState, handleInputChange: setLocalState } = useDebouncedValue({ value: props.state, @@ -79,6 +108,19 @@ export function DataDimensionEditor( [accessor, index, localState, layer, setLocalState] ); + const setColorMapping = useCallback( + (colorMapping?: ColorMapping.Config) => { + setLocalState(updateLayer(localState, { ...layer, colorMapping }, index)); + }, + [index, localState, layer, setLocalState] + ); + const setPalette = useCallback( + (palette: PaletteOutput) => { + setLocalState(updateLayer(localState, { ...layer, palette }, index)); + }, + [index, localState, layer, setLocalState] + ); + const overwriteColor = getSeriesColor(layer, accessor); const assignedColor = useMemo(() => { const sortedAccessors: string[] = getSortedAccessors( @@ -105,19 +147,128 @@ export function DataDimensionEditor( }, [props.frame, props.paletteService, state.layers, accessor, props.formatFactory, layer]); const localLayer: XYDataLayerConfig = layer; - if (props.groupId === 'breakdown') { + + const colors = layer.colorMapping + ? getColorsFromMapping(props.darkMode, layer.colorMapping) + : props.paletteService + .get(layer.palette?.name || 'default') + .getCategoricalColors(10, layer.palette); + + const table = props.frame.activeData?.[layer.layerId]; + const { splitAccessor } = layer; + const splitCategories = getColorCategories(table?.rows ?? [], splitAccessor); + + if (props.groupId === 'breakdown' && !layer.collapseFn) { return ( - <> - {!layer.collapseFn && ( - { - setState(updateLayer(localState, { ...localLayer, palette: newPalette }, index)); - }} - /> - )} - + + + + { + setIsPaletteOpen(!isPaletteOpen); + }} + /> + + + { + setIsPaletteOpen(!isPaletteOpen); + }} + size="xs" + /> + setIsPaletteOpen(!isPaletteOpen)} + title={ + useNewColorMapping + ? i18n.translate('xpack.lens.colorMapping.editColorMappingTitle', { + defaultMessage: 'Edit colors by term mapping', + }) + : i18n.translate('xpack.lens.colorMapping.editColorsTitle', { + defaultMessage: 'Edit colors', + }) + } + > +
+ + + + + {i18n.translate('xpack.lens.colorMapping.tryLabel', { + defaultMessage: 'Use the new Color Mapping feature', + })}{' '} + + {i18n.translate('xpack.lens.colorMapping.techPreviewLabel', { + defaultMessage: 'Tech preview', + })} + + + + } + data-test-subj="lns_colorMappingOrLegacyPalette_switch" + compressed + checked={useNewColorMapping} + onChange={({ target: { checked } }) => { + trackUiCounterEvents( + `color_mapping_switch_${checked ? 'enabled' : 'disabled'}` + ); + setColorMapping(checked ? { ...DEFAULT_COLOR_MAPPING_CONFIG } : undefined); + setUseNewColorMapping(checked); + }} + /> + + + + {canUseColorMapping || useNewColorMapping ? ( + setColorMapping(model)} + palettes={AVAILABLE_PALETTES} + data={{ + type: 'categories', + categories: splitCategories, + }} + specialTokens={SPECIAL_TOKENS_STRING_CONVERTION} + /> + ) : ( + { + setPalette(newPalette); + }} + /> + )} + + +
+
+
+
+
); } diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/xy_config_panel.test.tsx b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/xy_config_panel.test.tsx index 252c3de6b8e57..9a98f5bae168b 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/xy_config_panel.test.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/xy_config_panel.test.tsx @@ -272,6 +272,7 @@ describe('XY Config panels', () => { addLayer={jest.fn()} removeLayer={jest.fn()} datasource={{} as DatasourcePublicAPI} + darkMode={false} /> ); @@ -299,6 +300,7 @@ describe('XY Config panels', () => { addLayer={jest.fn()} removeLayer={jest.fn()} datasource={{} as DatasourcePublicAPI} + darkMode={false} /> ); @@ -347,6 +349,7 @@ describe('XY Config panels', () => { addLayer={jest.fn()} removeLayer={jest.fn()} datasource={{} as DatasourcePublicAPI} + darkMode={false} /> ); @@ -392,6 +395,7 @@ describe('XY Config panels', () => { addLayer={jest.fn()} removeLayer={jest.fn()} datasource={{} as DatasourcePublicAPI} + darkMode={false} /> ); @@ -437,6 +441,7 @@ describe('XY Config panels', () => { addLayer={jest.fn()} removeLayer={jest.fn()} datasource={{} as DatasourcePublicAPI} + darkMode={false} /> ); diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_suggestions.test.ts b/x-pack/plugins/lens/public/visualizations/xy/xy_suggestions.test.ts index 8417d02d79995..a12afc7465579 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/xy_suggestions.test.ts +++ b/x-pack/plugins/lens/public/visualizations/xy/xy_suggestions.test.ts @@ -18,7 +18,7 @@ import { generateId } from '../../id_generator'; import { getXyVisualization } from './xy_visualization'; import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; import { eventAnnotationServiceMock } from '@kbn/event-annotation-plugin/public/mocks'; -import type { PaletteOutput } from '@kbn/coloring'; +import { DEFAULT_COLOR_MAPPING_CONFIG, PaletteOutput } from '@kbn/coloring'; import { LayerTypes } from '@kbn/expression-xy-plugin/public'; import { fieldFormatsServiceMock } from '@kbn/field-formats-plugin/public/mocks'; import { coreMock, themeServiceMock } from '@kbn/core/public/mocks'; @@ -757,7 +757,7 @@ describe('xy_suggestions', () => { changeType: 'unchanged', }, keptLayerIds: [], - mainPalette, + mainPalette: { type: 'legacyPalette', value: mainPalette }, }); expect((suggestion.state.layers as XYDataLayerConfig[])[0].palette).toEqual(mainPalette); @@ -773,7 +773,7 @@ describe('xy_suggestions', () => { changeType: 'unchanged', }, keptLayerIds: [], - mainPalette, + mainPalette: { type: 'legacyPalette', value: mainPalette }, }); expect((suggestion.state.layers as XYDataLayerConfig[])[0].palette).toEqual(undefined); @@ -913,7 +913,13 @@ describe('xy_suggestions', () => { expect(suggestions[0].state).toEqual({ ...currentState, preferredSeriesType: 'line', - layers: [{ ...currentState.layers[0], seriesType: 'line' }], + layers: [ + { + ...currentState.layers[0], + seriesType: 'line', + colorMapping: DEFAULT_COLOR_MAPPING_CONFIG, + }, + ], }); expect(suggestions[0].title).toEqual('Line chart'); }); @@ -954,12 +960,24 @@ describe('xy_suggestions', () => { expect(seriesSuggestion.state).toEqual({ ...currentState, preferredSeriesType: 'line', - layers: [{ ...currentState.layers[0], seriesType: 'line' }], + layers: [ + { + ...currentState.layers[0], + seriesType: 'line', + colorMapping: DEFAULT_COLOR_MAPPING_CONFIG, + }, + ], }); expect(stackSuggestion.state).toEqual({ ...currentState, preferredSeriesType: 'bar_stacked', - layers: [{ ...currentState.layers[0], seriesType: 'bar_stacked' }], + layers: [ + { + ...currentState.layers[0], + seriesType: 'bar_stacked', + colorMapping: DEFAULT_COLOR_MAPPING_CONFIG, + }, + ], }); expect(seriesSuggestion.title).toEqual('Line chart'); expect(stackSuggestion.title).toEqual('Stacked'); @@ -1081,6 +1099,7 @@ describe('xy_suggestions', () => { ...currentState.layers[0], xAccessor: 'product', splitAccessor: 'category', + colorMapping: DEFAULT_COLOR_MAPPING_CONFIG, }, ], }); @@ -1126,6 +1145,7 @@ describe('xy_suggestions', () => { ...currentState.layers[0], xAccessor: 'category', splitAccessor: 'product', + colorMapping: DEFAULT_COLOR_MAPPING_CONFIG, }, ], }); @@ -1172,6 +1192,7 @@ describe('xy_suggestions', () => { ...currentState.layers[0], xAccessor: 'timestamp', splitAccessor: 'product', + colorMapping: DEFAULT_COLOR_MAPPING_CONFIG, }, ], }); diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_suggestions.ts b/x-pack/plugins/lens/public/visualizations/xy/xy_suggestions.ts index 33381822b6eed..b63acd9513300 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/xy_suggestions.ts +++ b/x-pack/plugins/lens/public/visualizations/xy/xy_suggestions.ts @@ -8,8 +8,8 @@ import { i18n } from '@kbn/i18n'; import { partition } from 'lodash'; import { Position } from '@elastic/charts'; -import type { PaletteOutput } from '@kbn/coloring'; import { LayerTypes } from '@kbn/expression-xy-plugin/public'; +import { DEFAULT_COLOR_MAPPING_CONFIG } from '@kbn/coloring'; import type { SuggestionRequest, VisualizationSuggestion, @@ -96,7 +96,7 @@ function getSuggestionForColumns( keptLayerIds: string[], currentState?: State, seriesType?: SeriesType, - mainPalette?: PaletteOutput, + mainPalette?: SuggestionRequest['mainPalette'], allowMixed?: boolean ): VisualizationSuggestion | Array> | undefined { const [buckets, values] = partition(table.columns, (col) => col.operation.isBucketed); @@ -230,7 +230,7 @@ function getSuggestionsForLayer({ tableLabel?: string; keptLayerIds: string[]; requestedSeriesType?: SeriesType; - mainPalette?: PaletteOutput; + mainPalette?: SuggestionRequest['mainPalette']; allowMixed?: boolean; }): VisualizationSuggestion | Array> { const title = getSuggestionTitle(yValues, xValue, tableLabel); @@ -493,7 +493,7 @@ function buildSuggestion({ changeType: TableChangeType; keptLayerIds: string[]; hide?: boolean; - mainPalette?: PaletteOutput; + mainPalette?: SuggestionRequest['mainPalette']; allowMixed?: boolean; }) { if (seriesType.includes('percentage') && xValue?.operation.scale === 'ordinal' && !splitBy) { @@ -505,10 +505,11 @@ function buildSuggestion({ const newLayer: XYDataLayerConfig = { ...(existingLayer || {}), palette: - mainPalette || - (existingLayer && 'palette' in existingLayer + mainPalette?.type === 'legacyPalette' + ? mainPalette.value + : existingLayer && 'palette' in existingLayer ? (existingLayer as XYDataLayerConfig).palette - : undefined), + : undefined, layerId, seriesType, xAccessor: xValue?.columnId, @@ -519,6 +520,11 @@ function buildSuggestion({ ? existingLayer.yConfig.filter(({ forAccessor }) => accessors.indexOf(forAccessor) !== -1) : undefined, layerType: LayerTypes.DATA, + colorMapping: !mainPalette + ? { ...DEFAULT_COLOR_MAPPING_CONFIG } + : mainPalette?.type === 'colorMapping' + ? mainPalette.value + : undefined, }; const hasDateHistogramDomain = diff --git a/x-pack/plugins/lens/tsconfig.json b/x-pack/plugins/lens/tsconfig.json index ca536dc187c3f..4fb8f849d6d27 100644 --- a/x-pack/plugins/lens/tsconfig.json +++ b/x-pack/plugins/lens/tsconfig.json @@ -86,6 +86,7 @@ "@kbn/content-management-utils", "@kbn/serverless", "@kbn/ebt-tools", + "@kbn/chart-expressions-common", "@kbn/search-response-warnings", ], "exclude": [ diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 4ae31ffb358ef..8981de9b982c7 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -21322,7 +21322,6 @@ "xpack.lens.table.dynamicColoring.text": "Texte", "xpack.lens.table.hide.hideLabel": "Masquer", "xpack.lens.table.palettePanelContainer.back": "Retour", - "xpack.lens.table.palettePanelTitle": "Couleur", "xpack.lens.table.resize.reset": "Réinitialiser la largeur", "xpack.lens.table.rowHeight.auto": "Ajustement automatique", "xpack.lens.table.rowHeight.custom": "Personnalisé", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 87e23ff29cb1f..41665e626fc8c 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -21337,7 +21337,6 @@ "xpack.lens.table.dynamicColoring.text": "テキスト", "xpack.lens.table.hide.hideLabel": "非表示", "xpack.lens.table.palettePanelContainer.back": "戻る", - "xpack.lens.table.palettePanelTitle": "色", "xpack.lens.table.resize.reset": "幅のリセット", "xpack.lens.table.rowHeight.auto": "自動的に合わせる", "xpack.lens.table.rowHeight.custom": "カスタム", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 6e3c128ec642a..33625a62a6356 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -21337,7 +21337,6 @@ "xpack.lens.table.dynamicColoring.text": "文本", "xpack.lens.table.hide.hideLabel": "隐藏", "xpack.lens.table.palettePanelContainer.back": "返回", - "xpack.lens.table.palettePanelTitle": "颜色", "xpack.lens.table.resize.reset": "重置宽度", "xpack.lens.table.rowHeight.auto": "自动适应", "xpack.lens.table.rowHeight.custom": "定制", diff --git a/x-pack/test/functional/apps/dashboard/group2/sync_colors.ts b/x-pack/test/functional/apps/dashboard/group2/sync_colors.ts index 5d1f590490c4d..a388a4d90af3b 100644 --- a/x-pack/test/functional/apps/dashboard/group2/sync_colors.ts +++ b/x-pack/test/functional/apps/dashboard/group2/sync_colors.ts @@ -68,6 +68,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { dimension: 'lnsXY_splitDimensionPanel > lns-empty-dimension', operation: 'terms', field: 'geo.src', + palette: { mode: 'legacy', id: 'default' }, }); await PageObjects.lens.save('vis1', false, true); @@ -84,6 +85,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { dimension: 'lnsXY_splitDimensionPanel > lns-empty-dimension', operation: 'terms', field: 'geo.src', + palette: { mode: 'legacy', id: 'default' }, }); await filterBar.addFilter({ field: 'geo.src', operation: 'is not', value: 'CN' }); diff --git a/x-pack/test/functional/apps/lens/group4/color_mapping.ts b/x-pack/test/functional/apps/lens/group4/color_mapping.ts new file mode 100644 index 0000000000000..0fc9f79afec79 --- /dev/null +++ b/x-pack/test/functional/apps/lens/group4/color_mapping.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import expect from '@kbn/expect'; + +import { + EUI_AMSTERDAM_PALETTE_COLORS, + ELASTIC_BRAND_PALETTE_COLORS, + EUIAmsterdamColorBlindPalette, + ElasticBrandPalette, +} from '@kbn/coloring/src/shared_components/color_mapping/palettes'; +import { FtrProviderContext } from '../../../ftr_provider_context'; + +export default function ({ getService, getPageObjects }: FtrProviderContext) { + const PageObjects = getPageObjects(['visualize', 'lens', 'common']); + const elasticChart = getService('elasticChart'); + + describe('lens color mapping', () => { + before(async () => { + await PageObjects.visualize.navigateToNewVisualization(); + await PageObjects.visualize.clickVisType('lens'); + await PageObjects.lens.goToTimeRange(); + await elasticChart.setNewChartUiDebugFlag(true); + + await PageObjects.lens.configureDimension({ + dimension: 'lnsXY_yDimensionPanel > lns-empty-dimension', + operation: 'average', + field: 'bytes', + }); + + await PageObjects.lens.configureDimension({ + dimension: 'lnsXY_splitDimensionPanel > lns-empty-dimension', + operation: 'terms', + field: 'extension.raw', + palette: { mode: 'colorMapping', id: ElasticBrandPalette.id }, + keepOpen: true, + }); + }); + + it('should render correct color mapping', async () => { + const chart = await PageObjects.lens.getCurrentChartDebugState('xyVisChart'); + const legendColors = chart?.legend?.items?.map((item) => item.color.toLowerCase()) ?? []; + expect(legendColors).to.eql( + ELASTIC_BRAND_PALETTE_COLORS.slice(0, 5).map((c) => c.toLowerCase()) + ); + }); + it('should allow switching color mapping palette', async () => { + await PageObjects.lens.changeColorMappingPalette( + 'lnsXY_splitDimensionPanel > lnsLayerPanel-dimensionLink', + EUIAmsterdamColorBlindPalette.id + ); + const chart = await PageObjects.lens.getCurrentChartDebugState('xyVisChart'); + const legendColors = chart?.legend?.items?.map((item) => item.color.toLowerCase()) ?? []; + expect(legendColors).to.eql( + EUI_AMSTERDAM_PALETTE_COLORS.slice(0, 5).map((c) => c.toLowerCase()) + ); + }); + + it('should change categorical color', async () => { + await PageObjects.lens.changeColorMappingCategoricalColors( + 'lnsXY_splitDimensionPanel > lnsLayerPanel-dimensionLink', + 0, + 3 + ); + const chart = await PageObjects.lens.getCurrentChartDebugState('xyVisChart'); + const firstLegendItemColor = chart?.legend?.items?.[0]?.color?.toLowerCase() ?? 'NONE'; + expect(firstLegendItemColor).to.eql(EUI_AMSTERDAM_PALETTE_COLORS[3].toLowerCase()); + }); + }); +} diff --git a/x-pack/test/functional/apps/lens/group4/colors.ts b/x-pack/test/functional/apps/lens/group4/colors.ts index 4078b0663d7ae..20265d247cf83 100644 --- a/x-pack/test/functional/apps/lens/group4/colors.ts +++ b/x-pack/test/functional/apps/lens/group4/colors.ts @@ -4,13 +4,14 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import { ElasticBrandPalette } from '@kbn/coloring'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['visualize', 'lens', 'common']); describe('lens color palette tests', () => { - it('should allow to pick color palette in xy chart', async () => { + it('should allow to pick legacy color palette in xy chart', async () => { await PageObjects.visualize.navigateToNewVisualization(); await PageObjects.visualize.clickVisType('lens'); await PageObjects.lens.goToTimeRange(); @@ -31,11 +32,38 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { dimension: 'lnsXY_splitDimensionPanel > lns-empty-dimension', operation: 'terms', field: '@message.raw', - palette: 'negative', + palette: { mode: 'legacy', id: 'negative' }, keepOpen: true, }); - await PageObjects.lens.assertPalette('negative'); + await PageObjects.lens.assertPalette('negative', true); + }); + it('should allow to pick color mapping palette in xy chart', async () => { + await PageObjects.visualize.navigateToNewVisualization(); + await PageObjects.visualize.clickVisType('lens'); + await PageObjects.lens.goToTimeRange(); + + await PageObjects.lens.configureDimension({ + dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', + operation: 'terms', + field: 'geo.src', + }); + + await PageObjects.lens.configureDimension({ + dimension: 'lnsXY_yDimensionPanel > lns-empty-dimension', + operation: 'average', + field: 'bytes', + }); + + await PageObjects.lens.configureDimension({ + dimension: 'lnsXY_splitDimensionPanel > lns-empty-dimension', + operation: 'terms', + field: '@message.raw', + palette: { mode: 'colorMapping', id: ElasticBrandPalette.id }, + keepOpen: true, + }); + + await PageObjects.lens.assertPalette(ElasticBrandPalette.id, false); }); it('should carry over palette to the pie chart', async () => { @@ -43,7 +71,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.lens.openDimensionEditor( 'lnsPie_sliceByDimensionPanel > lns-dimensionTrigger' ); - await PageObjects.lens.assertPalette('negative'); + await PageObjects.lens.assertPalette(ElasticBrandPalette.id, false); }); it('should carry palette back to the bar chart', async () => { @@ -51,7 +79,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.lens.openDimensionEditor( 'lnsXY_splitDimensionPanel > lns-dimensionTrigger' ); - await PageObjects.lens.assertPalette('negative'); + await PageObjects.lens.assertPalette(ElasticBrandPalette.id, false); }); }); } diff --git a/x-pack/test/functional/apps/lens/group4/index.ts b/x-pack/test/functional/apps/lens/group4/index.ts index 13cfa3fe421e1..9627b744300ba 100644 --- a/x-pack/test/functional/apps/lens/group4/index.ts +++ b/x-pack/test/functional/apps/lens/group4/index.ts @@ -73,6 +73,7 @@ export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext // total run time ~16m 30s loadTestFile(require.resolve('./colors')); // 1m 2s + loadTestFile(require.resolve('./color_mapping')); loadTestFile(require.resolve('./chart_data')); // 1m 10s loadTestFile(require.resolve('./time_shift')); // 1m loadTestFile(require.resolve('./dashboard')); // 6m 45s diff --git a/x-pack/test/functional/page_objects/lens_page.ts b/x-pack/test/functional/page_objects/lens_page.ts index 493977e7fc735..6069ae838cea8 100644 --- a/x-pack/test/functional/page_objects/lens_page.ts +++ b/x-pack/test/functional/page_objects/lens_page.ts @@ -178,7 +178,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont field?: string; isPreviousIncompatible?: boolean; keepOpen?: boolean; - palette?: string; + palette?: { mode: 'legacy' | 'colorMapping'; id: string }; formula?: string; disableEmptyRows?: boolean; }) { @@ -205,7 +205,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont } if (opts.palette) { - await this.setPalette(opts.palette); + await this.setPalette(opts.palette.id, opts.palette.mode === 'legacy'); } if (opts.disableEmptyRows) { @@ -519,13 +519,26 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont await PageObjects.header.waitUntilLoadingHasFinished(); }, - async assertPalette(palette: string) { + async assertPalette(paletteId: string, isLegacy: boolean) { await retry.try(async () => { - await testSubjects.click('lns-palettePicker'); + await testSubjects.click('lns_colorEditing_trigger'); + // open the palette picker + if (isLegacy) { + await testSubjects.click('lns-palettePicker'); + } else { + await testSubjects.click('kbnColoring_ColorMapping_PalettePicker'); + } const currentPalette = await ( await find.byCssSelector('[role=option][aria-selected=true]') ).getAttribute('id'); - expect(currentPalette).to.equal(palette); + // close the palette picker + if (isLegacy) { + await testSubjects.click('lns-palettePicker'); + } else { + await testSubjects.click('kbnColoring_ColorMapping_PalettePicker'); + } + expect(currentPalette).to.equal(paletteId); + await this.closePaletteEditor(); }); }, @@ -1214,9 +1227,20 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont await testSubjects.click(`${paletteName}-palette`); }, - async setPalette(paletteName: string) { - await testSubjects.click('lns-palettePicker'); - await find.clickByCssSelector(`#${paletteName}`); + async setPalette(paletteId: string, isLegacy: boolean) { + await testSubjects.click('lns_colorEditing_trigger'); + await testSubjects.setEuiSwitch( + 'lns_colorMappingOrLegacyPalette_switch', + isLegacy ? 'uncheck' : 'check' + ); + if (isLegacy) { + await testSubjects.click('lns-palettePicker'); + await find.clickByCssSelector(`#${paletteId}`); + } else { + await testSubjects.click('kbnColoring_ColorMapping_PalettePicker'); + await testSubjects.click(`kbnColoring_ColorMapping_Palette-${paletteId}`); + } + await this.closePaletteEditor(); }, async closePaletteEditor() { @@ -1456,7 +1480,6 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont dimension: string; field: string; keepOpen?: boolean; - palette?: string; }) { await retry.try(async () => { if (!(await testSubjects.exists('lns-indexPattern-dimensionContainerClose'))) { @@ -1467,10 +1490,6 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont await this.selectOptionFromComboBox('text-based-dimension-field', opts.field); - if (opts.palette) { - await this.setPalette(opts.palette); - } - if (!opts.keepOpen) { await this.closeDimensionEditor(); await testSubjects.click('applyFlyoutButton'); @@ -1857,5 +1876,42 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont await testSubjects.click('lensSuggestionsPanelToggleButton'); } }, + + async changeColorMappingPalette(selector: string, paletteId: string) { + await retry.try(async () => { + if (!(await testSubjects.exists('lns-indexPattern-dimensionContainerClose'))) { + await testSubjects.click(selector); + } + await testSubjects.existOrFail('lns-indexPattern-dimensionContainerClose'); + }); + await this.setPalette(paletteId, false); + await this.closeDimensionEditor(); + }, + + async changeColorMappingCategoricalColors( + selector: string, + colorSwatchIndex: number, + paletteColorIndex: number + ) { + await retry.try(async () => { + if (!(await testSubjects.exists('lns-indexPattern-dimensionContainerClose'))) { + await testSubjects.click(selector); + } + await testSubjects.existOrFail('lns-indexPattern-dimensionContainerClose'); + }); + await testSubjects.click('lns_colorEditing_trigger'); + // disable autoAssign + await testSubjects.setEuiSwitch('lns-colorMapping-autoAssignSwitch', 'uncheck'); + + await testSubjects.click(`lns-colorMapping-colorSwatch-${colorSwatchIndex}`); + + await testSubjects.click(`lns-colorMapping-colorPicker-staticColor-${paletteColorIndex}`); + + await testSubjects.click(`lns-colorMapping-colorSwatch-${colorSwatchIndex}`); + + await this.closePaletteEditor(); + + await this.closeDimensionEditor(); + }, }); } diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index 93d4866ef0933..bf7d721fc0ba2 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -141,6 +141,7 @@ "@kbn/aiops-utils", "@kbn/stack-alerts-plugin", "@kbn/apm-data-access-plugin", + "@kbn/coloring", "@kbn/profiling-utils", "@kbn/profiling-data-access-plugin", ] From 428f3e05ec47429948ca59b772853bf1e37e25ab Mon Sep 17 00:00:00 2001 From: Ash <1849116+ashokaditya@users.noreply.github.com> Date: Thu, 28 Sep 2023 14:18:05 +0200 Subject: [PATCH 13/61] [Security Solution][Endpoint] Unskip metadata API ftr test (#167226) ## Summary Adds an error handler block to help debug test setup errors during fleet agent setup for endpoint API ftr tests. Also adds missing header API version. fixes elastic/kibana/issues/151854 **flaky ftr test runners** - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3223 x 150 (without header) - (1 fail) - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3224 x 50 (all 50 pass) - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3228 x 100 (2 fails) - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3231 x 100 ( 1 fail) - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3241 x 50 ( 2 fails) ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- x-pack/test/common/services/ingest_manager.ts | 4 ++- .../page_objects/infra_hosts_view.ts | 1 + .../apis/data_stream_helper.ts | 20 +++++++------- .../apis/index.ts | 8 ++++-- .../apis/metadata.ts | 26 +++++++++++-------- 5 files changed, 34 insertions(+), 25 deletions(-) diff --git a/x-pack/test/common/services/ingest_manager.ts b/x-pack/test/common/services/ingest_manager.ts index 1ef80be40d803..c3187213d905d 100644 --- a/x-pack/test/common/services/ingest_manager.ts +++ b/x-pack/test/common/services/ingest_manager.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { fleetSetupRouteService } from '@kbn/fleet-plugin/common'; +import { API_VERSIONS, fleetSetupRouteService } from '@kbn/fleet-plugin/common'; +import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; import { FtrProviderContext } from '../ftr_provider_context'; export function IngestManagerProvider({ getService }: FtrProviderContext) { @@ -18,6 +19,7 @@ export function IngestManagerProvider({ getService }: FtrProviderContext) { await retry.try(async () => { await supertest .post(fleetSetupRouteService.postFleetSetupPath()) + .set(ELASTIC_HTTP_VERSION_HEADER, API_VERSIONS.public.v1) .set(headers) .send({ forceRecreate: true }) .expect(200); diff --git a/x-pack/test/functional/page_objects/infra_hosts_view.ts b/x-pack/test/functional/page_objects/infra_hosts_view.ts index 4dda165ea96a7..83628e1eae02a 100644 --- a/x-pack/test/functional/page_objects/infra_hosts_view.ts +++ b/x-pack/test/functional/page_objects/infra_hosts_view.ts @@ -4,6 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ + import { AlertStatus } from '@kbn/rule-data-utils'; import { WebElementWrapper } from '../../../../test/functional/services/lib/web_element_wrapper'; import { FtrProviderContext } from '../ftr_provider_context'; diff --git a/x-pack/test/security_solution_endpoint_api_int/apis/data_stream_helper.ts b/x-pack/test/security_solution_endpoint_api_int/apis/data_stream_helper.ts index 1caef61bec80c..67115c1610157 100644 --- a/x-pack/test/security_solution_endpoint_api_int/apis/data_stream_helper.ts +++ b/x-pack/test/security_solution_endpoint_api_int/apis/data_stream_helper.ts @@ -8,14 +8,14 @@ import { Client } from '@elastic/elasticsearch'; import { AGENTS_INDEX } from '@kbn/fleet-plugin/common'; import { - metadataIndexPattern, - eventsIndexPattern, alertsIndexPattern, - policyIndexPattern, + eventsIndexPattern, + METADATA_DATASTREAM, + METADATA_UNITED_INDEX, metadataCurrentIndexPattern, + metadataIndexPattern, + policyIndexPattern, telemetryIndexPattern, - METADATA_UNITED_INDEX, - METADATA_DATASTREAM, } from '@kbn/security-solution-plugin/common/endpoint/constants'; export function deleteDataStream(getService: (serviceName: 'es') => Client, index: string) { @@ -38,10 +38,8 @@ export async function deleteAllDocsFromIndex( const client = getService('es'); await client.deleteByQuery( { - body: { - query: { - match_all: {}, - }, + query: { + match_all: {}, }, index, wait_for_completion: true, @@ -132,12 +130,12 @@ export function bulkIndex( index: string, docs: unknown[] ) { - const body = docs.flatMap((doc) => [{ create: { _index: index } }, doc]); + const operations = docs.flatMap((doc) => [{ create: { _index: index } }, doc]); const client = getService('es'); return client.bulk({ index, refresh: 'wait_for', - body, + operations, }); } diff --git a/x-pack/test/security_solution_endpoint_api_int/apis/index.ts b/x-pack/test/security_solution_endpoint_api_int/apis/index.ts index e68db8182da20..06d54f0aaac45 100644 --- a/x-pack/test/security_solution_endpoint_api_int/apis/index.ts +++ b/x-pack/test/security_solution_endpoint_api_int/apis/index.ts @@ -7,7 +7,7 @@ import { getRegistryUrl as getRegistryUrlFromIngest } from '@kbn/fleet-plugin/server'; import { FtrProviderContext } from '../ftr_provider_context'; -import { isRegistryEnabled, getRegistryUrlFromTestEnv } from '../registry'; +import { getRegistryUrlFromTestEnv, isRegistryEnabled } from '../registry'; import { ROLE } from '../services/roles_users'; export default function endpointAPIIntegrationTests(providerContext: FtrProviderContext) { @@ -28,7 +28,11 @@ export default function endpointAPIIntegrationTests(providerContext: FtrProvider const roles = Object.values(ROLE); before(async () => { - await ingestManager.setup(); + try { + await ingestManager.setup(); + } catch (err) { + log.warning(`Error setting up ingestManager: ${err}`); + } // create role/user for (const role of roles) { diff --git a/x-pack/test/security_solution_endpoint_api_int/apis/metadata.ts b/x-pack/test/security_solution_endpoint_api_int/apis/metadata.ts index c4778f7039a91..a015cf693895e 100644 --- a/x-pack/test/security_solution_endpoint_api_int/apis/metadata.ts +++ b/x-pack/test/security_solution_endpoint_api_int/apis/metadata.ts @@ -9,14 +9,14 @@ import { v4 as uuidv4 } from 'uuid'; import expect from '@kbn/expect'; import { TransformGetTransformStatsTransformStats } from '@elastic/elasticsearch/lib/api/types'; import { - METADATA_DATASTREAM, + ENDPOINT_DEFAULT_SORT_DIRECTION, + ENDPOINT_DEFAULT_SORT_FIELD, HOST_METADATA_LIST_ROUTE, + METADATA_DATASTREAM, + METADATA_TRANSFORMS_STATUS_ROUTE, METADATA_UNITED_INDEX, METADATA_UNITED_TRANSFORM, - METADATA_TRANSFORMS_STATUS_ROUTE, metadataTransformPrefix, - ENDPOINT_DEFAULT_SORT_FIELD, - ENDPOINT_DEFAULT_SORT_DIRECTION, } from '@kbn/security-solution-plugin/common/endpoint/constants'; import { AGENTS_INDEX } from '@kbn/fleet-plugin/common'; import { indexFleetEndpointPolicy } from '@kbn/security-solution-plugin/common/endpoint/data_loaders/index_fleet_endpoint_policy'; @@ -29,22 +29,22 @@ import { } from '@kbn/security-solution-plugin/common/endpoint/types'; import { generateAgentDocs, generateMetadataDocs } from './metadata.fixtures'; import { + bulkIndex, + deleteAllDocsFromFleetAgents, + deleteAllDocsFromIndex, deleteAllDocsFromMetadataCurrentIndex, deleteAllDocsFromMetadataDatastream, - stopTransform, startTransform, - deleteAllDocsFromFleetAgents, - deleteAllDocsFromIndex, - bulkIndex, + stopTransform, } from './data_stream_helper'; import { FtrProviderContext } from '../ftr_provider_context'; export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertest'); const endpointTestResources = getService('endpointTestResources'); + const log = getService('log'); - // Failing: See https://github.com/elastic/kibana/issues/151854 - describe.skip('test metadata apis', () => { + describe('test metadata apis', () => { describe('list endpoints GET route', () => { const numberOfHostsInFixture = 2; let agent1Timestamp: number; @@ -55,7 +55,11 @@ export default function ({ getService }: FtrProviderContext) { await deleteAllDocsFromFleetAgents(getService); await deleteAllDocsFromMetadataDatastream(getService); await deleteAllDocsFromMetadataCurrentIndex(getService); - await deleteAllDocsFromIndex(getService, METADATA_UNITED_INDEX); + try { + await deleteAllDocsFromIndex(getService, METADATA_UNITED_INDEX); + } catch (err) { + log.warning(`Unable to delete index: ${err}`); + } const customIndexFn = async (): Promise => { // generate an endpoint policy and attach id to agents since From 239e50389f206a0df9fc311ca5760bd8c1a5236e Mon Sep 17 00:00:00 2001 From: Rudolf Meijering Date: Thu, 28 Sep 2023 14:27:14 +0200 Subject: [PATCH 14/61] Revert "[inspector] show request method, path, and querystring" (#167485) This reverts commit d61a5a051648facb8e6dfbd022b78b0d3ed3c311 from #166565 ## Summary Summarize your PR. If it involves visual changes include a screenshot or gif. ### Checklist Delete any items that are not applicable to this PR. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### Risk Matrix Delete this section if it is not applicable to this PR. Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release. When forming the risk matrix, consider some of the following examples and how they may potentially impact the change: | Risk | Probability | Severity | Mitigation/Notes | |---------------------------|-------------|----------|-------------------------| | Multiple Spaces—unexpected behavior in non-default Kibana Space. | Low | High | Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces. | | Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. | High | Low | Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure. | | Code should gracefully handle cases when feature X or plugin Y are disabled. | Medium | High | Unit tests will verify that any feature flag or plugin combination still results in our service operational. | | [See more potential risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) | ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --- .../data/common/search/expressions/esdsl.ts | 16 +- .../data/common/search/expressions/esql.ts | 8 +- .../data/common/search/expressions/essql.ts | 10 +- src/plugins/data/common/search/types.ts | 6 - .../search_interceptor/search_interceptor.ts | 21 -- .../data/server/search/routes/bsearch.ts | 7 - .../eql_search/eql_search_strategy.ts | 5 +- .../strategies/eql_search/response_utils.ts | 5 +- .../es_search/es_search_strategy.test.ts | 7 +- .../es_search/es_search_strategy.ts | 5 +- .../strategies/es_search/response_utils.ts | 7 +- .../ese_search/ese_search_strategy.ts | 10 +- .../strategies/ese_search/response_utils.ts | 8 +- .../esql_search/esql_search_strategy.ts | 4 +- .../strategies/sql_search/response_utils.ts | 5 +- .../sql_search/sql_search_strategy.ts | 8 +- .../move_request_params_to_top_level.test.ts | 66 ---- .../move_request_params_to_top_level.ts | 56 --- .../adapters/request/request_responder.ts | 3 +- .../common/adapters/request/types.ts | 4 - .../components/details/req_code_viewer.tsx | 28 +- .../details/req_details_request.tsx | 1 - .../server/report_server_error.ts | 14 +- test/api_integration/apis/search/bsearch.ts | 345 ------------------ .../apps/visualize/group2/_inspector.ts | 8 +- test/functional/services/inspector.ts | 15 - 26 files changed, 45 insertions(+), 627 deletions(-) delete mode 100644 src/plugins/inspector/common/adapters/request/move_request_params_to_top_level.test.ts delete mode 100644 src/plugins/inspector/common/adapters/request/move_request_params_to_top_level.ts diff --git a/src/plugins/data/common/search/expressions/esdsl.ts b/src/plugins/data/common/search/expressions/esdsl.ts index cc0a84cd4a908..34a67223b4be5 100644 --- a/src/plugins/data/common/search/expressions/esdsl.ts +++ b/src/plugins/data/common/search/expressions/esdsl.ts @@ -126,7 +126,7 @@ export const getEsdslFn = ({ }); try { - const finalResponse = await lastValueFrom( + const { rawResponse } = await lastValueFrom( search( { params: { @@ -141,14 +141,14 @@ export const getEsdslFn = ({ const stats: RequestStatistics = {}; - if (finalResponse.rawResponse?.took) { + if (rawResponse?.took) { stats.queryTime = { label: i18n.translate('data.search.es_search.queryTimeLabel', { defaultMessage: 'Query time', }), value: i18n.translate('data.search.es_search.queryTimeValue', { defaultMessage: '{queryTime}ms', - values: { queryTime: finalResponse.rawResponse.took }, + values: { queryTime: rawResponse.took }, }), description: i18n.translate('data.search.es_search.queryTimeDescription', { defaultMessage: @@ -158,12 +158,12 @@ export const getEsdslFn = ({ }; } - if (finalResponse.rawResponse?.hits) { + if (rawResponse?.hits) { stats.hitsTotal = { label: i18n.translate('data.search.es_search.hitsTotalLabel', { defaultMessage: 'Hits (total)', }), - value: `${finalResponse.rawResponse.hits.total}`, + value: `${rawResponse.hits.total}`, description: i18n.translate('data.search.es_search.hitsTotalDescription', { defaultMessage: 'The number of documents that match the query.', }), @@ -173,19 +173,19 @@ export const getEsdslFn = ({ label: i18n.translate('data.search.es_search.hitsLabel', { defaultMessage: 'Hits', }), - value: `${finalResponse.rawResponse.hits.hits.length}`, + value: `${rawResponse.hits.hits.length}`, description: i18n.translate('data.search.es_search.hitsDescription', { defaultMessage: 'The number of documents returned by the query.', }), }; } - request.stats(stats).ok({ json: finalResponse }); + request.stats(stats).ok({ json: rawResponse }); request.json(dsl); return { type: 'es_raw_response', - body: finalResponse.rawResponse, + body: rawResponse, }; } catch (e) { request.error({ json: e }); diff --git a/src/plugins/data/common/search/expressions/esql.ts b/src/plugins/data/common/search/expressions/esql.ts index b2d6a0458c63b..8ef0f49588303 100644 --- a/src/plugins/data/common/search/expressions/esql.ts +++ b/src/plugins/data/common/search/expressions/esql.ts @@ -210,24 +210,24 @@ export const getEsqlFn = ({ getStartDependencies }: EsqlFnArguments) => { return throwError(() => error); }), tap({ - next(finalResponse) { + next({ rawResponse }) { logInspectorRequest() .stats({ hits: { label: i18n.translate('data.search.es_search.hitsLabel', { defaultMessage: 'Hits', }), - value: `${finalResponse.rawResponse.values.length}`, + value: `${rawResponse.values.length}`, description: i18n.translate('data.search.es_search.hitsDescription', { defaultMessage: 'The number of documents returned by the query.', }), }, }) .json(params) - .ok({ json: finalResponse }); + .ok({ json: rawResponse }); }, error(error) { - logInspectorRequest().json(params).error({ json: error }); + logInspectorRequest().error({ json: error }); }, }) ); diff --git a/src/plugins/data/common/search/expressions/essql.ts b/src/plugins/data/common/search/expressions/essql.ts index e93ee85441a22..a5db4674a7d14 100644 --- a/src/plugins/data/common/search/expressions/essql.ts +++ b/src/plugins/data/common/search/expressions/essql.ts @@ -217,14 +217,14 @@ export const getEssqlFn = ({ getStartDependencies }: EssqlFnArguments) => { return throwError(() => error); }), tap({ - next(finalResponse) { + next({ rawResponse, took }) { logInspectorRequest() .stats({ hits: { label: i18n.translate('data.search.es_search.hitsLabel', { defaultMessage: 'Hits', }), - value: `${finalResponse.rawResponse.rows.length}`, + value: `${rawResponse.rows.length}`, description: i18n.translate('data.search.es_search.hitsDescription', { defaultMessage: 'The number of documents returned by the query.', }), @@ -235,7 +235,7 @@ export const getEssqlFn = ({ getStartDependencies }: EssqlFnArguments) => { }), value: i18n.translate('data.search.es_search.queryTimeValue', { defaultMessage: '{queryTime}ms', - values: { queryTime: finalResponse.took }, + values: { queryTime: took }, }), description: i18n.translate('data.search.es_search.queryTimeDescription', { defaultMessage: @@ -245,10 +245,10 @@ export const getEssqlFn = ({ getStartDependencies }: EssqlFnArguments) => { }, }) .json(params) - .ok({ json: finalResponse }); + .ok({ json: rawResponse }); }, error(error) { - logInspectorRequest().json(params).error({ json: error }); + logInspectorRequest().error({ json: error }); }, }) ); diff --git a/src/plugins/data/common/search/types.ts b/src/plugins/data/common/search/types.ts index b2f818acaa0ac..cedfa3ee02274 100644 --- a/src/plugins/data/common/search/types.ts +++ b/src/plugins/data/common/search/types.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import type { ConnectionRequestParams } from '@elastic/transport'; import type { TransportRequestOptions } from '@elastic/elasticsearch'; import type { KibanaExecutionContext } from '@kbn/core/public'; import type { DataView } from '@kbn/data-views-plugin/common'; @@ -87,11 +86,6 @@ export interface IKibanaSearchResponse { * The raw response returned by the internal search method (usually the raw ES response) */ rawResponse: RawResponse; - - /** - * HTTP request parameters from elasticsearch transport client t - */ - requestParams?: ConnectionRequestParams; } export interface IKibanaSearchRequest { diff --git a/src/plugins/data/public/search/search_interceptor/search_interceptor.ts b/src/plugins/data/public/search/search_interceptor/search_interceptor.ts index 414230b7e5add..00ed4226fea3d 100644 --- a/src/plugins/data/public/search/search_interceptor/search_interceptor.ts +++ b/src/plugins/data/public/search/search_interceptor/search_interceptor.ts @@ -29,7 +29,6 @@ import { takeUntil, tap, } from 'rxjs/operators'; -import type { ConnectionRequestParams } from '@elastic/transport'; import { PublicMethodsOf } from '@kbn/utility-types'; import type { HttpSetup, IHttpFetchError } from '@kbn/core-http-browser'; import { BfetchRequestError } from '@kbn/bfetch-plugin/public'; @@ -305,38 +304,18 @@ export class SearchInterceptor { const cancel = () => id && !isSavedToBackground && sendCancelRequest(); - // Async search requires a series of requests - // 1) POST //_async_search/ - // 2..n) GET /_async_search/ - // - // First request contains useful request params for tools like Inspector. - // Preserve and project first request params into responses. - let firstRequestParams: ConnectionRequestParams; - return pollSearch(search, cancel, { pollInterval: this.deps.searchConfig.asyncSearch.pollInterval, ...options, abortSignal: searchAbortController.getSignal(), }).pipe( tap((response) => { - if (!firstRequestParams && response.requestParams) { - firstRequestParams = response.requestParams; - } - id = response.id; if (isCompleteResponse(response)) { searchTracker?.complete(); } }), - map((response) => { - return firstRequestParams - ? { - ...response, - requestParams: firstRequestParams, - } - : response; - }), catchError((e: Error) => { searchTracker?.error(); cancel(); diff --git a/src/plugins/data/server/search/routes/bsearch.ts b/src/plugins/data/server/search/routes/bsearch.ts index 7248206c8ee95..581920feef89d 100644 --- a/src/plugins/data/server/search/routes/bsearch.ts +++ b/src/plugins/data/server/search/routes/bsearch.ts @@ -8,7 +8,6 @@ import { firstValueFrom } from 'rxjs'; import { catchError } from 'rxjs/operators'; -import { errors } from '@elastic/elasticsearch'; import { BfetchServerSetup } from '@kbn/bfetch-plugin/server'; import type { ExecutionContextSetup } from '@kbn/core/server'; import apm from 'elastic-apm-node'; @@ -48,12 +47,6 @@ export function registerBsearchRoute( message: err.message, statusCode: err.statusCode, attributes: err.errBody?.error, - // TODO remove 'instanceof errors.ResponseError' check when - // eql strategy throws KbnServerError (like all of the other strategies) - requestParams: - err instanceof errors.ResponseError - ? err.meta?.meta?.request?.params - : err.requestParams, }; }) ) diff --git a/src/plugins/data/server/search/strategies/eql_search/eql_search_strategy.ts b/src/plugins/data/server/search/strategies/eql_search/eql_search_strategy.ts index 45a7b4d90cd41..d6f5d948c784a 100644 --- a/src/plugins/data/server/search/strategies/eql_search/eql_search_strategy.ts +++ b/src/plugins/data/server/search/strategies/eql_search/eql_search_strategy.ts @@ -77,10 +77,7 @@ export const eqlSearchStrategyProvider = ( meta: true, }); - return toEqlKibanaSearchResponse( - response as TransportResult, - (response as TransportResult).meta?.request?.params - ); + return toEqlKibanaSearchResponse(response as TransportResult); }; const cancel = async () => { diff --git a/src/plugins/data/server/search/strategies/eql_search/response_utils.ts b/src/plugins/data/server/search/strategies/eql_search/response_utils.ts index 48c19c996fd52..f9bdf5bc7de30 100644 --- a/src/plugins/data/server/search/strategies/eql_search/response_utils.ts +++ b/src/plugins/data/server/search/strategies/eql_search/response_utils.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import type { ConnectionRequestParams } from '@elastic/transport'; import type { TransportResult } from '@elastic/elasticsearch'; import { EqlSearchResponse } from './types'; import { EqlSearchStrategyResponse } from '../../../../common'; @@ -16,14 +15,12 @@ import { EqlSearchStrategyResponse } from '../../../../common'; * (EQL does not provide _shard info, so total/loaded cannot be calculated.) */ export function toEqlKibanaSearchResponse( - response: TransportResult, - requestParams?: ConnectionRequestParams + response: TransportResult ): EqlSearchStrategyResponse { return { id: response.body.id, rawResponse: response, isPartial: response.body.is_partial, isRunning: response.body.is_running, - ...(requestParams ? { requestParams } : {}), }; } diff --git a/src/plugins/data/server/search/strategies/es_search/es_search_strategy.test.ts b/src/plugins/data/server/search/strategies/es_search/es_search_strategy.test.ts index 679bb5ae2a699..15a6a4df7eed8 100644 --- a/src/plugins/data/server/search/strategies/es_search/es_search_strategy.test.ts +++ b/src/plugins/data/server/search/strategies/es_search/es_search_strategy.test.ts @@ -113,7 +113,7 @@ describe('ES search strategy', () => { ) ); const [, searchOptions] = esClient.search.mock.calls[0]; - expect(searchOptions).toEqual({ signal: undefined, maxRetries: 5, meta: true }); + expect(searchOptions).toEqual({ signal: undefined, maxRetries: 5 }); }); it('can be aborted', async () => { @@ -131,10 +131,7 @@ describe('ES search strategy', () => { ...params, track_total_hits: true, }); - expect(esClient.search.mock.calls[0][1]).toEqual({ - signal: expect.any(AbortSignal), - meta: true, - }); + expect(esClient.search.mock.calls[0][1]).toEqual({ signal: expect.any(AbortSignal) }); }); it('throws normalized error if ResponseError is thrown', async () => { diff --git a/src/plugins/data/server/search/strategies/es_search/es_search_strategy.ts b/src/plugins/data/server/search/strategies/es_search/es_search_strategy.ts index 1dc9beb565c79..b2aed5804f248 100644 --- a/src/plugins/data/server/search/strategies/es_search/es_search_strategy.ts +++ b/src/plugins/data/server/search/strategies/es_search/es_search_strategy.ts @@ -50,13 +50,12 @@ export const esSearchStrategyProvider = ( ...(terminateAfter ? { terminate_after: terminateAfter } : {}), ...requestParams, }; - const { body, meta } = await esClient.asCurrentUser.search(params, { + const body = await esClient.asCurrentUser.search(params, { signal: abortSignal, ...transport, - meta: true, }); const response = shimHitsTotal(body, options); - return toKibanaSearchResponse(response, meta?.request?.params); + return toKibanaSearchResponse(response); } catch (e) { throw getKbnServerError(e); } diff --git a/src/plugins/data/server/search/strategies/es_search/response_utils.ts b/src/plugins/data/server/search/strategies/es_search/response_utils.ts index 6e364cbbc40bd..4773b6df3bbaf 100644 --- a/src/plugins/data/server/search/strategies/es_search/response_utils.ts +++ b/src/plugins/data/server/search/strategies/es_search/response_utils.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import type { ConnectionRequestParams } from '@elastic/transport'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { ISearchOptions } from '../../../../common'; @@ -25,15 +24,11 @@ export function getTotalLoaded(response: estypes.SearchResponse) { * Get the Kibana representation of this response (see `IKibanaSearchResponse`). * @internal */ -export function toKibanaSearchResponse( - rawResponse: estypes.SearchResponse, - requestParams?: ConnectionRequestParams -) { +export function toKibanaSearchResponse(rawResponse: estypes.SearchResponse) { return { rawResponse, isPartial: false, isRunning: false, - ...(requestParams ? { requestParams } : {}), ...getTotalLoaded(rawResponse), }; } diff --git a/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts b/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts index c8322d3083995..298933907b8bb 100644 --- a/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts +++ b/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts @@ -65,7 +65,7 @@ export const enhancedEsSearchStrategyProvider = ( ...(await getDefaultAsyncSubmitParams(uiSettingsClient, searchConfig, options)), ...request.params, }; - const { body, headers, meta } = id + const { body, headers } = id ? await client.asyncSearch.get( { ...params, id }, { ...options.transport, signal: options.abortSignal, meta: true } @@ -78,11 +78,7 @@ export const enhancedEsSearchStrategyProvider = ( const response = shimHitsTotal(body.response, options); - return toAsyncKibanaSearchResponse( - { ...body, response }, - headers?.warning, - meta?.request?.params - ); + return toAsyncKibanaSearchResponse({ ...body, response }, headers?.warning); }; const cancel = async () => { @@ -135,10 +131,8 @@ export const enhancedEsSearchStrategyProvider = ( ); const response = esResponse.body as estypes.SearchResponse; - const requestParams = esResponse.meta?.request?.params; return { rawResponse: shimHitsTotal(response, options), - ...(requestParams ? { requestParams } : {}), ...getTotalLoaded(response), }; } catch (e) { diff --git a/src/plugins/data/server/search/strategies/ese_search/response_utils.ts b/src/plugins/data/server/search/strategies/ese_search/response_utils.ts index 5439e8a618dae..c9390a1b381d5 100644 --- a/src/plugins/data/server/search/strategies/ese_search/response_utils.ts +++ b/src/plugins/data/server/search/strategies/ese_search/response_utils.ts @@ -6,25 +6,19 @@ * Side Public License, v 1. */ -import type { ConnectionRequestParams } from '@elastic/transport'; import type { AsyncSearchResponse } from './types'; import { getTotalLoaded } from '../es_search'; /** * Get the Kibana representation of an async search response (see `IKibanaSearchResponse`). */ -export function toAsyncKibanaSearchResponse( - response: AsyncSearchResponse, - warning?: string, - requestParams?: ConnectionRequestParams -) { +export function toAsyncKibanaSearchResponse(response: AsyncSearchResponse, warning?: string) { return { id: response.id, rawResponse: response.response, isPartial: response.is_partial, isRunning: response.is_running, ...(warning ? { warning } : {}), - ...(requestParams ? { requestParams } : {}), ...getTotalLoaded(response.response), }; } diff --git a/src/plugins/data/server/search/strategies/esql_search/esql_search_strategy.ts b/src/plugins/data/server/search/strategies/esql_search/esql_search_strategy.ts index e61feaba15668..7f3f6f521853d 100644 --- a/src/plugins/data/server/search/strategies/esql_search/esql_search_strategy.ts +++ b/src/plugins/data/server/search/strategies/esql_search/esql_search_strategy.ts @@ -32,7 +32,7 @@ export const esqlSearchStrategyProvider = ( const search = async () => { try { const { terminateAfter, ...requestParams } = request.params ?? {}; - const { headers, body, meta } = await esClient.asCurrentUser.transport.request( + const { headers, body } = await esClient.asCurrentUser.transport.request( { method: 'POST', path: '/_query', @@ -45,12 +45,10 @@ export const esqlSearchStrategyProvider = ( meta: true, } ); - const transportRequestParams = meta?.request?.params; return { rawResponse: body, isPartial: false, isRunning: false, - ...(transportRequestParams ? { requestParams: transportRequestParams } : {}), warning: headers?.warning, }; } catch (e) { diff --git a/src/plugins/data/server/search/strategies/sql_search/response_utils.ts b/src/plugins/data/server/search/strategies/sql_search/response_utils.ts index 0f4fb3e275f0e..b859df9db4237 100644 --- a/src/plugins/data/server/search/strategies/sql_search/response_utils.ts +++ b/src/plugins/data/server/search/strategies/sql_search/response_utils.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import type { ConnectionRequestParams } from '@elastic/transport'; import { SqlQueryResponse } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { SqlSearchStrategyResponse } from '../../../../common'; @@ -16,8 +15,7 @@ import { SqlSearchStrategyResponse } from '../../../../common'; export function toAsyncKibanaSearchResponse( response: SqlQueryResponse, startTime: number, - warning?: string, - requestParams?: ConnectionRequestParams + warning?: string ): SqlSearchStrategyResponse { return { id: response.id, @@ -26,6 +24,5 @@ export function toAsyncKibanaSearchResponse( isRunning: response.is_running, took: Date.now() - startTime, ...(warning ? { warning } : {}), - ...(requestParams ? { requestParams } : {}), }; } diff --git a/src/plugins/data/server/search/strategies/sql_search/sql_search_strategy.ts b/src/plugins/data/server/search/strategies/sql_search/sql_search_strategy.ts index b6207787d8fbb..c8928a343eec5 100644 --- a/src/plugins/data/server/search/strategies/sql_search/sql_search_strategy.ts +++ b/src/plugins/data/server/search/strategies/sql_search/sql_search_strategy.ts @@ -9,7 +9,6 @@ import type { IncomingHttpHeaders } from 'http'; import type { IScopedClusterClient, Logger } from '@kbn/core/server'; import { catchError, tap } from 'rxjs/operators'; -import type { DiagnosticResult } from '@elastic/transport'; import { SqlQueryResponse } from '@elastic/elasticsearch/lib/api/types'; import { getKbnServerError } from '@kbn/kibana-utils-plugin/server'; import type { ISearchStrategy, SearchStrategyDependencies } from '../../types'; @@ -49,10 +48,9 @@ export const sqlSearchStrategyProvider = ( const { keep_cursor: keepCursor, ...params } = request.params ?? {}; let body: SqlQueryResponse; let headers: IncomingHttpHeaders; - let meta: DiagnosticResult['meta']; if (id) { - ({ body, headers, meta } = await client.sql.getAsync( + ({ body, headers } = await client.sql.getAsync( { format: params?.format ?? 'json', ...getDefaultAsyncGetParams(searchConfig, options), @@ -61,7 +59,7 @@ export const sqlSearchStrategyProvider = ( { ...options.transport, signal: options.abortSignal, meta: true } )); } else { - ({ headers, body, meta } = await client.sql.query( + ({ headers, body } = await client.sql.query( { format: params.format ?? 'json', ...getDefaultAsyncSubmitParams(searchConfig, options), @@ -81,7 +79,7 @@ export const sqlSearchStrategyProvider = ( } } - return toAsyncKibanaSearchResponse(body, startTime, headers?.warning, meta?.request?.params); + return toAsyncKibanaSearchResponse(body, startTime, headers?.warning); }; const cancel = async () => { diff --git a/src/plugins/inspector/common/adapters/request/move_request_params_to_top_level.test.ts b/src/plugins/inspector/common/adapters/request/move_request_params_to_top_level.test.ts deleted file mode 100644 index 37b7a8dd6f283..0000000000000 --- a/src/plugins/inspector/common/adapters/request/move_request_params_to_top_level.test.ts +++ /dev/null @@ -1,66 +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 { moveRequestParamsToTopLevel } from './move_request_params_to_top_level'; -import { RequestStatus } from './types'; - -describe('moveRequestParamsToTopLevel', () => { - test('should move request meta from error response', () => { - expect( - moveRequestParamsToTopLevel(RequestStatus.ERROR, { - json: { - attributes: {}, - err: { - message: 'simulated error', - requestParams: { - method: 'POST', - path: '/_query', - }, - }, - }, - time: 1, - }) - ).toEqual({ - json: { - attributes: {}, - err: { - message: 'simulated error', - }, - }, - requestParams: { - method: 'POST', - path: '/_query', - }, - time: 1, - }); - }); - - test('should move request meta from ok response', () => { - expect( - moveRequestParamsToTopLevel(RequestStatus.OK, { - json: { - rawResponse: {}, - requestParams: { - method: 'POST', - path: '/_query', - }, - }, - time: 1, - }) - ).toEqual({ - json: { - rawResponse: {}, - }, - requestParams: { - method: 'POST', - path: '/_query', - }, - time: 1, - }); - }); -}); diff --git a/src/plugins/inspector/common/adapters/request/move_request_params_to_top_level.ts b/src/plugins/inspector/common/adapters/request/move_request_params_to_top_level.ts deleted file mode 100644 index a00a2d90559c7..0000000000000 --- a/src/plugins/inspector/common/adapters/request/move_request_params_to_top_level.ts +++ /dev/null @@ -1,56 +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 type { ConnectionRequestParams } from '@elastic/transport'; -import { RequestStatus, Response } from './types'; - -interface ErrorResponse { - [key: string]: unknown; - err?: { - [key: string]: unknown; - requestParams?: ConnectionRequestParams; - }; -} - -interface OkResponse { - [key: string]: unknown; - requestParams?: ConnectionRequestParams; -} - -export function moveRequestParamsToTopLevel(status: RequestStatus, response: Response) { - if (status === RequestStatus.ERROR) { - const requestParams = (response.json as ErrorResponse)?.err?.requestParams; - if (!requestParams) { - return response; - } - - const json = { - ...response.json, - err: { ...(response.json as ErrorResponse).err }, - }; - delete json.err.requestParams; - return { - ...response, - json, - requestParams, - }; - } - - const requestParams = (response.json as OkResponse)?.requestParams; - if (!requestParams) { - return response; - } - - const json = { ...response.json } as OkResponse; - delete json.requestParams; - return { - ...response, - json, - requestParams, - }; -} diff --git a/src/plugins/inspector/common/adapters/request/request_responder.ts b/src/plugins/inspector/common/adapters/request/request_responder.ts index cf3a4b6c223da..1d3a999e4834d 100644 --- a/src/plugins/inspector/common/adapters/request/request_responder.ts +++ b/src/plugins/inspector/common/adapters/request/request_responder.ts @@ -8,7 +8,6 @@ import { i18n } from '@kbn/i18n'; import { Request, RequestStatistics, RequestStatus, Response } from './types'; -import { moveRequestParamsToTopLevel } from './move_request_params_to_top_level'; /** * An API to specify information about a specific request that will be logged. @@ -54,7 +53,7 @@ export class RequestResponder { public finish(status: RequestStatus, response: Response): void { this.request.time = response.time ?? Date.now() - this.request.startTime; this.request.status = status; - this.request.response = moveRequestParamsToTopLevel(status, response); + this.request.response = response; this.onChange(); } diff --git a/src/plugins/inspector/common/adapters/request/types.ts b/src/plugins/inspector/common/adapters/request/types.ts index d00e1304f74f5..4e6a8d324559f 100644 --- a/src/plugins/inspector/common/adapters/request/types.ts +++ b/src/plugins/inspector/common/adapters/request/types.ts @@ -6,8 +6,6 @@ * Side Public License, v 1. */ -import type { ConnectionRequestParams } from '@elastic/transport'; - /** * The status a request can have. */ @@ -54,8 +52,6 @@ export interface RequestStatistic { } export interface Response { - // TODO replace object with IKibanaSearchResponse once IKibanaSearchResponse is seperated from data plugin. json?: object; - requestParams?: ConnectionRequestParams; time?: number; } diff --git a/src/plugins/inspector/public/views/requests/components/details/req_code_viewer.tsx b/src/plugins/inspector/public/views/requests/components/details/req_code_viewer.tsx index 58f5dd44f3f11..5ab50ba33a514 100644 --- a/src/plugins/inspector/public/views/requests/components/details/req_code_viewer.tsx +++ b/src/plugins/inspector/public/views/requests/components/details/req_code_viewer.tsx @@ -12,7 +12,6 @@ /* eslint-disable @elastic/eui/href-or-on-click */ import { EuiButtonEmpty, EuiCopy, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import type { ConnectionRequestParams } from '@elastic/transport'; import { i18n } from '@kbn/i18n'; import { XJsonLang } from '@kbn/monaco'; import { compressToEncodedURIComponent } from 'lz-string'; @@ -22,7 +21,6 @@ import { InspectorPluginStartDeps } from '../../../../plugin'; interface RequestCodeViewerProps { indexPattern?: string; - requestParams?: ConnectionRequestParams; json: string; } @@ -41,37 +39,19 @@ const openInSearchProfilerLabel = i18n.translate('inspector.requests.openInSearc /** * @internal */ -export const RequestCodeViewer = ({ - indexPattern, - requestParams, - json, -}: RequestCodeViewerProps) => { +export const RequestCodeViewer = ({ indexPattern, json }: RequestCodeViewerProps) => { const { services } = useKibana(); const navigateToUrl = services.application?.navigateToUrl; - function getValue() { - if (!requestParams) { - return json; - } - - const fullPath = requestParams.querystring - ? `${requestParams.path}?${requestParams.querystring}` - : requestParams.path; - - return `${requestParams.method} ${fullPath}\n${json}`; - } - - const value = getValue(); - - const devToolsDataUri = compressToEncodedURIComponent(value); + const devToolsDataUri = compressToEncodedURIComponent(`GET ${indexPattern}/_search\n${json}`); const consoleHref = services.share.url.locators .get('CONSOLE_APP_LOCATOR') ?.useUrl({ loadFrom: `data:text/plain,${devToolsDataUri}` }); // Check if both the Dev Tools UI and the Console UI are enabled. const canShowDevTools = services.application?.capabilities?.dev_tools.show && consoleHref !== undefined; - const shouldShowDevToolsLink = !!(requestParams && canShowDevTools); + const shouldShowDevToolsLink = !!(indexPattern && canShowDevTools); const handleDevToolsLinkClick = useCallback( () => consoleHref && navigateToUrl && navigateToUrl(consoleHref), [consoleHref, navigateToUrl] @@ -155,7 +135,7 @@ export const RequestCodeViewer = ({ { return ( ); diff --git a/src/plugins/kibana_utils/server/report_server_error.ts b/src/plugins/kibana_utils/server/report_server_error.ts index a9fd5d9265bd3..0fcc0c34cc4a9 100644 --- a/src/plugins/kibana_utils/server/report_server_error.ts +++ b/src/plugins/kibana_utils/server/report_server_error.ts @@ -7,22 +7,14 @@ */ import { errors } from '@elastic/elasticsearch'; -import type { ConnectionRequestParams } from '@elastic/transport'; import { KibanaResponseFactory } from '@kbn/core/server'; import { KbnError } from '../common'; export class KbnServerError extends KbnError { public errBody?: Record; - public requestParams?: ConnectionRequestParams; - constructor( - message: string, - public readonly statusCode: number, - errBody?: Record, - requestParams?: ConnectionRequestParams - ) { + constructor(message: string, public readonly statusCode: number, errBody?: Record) { super(message); this.errBody = errBody; - this.requestParams = requestParams; } } @@ -36,8 +28,7 @@ export function getKbnServerError(e: Error) { return new KbnServerError( e.message ?? 'Unknown error', e instanceof errors.ResponseError ? e.statusCode! : 500, - e instanceof errors.ResponseError ? e.body : undefined, - e instanceof errors.ResponseError ? e.meta?.meta?.request?.params : undefined + e instanceof errors.ResponseError ? e.body : undefined ); } @@ -52,7 +43,6 @@ export function reportServerError(res: KibanaResponseFactory, err: KbnServerErro body: { message: err.message, attributes: err.errBody?.error, - ...(err.requestParams ? { requestParams: err.requestParams } : {}), }, }); } diff --git a/test/api_integration/apis/search/bsearch.ts b/test/api_integration/apis/search/bsearch.ts index 58f0765a53913..9ce10dc38a643 100644 --- a/test/api_integration/apis/search/bsearch.ts +++ b/test/api_integration/apis/search/bsearch.ts @@ -232,351 +232,6 @@ export default function ({ getService }: FtrProviderContext) { }); }); }); - - describe('request meta', () => { - describe('es', () => { - it(`should return request meta`, async () => { - const resp = await supertest - .post(`/internal/bsearch`) - .set(ELASTIC_HTTP_VERSION_HEADER, BFETCH_ROUTE_VERSION_LATEST) - .send({ - batch: [ - { - request: { - params: { - index: '.kibana', - body: { - query: { - match_all: {}, - }, - }, - }, - }, - options: { - strategy: 'es', - }, - }, - ], - }); - - const jsonBody = parseBfetchResponse(resp); - - expect(resp.status).to.be(200); - expect(jsonBody[0].result).to.have.property('requestParams'); - expect(jsonBody[0].result.requestParams.method).to.be('POST'); - expect(jsonBody[0].result.requestParams.path).to.be('/.kibana/_search'); - expect(jsonBody[0].result.requestParams.querystring).to.be('ignore_unavailable=true'); - }); - - it(`should return request meta when request fails`, async () => { - const resp = await supertest - .post(`/internal/bsearch`) - .set(ELASTIC_HTTP_VERSION_HEADER, BFETCH_ROUTE_VERSION_LATEST) - .send({ - batch: [ - { - request: { - params: { - index: '.kibana', - body: { - query: { - bool: { - filter: [ - { - error_query: { - indices: [ - { - error_type: 'exception', - message: 'simulated failure', - name: '.kibana', - }, - ], - }, - }, - ], - }, - }, - }, - }, - }, - options: { - strategy: 'es', - }, - }, - ], - }); - - const jsonBody = parseBfetchResponse(resp); - - expect(resp.status).to.be(200); - expect(jsonBody[0].error).to.have.property('requestParams'); - expect(jsonBody[0].error.requestParams.method).to.be('POST'); - expect(jsonBody[0].error.requestParams.path).to.be('/.kibana/_search'); - expect(jsonBody[0].error.requestParams.querystring).to.be('ignore_unavailable=true'); - }); - }); - - describe('ese', () => { - it(`should return request meta`, async () => { - const resp = await supertest - .post(`/internal/bsearch`) - .set(ELASTIC_HTTP_VERSION_HEADER, BFETCH_ROUTE_VERSION_LATEST) - .send({ - batch: [ - { - request: { - params: { - index: '.kibana', - body: { - query: { - match_all: {}, - }, - }, - }, - }, - options: { - strategy: 'ese', - }, - }, - ], - }); - - const jsonBody = parseBfetchResponse(resp); - - expect(resp.status).to.be(200); - expect(jsonBody[0].result).to.have.property('requestParams'); - expect(jsonBody[0].result.requestParams.method).to.be('POST'); - expect(jsonBody[0].result.requestParams.path).to.be('/.kibana/_async_search'); - expect(jsonBody[0].result.requestParams.querystring).to.be( - 'batched_reduce_size=64&ccs_minimize_roundtrips=true&wait_for_completion_timeout=200ms&keep_on_completion=false&keep_alive=60000ms&ignore_unavailable=true' - ); - }); - - it(`should return request meta when request fails`, async () => { - const resp = await supertest - .post(`/internal/bsearch`) - .set(ELASTIC_HTTP_VERSION_HEADER, BFETCH_ROUTE_VERSION_LATEST) - .send({ - batch: [ - { - request: { - params: { - index: '.kibana', - body: { - bool: { - filter: [ - { - error_query: { - indices: [ - { - error_type: 'exception', - message: 'simulated failure', - name: '.kibana', - }, - ], - }, - }, - ], - }, - }, - }, - }, - options: { - strategy: 'ese', - }, - }, - ], - }); - - const jsonBody = parseBfetchResponse(resp); - - expect(resp.status).to.be(200); - expect(jsonBody[0].error).to.have.property('requestParams'); - expect(jsonBody[0].error.requestParams.method).to.be('POST'); - expect(jsonBody[0].error.requestParams.path).to.be('/.kibana/_async_search'); - expect(jsonBody[0].error.requestParams.querystring).to.be( - 'batched_reduce_size=64&ccs_minimize_roundtrips=true&wait_for_completion_timeout=200ms&keep_on_completion=false&keep_alive=60000ms&ignore_unavailable=true' - ); - }); - }); - - describe('esql', () => { - it(`should return request meta`, async () => { - const resp = await supertest - .post(`/internal/bsearch`) - .set(ELASTIC_HTTP_VERSION_HEADER, BFETCH_ROUTE_VERSION_LATEST) - .send({ - batch: [ - { - request: { - params: { - query: 'from .kibana | limit 1', - }, - }, - options: { - strategy: 'esql', - }, - }, - ], - }); - - const jsonBody = parseBfetchResponse(resp); - - expect(resp.status).to.be(200); - expect(jsonBody[0].result).to.have.property('requestParams'); - expect(jsonBody[0].result.requestParams.method).to.be('POST'); - expect(jsonBody[0].result.requestParams.path).to.be('/_query'); - expect(jsonBody[0].result.requestParams.querystring).to.be(''); - }); - - it(`should return request meta when request fails`, async () => { - const resp = await supertest - .post(`/internal/bsearch`) - .set(ELASTIC_HTTP_VERSION_HEADER, BFETCH_ROUTE_VERSION_LATEST) - .send({ - batch: [ - { - request: { - params: { - query: 'fro .kibana | limit 1', - }, - }, - options: { - strategy: 'esql', - }, - }, - ], - }); - - const jsonBody = parseBfetchResponse(resp); - - expect(resp.status).to.be(200); - expect(jsonBody[0].error).to.have.property('requestParams'); - expect(jsonBody[0].error.requestParams.method).to.be('POST'); - expect(jsonBody[0].error.requestParams.path).to.be('/_query'); - expect(jsonBody[0].error.requestParams.querystring).to.be(''); - }); - }); - - describe('sql', () => { - it(`should return request meta`, async () => { - const resp = await supertest - .post(`/internal/bsearch`) - .set(ELASTIC_HTTP_VERSION_HEADER, BFETCH_ROUTE_VERSION_LATEST) - .send({ - batch: [ - { - request: { - params: { - query: 'SELECT * FROM ".kibana" LIMIT 1', - }, - }, - options: { - strategy: 'sql', - }, - }, - ], - }); - - const jsonBody = parseBfetchResponse(resp); - - expect(resp.status).to.be(200); - expect(jsonBody[0].result).to.have.property('requestParams'); - expect(jsonBody[0].result.requestParams.method).to.be('POST'); - expect(jsonBody[0].result.requestParams.path).to.be('/_sql'); - expect(jsonBody[0].result.requestParams.querystring).to.be('format=json'); - }); - - it(`should return request meta when request fails`, async () => { - const resp = await supertest - .post(`/internal/bsearch`) - .set(ELASTIC_HTTP_VERSION_HEADER, BFETCH_ROUTE_VERSION_LATEST) - .send({ - batch: [ - { - request: { - params: { - query: 'SELEC * FROM ".kibana" LIMIT 1', - }, - }, - options: { - strategy: 'sql', - }, - }, - ], - }); - - const jsonBody = parseBfetchResponse(resp); - - expect(resp.status).to.be(200); - expect(jsonBody[0].error).to.have.property('requestParams'); - expect(jsonBody[0].error.requestParams.method).to.be('POST'); - expect(jsonBody[0].error.requestParams.path).to.be('/_sql'); - expect(jsonBody[0].error.requestParams.querystring).to.be('format=json'); - }); - }); - - describe('eql', () => { - it(`should return request meta`, async () => { - const resp = await supertest - .post(`/internal/bsearch`) - .set(ELASTIC_HTTP_VERSION_HEADER, BFETCH_ROUTE_VERSION_LATEST) - .send({ - batch: [ - { - request: { - params: { - index: '.kibana', - query: 'any where true', - timestamp_field: 'created_at', - }, - }, - options: { - strategy: 'eql', - }, - }, - ], - }); - - const jsonBody = parseBfetchResponse(resp); - - expect(resp.status).to.be(200); - expect(jsonBody[0].result).to.have.property('requestParams'); - expect(jsonBody[0].result.requestParams.method).to.be('POST'); - expect(jsonBody[0].result.requestParams.path).to.be('/.kibana/_eql/search'); - expect(jsonBody[0].result.requestParams.querystring).to.be('ignore_unavailable=true'); - }); - - it(`should return request meta when request fails`, async () => { - const resp = await supertest - .post(`/internal/bsearch`) - .set(ELASTIC_HTTP_VERSION_HEADER, BFETCH_ROUTE_VERSION_LATEST) - .send({ - batch: [ - { - request: { - params: { - index: '.kibana', - query: 'any where true', - }, - }, - options: { - strategy: 'eql', - }, - }, - ], - }); - - const jsonBody = parseBfetchResponse(resp); - - expect(resp.status).to.be(200); - expect(jsonBody[0].error).to.have.property('requestParams'); - expect(jsonBody[0].error.requestParams.method).to.be('POST'); - expect(jsonBody[0].error.requestParams.path).to.be('/.kibana/_eql/search'); - expect(jsonBody[0].error.requestParams.querystring).to.be('ignore_unavailable=true'); - }); - }); - }); }); }); } diff --git a/test/functional/apps/visualize/group2/_inspector.ts b/test/functional/apps/visualize/group2/_inspector.ts index 077a37a90c06c..80cfc42ab3cd6 100644 --- a/test/functional/apps/visualize/group2/_inspector.ts +++ b/test/functional/apps/visualize/group2/_inspector.ts @@ -14,6 +14,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const log = getService('log'); const inspector = getService('inspector'); const filterBar = getService('filterBar'); + const monacoEditor = getService('monacoEditor'); const PageObjects = getPageObjects(['visualize', 'visEditor', 'visChart', 'timePicker']); describe('inspector', function describeIndexTests() { @@ -40,8 +41,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await inspector.open(); await inspector.openInspectorRequestsView(); - const { body } = await inspector.getRequest(1); - expect(body.aggs['2'].max).property('missing', 10); + const requestTab = await inspector.getOpenRequestDetailRequestButton(); + await requestTab.click(); + const requestJSON = JSON.parse(await monacoEditor.getCodeEditorValue(1)); + + expect(requestJSON.aggs['2'].max).property('missing', 10); }); after(async () => { diff --git a/test/functional/services/inspector.ts b/test/functional/services/inspector.ts index 7313187047a18..6222405aa6dae 100644 --- a/test/functional/services/inspector.ts +++ b/test/functional/services/inspector.ts @@ -299,21 +299,6 @@ export class InspectorService extends FtrService { return this.testSubjects.find('inspectorRequestDetailResponse'); } - public async getRequest( - codeEditorIndex: number = 0 - ): Promise<{ command: string; body: Record }> { - await (await this.getOpenRequestDetailRequestButton()).click(); - - await this.monacoEditor.waitCodeEditorReady('inspectorRequestCodeViewerContainer'); - const requestString = await this.monacoEditor.getCodeEditorValue(codeEditorIndex); - this.log.debug('Request string from inspector:', requestString); - const openBraceIndex = requestString.indexOf('{'); - return { - command: openBraceIndex >= 0 ? requestString.substring(0, openBraceIndex).trim() : '', - body: openBraceIndex >= 0 ? JSON.parse(requestString.substring(openBraceIndex)) : {}, - }; - } - public async getResponse(): Promise> { await (await this.getOpenRequestDetailResponseButton()).click(); From a42d601fe5d5a4b63dd8ac6d0c0a70a2d8ddeaad Mon Sep 17 00:00:00 2001 From: Josh Dover <1813008+joshdover@users.noreply.github.com> Date: Thu, 28 Sep 2023 14:34:50 +0200 Subject: [PATCH 15/61] [Fleet] Add retries w/ backoff to Fleet setup on Kibana boot (#167246) Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com> --- config/serverless.yml | 1 + package.json | 1 + x-pack/plugins/fleet/common/types/index.ts | 1 + x-pack/plugins/fleet/server/config.ts | 1 + x-pack/plugins/fleet/server/plugin.ts | 40 ++++++++++++++++--- .../epm/packages/_install_package.test.ts | 3 ++ 6 files changed, 42 insertions(+), 5 deletions(-) diff --git a/config/serverless.yml b/config/serverless.yml index 33eaec2b22b6a..8319d4c0ecee9 100644 --- a/config/serverless.yml +++ b/config/serverless.yml @@ -7,6 +7,7 @@ xpack.fleet.internal.disableILMPolicies: true xpack.fleet.internal.disableProxies: true xpack.fleet.internal.activeAgentsSoftLimit: 25000 xpack.fleet.internal.onlyAllowAgentUpgradeToKnownVersions: true +xpack.fleet.internal.retrySetupOnBoot: true # Cloud links xpack.cloud.base_url: 'https://cloud.elastic.co' diff --git a/package.json b/package.json index 313ee86a8171d..4792c66f475ab 100644 --- a/package.json +++ b/package.json @@ -888,6 +888,7 @@ "email-addresses": "^5.0.0", "execa": "^5.1.1", "expiry-js": "0.1.7", + "exponential-backoff": "^3.1.1", "extract-zip": "^2.0.1", "fast-deep-equal": "^3.1.1", "fflate": "^0.6.9", diff --git a/x-pack/plugins/fleet/common/types/index.ts b/x-pack/plugins/fleet/common/types/index.ts index 47f62c8e19794..6ef34d045e20f 100644 --- a/x-pack/plugins/fleet/common/types/index.ts +++ b/x-pack/plugins/fleet/common/types/index.ts @@ -51,6 +51,7 @@ export interface FleetConfigType { fleetServerStandalone: boolean; onlyAllowAgentUpgradeToKnownVersions: boolean; activeAgentsSoftLimit?: number; + retrySetupOnBoot: boolean; registry: { kibanaVersionCheckEnabled: boolean; capabilities: string[]; diff --git a/x-pack/plugins/fleet/server/config.ts b/x-pack/plugins/fleet/server/config.ts index b68684460bf81..f1210a49f7f0c 100644 --- a/x-pack/plugins/fleet/server/config.ts +++ b/x-pack/plugins/fleet/server/config.ts @@ -188,6 +188,7 @@ export const config: PluginConfigDescriptor = { min: 0, }) ), + retrySetupOnBoot: schema.boolean({ defaultValue: false }), registry: schema.object( { kibanaVersionCheckEnabled: schema.boolean({ defaultValue: true }), diff --git a/x-pack/plugins/fleet/server/plugin.ts b/x-pack/plugins/fleet/server/plugin.ts index 9603eb2b47064..e0aa5315d8ff9 100644 --- a/x-pack/plugins/fleet/server/plugin.ts +++ b/x-pack/plugins/fleet/server/plugin.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { backOff } from 'exponential-backoff'; import type { Observable } from 'rxjs'; import { BehaviorSubject } from 'rxjs'; import { take, filter } from 'rxjs/operators'; @@ -532,9 +533,39 @@ export class FleetPlugin ) .toPromise(); - await setupFleet( - new SavedObjectsClient(core.savedObjects.createInternalRepository()), - core.elasticsearch.client.asInternalUser + // Retry Fleet setup w/ backoff + await backOff( + async () => { + await setupFleet( + new SavedObjectsClient(core.savedObjects.createInternalRepository()), + core.elasticsearch.client.asInternalUser + ); + }, + { + // We only retry when this feature flag is enabled + numOfAttempts: this.configInitialValue.internal?.retrySetupOnBoot ? Infinity : 1, + // 250ms initial backoff + startingDelay: 250, + // 5m max backoff + maxDelay: 60000 * 5, + timeMultiple: 2, + // avoid HA contention with other Kibana instances + jitter: 'full', + retry: (error: any, attemptCount: number) => { + const summary = `Fleet setup attempt ${attemptCount} failed, will retry after backoff`; + logger.debug(summary, { error: { message: error } }); + + this.fleetStatus$.next({ + level: ServiceStatusLevels.available, + summary, + meta: { + attemptCount, + error, + }, + }); + return true; + }, + } ); this.fleetStatus$.next({ @@ -542,8 +573,7 @@ export class FleetPlugin summary: 'Fleet is available', }); } catch (error) { - logger.warn('Fleet setup failed'); - logger.warn(error); + logger.warn('Fleet setup failed', { error: { message: error } }); this.fleetStatus$.next({ // As long as Fleet has a dependency on EPR, we can't reliably set Kibana status to `unavailable` here. diff --git a/x-pack/plugins/fleet/server/services/epm/packages/_install_package.test.ts b/x-pack/plugins/fleet/server/services/epm/packages/_install_package.test.ts index b7fe0d95310ef..af3460e266af1 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/_install_package.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/_install_package.test.ts @@ -135,6 +135,7 @@ describe('_installPackage', () => { disableProxies: false, fleetServerStandalone: false, onlyAllowAgentUpgradeToKnownVersions: false, + retrySetupOnBoot: false, registry: { kibanaVersionCheckEnabled: true, capabilities: [], @@ -192,6 +193,7 @@ describe('_installPackage', () => { disableILMPolicies: false, fleetServerStandalone: false, onlyAllowAgentUpgradeToKnownVersions: false, + retrySetupOnBoot: false, registry: { kibanaVersionCheckEnabled: true, capabilities: [], @@ -265,6 +267,7 @@ describe('_installPackage', () => { disableProxies: false, fleetServerStandalone: false, onlyAllowAgentUpgradeToKnownVersions: false, + retrySetupOnBoot: false, registry: { kibanaVersionCheckEnabled: true, capabilities: [], From 833c07536267141ab9c53335e000698f74ce22d3 Mon Sep 17 00:00:00 2001 From: Marco Antonio Ghiani Date: Thu, 28 Sep 2023 14:54:40 +0200 Subject: [PATCH 16/61] [Stack Monitoring] Update flows for cpu stats fetching (#167244) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 📓 Summary When retrieving the CPU stats for containerized (or non-container) clusters, we were not considering a scenario where the user could run in a cgroup but without limits set. These changes re-write the conditions to determine whether we allow treating limitless containers as non-containerized, covering the case where a user run in a cgroup and for some reason hasn't set the limit. ## Testing > Taken from https://github.com/elastic/kibana/pull/159351 since it reproduced the same behaviours There are 3 main states to test: No limit set but Kibana configured to use container stats. Limit changed during lookback period (to/from real value, to/from no limit). Limit set and CPU usage crossing threshold and then falling down to recovery **Note: Please also test the non-container use case for this rule to ensure that didn't get broken during this refactor** **1. Start Elasticsearch in a container without setting the CPU limits:** ``` docker network create elastic docker run --name es01 --net elastic -p 9201:9200 -e xpack.license.self_generated.type=trial -it docker.elastic.co/elasticsearch/elasticsearch:master-SNAPSHOT ``` (We're using `master-SNAPSHOT` to include a recent fix to reporting for cgroup v2) Make note of the generated password for the `elastic` user. **2. Start another Elasticsearch instance to act as the monitoring cluster** **3. Configure Kibana to connect to the monitoring cluster and start it** **4. Configure Metricbeat to collect metrics from the Docker cluster and ship them to the monitoring cluster, then start it** Execute the below command next to the Metricbeat binary to grab the CA certificate from the Elasticsearch cluster. ``` docker cp es01:/usr/share/elasticsearch/config/certs/http_ca.crt . ``` Use the `elastic` password and the CA certificate to configure the `elasticsearch` module: ``` - module: elasticsearch xpack.enabled: true period: 10s hosts: - "https://localhost:9201" username: "elastic" password: "PASSWORD" ssl.certificate_authorities: "PATH_TO_CERT/http_ca.crt" ``` **5. Configure an alert in Kibana with a chosen threshold** OBSERVE: Alert gets fired to inform you that there looks to be a misconfiguration, together with reporting the current value for the fallback metric (warning if the fallback metric is below threshold, danger is if is above). **6. Set limit** First stop ES using `docker stop es01`, then set the limit using `docker update --cpus=1 es01` and start it again using `docker start es01`. After a brief delay you should now see the alert change to a warning about the limits having changed during the alert lookback period and stating that the CPU usage could not be confidently calculated. Wait for change event to pass out of lookback window. **7. Generate load on the monitored cluster** [Slingshot](https://github.com/elastic/slingshot) is an option. After you clone it, you need to update the `package.json` to match [this change](https://github.com/elastic/slingshot/blob/8bfa8351deb0d89859548ee5241e34d0920927e5/package.json#L45-L46) before running `npm install`. Then you can modify the value for `elasticsearch` in the `configs/hosts.json` file like this: ``` "elasticsearch": { "node": "https://localhost:9201", "auth": { "username": "elastic", "password": "PASSWORD" }, "ssl": { "ca": "PATH_TO_CERT/http_ca.crt", "rejectUnauthorized": false } } ``` Then you can start one or more instances of Slingshot like this: `npx ts-node bin/slingshot load --config configs/hosts.json` **7. Observe the alert firing in the logs** Assuming you're using a connector for server log output, you should see a message like below once the threshold is breached: ``` `[2023-06-13T13:05:50.036+02:00][INFO ][plugins.actions.server-log] Server log: CPU usage alert is firing for node e76ce10526e2 in cluster: docker-cluster. [View node](/app/monitoring#/elasticsearch/nodes/OyDWTz1PS-aEwjqcPN2vNQ?_g=(cluster_uuid:kasJK8VyTG6xNZ2PFPAtYg))` ``` The alert should also be visible in the Stack Monitoring UI overview page. At this point you can stop Slingshot and confirm that the alert recovers once CPU usage goes back down below the threshold. **8. Stop the load and confirm that the rule recovers.** --------- Co-authored-by: Marco Antonio Ghiani Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../plugins/monitoring/common/types/alerts.ts | 1 - .../server/alerts/cpu_usage_rule.test.ts | 40 ++++++--- .../server/alerts/cpu_usage_rule.ts | 27 +----- .../alerts/fetch_cpu_usage_node_stats.test.ts | 83 +----------------- .../lib/alerts/fetch_cpu_usage_node_stats.ts | 86 +++++-------------- 5 files changed, 56 insertions(+), 181 deletions(-) diff --git a/x-pack/plugins/monitoring/common/types/alerts.ts b/x-pack/plugins/monitoring/common/types/alerts.ts index 71943f42dd21f..adf00789d4056 100644 --- a/x-pack/plugins/monitoring/common/types/alerts.ts +++ b/x-pack/plugins/monitoring/common/types/alerts.ts @@ -171,7 +171,6 @@ export interface AlertNodeStats { export interface AlertCpuUsageNodeStats extends AlertNodeStats { cpuUsage?: number; limitsChanged?: boolean; - missingLimits?: boolean; unexpectedLimits?: boolean; } diff --git a/x-pack/plugins/monitoring/server/alerts/cpu_usage_rule.test.ts b/x-pack/plugins/monitoring/server/alerts/cpu_usage_rule.test.ts index 171daed9f9d64..dcf1e80583726 100644 --- a/x-pack/plugins/monitoring/server/alerts/cpu_usage_rule.test.ts +++ b/x-pack/plugins/monitoring/server/alerts/cpu_usage_rule.test.ts @@ -258,12 +258,7 @@ describe('CpuUsageRule', () => { it('should fire actions when resource limits are missing', async () => { (fetchCpuUsageNodeStats as jest.Mock).mockImplementation(() => { - return [ - { - ...stat, - missingLimits: true, - }, - ]; + return [stat]; }); const rule = new CpuUsageRule(); @@ -287,14 +282,39 @@ describe('CpuUsageRule', () => { nodeId, nodeName, threshold, - missingLimits: true, }, nodeId, nodeName, ui: { isFiring: true, message: { - text: `Kibana is configured for containerized workloads but node #start_linkmyNodeName#end_link does not have resource limits configured. Fallback metric reports usage of ${cpuUsage}%. Last checked at #absolute`, + text: `Node #start_link${nodeName}#end_link is reporting CPU usage of ${cpuUsage}% which is above the configured threshold of ${threshold}%. Last checked at #absolute`, + nextSteps: [ + { + text: '#start_linkCheck hot threads#end_link', + tokens: [ + { + startToken: '#start_link', + endToken: '#end_link', + type: 'docLink', + partialUrl: + '{elasticWebsiteUrl}guide/en/elasticsearch/reference/{docLinkVersion}/cluster-nodes-hot-threads.html', + }, + ], + }, + { + text: '#start_linkCheck long running tasks#end_link', + tokens: [ + { + startToken: '#start_link', + endToken: '#end_link', + type: 'docLink', + partialUrl: + '{elasticWebsiteUrl}guide/en/elasticsearch/reference/{docLinkVersion}/tasks.html', + }, + ], + }, + ], tokens: [ { startToken: '#start_link', @@ -319,8 +339,8 @@ describe('CpuUsageRule', () => { ], }); expect(scheduleActions).toHaveBeenCalledWith('default', { - internalFullMessage: `CPU usage alert for node ${nodeName} in cluster ${clusterName} faced issues while evaluating the usage. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid}))`, - internalShortMessage: `CPU usage alert for node ${nodeName} in cluster ${clusterName} faced issues while evaluating the usage. Verify CPU usage of node.`, + internalFullMessage: `CPU usage alert is firing for node ${nodeName} in cluster ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid}))`, + internalShortMessage: `CPU usage alert is firing for node ${nodeName} in cluster ${clusterName}. Verify CPU usage of node.`, action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid}))`, actionPlain: 'Verify CPU usage of node.', clusterName, diff --git a/x-pack/plugins/monitoring/server/alerts/cpu_usage_rule.ts b/x-pack/plugins/monitoring/server/alerts/cpu_usage_rule.ts index 58265dbfdbad7..49ab66f2ce10d 100644 --- a/x-pack/plugins/monitoring/server/alerts/cpu_usage_rule.ts +++ b/x-pack/plugins/monitoring/server/alerts/cpu_usage_rule.ts @@ -100,12 +100,7 @@ export class CpuUsageRule extends BaseRule { stat: AlertCpuUsageNodeStats, threshold: number ): { shouldFire: boolean; severity: AlertSeverity } { - if ( - stat.missingLimits || - stat.limitsChanged || - stat.unexpectedLimits || - stat.cpuUsage === undefined - ) { + if (stat.limitsChanged || stat.unexpectedLimits || stat.cpuUsage === undefined) { let severity = AlertSeverity.Warning; if (stat.cpuUsage && stat.cpuUsage > threshold) { severity = AlertSeverity.Danger; @@ -149,19 +144,6 @@ export class CpuUsageRule extends BaseRule { } as AlertMessageTimeToken, ]; - if (stat.missingLimits) { - return { - text: i18n.translate('xpack.monitoring.alerts.cpuUsage.ui.missingLimits', { - defaultMessage: `Kibana is configured for containerized workloads but node #start_link{nodeName}#end_link does not have resource limits configured. Fallback metric reports usage of {cpuUsage}%. Last checked at #absolute`, - values: { - nodeName: stat.nodeName, - cpuUsage: numeral(stat.cpuUsage).format(ROUNDED_FLOAT), - }, - }), - tokens, - }; - } - if (stat.unexpectedLimits) { return { text: i18n.translate('xpack.monitoring.alerts.cpuUsage.ui.unexpectedLimits', { @@ -273,12 +255,7 @@ export class CpuUsageRule extends BaseRule { private getMessage(state: AlertCpuUsageState, clusterName: string, action: string) { const stat = state.meta as AlertCpuUsageNodeStats; - if ( - stat.missingLimits || - stat.limitsChanged || - stat.unexpectedLimits || - stat.cpuUsage === undefined - ) { + if (stat.limitsChanged || stat.unexpectedLimits || stat.cpuUsage === undefined) { return i18n.translate('xpack.monitoring.alerts.cpuUsage.firing.internalMessageForFailure', { defaultMessage: `CPU usage alert for node {nodeName} in cluster {clusterName} faced issues while evaluating the usage. {action}`, values: { 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 9551b30d1c2d2..214a7c04005f5 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 @@ -126,10 +126,10 @@ describe('fetchCpuUsageNodeStats', () => { value: 45, }, quota_micros_max: { - value: -1, + value: 2000, }, quota_micros_min: { - value: -1, + value: 2000, }, name: { buckets: [ @@ -366,7 +366,6 @@ describe('fetchCpuUsageNodeStats', () => { expect(stats).toEqual([ { - missingLimits: true, clusterUuid: 'my-test-cluster', nodeId: 'my-test-node', nodeName: 'test-node', @@ -454,83 +453,5 @@ describe('fetchCpuUsageNodeStats', () => { }, ]); }); - - it('warns about failing to compute usage due to values missing', async () => { - esClient.search.mockResponse({ - aggregations: { - clusters: { - buckets: [ - { - key: 'my-test-cluster', - nodes: { - buckets: [ - { - key: 'my-test-node', - min_usage_nanos: { - value: null, - }, - max_usage_nanos: { - value: null, - }, - min_periods: { - value: null, - }, - max_periods: { - value: null, - }, - quota_micros_min: { - value: 10000, - }, - quota_micros_max: { - value: 10000, - }, - average_cpu_usage_percent: { - value: 45, - }, - name: { - buckets: [ - { - key: 'test-node', - }, - ], - }, - index: { - buckets: [ - { - key: 'a-local-index', - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - } as any); - - const stats = await fetchCpuUsageNodeStats( - { - esClient, - clusterUuids: ['my-test-cluster'], - startMs: 0, - endMs: 10, - filterQuery, - logger: loggerMock.create(), - }, - configSlice - ); - - expect(stats).toEqual([ - { - clusterUuid: 'my-test-cluster', - nodeId: 'my-test-node', - nodeName: 'test-node', - ccs: undefined, - cpuUsage: undefined, - }, - ]); - }); }); }); diff --git a/x-pack/plugins/monitoring/server/lib/alerts/fetch_cpu_usage_node_stats.ts b/x-pack/plugins/monitoring/server/lib/alerts/fetch_cpu_usage_node_stats.ts index 014c38f447e1e..5ccaa522c7368 100644 --- a/x-pack/plugins/monitoring/server/lib/alerts/fetch_cpu_usage_node_stats.ts +++ b/x-pack/plugins/monitoring/server/lib/alerts/fetch_cpu_usage_node_stats.ts @@ -14,14 +14,6 @@ import { MonitoringConfig } from '../../config'; import { getElasticsearchDataset, getIndexPatterns } from '../cluster/get_index_patterns'; import { createDatasetFilter } from './create_dataset_query_filter'; -interface CpuUsageFieldsWithValues { - 'max of node_stats.os.cgroup.cpu.cfs_quota_micros': number | null; - 'max of node_stats.os.cgroup.cpuacct.usage_nanos': number | null; - 'min of node_stats.os.cgroup.cpuacct.usage_nanos': number | null; - 'max of node_stats.os.cgroup.cpu.stat.number_of_elapsed_periods': number | null; - 'min of node_stats.os.cgroup.cpu.stat.number_of_elapsed_periods': number | null; -} - interface Options { esClient: ElasticsearchClient; clusterUuids: string[]; @@ -45,7 +37,7 @@ export async function fetchCpuUsageNodeStats( } async function fetchContainerStats( - { esClient, startMs, endMs, clusterUuids, filterQuery, logger }: Options, + { esClient, startMs, endMs, clusterUuids, filterQuery }: Options, config: MonitoringConfig ) { const indexPatterns = getIndexPatterns({ @@ -178,58 +170,34 @@ async function fetchContainerStats( ccs = index.includes(':') ? index.split(':')[0] : undefined; } - const limitsNotSet = node.quota_micros_max.value === -1 && node.quota_micros_min.value === -1; - const notRunningInAContainer = - node.quota_micros_min.value === null && node.quota_micros_max.value === null; - if (limitsNotSet || notRunningInAContainer) { - return { - missingLimits: true, - clusterUuid: cluster.key as string, - nodeId: node.key as string, - cpuUsage: node.average_cpu_usage_percent.value ?? undefined, - nodeName, - ccs, - }; - } + const nodeStats = { + clusterUuid: cluster.key as string, + nodeId: node.key as string, + nodeName, + ccs, + }; - if (node.quota_micros_min.value !== node.quota_micros_max.value) { - return { - limitsChanged: true, - clusterUuid: cluster.key as string, - nodeId: node.key as string, - cpuUsage: undefined, - nodeName, - ccs, - }; - } + const limitsNotSet = node.quota_micros_max.value === -1 && node.quota_micros_min.value === -1; if ( + limitsNotSet || node.max_usage_nanos.value === null || node.min_usage_nanos.value === null || node.max_periods.value === null || node.min_periods.value === null || node.quota_micros_max.value === null ) { - logger.warn( - `CPU usage rule: Some aggregated values needed for container CPU usage calculation was empty: ${findEmptyValues( - { - 'max of node_stats.os.cgroup.cpu.cfs_quota_micros': node.quota_micros_max.value, - 'max of node_stats.os.cgroup.cpuacct.usage_nanos': node.max_usage_nanos.value, - 'min of node_stats.os.cgroup.cpuacct.usage_nanos': node.min_usage_nanos.value, - 'max of node_stats.os.cgroup.cpu.stat.number_of_elapsed_periods': - node.max_periods.value, - 'min of node_stats.os.cgroup.cpu.stat.number_of_elapsed_periods': - node.min_periods.value, - } - )}` - ); + return { + ...nodeStats, + cpuUsage: node.average_cpu_usage_percent.value ?? undefined, + }; + } + if (node.quota_micros_min.value !== node.quota_micros_max.value) { return { - clusterUuid: cluster.key as string, - nodeId: node.key as string, + ...nodeStats, + limitsChanged: true, cpuUsage: undefined, - nodeName, - ccs, }; } @@ -243,24 +211,13 @@ async function fetchContainerStats( ); return { - clusterUuid: cluster.key as string, - nodeId: node.key as string, + ...nodeStats, cpuUsage: Math.round(cpuUsage * 100) / 100, - nodeName, - ccs, }; }); }); } -function findEmptyValues(fieldsWithValues: CpuUsageFieldsWithValues): string { - const entries: Array<[string, number | null]> = Object.entries(fieldsWithValues); - return entries - .filter(([, value]) => value === null) - .map(([key]) => key) - .join(', '); -} - function computeCfsPercentCpuUsage(usageNanos: number, quotaMicros: number, periods: number) { // See https://github.com/elastic/kibana/pull/159351 for an explanation of this formula const quotaNanos = quotaMicros * 1000; @@ -380,8 +337,9 @@ async function fetchNonContainerStats( ccs = index.includes(':') ? index.split(':')[0] : undefined; } - const runningInAContainer = - node.quota_micros_min.value !== null || node.quota_micros_max.value !== null; + const runningInAContainerWithLimits = + (node.quota_micros_min.value !== null && node.quota_micros_min.value !== -1) || + (node.quota_micros_max.value !== null && node.quota_micros_max.value !== -1); return { clusterUuid: cluster.key as string, @@ -389,7 +347,7 @@ async function fetchNonContainerStats( cpuUsage: node.average_cpu.value ?? undefined, nodeName, ccs, - unexpectedLimits: runningInAContainer, + unexpectedLimits: runningInAContainerWithLimits, }; }); }); From 1f593f4c96fb6e9eb2ca24ee366fdcae22c65f0b Mon Sep 17 00:00:00 2001 From: Tomasz Ciecierski Date: Thu, 28 Sep 2023 15:06:58 +0200 Subject: [PATCH 17/61] [EDR Workflows] FIX Cypress DW not creating Fleet server (#167378) We realized that our 'real agent' tests in DW Cypress do not run locally, because FS is not being created (normally created in a before:run task). The `before:run` task in cypress was not run. According to the [docs](https://docs.cypress.io/api/plugins/before-run-api), it requires an experimental flag `experimentalInteractiveRunEvents` enabled and it was removed in [here](https://github.com/elastic/kibana/pull/166757/files#diff-c2e90a076b73f17a80dcb5bfaf96f143d4d0de4dfaa68f5085608621a86c612dL33) --- .../public/management/cypress/cypress_base.config.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x-pack/plugins/security_solution/public/management/cypress/cypress_base.config.ts b/x-pack/plugins/security_solution/public/management/cypress/cypress_base.config.ts index e7624ed670f50..7416ef60eda19 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/cypress_base.config.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/cypress_base.config.ts @@ -59,6 +59,8 @@ export const getCypressBaseConfig = ( supportFile: 'public/management/cypress/support/e2e.ts', specPattern: 'public/management/cypress/e2e/**/*.cy.{js,jsx,ts,tsx}', experimentalRunAllSpecs: true, + experimentalMemoryManagement: true, + experimentalInteractiveRunEvents: true, setupNodeEvents: (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) => { dataLoaders(on, config); From 911ed802b736e012cf0cd91677f2c8d2ef70567c Mon Sep 17 00:00:00 2001 From: Marco Liberati Date: Thu, 28 Sep 2023 15:19:23 +0200 Subject: [PATCH 18/61] [Lens] Mute visualization modifier badge if layer has only manual annotations (#167483) ## Summary Fixes #167408 This PR reduces the amount of "visualization modifiers" in the specific case where ALL annotations in a layer are manual. The `Ignore global filters` will still be shown if at least one query-based annotation is defined in the layer. ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Stratoula Kalafateli --- .../visualizations/xy/visualization.test.tsx | 88 ++++++++++++++++++- .../visualizations/xy/visualization.tsx | 5 +- .../apps/lens/group2/layer_actions.ts | 16 ++++ 3 files changed, 104 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/lens/public/visualizations/xy/visualization.test.tsx b/x-pack/plugins/lens/public/visualizations/xy/visualization.test.tsx index c9d52d43df7ef..9024e43292939 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/visualization.test.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/visualization.test.tsx @@ -731,12 +731,14 @@ describe('xy_visualization', () => { }, }; }); + it('when there is no date histogram annotation layer is disabled', () => { const supportedAnnotationLayer = xyVisualization .getSupportedLayers(exampleState()) .find((a) => a.type === 'annotations'); expect(supportedAnnotationLayer?.disabled).toBeTruthy(); }); + it('for data with date histogram annotation layer is enabled and calculates initial dimensions', () => { const supportedAnnotationLayer = xyVisualization .getSupportedLayers(exampleState(), frame) @@ -3216,6 +3218,34 @@ describe('xy_visualization', () => { }); describe('info', () => { + function createStateWithAnnotationProps(annotation: Partial) { + return { + layers: [ + { + layerId: 'first', + layerType: layerTypes.DATA, + seriesType: 'area', + splitAccessor: undefined, + xAccessor: DATE_HISTORGRAM_COLUMN_ID, + accessors: ['b'], + }, + { + layerId: 'layerId', + layerType: 'annotations', + indexPatternId: 'first', + annotations: [ + { + label: 'Event', + id: '1', + type: 'query', + timeField: 'start_date', + ...annotation, + }, + ], + }, + ], + } as XYState; + } function getFrameMock() { const datasourceMock = createMockDatasource('testDatasource'); datasourceMock.publicAPIMock.getOperationForColumnId.mockImplementation((id) => @@ -3239,21 +3269,47 @@ describe('xy_visualization', () => { }); } - it('should return an info message if annotation layer is ignoring the global filters', () => { - const initialState = exampleState(); + it('should not return an info message if annotation layer is ignoring the global filters but contains only manual annotations', () => { + const initialState = createStateWithAnnotationProps({}); const state: State = { ...initialState, layers: [ - ...initialState.layers, + // replace the existing annotation layers with a new one + ...initialState.layers.filter(({ layerType }) => layerType !== layerTypes.ANNOTATIONS), { layerId: 'annotation', layerType: layerTypes.ANNOTATIONS, - annotations: [exampleAnnotation2], + annotations: [exampleAnnotation2, { ...exampleAnnotation2, id: 'an3' }], ignoreGlobalFilters: true, indexPatternId: 'myIndexPattern', }, ], }; + expect(xyVisualization.getUserMessages!(state, { frame: getFrameMock() })).toHaveLength(0); + }); + + it("should return an info message if the annotation layer is ignoring filters and there's at least a query annotation", () => { + const state = createStateWithAnnotationProps({ + filter: { + language: 'kuery', + query: 'agent.keyword: *', + type: 'kibana_query', + }, + id: 'newColId', + key: { + type: 'point_in_time', + }, + label: 'agent.keyword: *', + timeField: 'timestamp', + type: 'query', + }); + + const annotationLayer = state.layers.find( + ({ layerType }) => layerType === layerTypes.ANNOTATIONS + )! as XYAnnotationLayerConfig; + annotationLayer.ignoreGlobalFilters = true; + annotationLayer.annotations.push(exampleAnnotation2); + expect(xyVisualization.getUserMessages!(state, { frame: getFrameMock() })).toContainEqual( expect.objectContaining({ displayLocations: [{ id: 'embeddableBadge' }], @@ -3264,6 +3320,30 @@ describe('xy_visualization', () => { }) ); }); + + it('should not return an info message if annotation layer is not ignoring the global filters', () => { + const state = createStateWithAnnotationProps({ + filter: { + language: 'kuery', + query: 'agent.keyword: *', + type: 'kibana_query', + }, + id: 'newColId', + key: { + type: 'point_in_time', + }, + label: 'agent.keyword: *', + timeField: 'timestamp', + type: 'query', + }); + + const annotationLayer = state.layers.find( + ({ layerType }) => layerType === layerTypes.ANNOTATIONS + )! as XYAnnotationLayerConfig; + annotationLayer.ignoreGlobalFilters = false; + annotationLayer.annotations.push(exampleAnnotation2); + expect(xyVisualization.getUserMessages!(state, { frame: getFrameMock() })).toHaveLength(0); + }); }); }); diff --git a/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx b/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx index 812d74ddcb331..07ebec4c47b58 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx @@ -1149,7 +1149,10 @@ function getNotifiableFeatures( fieldFormats: FieldFormatsStart ): UserMessage[] { const annotationsWithIgnoreFlag = getAnnotationsLayers(state.layers).filter( - (layer) => layer.ignoreGlobalFilters + (layer) => + layer.ignoreGlobalFilters && + // If all annotations are manual, do not report it + layer.annotations.some((annotation) => annotation.type !== 'manual') ); if (!annotationsWithIgnoreFlag.length) { return []; diff --git a/x-pack/test/functional/apps/lens/group2/layer_actions.ts b/x-pack/test/functional/apps/lens/group2/layer_actions.ts index 1afda462402c3..77d36603c0252 100644 --- a/x-pack/test/functional/apps/lens/group2/layer_actions.ts +++ b/x-pack/test/functional/apps/lens/group2/layer_actions.ts @@ -12,6 +12,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['visualize', 'lens', 'common', 'header']); const find = getService('find'); const testSubjects = getService('testSubjects'); + const retry = getService('retry'); describe('lens layer actions tests', () => { it('should allow creation of lens xy chart', async () => { @@ -239,6 +240,21 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // by default annotations ignore global filters await PageObjects.lens.createLayer('annotations'); + await testSubjects.click('lns-layerPanel-2 > lnsXY_xAnnotationsPanel > lns-dimensionTrigger'); + + await testSubjects.click('lnsXY_annotation_query'); + + await retry.try(async () => { + if (!(await testSubjects.exists('annotation-query-based-query-input'))) { + await testSubjects.setValue('annotation-query-based-query-input', '*', { + clearWithKeyboard: true, + typeCharByChar: true, + }); + } + }); + + await PageObjects.lens.closeDimensionEditor(); + await PageObjects.lens.save('sampledVisualization', false, true, false, 'new'); // now check for the bottom-left badge From c2745d3c19291c8ceabe7830dad2922161fa55b5 Mon Sep 17 00:00:00 2001 From: Kevin Delemme Date: Thu, 28 Sep 2023 09:20:33 -0400 Subject: [PATCH 19/61] feat(slo): limit perPage in find api (#167185) --- .../observability/docs/openapi/slo/bundled.json | 3 ++- .../observability/docs/openapi/slo/bundled.yaml | 1 + .../openapi/slo/paths/s@{spaceid}@api@slos.yaml | 1 + .../server/services/slo/find_slo.test.ts | 13 +++++++++++++ .../observability/server/services/slo/find_slo.ts | 6 ++++++ 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/observability/docs/openapi/slo/bundled.json b/x-pack/plugins/observability/docs/openapi/slo/bundled.json index 559f5713e2c35..e51f3828886cf 100644 --- a/x-pack/plugins/observability/docs/openapi/slo/bundled.json +++ b/x-pack/plugins/observability/docs/openapi/slo/bundled.json @@ -160,7 +160,8 @@ "description": "The number of SLOs to return per page", "schema": { "type": "integer", - "default": 25 + "default": 25, + "maximum": 5000 }, "example": 25 }, diff --git a/x-pack/plugins/observability/docs/openapi/slo/bundled.yaml b/x-pack/plugins/observability/docs/openapi/slo/bundled.yaml index efeeb090f0156..4b0ca84bc7c52 100644 --- a/x-pack/plugins/observability/docs/openapi/slo/bundled.yaml +++ b/x-pack/plugins/observability/docs/openapi/slo/bundled.yaml @@ -99,6 +99,7 @@ paths: schema: type: integer default: 25 + maximum: 5000 example: 25 - name: sortBy in: query diff --git a/x-pack/plugins/observability/docs/openapi/slo/paths/s@{spaceid}@api@slos.yaml b/x-pack/plugins/observability/docs/openapi/slo/paths/s@{spaceid}@api@slos.yaml index 0c7559e41bb62..b606a0aac05fb 100644 --- a/x-pack/plugins/observability/docs/openapi/slo/paths/s@{spaceid}@api@slos.yaml +++ b/x-pack/plugins/observability/docs/openapi/slo/paths/s@{spaceid}@api@slos.yaml @@ -79,6 +79,7 @@ get: schema: type: integer default: 25 + maximum: 5000 example: 25 - name: sortBy in: query diff --git a/x-pack/plugins/observability/server/services/slo/find_slo.test.ts b/x-pack/plugins/observability/server/services/slo/find_slo.test.ts index c5b9d2b73d202..10436bc0fad54 100644 --- a/x-pack/plugins/observability/server/services/slo/find_slo.test.ts +++ b/x-pack/plugins/observability/server/services/slo/find_slo.test.ts @@ -138,6 +138,19 @@ describe('FindSLO', () => { `); }); }); + + describe('validation', () => { + it("throws an error when 'perPage > 5000'", async () => { + const slo = createSLO(); + mockSummarySearchClient.search.mockResolvedValueOnce(summarySearchResult(slo)); + mockRepository.findAllByIds.mockResolvedValueOnce([slo]); + + await expect(findSLO.execute({ perPage: '5000' })).resolves.not.toThrow(); + await expect(findSLO.execute({ perPage: '5001' })).rejects.toThrowError( + 'perPage limit to 5000' + ); + }); + }); }); function summarySearchResult(slo: SLO): Paginated { diff --git a/x-pack/plugins/observability/server/services/slo/find_slo.ts b/x-pack/plugins/observability/server/services/slo/find_slo.ts index b2b5bab8ee75a..cf8150db3e627 100644 --- a/x-pack/plugins/observability/server/services/slo/find_slo.ts +++ b/x-pack/plugins/observability/server/services/slo/find_slo.ts @@ -7,11 +7,13 @@ import { FindSLOParams, FindSLOResponse, findSLOResponseSchema } from '@kbn/slo-schema'; import { SLO, SLOWithSummary } from '../../domain/models'; +import { IllegalArgumentError } from '../../errors'; import { SLORepository } from './slo_repository'; import { Pagination, SLOSummary, Sort, SummarySearchClient } from './summary_search_client'; const DEFAULT_PAGE = 1; const DEFAULT_PER_PAGE = 25; +const MAX_PER_PAGE = 5000; export class FindSLO { constructor( @@ -52,6 +54,10 @@ function toPagination(params: FindSLOParams): Pagination { const page = Number(params.page); const perPage = Number(params.perPage); + if (!isNaN(perPage) && perPage > MAX_PER_PAGE) { + throw new IllegalArgumentError('perPage limit to 5000'); + } + return { page: !isNaN(page) && page >= 1 ? page : DEFAULT_PAGE, perPage: !isNaN(perPage) && perPage >= 1 ? perPage : DEFAULT_PER_PAGE, From 67cc63affe0da782f80472c53d3f259637568012 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 28 Sep 2023 09:26:55 -0400 Subject: [PATCH 20/61] skip failing test suite (#167496) From 3ad5addd8922cf16307532384c801c04f4bdd3a3 Mon Sep 17 00:00:00 2001 From: Dima Arnautov Date: Thu, 28 Sep 2023 15:46:42 +0200 Subject: [PATCH 21/61] [ML] Alerts as data integration for Anomaly Detection rule type (#166349) ## Summary Part of #165958 Replaces usage of the deprecated `alertFactory` with the new alerts client and adds alerts-as-data integration for Anomaly Detection alerting rule type. Alert instances are stored in `.alerts-ml.anomaly-detection.alerts-default` index and extends the common `AlertSchema`.
Result mappings ```json { ".internal.alerts-ml.anomaly-detection.alerts-default-000001": { "mappings": { "dynamic": "false", "_meta": { "namespace": "default", "kibana": { "version": "8.11.0" }, "managed": true }, "properties": { "@timestamp": { "type": "date" }, "event": { "properties": { "action": { "type": "keyword" }, "kind": { "type": "keyword" } } }, "kibana": { "properties": { "alert": { "properties": { "action_group": { "type": "keyword" }, "anomaly_score": { "type": "double" }, "anomaly_timestamp": { "type": "date" }, "case_ids": { "type": "keyword" }, "duration": { "properties": { "us": { "type": "long" } } }, "end": { "type": "date" }, "flapping": { "type": "boolean" }, "flapping_history": { "type": "boolean" }, "instance": { "properties": { "id": { "type": "keyword" } } }, "is_interim": { "type": "boolean" }, "job_id": { "type": "keyword" }, "last_detected": { "type": "date" }, "maintenance_window_ids": { "type": "keyword" }, "reason": { "type": "keyword" }, "rule": { "properties": { "category": { "type": "keyword" }, "consumer": { "type": "keyword" }, "execution": { "properties": { "uuid": { "type": "keyword" } } }, "name": { "type": "keyword" }, "parameters": { "type": "flattened", "ignore_above": 4096 }, "producer": { "type": "keyword" }, "revision": { "type": "long" }, "rule_type_id": { "type": "keyword" }, "tags": { "type": "keyword" }, "uuid": { "type": "keyword" } } }, "start": { "type": "date" }, "status": { "type": "keyword" }, "time_range": { "type": "date_range", "format": "epoch_millis||strict_date_optional_time" }, "top_influencers": { "type": "nested", "dynamic": "false", "properties": { "influencer_field_name": { "type": "keyword" }, "influencer_field_value": { "type": "keyword" }, "influencer_score": { "type": "double" }, "initial_influencer_score": { "type": "double" }, "is_interim": { "type": "boolean" }, "job_id": { "type": "keyword" }, "timestamp": { "type": "date" } } }, "top_records": { "type": "nested", "dynamic": "false", "properties": { "actual": { "type": "double" }, "by_field_name": { "type": "keyword" }, "by_field_value": { "type": "keyword" }, "detector_index": { "type": "integer" }, "field_name": { "type": "keyword" }, "function": { "type": "keyword" }, "initial_record_score": { "type": "double" }, "is_interim": { "type": "boolean" }, "job_id": { "type": "keyword" }, "over_field_name": { "type": "keyword" }, "over_field_value": { "type": "keyword" }, "partition_field_name": { "type": "keyword" }, "partition_field_value": { "type": "keyword" }, "record_score": { "type": "double" }, "timestamp": { "type": "date" }, "typical": { "type": "double" } } }, "url": { "type": "keyword", "index": false, "ignore_above": 2048 }, "uuid": { "type": "keyword" }, "workflow_status": { "type": "keyword" }, "workflow_tags": { "type": "keyword" } } }, "space_ids": { "type": "keyword" }, "version": { "type": "version" } } }, "tags": { "type": "keyword" } } } } } ```
### Checklist - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --- .../src/field_maps/types.ts | 2 + .../schemas/create_schema_from_field_map.ts | 1 + .../generated/ml_anomaly_detection_schema.ts | 120 +++++++++ .../src/schemas/index.ts | 5 +- .../alert_schema/context_to_schema_name.ts | 2 +- x-pack/plugins/ml/common/types/alerts.ts | 29 +++ .../ml/server/lib/alerts/alerting_service.ts | 232 ++++++++++++++---- .../register_anomaly_detection_alert_type.ts | 153 +++++++++++- x-pack/plugins/ml/tsconfig.json | 2 + .../ml_rule_types/anomaly_detection/alert.ts | 28 +++ .../alerting/group4/generate_alert_schemas.ts | 2 +- 11 files changed, 512 insertions(+), 64 deletions(-) create mode 100644 packages/kbn-alerts-as-data-utils/src/schemas/generated/ml_anomaly_detection_schema.ts diff --git a/packages/kbn-alerts-as-data-utils/src/field_maps/types.ts b/packages/kbn-alerts-as-data-utils/src/field_maps/types.ts index 04f9d045f6e28..0a0b68a2f26e6 100644 --- a/packages/kbn-alerts-as-data-utils/src/field_maps/types.ts +++ b/packages/kbn-alerts-as-data-utils/src/field_maps/types.ts @@ -34,6 +34,7 @@ export interface EcsMetadata { scaling_factor?: number; short: string; type: string; + properties?: Record; } export interface FieldMap { @@ -50,5 +51,6 @@ export interface FieldMap { path?: string; scaling_factor?: number; dynamic?: boolean | 'strict'; + properties?: Record; }; } diff --git a/packages/kbn-alerts-as-data-utils/src/schemas/create_schema_from_field_map.ts b/packages/kbn-alerts-as-data-utils/src/schemas/create_schema_from_field_map.ts index 99bbb502e1011..a0599d85fab33 100644 --- a/packages/kbn-alerts-as-data-utils/src/schemas/create_schema_from_field_map.ts +++ b/packages/kbn-alerts-as-data-utils/src/schemas/create_schema_from_field_map.ts @@ -198,6 +198,7 @@ const generateSchemaLines = ({ break; case 'float': case 'integer': + case 'double': lineWriter.addLine(`${keyToWrite}: ${getSchemaDefinition('schemaNumber', isArray)},`); break; case 'boolean': diff --git a/packages/kbn-alerts-as-data-utils/src/schemas/generated/ml_anomaly_detection_schema.ts b/packages/kbn-alerts-as-data-utils/src/schemas/generated/ml_anomaly_detection_schema.ts new file mode 100644 index 0000000000000..2e5912bca84c2 --- /dev/null +++ b/packages/kbn-alerts-as-data-utils/src/schemas/generated/ml_anomaly_detection_schema.ts @@ -0,0 +1,120 @@ +/* + * 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. + */ +// ---------------------------------- WARNING ---------------------------------- +// this file was generated, and should not be edited by hand +// ---------------------------------- WARNING ---------------------------------- +import * as rt from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { AlertSchema } from './alert_schema'; +const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/; +export const IsoDateString = new rt.Type( + 'IsoDateString', + rt.string.is, + (input, context): Either => { + if (typeof input === 'string' && ISO_DATE_PATTERN.test(input)) { + return rt.success(input); + } else { + return rt.failure(input, context); + } + }, + rt.identity +); +export type IsoDateStringC = typeof IsoDateString; +export const schemaDate = IsoDateString; +export const schemaDateArray = rt.array(IsoDateString); +export const schemaDateRange = rt.partial({ + gte: schemaDate, + lte: schemaDate, +}); +export const schemaDateRangeArray = rt.array(schemaDateRange); +export const schemaUnknown = rt.unknown; +export const schemaUnknownArray = rt.array(rt.unknown); +export const schemaString = rt.string; +export const schemaStringArray = rt.array(schemaString); +export const schemaNumber = rt.number; +export const schemaNumberArray = rt.array(schemaNumber); +export const schemaStringOrNumber = rt.union([schemaString, schemaNumber]); +export const schemaStringOrNumberArray = rt.array(schemaStringOrNumber); +export const schemaBoolean = rt.boolean; +export const schemaBooleanArray = rt.array(schemaBoolean); +const schemaGeoPointCoords = rt.type({ + type: schemaString, + coordinates: schemaNumberArray, +}); +const schemaGeoPointString = schemaString; +const schemaGeoPointLatLon = rt.type({ + lat: schemaNumber, + lon: schemaNumber, +}); +const schemaGeoPointLocation = rt.type({ + location: schemaNumberArray, +}); +const schemaGeoPointLocationString = rt.type({ + location: schemaString, +}); +export const schemaGeoPoint = rt.union([ + schemaGeoPointCoords, + schemaGeoPointString, + schemaGeoPointLatLon, + schemaGeoPointLocation, + schemaGeoPointLocationString, +]); +export const schemaGeoPointArray = rt.array(schemaGeoPoint); +// prettier-ignore +const MlAnomalyDetectionAlertRequired = rt.type({ + kibana: rt.type({ + alert: rt.type({ + job_id: schemaString, + }), + }), +}); +const MlAnomalyDetectionAlertOptional = rt.partial({ + kibana: rt.partial({ + alert: rt.partial({ + anomaly_score: schemaNumber, + anomaly_timestamp: schemaDate, + is_interim: schemaBoolean, + top_influencers: rt.array( + rt.partial({ + influencer_field_name: schemaString, + influencer_field_value: schemaString, + influencer_score: schemaNumber, + initial_influencer_score: schemaNumber, + is_interim: schemaBoolean, + job_id: schemaString, + timestamp: schemaDate, + }) + ), + top_records: rt.array( + rt.partial({ + actual: schemaNumber, + by_field_name: schemaString, + by_field_value: schemaString, + detector_index: schemaNumber, + field_name: schemaString, + function: schemaString, + initial_record_score: schemaNumber, + is_interim: schemaBoolean, + job_id: schemaString, + over_field_name: schemaString, + over_field_value: schemaString, + partition_field_name: schemaString, + partition_field_value: schemaString, + record_score: schemaNumber, + timestamp: schemaDate, + typical: schemaNumber, + }) + ), + }), + }), +}); + +// prettier-ignore +export const MlAnomalyDetectionAlertSchema = rt.intersection([MlAnomalyDetectionAlertRequired, MlAnomalyDetectionAlertOptional, AlertSchema]); +// prettier-ignore +export type MlAnomalyDetectionAlert = rt.TypeOf; diff --git a/packages/kbn-alerts-as-data-utils/src/schemas/index.ts b/packages/kbn-alerts-as-data-utils/src/schemas/index.ts index 77d9476d2034b..28da937087cf1 100644 --- a/packages/kbn-alerts-as-data-utils/src/schemas/index.ts +++ b/packages/kbn-alerts-as-data-utils/src/schemas/index.ts @@ -13,6 +13,7 @@ import type { ObservabilityMetricsAlert } from './generated/observability_metric import type { ObservabilitySloAlert } from './generated/observability_slo_schema'; import type { ObservabilityUptimeAlert } from './generated/observability_uptime_schema'; import type { SecurityAlert } from './generated/security_schema'; +import type { MlAnomalyDetectionAlert } from './generated/ml_anomaly_detection_schema'; export * from './create_schema_from_field_map'; @@ -24,6 +25,7 @@ export type { ObservabilitySloAlert } from './generated/observability_slo_schema export type { ObservabilityUptimeAlert } from './generated/observability_uptime_schema'; export type { SecurityAlert } from './generated/security_schema'; export type { StackAlert } from './generated/stack_schema'; +export type { MlAnomalyDetectionAlert } from './generated/ml_anomaly_detection_schema'; export type AADAlert = | Alert @@ -32,4 +34,5 @@ export type AADAlert = | ObservabilityMetricsAlert | ObservabilitySloAlert | ObservabilityUptimeAlert - | SecurityAlert; + | SecurityAlert + | MlAnomalyDetectionAlert; diff --git a/x-pack/plugins/alerting/common/alert_schema/context_to_schema_name.ts b/x-pack/plugins/alerting/common/alert_schema/context_to_schema_name.ts index 52435b05dbaff..e2268f5e1429f 100644 --- a/x-pack/plugins/alerting/common/alert_schema/context_to_schema_name.ts +++ b/x-pack/plugins/alerting/common/alert_schema/context_to_schema_name.ts @@ -9,7 +9,7 @@ import { capitalize } from 'lodash'; export const contextToSchemaName = (context: string) => { return `${context - .split('.') + .split(/[.\-]/) .map((part: string) => capitalize(part)) .join('')}Alert`; }; diff --git a/x-pack/plugins/ml/common/types/alerts.ts b/x-pack/plugins/ml/common/types/alerts.ts index 267096e105ef6..12bae1a9d3d16 100644 --- a/x-pack/plugins/ml/common/types/alerts.ts +++ b/x-pack/plugins/ml/common/types/alerts.ts @@ -44,6 +44,35 @@ interface BaseAnomalyAlertDoc { unique_key: string; } +export interface TopRecordAADDoc { + job_id: string; + record_score: number; + initial_record_score: number; + timestamp: number; + is_interim: boolean; + function: string; + field_name?: string; + by_field_name?: string; + by_field_value?: string | number; + over_field_name?: string; + over_field_value?: string | number; + partition_field_name?: string; + partition_field_value?: string | number; + typical: number[]; + actual: number[]; + detector_index: number; +} + +export interface TopInfluencerAADDoc { + job_id: string; + influencer_score: number; + initial_influencer_score: number; + is_interim: boolean; + timestamp: number; + influencer_field_name: string; + influencer_field_value: string | number; +} + export interface RecordAnomalyAlertDoc extends BaseAnomalyAlertDoc { result_type: typeof ML_ANOMALY_RESULT_TYPE.RECORD; function: string; diff --git a/x-pack/plugins/ml/server/lib/alerts/alerting_service.ts b/x-pack/plugins/ml/server/lib/alerts/alerting_service.ts index 18be37a187c44..dc85428a63386 100644 --- a/x-pack/plugins/ml/server/lib/alerts/alerting_service.ts +++ b/x-pack/plugins/ml/server/lib/alerts/alerting_service.ts @@ -9,7 +9,7 @@ import Boom from '@hapi/boom'; import { i18n } from '@kbn/i18n'; import rison from '@kbn/rison'; import type { Duration } from 'moment/moment'; -import { memoize } from 'lodash'; +import { memoize, pick } from 'lodash'; import { FIELD_FORMAT_IDS, type IFieldFormat, @@ -24,6 +24,7 @@ import { ML_ANOMALY_RESULT_TYPE, } from '@kbn/ml-anomaly-utils'; import { DEFAULT_SPACE_ID } from '@kbn/spaces-plugin/common'; +import { ALERT_REASON, ALERT_URL } from '@kbn/rule-data-utils'; import type { MlClient } from '../ml_client'; import type { MlAnomalyDetectionAlertParams, @@ -36,8 +37,13 @@ import type { PreviewResultsKeys, RecordAnomalyAlertDoc, TopHitsResultsKeys, + TopInfluencerAADDoc, + TopRecordAADDoc, } from '../../../common/types/alerts'; -import type { AnomalyDetectionAlertContext } from './register_anomaly_detection_alert_type'; +import type { + AnomalyDetectionAlertContext, + AnomalyDetectionAlertPayload, +} from './register_anomaly_detection_alert_type'; import { resolveMaxTimeInterval } from '../../../common/util/job_utils'; import { getTopNBuckets, resolveLookbackInterval } from '../../../common/util/alerts'; import type { DatafeedsService } from '../../models/job_service/datafeeds'; @@ -391,12 +397,89 @@ export function alertingServiceProvider( return alertInstanceKey; }; + /** + * Returns a callback for formatting elasticsearch aggregation response + * to the alert-as-data document. + * @param resultType + */ + const getResultsToPayloadFormatter = ( + resultType: MlAnomalyResultType, + useInitialScore: boolean = false + ) => { + const resultsLabel = getAggResultsLabel(resultType); + + return ( + v: AggResultsResponse + ): Omit | undefined => { + const aggTypeResults = v[resultsLabel.aggGroupLabel]; + if (aggTypeResults.doc_count === 0) { + return; + } + const requestedAnomalies = aggTypeResults[resultsLabel.topHitsLabel].hits.hits; + const topAnomaly = requestedAnomalies[0]; + const timestamp = topAnomaly._source.timestamp; + + return { + [ALERT_REASON]: i18n.translate( + 'xpack.ml.alertTypes.anomalyDetectionAlertingRule.alertMessage', + { + defaultMessage: + 'Alerts are raised based on real-time scores. Remember that scores may be adjusted over time as data continues to be analyzed.', + } + ), + job_id: [...new Set(requestedAnomalies.map((h) => h._source.job_id))][0], + is_interim: requestedAnomalies.some((h) => h._source.is_interim), + anomaly_timestamp: timestamp, + anomaly_score: topAnomaly._source[getScoreFields(resultType, useInitialScore)], + top_records: v.record_results.top_record_hits.hits.hits.map((h) => { + const { actual, typical } = getTypicalAndActualValues(h._source); + return pick( + { + ...h._source, + typical, + actual, + }, + [ + 'job_id', + 'record_score', + 'initial_record_score', + 'detector_index', + 'is_interim', + 'timestamp', + 'partition_field_name', + 'partition_field_value', + 'function', + 'actual', + 'typical', + ] + ) as TopRecordAADDoc; + }) as TopRecordAADDoc[], + top_influencers: v.influencer_results.top_influencer_hits.hits.hits.map((influencerDoc) => { + return pick( + { + ...influencerDoc._source, + }, + [ + 'job_id', + 'influencer_field_name', + 'influencer_field_value', + 'influencer_score', + 'initial_influencer_score', + 'is_interim', + 'timestamp', + ] + ) as TopInfluencerAADDoc; + }) as TopInfluencerAADDoc[], + }; + }; + }; + /** * Returns a callback for formatting elasticsearch aggregation response * to the alert context. * @param resultType */ - const getResultsFormatter = ( + const getResultsToContextFormatter = ( resultType: MlAnomalyResultType, useInitialScore: boolean = false, formatters: FieldFormatters @@ -468,7 +551,7 @@ export function alertingServiceProvider( * @param previewTimeInterval - Relative time interval to test the alert condition * @param checkIntervalGap - Interval between alert executions */ - const fetchAnomalies = async ( + const fetchPreviewResults = async ( params: MlAnomalyDetectionAlertParams, previewTimeInterval?: string, checkIntervalGap?: Duration @@ -570,7 +653,7 @@ export function alertingServiceProvider( const fieldsFormatters = await getFormatters(datafeeds![0]!.indices[0]); - const formatter = getResultsFormatter( + const formatter = getResultsToContextFormatter( params.resultType, !!previewTimeInterval, fieldsFormatters @@ -660,7 +743,7 @@ export function alertingServiceProvider( */ const fetchResult = async ( params: AnomalyESQueryParams - ): Promise => { + ): Promise => { const { resultType, jobIds, @@ -670,7 +753,6 @@ export function alertingServiceProvider( anomalyScoreField, includeInterimResults, anomalyScoreThreshold, - indexPattern, } = params; const requestBody = { @@ -761,9 +843,44 @@ export function alertingServiceProvider( prev.max_score.value > current.max_score.value ? prev : current ); + return topResult; + }; + + const getFormatted = async ( + indexPattern: string, + resultType: MlAnomalyDetectionAlertParams['resultType'], + spaceId: string, + value: AggResultsResponse + ): Promise< + | { payload: AnomalyDetectionAlertPayload; context: AnomalyDetectionAlertContext; name: string } + | undefined + > => { const formatters = await getFormatters(indexPattern); - return getResultsFormatter(params.resultType, false, formatters)(topResult); + const context = getResultsToContextFormatter(resultType, false, formatters)(value); + const payload = getResultsToPayloadFormatter(resultType, false)(value); + + if (!context || !payload) return; + + const anomalyExplorerUrl = buildExplorerUrl( + context.jobIds, + { from: context.bucketRange.start, to: context.bucketRange.end }, + resultType, + spaceId, + context + ); + + return { + payload: { + ...payload, + [ALERT_URL]: anomalyExplorerUrl, + }, + context: { + ...context, + anomalyExplorerUrl, + }, + name: context.alertInstanceKey, + }; }; return { @@ -777,7 +894,13 @@ export function alertingServiceProvider( params: MlAnomalyDetectionAlertParams, spaceId: string ): Promise< - { context: AnomalyDetectionAlertContext; name: string; isHealthy: boolean } | undefined + | { + payload: AnomalyDetectionAlertPayload; + context: AnomalyDetectionAlertContext; + name: string; + isHealthy: boolean; + } + | undefined > => { const queryParams = await getQueryParams(params); @@ -787,50 +910,57 @@ export function alertingServiceProvider( const result = await fetchResult(queryParams); - if (result) { - const anomalyExplorerUrl = buildExplorerUrl( - result.jobIds, - { from: result.bucketRange.start, to: result.bucketRange.end }, - params.resultType, - spaceId, - result + const formattedResult = result + ? await getFormatted(queryParams.indexPattern, queryParams.resultType, spaceId, result) + : undefined; + + if (!formattedResult) { + // If no anomalies found, report as recovered. + + const url = buildExplorerUrl( + queryParams.jobIds, + { + from: `now-${queryParams.lookBackTimeInterval}`, + to: 'now', + mode: 'relative', + }, + queryParams.resultType, + spaceId ); - const executionResult = { - ...result, - anomalyExplorerUrl, - }; + const message = i18n.translate( + 'xpack.ml.alertTypes.anomalyDetectionAlertingRule.recoveredMessage', + { + defaultMessage: + 'No anomalies have been found in the past {lookbackInterval} that exceed the severity threshold of {severity}.', + values: { + severity: queryParams.anomalyScoreThreshold, + lookbackInterval: queryParams.lookBackTimeInterval, + }, + } + ); - return { context: executionResult, name: result.alertInstanceKey, isHealthy: false }; + return { + name: '', + isHealthy: true, + payload: { + [ALERT_URL]: url, + [ALERT_REASON]: message, + job_id: queryParams.jobIds[0], + }, + context: { + anomalyExplorerUrl: url, + jobIds: queryParams.jobIds, + message, + } as AnomalyDetectionAlertContext, + }; } return { - name: '', - isHealthy: true, - context: { - anomalyExplorerUrl: buildExplorerUrl( - queryParams.jobIds, - { - from: `now-${queryParams.lookBackTimeInterval}`, - to: 'now', - mode: 'relative', - }, - queryParams.resultType, - spaceId - ), - jobIds: queryParams.jobIds, - message: i18n.translate( - 'xpack.ml.alertTypes.anomalyDetectionAlertingRule.recoveredMessage', - { - defaultMessage: - 'No anomalies have been found in the past {lookbackInterval} that exceed the severity threshold of {severity}.', - values: { - severity: queryParams.anomalyScoreThreshold, - lookbackInterval: queryParams.lookBackTimeInterval, - }, - } - ), - } as AnomalyDetectionAlertContext, + context: formattedResult.context, + payload: formattedResult.payload, + name: formattedResult.name, + isHealthy: false, }; }, /** @@ -844,16 +974,16 @@ export function alertingServiceProvider( timeRange, sampleSize, }: MlAnomalyDetectionAlertPreviewRequest): Promise => { - const res = await fetchAnomalies(alertParams, timeRange); + const previewResults = await fetchPreviewResults(alertParams, timeRange); - if (!res) { + if (!previewResults) { throw Boom.notFound(`No results found`); } return { // sum of all alert responses within the time range - count: res.length, - results: res.slice(0, sampleSize), + count: previewResults.length, + results: previewResults.slice(0, sampleSize), }; }, }; diff --git a/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts b/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts index 2a1f19b48802e..2935643348f76 100644 --- a/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts +++ b/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts @@ -11,8 +11,15 @@ import type { ActionGroup, AlertInstanceContext, AlertInstanceState, + RuleTypeParams, RuleTypeState, + RecoveredActionGroupId, } from '@kbn/alerting-plugin/common'; +import { IRuleTypeAlerts, RuleExecutorOptions } from '@kbn/alerting-plugin/server'; +import { ALERT_NAMESPACE, ALERT_REASON, ALERT_URL } from '@kbn/rule-data-utils'; +import { MlAnomalyDetectionAlert } from '@kbn/alerts-as-data-utils'; +import { ES_FIELD_TYPES } from '@kbn/field-types'; +import { expandFlattenedAlert } from '@kbn/alerting-plugin/server/alerts_client/lib'; import { ML_ALERT_TYPES } from '../../../common/constants/alerts'; import { PLUGIN_ID } from '../../../common/constants/app'; import { MINIMUM_FULL_LICENSE } from '../../../common/license'; @@ -36,6 +43,19 @@ export type AnomalyDetectionAlertBaseContext = AlertInstanceContext & { message: string; }; +// Flattened alert payload for alert-as-data +export type AnomalyDetectionAlertPayload = { + job_id: string; + anomaly_score?: number; + is_interim?: boolean; + anomaly_timestamp?: number; + top_records?: any; + top_influencers?: any; +} & { + [ALERT_URL]: string; + [ALERT_REASON]: string; +}; + export type AnomalyDetectionAlertContext = AnomalyDetectionAlertBaseContext & { timestampIso8601: string; timestamp: number; @@ -45,10 +65,88 @@ export type AnomalyDetectionAlertContext = AnomalyDetectionAlertBaseContext & { topInfluencers?: InfluencerAnomalyAlertDoc[]; }; +export type ExecutorOptions

= RuleExecutorOptions< + P, + RuleTypeState, + {}, + AnomalyDetectionAlertContext, + typeof ANOMALY_SCORE_MATCH_GROUP_ID, + MlAnomalyDetectionAlert +>; + export const ANOMALY_SCORE_MATCH_GROUP_ID = 'anomaly_score_match'; export type AnomalyScoreMatchGroupId = typeof ANOMALY_SCORE_MATCH_GROUP_ID; +export const ANOMALY_DETECTION_AAD_INDEX_NAME = 'ml.anomaly-detection'; + +const ML_ALERT_NAMESPACE = ALERT_NAMESPACE; + +export const ALERT_ANOMALY_DETECTION_JOB_ID = `${ML_ALERT_NAMESPACE}.job_id` as const; + +export const ALERT_ANOMALY_SCORE = `${ML_ALERT_NAMESPACE}.anomaly_score` as const; +export const ALERT_ANOMALY_IS_INTERIM = `${ML_ALERT_NAMESPACE}.is_interim` as const; +export const ALERT_ANOMALY_TIMESTAMP = `${ML_ALERT_NAMESPACE}.anomaly_timestamp` as const; + +export const ALERT_TOP_RECORDS = `${ML_ALERT_NAMESPACE}.top_records` as const; +export const ALERT_TOP_INFLUENCERS = `${ML_ALERT_NAMESPACE}.top_influencers` as const; + +export const ANOMALY_DETECTION_AAD_CONFIG: IRuleTypeAlerts = { + context: ANOMALY_DETECTION_AAD_INDEX_NAME, + mappings: { + fieldMap: { + [ALERT_ANOMALY_DETECTION_JOB_ID]: { + type: ES_FIELD_TYPES.KEYWORD, + array: false, + required: true, + }, + [ALERT_ANOMALY_SCORE]: { type: ES_FIELD_TYPES.DOUBLE, array: false, required: false }, + [ALERT_ANOMALY_IS_INTERIM]: { type: ES_FIELD_TYPES.BOOLEAN, array: false, required: false }, + [ALERT_ANOMALY_TIMESTAMP]: { type: ES_FIELD_TYPES.DATE, array: false, required: false }, + [ALERT_TOP_RECORDS]: { + type: ES_FIELD_TYPES.OBJECT, + array: true, + required: false, + dynamic: false, + properties: { + job_id: { type: ES_FIELD_TYPES.KEYWORD }, + record_score: { type: ES_FIELD_TYPES.DOUBLE }, + initial_record_score: { type: ES_FIELD_TYPES.DOUBLE }, + detector_index: { type: ES_FIELD_TYPES.INTEGER }, + is_interim: { type: ES_FIELD_TYPES.BOOLEAN }, + timestamp: { type: ES_FIELD_TYPES.DATE }, + partition_field_name: { type: ES_FIELD_TYPES.KEYWORD }, + partition_field_value: { type: ES_FIELD_TYPES.KEYWORD }, + over_field_name: { type: ES_FIELD_TYPES.KEYWORD }, + over_field_value: { type: ES_FIELD_TYPES.KEYWORD }, + by_field_name: { type: ES_FIELD_TYPES.KEYWORD }, + by_field_value: { type: ES_FIELD_TYPES.KEYWORD }, + function: { type: ES_FIELD_TYPES.KEYWORD }, + typical: { type: ES_FIELD_TYPES.DOUBLE }, + actual: { type: ES_FIELD_TYPES.DOUBLE }, + field_name: { type: ES_FIELD_TYPES.KEYWORD }, + }, + }, + [ALERT_TOP_INFLUENCERS]: { + type: ES_FIELD_TYPES.OBJECT, + array: true, + required: false, + dynamic: false, + properties: { + job_id: { type: ES_FIELD_TYPES.KEYWORD }, + influencer_field_name: { type: ES_FIELD_TYPES.KEYWORD }, + influencer_field_value: { type: ES_FIELD_TYPES.KEYWORD }, + influencer_score: { type: ES_FIELD_TYPES.DOUBLE }, + initial_influencer_score: { type: ES_FIELD_TYPES.DOUBLE }, + is_interim: { type: ES_FIELD_TYPES.BOOLEAN }, + timestamp: { type: ES_FIELD_TYPES.DATE }, + }, + }, + }, + }, + shouldWrite: true, +}; + export const THRESHOLD_MET_GROUP: ActionGroup = { id: ANOMALY_SCORE_MATCH_GROUP_ID, name: i18n.translate('xpack.ml.anomalyDetectionAlert.actionGroupName', { @@ -66,7 +164,9 @@ export function registerAnomalyDetectionAlertType({ RuleTypeState, AlertInstanceState, AnomalyDetectionAlertContext, - AnomalyScoreMatchGroupId + AnomalyScoreMatchGroupId, + RecoveredActionGroupId, + MlAnomalyDetectionAlert >({ id: ML_ALERT_TYPES.ANOMALY_DETECTION, name: i18n.translate('xpack.ml.anomalyDetectionAlert.name', { @@ -140,29 +240,62 @@ export function registerAnomalyDetectionAlertType({ minimumLicenseRequired: MINIMUM_FULL_LICENSE, isExportable: true, doesSetRecoveryContext: true, - async executor({ services, params, spaceId }) { + executor: async ({ + services, + params, + spaceId, + }: ExecutorOptions) => { const fakeRequest = {} as KibanaRequest; const { execute } = mlSharedServices.alertingServiceProvider( services.savedObjectsClient, fakeRequest ); + + const { alertsClient } = services; + if (!alertsClient) return { state: {} }; + const executionResult = await execute(params, spaceId); - if (executionResult && !executionResult.isHealthy) { - const alertInstanceName = executionResult.name; - const alertInstance = services.alertFactory.create(alertInstanceName); - alertInstance.scheduleActions(ANOMALY_SCORE_MATCH_GROUP_ID, executionResult.context); + if (!executionResult) return { state: {} }; + + const { isHealthy, name, context, payload } = executionResult; + + if (!isHealthy) { + alertsClient.report({ + id: name, + actionGroup: ANOMALY_SCORE_MATCH_GROUP_ID, + context, + payload: expandFlattenedAlert({ + [ALERT_URL]: payload[ALERT_URL], + [ALERT_REASON]: payload[ALERT_REASON], + [ALERT_ANOMALY_DETECTION_JOB_ID]: payload.job_id, + [ALERT_ANOMALY_SCORE]: payload.anomaly_score, + [ALERT_ANOMALY_IS_INTERIM]: payload.is_interim, + [ALERT_ANOMALY_TIMESTAMP]: payload.anomaly_timestamp, + [ALERT_TOP_RECORDS]: payload.top_records, + [ALERT_TOP_INFLUENCERS]: payload.top_influencers, + }), + }); } // Set context for recovered alerts - const { getRecoveredAlerts } = services.alertFactory.done(); - for (const recoveredAlert of getRecoveredAlerts()) { - if (!!executionResult?.isHealthy) { - recoveredAlert.setContext(executionResult.context); + for (const recoveredAlert of alertsClient.getRecoveredAlerts()) { + if (isHealthy) { + const alertId = recoveredAlert.alert.getId(); + alertsClient.setAlertData({ + id: alertId, + context, + payload: expandFlattenedAlert({ + [ALERT_URL]: payload[ALERT_URL], + [ALERT_REASON]: payload[ALERT_REASON], + [ALERT_ANOMALY_DETECTION_JOB_ID]: payload.job_id, + }), + }); } } return { state: {} }; }, + alerts: ANOMALY_DETECTION_AAD_CONFIG, }); } diff --git a/x-pack/plugins/ml/tsconfig.json b/x-pack/plugins/ml/tsconfig.json index 7962e2dd27296..4a0077770808a 100644 --- a/x-pack/plugins/ml/tsconfig.json +++ b/x-pack/plugins/ml/tsconfig.json @@ -106,5 +106,7 @@ "@kbn/react-kibana-mount", "@kbn/core-http-browser", "@kbn/data-view-editor-plugin", + "@kbn/rule-data-utils", + "@kbn/alerts-as-data-utils", ], } diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/ml_rule_types/anomaly_detection/alert.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/ml_rule_types/anomaly_detection/alert.ts index 1c970174ad3a2..941f663bb6284 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/ml_rule_types/anomaly_detection/alert.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/ml_rule_types/anomaly_detection/alert.ts @@ -23,6 +23,8 @@ const ES_TEST_INDEX_SOURCE = 'ml-alert:anomaly-detection'; const ES_TEST_INDEX_REFERENCE = '-na-'; const ES_TEST_OUTPUT_INDEX_NAME = `${ES_TEST_INDEX_NAME}-ad-alert-output`; +const AAD_INDEX = '.alerts-ml.anomaly-detection.alerts-default'; + const ALERT_INTERVAL_SECONDS = 3; const AD_JOB_ID = 'rt-anomaly-mean-value'; @@ -144,6 +146,18 @@ export default function alertTests({ getService }: FtrProviderContext) { '/s/space1/app/ml/explorer/?_g=(ml%3A(jobIds%3A!(rt-anomaly-mean-value))' ); } + + log.debug('Checking docs in the alerts-as-data index...'); + + const aadDocs = await waitForAAD(1); + + for (const doc of aadDocs) { + const { job_id: jobId, url } = doc._source.kibana.alert; + expect(jobId).to.be(AD_JOB_ID); + expect(url).to.contain( + '/s/space1/app/ml/explorer/?_g=(ml%3A(jobIds%3A!(rt-anomaly-mean-value))' + ); + } }); async function waitForDocs(count: number): Promise { @@ -154,6 +168,20 @@ export default function alertTests({ getService }: FtrProviderContext) { ); } + async function waitForAAD(numDocs: number): Promise { + return await retry.try(async () => { + const searchResult = await es.search({ index: AAD_INDEX, size: 1000 }); + + // @ts-expect-error doesn't handle total: number + const value = searchResult.hits.total.value?.value || searchResult.hits.total.value; + if (value < numDocs) { + // @ts-expect-error doesn't handle total: number + throw new Error(`Expected ${numDocs} but received ${searchResult.hits.total.value}.`); + } + return searchResult.hits.hits; + }); + } + async function createAlert({ name, ...params diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/generate_alert_schemas.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/generate_alert_schemas.ts index 478a9b17a21f5..51b1adc7526a9 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/generate_alert_schemas.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/generate_alert_schemas.ts @@ -71,7 +71,7 @@ export default function checkAlertSchemasTest({ getService }: FtrProviderContext createSchemaFromFieldMap({ outputFile: `schemas/generated/${alertsDefinition.context.replaceAll( - '.', + /[.\-]/g, '_' )}_schema.ts`, fieldMap: alertsDefinition.mappings.fieldMap, From e6e3e2d1880df695e177c5568941c1f546ced38b Mon Sep 17 00:00:00 2001 From: Patrick Mueller Date: Thu, 28 Sep 2023 09:47:17 -0400 Subject: [PATCH 22/61] [ResponseOps] resolve conflicts when updating alert docs after rule execution (#166283) resolves: #158403 When conflicts are detected while updating alert docs after a rule runs, we'll try to resolve the conflict by `mget()`'ing the alert documents again, to get the updated OCC info `_seq_no` and `_primary_term`. We'll also get the current versions of "ad-hoc" updated fields (which caused the conflict), like workflow status, case assignments, etc. And then attempt to update the alert doc again, with that info, which should get it back up-to-date. Note that the rule registry was not touched here. During this PR's development, I added the retry support to it, but then my function tests were failing because there were never any conflicts happening. Turns out rule registry mget's the alerts before it updates them, to get the latest values. So they won't need this fix. It's also not clear to me if this can be exercised in serverless, since it requires the use of an alerting framework based AaD implementation AND the ability to ad-hoc update alerts. I think this can only be done with Elasticsearch Query and Index Threshold, and only when used in metrics scope, so it will show up in the metrics UX, which is where you can add the alerts to the case. ## manual testing It's hard! I've seen the conflict messages before, but it's quite difficult to get them to go off whenever you want. The basic idea is to get a rule that uses alerting framework AAD (not rule registry, which is not affected the same way with conflicts (they mget alerts right before updating them), set it to run on a `1s` interval, and probably also configure TM to run a `1s` interval, via the following configs: ``` xpack.alerting.rules.minimumScheduleInterval.value: "1s" xpack.task_manager.poll_interval: 1000 ``` You want to get the rule to execute often and generate a lot of alerts, and run for as long as possible. Then while it's running, add the generated alerts to cases. Here's the EQ rule definition I used: ![image](https://github.com/elastic/kibana/assets/25117/56c69d50-a76c-48d4-9a45-665a0008b248) I selected the alerts from the o11y alerts page, since you can't add alerts to cases from the stack page. Hmm. :-). Sort the alert list by low-high duration, so the newest alerts will be at the top. Refresh, select all the rules (set page to show 100), then add to case from the `...` menu. If you force a conflict, you should see something like this in the Kibana logs: ``` [ERROR] [plugins.alerting] Error writing alerts: 168 successful, 100 conflicts, 0 errors: [INFO ] [plugins.alerting] Retrying bulk update of 100 conflicted alerts [INFO ] [plugins.alerting] Retried bulk update of 100 conflicted alerts succeeded ``` --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../alerts_client/alerts_client.test.ts | 2 +- .../server/alerts_client/alerts_client.ts | 21 +- .../lib/alert_conflict_resolver.test.ts | 307 ++++++++++++++++++ .../lib/alert_conflict_resolver.ts | 288 ++++++++++++++++ .../plugins/alerts/server/alert_types.ts | 133 +++++++- .../common/plugins/alerts/server/plugin.ts | 3 + .../packages/helpers/es_test_index_tool.ts | 11 + .../alerts_as_data_conflicts.ts | 284 ++++++++++++++++ .../alerting/group4/alerts_as_data/index.ts | 1 + 9 files changed, 1039 insertions(+), 11 deletions(-) create mode 100644 x-pack/plugins/alerting/server/alerts_client/lib/alert_conflict_resolver.test.ts create mode 100644 x-pack/plugins/alerting/server/alerts_client/lib/alert_conflict_resolver.ts create mode 100644 x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/alerts_as_data/alerts_as_data_conflicts.ts diff --git a/x-pack/plugins/alerting/server/alerts_client/alerts_client.test.ts b/x-pack/plugins/alerting/server/alerts_client/alerts_client.test.ts index a5378245b7a02..6fc742e344758 100644 --- a/x-pack/plugins/alerting/server/alerts_client/alerts_client.test.ts +++ b/x-pack/plugins/alerting/server/alerts_client/alerts_client.test.ts @@ -1299,7 +1299,7 @@ describe('Alerts Client', () => { expect(clusterClient.bulk).toHaveBeenCalled(); expect(logger.error).toHaveBeenCalledWith( - `Error writing 1 out of 2 alerts - [{\"type\":\"action_request_validation_exception\",\"reason\":\"Validation Failed: 1: index is missing;2: type is missing;\"}]` + `Error writing alerts: 1 successful, 0 conflicts, 1 errors: Validation Failed: 1: index is missing;2: type is missing;` ); }); diff --git a/x-pack/plugins/alerting/server/alerts_client/alerts_client.ts b/x-pack/plugins/alerting/server/alerts_client/alerts_client.ts index 8164989761af7..eec5d3c5595bd 100644 --- a/x-pack/plugins/alerting/server/alerts_client/alerts_client.ts +++ b/x-pack/plugins/alerting/server/alerts_client/alerts_client.ts @@ -55,6 +55,7 @@ import { getContinualAlertsQuery, } from './lib'; import { isValidAlertIndexName } from '../alerts_service'; +import { resolveAlertConflicts } from './lib/alert_conflict_resolver'; // Term queries can take up to 10,000 terms const CHUNK_SIZE = 10000; @@ -467,15 +468,17 @@ export class AlertsClient< // If there were individual indexing errors, they will be returned in the success response if (response && response.errors) { - const errorsInResponse = (response.items ?? []) - .map((item) => item?.index?.error || item?.create?.error) - .filter((item) => item != null); - - this.options.logger.error( - `Error writing ${errorsInResponse.length} out of ${ - alertsToIndex.length - } alerts - ${JSON.stringify(errorsInResponse)}` - ); + await resolveAlertConflicts({ + logger: this.options.logger, + esClient, + bulkRequest: { + refresh: 'wait_for', + index: this.indexTemplateAndPattern.alias, + require_alias: !this.isUsingDataStreams(), + operations: bulkBody, + }, + bulkResponse: response, + }); } } catch (err) { this.options.logger.error( diff --git a/x-pack/plugins/alerting/server/alerts_client/lib/alert_conflict_resolver.test.ts b/x-pack/plugins/alerting/server/alerts_client/lib/alert_conflict_resolver.test.ts new file mode 100644 index 0000000000000..ffa2adc96f54f --- /dev/null +++ b/x-pack/plugins/alerting/server/alerts_client/lib/alert_conflict_resolver.test.ts @@ -0,0 +1,307 @@ +/* + * 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/server/mocks'; +import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; +import { + BulkRequest, + BulkResponse, + BulkResponseItem, + BulkOperationType, +} from '@elastic/elasticsearch/lib/api/types'; + +import { resolveAlertConflicts } from './alert_conflict_resolver'; + +const logger = loggingSystemMock.create().get(); +const esClient = elasticsearchServiceMock.createElasticsearchClient(); + +const alertDoc = { + event: { action: 'active' }, + kibana: { + alert: { + status: 'untracked', + workflow_status: 'a-ok!', + workflow_tags: ['fee', 'fi', 'fo', 'fum'], + case_ids: ['123', '456', '789'], + }, + }, +}; + +describe('alert_conflict_resolver', () => { + beforeEach(() => { + jest.resetAllMocks(); + }); + + describe('handles errors gracefully', () => { + test('when mget fails', async () => { + const { bulkRequest, bulkResponse } = getReqRes('ic'); + + esClient.mget.mockRejectedValueOnce(new Error('mget failed')); + + await resolveAlertConflicts({ logger, esClient, bulkRequest, bulkResponse }); + + expect(logger.error).toHaveBeenNthCalledWith( + 2, + 'Error resolving alert conflicts: mget failed' + ); + }); + + test('when bulk fails', async () => { + const { bulkRequest, bulkResponse } = getReqRes('ic'); + + esClient.mget.mockResolvedValueOnce({ + docs: [getMGetResDoc(0, alertDoc)], + }); + esClient.bulk.mockRejectedValueOnce(new Error('bulk failed')); + + await resolveAlertConflicts({ logger, esClient, bulkRequest, bulkResponse }); + + expect(logger.error).toHaveBeenNthCalledWith( + 2, + 'Error resolving alert conflicts: bulk failed' + ); + }); + }); + + describe('is successful with', () => { + test('no bulk results', async () => { + const { bulkRequest, bulkResponse } = getReqRes(''); + await resolveAlertConflicts({ logger, esClient, bulkRequest, bulkResponse }); + expect(logger.error).not.toHaveBeenCalled(); + }); + + test('no errors in bulk results', async () => { + const { bulkRequest, bulkResponse } = getReqRes('c is is c is'); + await resolveAlertConflicts({ logger, esClient, bulkRequest, bulkResponse }); + expect(logger.error).not.toHaveBeenCalled(); + }); + + test('one conflicted doc', async () => { + const { bulkRequest, bulkResponse } = getReqRes('ic'); + + esClient.mget.mockResolvedValueOnce({ + docs: [getMGetResDoc(0, alertDoc)], + }); + + esClient.bulk.mockResolvedValueOnce({ + errors: false, + took: 0, + items: [getBulkResItem(0)], + }); + + await resolveAlertConflicts({ logger, esClient, bulkRequest, bulkResponse }); + + expect(logger.error).toHaveBeenNthCalledWith( + 1, + `Error writing alerts: 0 successful, 1 conflicts, 0 errors: ` + ); + expect(logger.info).toHaveBeenNthCalledWith(1, `Retrying bulk update of 1 conflicted alerts`); + expect(logger.info).toHaveBeenNthCalledWith( + 2, + `Retried bulk update of 1 conflicted alerts succeeded` + ); + }); + + test('one conflicted doc amonst other successes and errors', async () => { + const { bulkRequest, bulkResponse } = getReqRes('is c ic ie'); + + esClient.mget.mockResolvedValueOnce({ + docs: [getMGetResDoc(2, alertDoc)], + }); + + esClient.bulk.mockResolvedValueOnce({ + errors: false, + took: 0, + items: [getBulkResItem(2)], + }); + + await resolveAlertConflicts({ logger, esClient, bulkRequest, bulkResponse }); + + expect(logger.error).toHaveBeenNthCalledWith( + 1, + `Error writing alerts: 2 successful, 1 conflicts, 1 errors: hallo` + ); + expect(logger.info).toHaveBeenNthCalledWith(1, `Retrying bulk update of 1 conflicted alerts`); + expect(logger.info).toHaveBeenNthCalledWith( + 2, + `Retried bulk update of 1 conflicted alerts succeeded` + ); + }); + + test('multiple conflicted doc amonst other successes and errors', async () => { + const { bulkRequest, bulkResponse } = getReqRes('is c ic ic ie ic'); + + esClient.mget.mockResolvedValueOnce({ + docs: [getMGetResDoc(2, alertDoc), getMGetResDoc(3, alertDoc), getMGetResDoc(5, alertDoc)], + }); + + esClient.bulk.mockResolvedValueOnce({ + errors: false, + took: 0, + items: [getBulkResItem(2), getBulkResItem(3), getBulkResItem(5)], + }); + + await resolveAlertConflicts({ logger, esClient, bulkRequest, bulkResponse }); + + expect(logger.error).toHaveBeenNthCalledWith( + 1, + `Error writing alerts: 2 successful, 3 conflicts, 1 errors: hallo` + ); + expect(logger.info).toHaveBeenNthCalledWith(1, `Retrying bulk update of 3 conflicted alerts`); + expect(logger.info).toHaveBeenNthCalledWith( + 2, + `Retried bulk update of 3 conflicted alerts succeeded` + ); + }); + }); +}); + +function getBulkResItem(id: number) { + return { + index: { + _index: `index-${id}`, + _id: `id-${id}`, + _seq_no: 18, + _primary_term: 1, + status: 200, + }, + }; +} + +function getMGetResDoc(id: number, doc: unknown) { + return { + _index: `index-${id}}`, + _id: `id-${id}`, + _seq_no: 18, + _primary_term: 1, + found: true, + _source: doc, + }; +} + +interface GetReqResResult { + bulkRequest: BulkRequest; + bulkResponse: BulkResponse; +} + +/** + * takes as input a string of c, is, ic, ie tokens and builds appropriate + * bulk request and response objects to use in the tests: + * - c: create, ignored by the resolve logic + * - is: index with success + * - ic: index with conflict + * - ie: index with error but not conflict + */ +function getReqRes(bulkOps: string): GetReqResResult { + const ops = bulkOps.trim().split(/\s+/g); + + const bulkRequest = getBulkRequest(); + const bulkResponse = getBulkResponse(); + + bulkRequest.operations = []; + bulkResponse.items = []; + bulkResponse.errors = false; + + if (ops[0] === '') return { bulkRequest, bulkResponse }; + + const createOp = { create: {} }; + + let id = 0; + for (const op of ops) { + id++; + switch (op) { + // create, ignored by the resolve logic + case 'c': + bulkRequest.operations.push(createOp, alertDoc); + bulkResponse.items.push(getResponseItem('create', id, false, 200)); + break; + + // index with success + case 'is': + bulkRequest.operations.push(getIndexOp(id), alertDoc); + bulkResponse.items.push(getResponseItem('index', id, false, 200)); + break; + + // index with conflict + case 'ic': + bulkResponse.errors = true; + bulkRequest.operations.push(getIndexOp(id), alertDoc); + bulkResponse.items.push(getResponseItem('index', id, true, 409)); + break; + + // index with error but not conflict + case 'ie': + bulkResponse.errors = true; + bulkRequest.operations.push(getIndexOp(id), alertDoc); + bulkResponse.items.push(getResponseItem('index', id, true, 418)); // I'm a teapot + break; + + // developer error + default: + throw new Error('bad input'); + } + } + + return { bulkRequest, bulkResponse }; +} + +function getBulkRequest(): BulkRequest { + return { + refresh: 'wait_for', + index: 'some-index', + require_alias: true, + operations: [], + }; +} + +function getIndexOp(id: number) { + return { + index: { + _id: `id-${id}`, + _index: `index-${id}`, + if_seq_no: 17, + if_primary_term: 1, + require_alias: false, + }, + }; +} + +function getBulkResponse(): BulkResponse { + return { + errors: false, + took: 0, + items: [], + }; +} + +function getResponseItem( + type: BulkOperationType, + id: number, + error: boolean, + status: number +): Partial> { + if (error) { + return { + [type]: { + _index: `index-${id}`, + _id: `id-${id}`, + error: { reason: 'hallo' }, + status, + }, + }; + } + + return { + [type]: { + _index: `index-${id}`, + _id: `id-${id}`, + _seq_no: 18, + _primary_term: 1, + status: 200, + }, + }; +} diff --git a/x-pack/plugins/alerting/server/alerts_client/lib/alert_conflict_resolver.ts b/x-pack/plugins/alerting/server/alerts_client/lib/alert_conflict_resolver.ts new file mode 100644 index 0000000000000..223070c0e7245 --- /dev/null +++ b/x-pack/plugins/alerting/server/alerts_client/lib/alert_conflict_resolver.ts @@ -0,0 +1,288 @@ +/* + * 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 { + BulkRequest, + BulkResponse, + BulkOperationContainer, + MgetResponseItem, +} from '@elastic/elasticsearch/lib/api/types'; + +import { Logger, ElasticsearchClient } from '@kbn/core/server'; +import { + ALERT_STATUS, + ALERT_STATUS_ACTIVE, + ALERT_STATUS_RECOVERED, + ALERT_WORKFLOW_STATUS, + ALERT_WORKFLOW_TAGS, + ALERT_CASE_IDS, +} from '@kbn/rule-data-utils'; + +import { set } from '@kbn/safer-lodash-set'; +import { zip, get } from 'lodash'; + +// these fields are the one's we'll refresh from the fresh mget'd docs +const REFRESH_FIELDS_ALWAYS = [ALERT_WORKFLOW_STATUS, ALERT_WORKFLOW_TAGS, ALERT_CASE_IDS]; +const REFRESH_FIELDS_CONDITIONAL = [ALERT_STATUS]; +const REFRESH_FIELDS_ALL = [...REFRESH_FIELDS_ALWAYS, ...REFRESH_FIELDS_CONDITIONAL]; + +export interface ResolveAlertConflictsParams { + esClient: ElasticsearchClient; + logger: Logger; + bulkRequest: BulkRequest; + bulkResponse: BulkResponse; +} + +interface NormalizedBulkRequest { + op: BulkOperationContainer; + doc: unknown; +} + +// wrapper to catch anything thrown; current usage of this function is +// to replace just logging that the error occurred, so we don't want +// to cause _more_ errors ... +export async function resolveAlertConflicts(params: ResolveAlertConflictsParams): Promise { + const { logger } = params; + try { + await resolveAlertConflicts_(params); + } catch (err) { + logger.error(`Error resolving alert conflicts: ${err.message}`); + } +} + +async function resolveAlertConflicts_(params: ResolveAlertConflictsParams): Promise { + const { logger, esClient, bulkRequest, bulkResponse } = params; + if (bulkRequest.operations && bulkRequest.operations?.length === 0) return; + if (bulkResponse.items && bulkResponse.items?.length === 0) return; + + // get numbers for a summary log message + const { success, errors, conflicts, messages } = getResponseStats(bulkResponse); + if (conflicts === 0 && errors === 0) return; + + const allMessages = messages.join('; '); + logger.error( + `Error writing alerts: ${success} successful, ${conflicts} conflicts, ${errors} errors: ${allMessages}` + ); + + // get a new bulk request for just conflicted docs + const conflictRequest = getConflictRequest(bulkRequest, bulkResponse); + if (conflictRequest.length === 0) return; + + // get the fresh versions of those docs + const freshDocs = await getFreshDocs(esClient, conflictRequest); + + // update the OCC and refresh-able fields + await updateOCC(conflictRequest, freshDocs); + await refreshFieldsInDocs(conflictRequest, freshDocs); + + logger.info(`Retrying bulk update of ${conflictRequest.length} conflicted alerts`); + const mbrResponse = await makeBulkRequest(params.esClient, params.bulkRequest, conflictRequest); + + if (mbrResponse.bulkResponse?.items.length !== conflictRequest.length) { + const actual = mbrResponse.bulkResponse?.items.length; + const expected = conflictRequest.length; + logger.error( + `Unexpected number of bulk response items retried; expecting ${expected}, retried ${actual}` + ); + return; + } + + if (mbrResponse.error) { + const index = bulkRequest.index || 'unknown index'; + logger.error( + `Error writing ${conflictRequest.length} alerts to ${index} - ${mbrResponse.error.message}` + ); + return; + } + + if (mbrResponse.errors === 0) { + logger.info(`Retried bulk update of ${conflictRequest.length} conflicted alerts succeeded`); + } else { + logger.error( + `Retried bulk update of ${conflictRequest.length} conflicted alerts still had ${mbrResponse.errors} conflicts` + ); + } +} + +interface MakeBulkRequestResponse { + bulkRequest: BulkRequest; + bulkResponse?: BulkResponse; + errors: number; + error?: Error; +} + +// make the bulk request to fix conflicts +async function makeBulkRequest( + esClient: ElasticsearchClient, + bulkRequest: BulkRequest, + conflictRequest: NormalizedBulkRequest[] +): Promise { + const operations = conflictRequest.map((req) => [req.op, req.doc]).flat(); + // just replace the operations from the original request + const updatedBulkRequest = { ...bulkRequest, operations }; + + const bulkResponse = await esClient.bulk(updatedBulkRequest); + + const errors = bulkResponse.items.filter((item) => item.index?.error).length; + return { bulkRequest, bulkResponse, errors }; +} + +/** Update refreshable fields in the conflict requests. */ +async function refreshFieldsInDocs( + conflictRequests: NormalizedBulkRequest[], + freshResponses: MgetResponseItem[] +) { + for (const [conflictRequest, freshResponse] of zip(conflictRequests, freshResponses)) { + if (!conflictRequest?.op.index || !freshResponse) continue; + + // @ts-expect-error @elastic/elasticsearch _source is not in the type! + const freshDoc = freshResponse._source; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const conflictDoc = conflictRequest.doc as Record; + if (!freshDoc || !conflictDoc) continue; + + for (const refreshField of REFRESH_FIELDS_ALWAYS) { + const val = get(freshDoc, refreshField); + set(conflictDoc, refreshField, val); + } + + // structured this way to make sure all conditional refresh + // fields are listed in REFRESH_FIELDS_CONDITIONAL when we mget + for (const refreshField of REFRESH_FIELDS_CONDITIONAL) { + switch (refreshField) { + // hamdling for kibana.alert.status: overwrite conflict doc + // with fresh version if it's not active or recovered (ie, untracked) + case ALERT_STATUS: + const freshStatus = get(freshDoc, ALERT_STATUS); + + if (freshStatus !== ALERT_STATUS_ACTIVE && freshStatus !== ALERT_STATUS_RECOVERED) { + set(conflictDoc, ALERT_STATUS, freshStatus); + } + break; + } + } + } +} + +/** Update the OCC info in the conflict request with the fresh info. */ +async function updateOCC(conflictRequests: NormalizedBulkRequest[], freshDocs: MgetResponseItem[]) { + for (const [req, freshDoc] of zip(conflictRequests, freshDocs)) { + if (!req?.op.index || !freshDoc) continue; + + // @ts-expect-error @elastic/elasticsearch _seq_no is not in the type! + const seqNo: number | undefined = freshDoc._seq_no; + // @ts-expect-error @elastic/elasticsearch _primary_term is not in the type! + const primaryTerm: number | undefined = freshDoc._primary_term; + + if (seqNo === undefined) throw new Error('Unexpected undefined seqNo'); + if (primaryTerm === undefined) throw new Error('Unexpected undefined primaryTerm'); + + req.op.index.if_seq_no = seqNo; + req.op.index.if_primary_term = primaryTerm; + } +} + +/** Get the latest version of the conflicted docs, with fields to refresh. */ +async function getFreshDocs( + esClient: ElasticsearchClient, + conflictRequests: NormalizedBulkRequest[] +): Promise { + const docs: Array<{ _id: string; _index: string }> = []; + + conflictRequests.forEach((req) => { + const [id, index] = [req.op.index?._id, req.op.index?._index]; + if (!id || !index) return; + + docs.push({ _id: id, _index: index }); + }); + + const mgetRes = await esClient.mget({ docs, _source_includes: REFRESH_FIELDS_ALL }); + + if (mgetRes.docs.length !== docs.length) { + throw new Error( + `Unexpected number of mget response docs; expected ${docs.length}, got ${mgetRes.docs.length}` + ); + } + + return mgetRes.docs; +} + +/** Return the bulk request, filtered to those requests that had conflicts. */ +function getConflictRequest( + bulkRequest: BulkRequest, + bulkResponse: BulkResponse +): NormalizedBulkRequest[] { + // first "normalize" the request from it's non-linear form + const request = normalizeRequest(bulkRequest); + + // maybe we didn't unwind it right ... + if (request.length !== bulkResponse.items.length) { + throw new Error('Unexpected number of bulk response items'); + } + + if (request.length === 0) return []; + + // we only want op: index where the status was 409 / conflict + const conflictRequest = zip(request, bulkResponse.items) + .filter(([_, res]) => res?.index?.status === 409) + .map(([req, _]) => req!); + + return conflictRequest; +} + +/** Convert a bulk request (op | doc)[] to an array of { op, doc }[] */ +function normalizeRequest(bulkRequest: BulkRequest) { + if (!bulkRequest.operations) return []; + const result: NormalizedBulkRequest[] = []; + + let index = 0; + while (index < bulkRequest.operations.length) { + // the "op" data + const op = bulkRequest.operations[index] as BulkOperationContainer; + + // now the "doc" data, if there is any (none for delete) + if (op.create || op.index || op.update) { + index++; + const doc = bulkRequest.operations[index]; + result.push({ op, doc }); + } else if (op.delete) { + // no doc for delete op + } else { + throw new Error(`Unsupported bulk operation: ${JSON.stringify(op)}`); + } + + index++; + } + + return result; +} + +interface ResponseStatsResult { + success: number; + conflicts: number; + errors: number; + messages: string[]; +} + +// generate a summary of the original bulk request attempt, for logging +function getResponseStats(bulkResponse: BulkResponse): ResponseStatsResult { + const stats: ResponseStatsResult = { success: 0, conflicts: 0, errors: 0, messages: [] }; + for (const item of bulkResponse.items) { + const op = item.create || item.index || item.update || item.delete; + if (op?.error) { + if (op?.status === 409 && op === item.index) { + stats.conflicts++; + } else { + stats.errors++; + stats.messages.push(op?.error?.reason || 'no bulk reason provided'); + } + } else { + stats.success++; + } + } + return stats; +} diff --git a/x-pack/test/alerting_api_integration/common/plugins/alerts/server/alert_types.ts b/x-pack/test/alerting_api_integration/common/plugins/alerts/server/alert_types.ts index 5003acd160f29..72b3b7b34476f 100644 --- a/x-pack/test/alerting_api_integration/common/plugins/alerts/server/alert_types.ts +++ b/x-pack/test/alerting_api_integration/common/plugins/alerts/server/alert_types.ts @@ -7,7 +7,7 @@ import { v4 as uuidv4 } from 'uuid'; import { Logger } from '@kbn/logging'; -import { CoreSetup } from '@kbn/core/server'; +import { CoreSetup, ElasticsearchClient } from '@kbn/core/server'; import { schema, TypeOf } from '@kbn/config-schema'; import { curry, range, times } from 'lodash'; import { @@ -941,6 +941,136 @@ function getAlwaysFiringAlertAsDataRuleType( }); } +function getWaitingRuleType(logger: Logger) { + const ParamsType = schema.object({ + source: schema.string(), + alerts: schema.number(), + }); + type ParamsType = TypeOf; + interface State extends RuleTypeState { + runCount?: number; + } + const id = 'test.waitingRule'; + + const result: RuleType< + ParamsType, + never, + State, + {}, + {}, + 'default', + 'recovered', + { runCount: number } + > = { + id, + name: 'Test: Rule that waits for a signal before finishing', + actionGroups: [{ id: 'default', name: 'Default' }], + producer: 'alertsFixture', + defaultActionGroupId: 'default', + minimumLicenseRequired: 'basic', + isExportable: true, + doesSetRecoveryContext: true, + validate: { params: ParamsType }, + alerts: { + context: id.toLowerCase(), + shouldWrite: true, + mappings: { + fieldMap: { + runCount: { required: false, type: 'long' }, + }, + }, + }, + async executor(alertExecutorOptions) { + const { services, state, params } = alertExecutorOptions; + const { source, alerts } = params; + + const alertsClient = services.alertsClient; + if (!alertsClient) throw new Error(`Expected alertsClient!`); + + const runCount = (state.runCount || 0) + 1; + const es = services.scopedClusterClient.asInternalUser; + + await sendSignal(logger, es, id, source, `rule-starting-${runCount}`); + await waitForSignal(logger, es, id, source, `rule-complete-${runCount}`); + + for (let i = 0; i < alerts; i++) { + alertsClient.report({ + id: `alert-${i}`, + actionGroup: 'default', + payload: { runCount }, + }); + } + + return { state: { runCount } }; + }, + }; + + return result; +} + +async function sendSignal( + logger: Logger, + es: ElasticsearchClient, + id: string, + source: string, + reference: string +) { + logger.info(`rule type ${id} sending signal ${reference}`); + await es.index({ index: ES_TEST_INDEX_NAME, refresh: 'true', body: { source, reference } }); +} + +async function waitForSignal( + logger: Logger, + es: ElasticsearchClient, + id: string, + source: string, + reference: string +) { + let docs: unknown[] = []; + for (let attempt = 0; attempt < 20; attempt++) { + docs = await getSignalDocs(es, source, reference); + if (docs.length > 0) { + logger.info(`rule type ${id} received signal ${reference}`); + break; + } + + logger.info(`rule type ${id} waiting for signal ${reference}`); + await new Promise((resolve) => setTimeout(resolve, 1000)); + } + if (docs.length === 0) { + throw new Error(`Expected to find docs with source ${source}`); + } +} + +async function getSignalDocs(es: ElasticsearchClient, source: string, reference: string) { + const body = { + query: { + bool: { + must: [ + { + term: { + source, + }, + }, + { + term: { + reference, + }, + }, + ], + }, + }, + }; + const params = { + index: ES_TEST_INDEX_NAME, + size: 1000, + _source: false, + body, + }; + const result = await es.search(params, { meta: true }); + return result?.body?.hits?.hits || []; +} + export function defineAlertTypes( core: CoreSetup, { alerting, ruleRegistry }: Pick, @@ -1162,4 +1292,5 @@ export function defineAlertTypes( alerting.registerType(getAlwaysFiringAlertAsDataRuleType(logger, { ruleRegistry })); alerting.registerType(getPatternFiringAutoRecoverFalseAlertType()); alerting.registerType(getPatternFiringAlertsAsDataRuleType()); + alerting.registerType(getWaitingRuleType(logger)); } diff --git a/x-pack/test/alerting_api_integration/common/plugins/alerts/server/plugin.ts b/x-pack/test/alerting_api_integration/common/plugins/alerts/server/plugin.ts index 0809a4a5b71c7..7a257d214f26a 100644 --- a/x-pack/test/alerting_api_integration/common/plugins/alerts/server/plugin.ts +++ b/x-pack/test/alerting_api_integration/common/plugins/alerts/server/plugin.ts @@ -88,6 +88,7 @@ export class FixturePlugin implements Plugin, b: SearchHit) { + return a._source!.kibana.alert.instance.id.localeCompare(b._source!.kibana.alert.instance.id); +} + +// eslint-disable-next-line import/no-default-export +export default function createAlertsAsDataInstallResourcesTest({ getService }: FtrProviderContext) { + const es = getService('es'); + const retry = getService('retry'); + const supertestWithoutAuth = getService('supertestWithoutAuth'); + const objectRemover = new ObjectRemover(supertestWithoutAuth); + const esTestIndexTool = new ESTestIndexTool(es, retry); + + describe('document conflicts during rule execution', () => { + before(async () => { + await esTestIndexTool.destroy(); + await esTestIndexTool.setup(); + }); + + after(async () => { + await objectRemover.removeAll(); + await esTestIndexTool.destroy(); + }); + + const ruleType = 'test.waitingRule'; + const aadIndex = `.alerts-${ruleType.toLowerCase()}.alerts-default`; + + describe(`should be handled for alerting framework based AaD`, () => { + it('for a single conflicted alert', async () => { + const source = uuidv4(); + const count = 1; + const params = { source, alerts: count }; + const createdRule = await supertestWithoutAuth + .post(`${getUrlPrefix(Spaces.space1.id)}/api/alerting/rule`) + .set('kbn-xsrf', 'foo') + .send( + getTestRuleData({ + name: `${basename(__filename)} ${ruleType} ${source}}`, + rule_type_id: ruleType, + schedule: { interval: '1s' }, + throttle: null, + params, + actions: [], + }) + ); + + if (createdRule.status !== 200) { + log(`error creating rule: ${JSON.stringify(createdRule, null, 4)}`); + } + expect(createdRule.status).to.eql(200); + + const ruleId = createdRule.body.id; + objectRemover.add(Spaces.space1.id, ruleId, 'rule', 'alerting'); + + // this rule type uses esTextIndexTool documents to communicate + // with the rule executor. Once the rule starts executing, it + // "sends" `rule-starting-`, which this code waits for. It + // then updates the alert doc, and "sends" `rule-complete-`. + // which the rule executor is waiting on, to complete the rule + // execution. + log(`signal the rule to finish the first run`); + await esTestIndexTool.indexDoc(source, 'rule-complete-1'); + + log(`wait for the first alert doc to be created`); + const initialDocs = await waitForAlertDocs(aadIndex, ruleId, count); + expect(initialDocs.length).to.eql(count); + + log(`wait for the start of the next execution`); + await esTestIndexTool.waitForDocs(source, 'rule-starting-2'); + + log(`ad-hoc update the alert doc`); + await adHocUpdate(es, aadIndex, initialDocs[0]._id); + + log(`signal the rule to finish`); + await esTestIndexTool.indexDoc(source, 'rule-complete-2'); + + log(`wait for the start of the next execution`); + await esTestIndexTool.waitForDocs(source, 'rule-starting-3'); + + log(`get the updated alert doc`); + const updatedDocs = await waitForAlertDocs(aadIndex, ruleId, count); + expect(updatedDocs.length).to.eql(1); + + log(`signal the rule to finish, then delete it`); + await esTestIndexTool.indexDoc(source, 'rule-complete-3'); + await objectRemover.removeAll(); + + // compare the initial and updated alert docs + compareAlertDocs(initialDocs[0], updatedDocs[0], true); + }); + + it('for a mix of successful and conflicted alerts', async () => { + const source = uuidv4(); + const count = 5; + const params = { source, alerts: count }; + const createdRule = await supertestWithoutAuth + .post(`${getUrlPrefix(Spaces.space1.id)}/api/alerting/rule`) + .set('kbn-xsrf', 'foo') + .send( + getTestRuleData({ + name: `${basename(__filename)} ${ruleType} ${source}}`, + rule_type_id: ruleType, + schedule: { interval: '1s' }, + throttle: null, + params, + actions: [], + }) + ); + + if (createdRule.status !== 200) { + log(`error creating rule: ${JSON.stringify(createdRule, null, 4)}`); + } + expect(createdRule.status).to.eql(200); + + const ruleId = createdRule.body.id; + objectRemover.add(Spaces.space1.id, ruleId, 'rule', 'alerting'); + + log(`signal the rule to finish the first run`); + await esTestIndexTool.indexDoc(source, 'rule-complete-1'); + + log(`wait for the first alert doc to be created`); + const initialDocs = await waitForAlertDocs(aadIndex, ruleId, count); + initialDocs.sort(sortAlertDocsByInstanceId); + expect(initialDocs.length).to.eql(5); + + log(`wait for the start of the next execution`); + await esTestIndexTool.waitForDocs(source, 'rule-starting-2'); + + log(`ad-hoc update the 2nd and 4th alert docs`); + await adHocUpdate(es, aadIndex, initialDocs[1]._id); + await adHocUpdate(es, aadIndex, initialDocs[3]._id); + + log(`signal the rule to finish`); + await esTestIndexTool.indexDoc(source, 'rule-complete-2'); + + log(`wait for the start of the next execution`); + await esTestIndexTool.waitForDocs(source, 'rule-starting-3'); + + log(`get the updated alert doc`); + const updatedDocs = await waitForAlertDocs(aadIndex, ruleId, count); + updatedDocs.sort(sortAlertDocsByInstanceId); + expect(updatedDocs.length).to.eql(5); + + log(`signal the rule to finish, then delete it`); + await esTestIndexTool.indexDoc(source, 'rule-complete-3'); + await objectRemover.removeAll(); + + // compare the initial and updated alert docs + compareAlertDocs(initialDocs[0], updatedDocs[0], false); + compareAlertDocs(initialDocs[1], updatedDocs[1], true); + compareAlertDocs(initialDocs[2], updatedDocs[2], false); + compareAlertDocs(initialDocs[3], updatedDocs[3], true); + compareAlertDocs(initialDocs[4], updatedDocs[4], false); + }); + }); + }); + + // waits for a specified number of alert documents + async function waitForAlertDocs( + index: string, + ruleId: string, + count: number = 1 + ): Promise>> { + return await retry.try(async () => { + const searchResult = await es.search({ + index, + size: count, + body: { + query: { + bool: { + must: [{ term: { 'kibana.alert.rule.uuid': ruleId } }], + }, + }, + }, + }); + + const docs = searchResult.hits.hits as Array>; + if (docs.length < count) throw new Error(`only ${docs.length} out of ${count} docs found`); + + return docs; + }); + } +} + +// general comparator for initial / updated alert documents +function compareAlertDocs( + initialDoc: SearchHit, + updatedDoc: SearchHit, + conflicted: boolean +) { + // ensure both rule run updates and other updates persisted + if (!initialDoc) throw new Error('not enough initial docs'); + if (!updatedDoc) throw new Error('not enough updated docs'); + + const initialAlert = initialDoc._source!; + const updatedAlert = updatedDoc._source!; + + expect(initialAlert.runCount).to.be.greaterThan(0); + expect(updatedAlert.runCount).not.to.eql(-1); + expect(updatedAlert.runCount).to.be.greaterThan(initialAlert.runCount); + + if (conflicted) { + expect(get(updatedAlert, 'kibana.alert.case_ids')).to.eql( + get(DocUpdate, 'kibana.alert.case_ids') + ); + expect(get(updatedAlert, 'kibana.alert.workflow_tags')).to.eql( + get(DocUpdate, 'kibana.alert.workflow_tags') + ); + expect(get(updatedAlert, 'kibana.alert.workflow_status')).to.eql( + get(DocUpdate, 'kibana.alert.workflow_status') + ); + + expect(get(initialAlert, 'kibana.alert.status')).to.be('active'); + expect(get(updatedAlert, 'kibana.alert.status')).to.be('untracked'); + } + + const initial = omit(initialAlert, SkipFields); + const updated = omit(updatedAlert, SkipFields); + + expect(initial).to.eql(updated); +} + +// perform an adhoc update to an alert doc +async function adHocUpdate(es: Client, index: string, id: string) { + const body = { doc: DocUpdate }; + await es.update({ index, id, body, refresh: true }); +} + +// we'll do the adhoc updates with this data +const DocUpdate = { + runCount: -1, // rule-specific field, will be overwritten by rule execution + kibana: { + alert: { + action_group: 'not-the-default', // will be overwritten by rule execution + // below are all fields that will NOT be overwritten by rule execution + workflow_status: 'a-ok!', + workflow_tags: ['fee', 'fi', 'fo', 'fum'], + case_ids: ['123', '456', '789'], + status: 'untracked', + }, + }, +}; + +const SkipFields = [ + // dynamically changing fields we have no control over + '@timestamp', + 'event.action', + 'kibana.alert.duration.us', + 'kibana.alert.flapping_history', + 'kibana.alert.rule.execution.uuid', + + // fields under our control we test separately + 'runCount', + 'kibana.alert.status', + 'kibana.alert.case_ids', + 'kibana.alert.workflow_tags', + 'kibana.alert.workflow_status', +]; + +function log(message: string) { + // eslint-disable-next-line no-console + console.log(`${new Date().toISOString()} ${message}`); +} diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/alerts_as_data/index.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/alerts_as_data/index.ts index 9156fb9e8ec37..20342e053016d 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/alerts_as_data/index.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/alerts_as_data/index.ts @@ -13,5 +13,6 @@ export default function alertsAsDataTests({ loadTestFile }: FtrProviderContext) loadTestFile(require.resolve('./install_resources')); loadTestFile(require.resolve('./alerts_as_data')); loadTestFile(require.resolve('./alerts_as_data_flapping')); + loadTestFile(require.resolve('./alerts_as_data_conflicts')); }); } From 88b8b8c190fcc2a2344ade8ae8ee13f9ca7274db Mon Sep 17 00:00:00 2001 From: Maxim Palenov Date: Thu, 28 Sep 2023 07:19:13 -0700 Subject: [PATCH 23/61] [Security Solution] Reenable rules table filtering serverless tests (#166771) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Relates to:** https://github.com/elastic/kibana/issues/161540 ## Summary This PR unskips rules table filtering serverless tests. Serverless [rules_table_filtering.cy.ts (100 runs)](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3205) 🟢 --- .../rules_table/rules_table_filtering.cy.ts | 11 ++--- .../cypress/tasks/api_calls/elasticsearch.ts | 41 ++++++++++++++++--- 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_filtering.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_filtering.cy.ts index 537bd67d98aae..ff73d4c5775a7 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_filtering.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_filtering.cy.ts @@ -29,9 +29,7 @@ import { import { disableAutoRefresh } from '../../../../tasks/alerts_detection_rules'; import { getNewRule } from '../../../../objects/rule'; -// TODO: https://github.com/elastic/kibana/issues/161540 -// Flaky in serverless tests -describe('Rules table: filtering', { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { +describe('Rules table: filtering', { tags: ['@ess', '@serverless'] }, () => { before(() => { cleanKibana(); }); @@ -44,11 +42,8 @@ describe('Rules table: filtering', { tags: ['@ess', '@serverless', '@skipInServe cy.task('esArchiverResetKibana'); }); - // TODO: https://github.com/elastic/kibana/issues/161540 - describe.skip('Last response filter', () => { - // Flaky in serverless tests - // @brokenInServerless tag is not working so a skip was needed - it('Filters rules by last response', { tags: ['@brokenInServerless'] }, function () { + describe('Last response filter', () => { + it('Filters rules by last response', function () { deleteIndex('test_index'); createIndex('test_index', { diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/elasticsearch.ts b/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/elasticsearch.ts index e5edbaf65bd0a..dd7c1a71048f2 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/elasticsearch.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/elasticsearch.ts @@ -9,8 +9,12 @@ import { rootRequest } from '../common'; export const deleteIndex = (index: string) => { rootRequest({ method: 'DELETE', - url: `${Cypress.env('ELASTICSEARCH_URL')}/${index}?refresh=wait_for`, - headers: { 'kbn-xsrf': 'cypress-creds', 'x-elastic-internal-origin': 'security-solution' }, + url: `${Cypress.env('ELASTICSEARCH_URL')}/${index}`, + headers: { + 'kbn-xsrf': 'cypress-creds', + 'x-elastic-internal-origin': 'security-solution', + 'elastic-api-version': '2023-10-31', + }, failOnStatusCode: false, }); }; @@ -19,7 +23,11 @@ export const deleteDataStream = (dataStreamName: string) => { rootRequest({ method: 'DELETE', url: `${Cypress.env('ELASTICSEARCH_URL')}/_data_stream/${dataStreamName}`, - headers: { 'kbn-xsrf': 'cypress-creds', 'x-elastic-internal-origin': 'security-solution' }, + headers: { + 'kbn-xsrf': 'cypress-creds', + 'x-elastic-internal-origin': 'security-solution', + 'elastic-api-version': '2023-10-31', + }, failOnStatusCode: false, }); }; @@ -30,6 +38,11 @@ export const deleteAllDocuments = (target: string) => url: `${Cypress.env( 'ELASTICSEARCH_URL' )}/${target}/_delete_by_query?conflicts=proceed&scroll_size=10000&refresh`, + headers: { + 'kbn-xsrf': 'cypress-creds', + 'x-elastic-internal-origin': 'security-solution', + 'elastic-api-version': '2023-10-31', + }, body: { query: { match_all: {}, @@ -41,6 +54,11 @@ export const createIndex = (indexName: string, properties: Record({ method: 'GET', url: `${Cypress.env('ELASTICSEARCH_URL')}/${index}/_search`, - headers: { 'kbn-xsrf': 'cypress-creds', 'x-elastic-internal-origin': 'security-solution' }, + headers: { + 'kbn-xsrf': 'cypress-creds', + 'x-elastic-internal-origin': 'security-solution', + 'elastic-api-version': '2023-10-31', + }, failOnStatusCode: false, }).then((response) => { if (response.status !== 200) { @@ -80,7 +107,11 @@ export const refreshIndex = (index: string) => { rootRequest({ method: 'POST', url: `${Cypress.env('ELASTICSEARCH_URL')}/${index}/_refresh`, - headers: { 'kbn-xsrf': 'cypress-creds', 'x-elastic-internal-origin': 'security-solution' }, + headers: { + 'kbn-xsrf': 'cypress-creds', + 'x-elastic-internal-origin': 'security-solution', + 'elastic-api-version': '2023-10-31', + }, failOnStatusCode: false, }).then((response) => { if (response.status !== 200) { From 6fd9909b5e0bd1d945063cf621d93d20a72a0b60 Mon Sep 17 00:00:00 2001 From: Anton Dosov Date: Thu, 28 Sep 2023 16:33:04 +0200 Subject: [PATCH 24/61] [CM] Soften response validation (#166919) ## Summary Close https://github.com/elastic/kibana/issues/167152 Log a warning instead of throwing an error in `saved_object_content_storage` when response validation failed. We decided to do this as a precaution and as a follow up to an issue found in saved search https://github.com/elastic/kibana/pull/166886 where storage started failing because of too strict validation. As of this PR the saved_object_content_storage covers and this change cover: - `search` - `index_pattern` - `dashboard` - `lens` - `maps` For other types we agreed with @dej611 that instead of applying the same change for other types (visualization, graph, annotation) the team would look into migrating their types to also use `saved_object_content_storage` https://github.com/elastic/kibana/issues/167421 --- .../src/saved_object_content_storage.test.ts | 600 ++++++++++++++++++ .../src/saved_object_content_storage.ts | 122 +++- .../tsconfig.json | 3 + .../content_management/dashboard_storage.ts | 11 +- src/plugins/dashboard/server/plugin.ts | 7 +- src/plugins/dashboard/tsconfig.json | 3 +- .../content_management/data_views_storage.ts | 11 +- src/plugins/data_views/server/plugin.ts | 5 +- src/plugins/data_views/tsconfig.json | 1 + .../saved_search_storage.ts | 11 +- src/plugins/saved_search/server/index.ts | 4 +- src/plugins/saved_search/server/plugin.ts | 9 +- src/plugins/saved_search/tsconfig.json | 2 + .../server/content_management/lens_storage.ts | 31 +- x-pack/plugins/lens/server/index.ts | 4 +- x-pack/plugins/lens/server/plugin.tsx | 9 +- x-pack/plugins/lens/tsconfig.json | 2 + .../server/content_management/maps_storage.ts | 11 +- x-pack/plugins/maps/server/plugin.ts | 5 +- x-pack/plugins/maps/tsconfig.json | 1 + .../apps/lens/group6/error_handling.ts | 2 +- 21 files changed, 811 insertions(+), 43 deletions(-) create mode 100644 packages/kbn-content-management-utils/src/saved_object_content_storage.test.ts diff --git a/packages/kbn-content-management-utils/src/saved_object_content_storage.test.ts b/packages/kbn-content-management-utils/src/saved_object_content_storage.test.ts new file mode 100644 index 0000000000000..2268f279ae7ed --- /dev/null +++ b/packages/kbn-content-management-utils/src/saved_object_content_storage.test.ts @@ -0,0 +1,600 @@ +/* + * 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 { SOContentStorage } from './saved_object_content_storage'; +import { CMCrudTypes } from './types'; +import { loggerMock, MockedLogger } from '@kbn/logging-mocks'; + +import { schema } from '@kbn/config-schema'; +import type { + ContentManagementServicesDefinition as ServicesDefinition, + Version, +} from '@kbn/object-versioning'; +import { getContentManagmentServicesTransforms } from '@kbn/object-versioning'; +import { savedObjectSchema, objectTypeToGetResultSchema, createResultSchema } from './schema'; + +import { coreMock } from '@kbn/core/server/mocks'; +import type { SavedObject } from '@kbn/core/server'; + +const testAttributesSchema = schema.object( + { + title: schema.string(), + description: schema.string(), + }, + { unknowns: 'forbid' } +); + +const testSavedObjectSchema = savedObjectSchema(testAttributesSchema); + +export const serviceDefinition: ServicesDefinition = { + get: { + out: { + result: { + schema: objectTypeToGetResultSchema(testSavedObjectSchema), + }, + }, + }, + create: { + out: { + result: { + schema: createResultSchema(testSavedObjectSchema), + }, + }, + }, + update: { + out: { + result: { + schema: createResultSchema(testSavedObjectSchema), + }, + }, + }, + search: { + out: { + result: { + schema: schema.object({ hits: schema.arrayOf(testSavedObjectSchema) }), + }, + }, + }, + mSearch: { + out: { + result: { + schema: testSavedObjectSchema, + }, + }, + }, +}; + +export const cmServicesDefinition: { [version: Version]: ServicesDefinition } = { + 1: serviceDefinition, +}; + +const transforms = getContentManagmentServicesTransforms(cmServicesDefinition, 1); + +class TestSOContentStorage extends SOContentStorage { + constructor({ + throwOnResultValidationError, + logger, + }: { throwOnResultValidationError?: boolean; logger?: MockedLogger } = {}) { + super({ + savedObjectType: 'test', + cmServicesDefinition, + allowedSavedObjectAttributes: ['title', 'description'], + logger: logger ?? loggerMock.create(), + throwOnResultValidationError: throwOnResultValidationError ?? false, + enableMSearch: true, + }); + } +} + +const setup = ({ storage }: { storage?: TestSOContentStorage } = {}) => { + storage = storage ?? new TestSOContentStorage(); + const requestHandlerCoreContext = coreMock.createRequestHandlerContext(); + + const requestHandlerContext = { + core: Promise.resolve(requestHandlerCoreContext), + resolve: jest.fn(), + }; + + return { + get: (mockSavedObject: SavedObject) => { + requestHandlerCoreContext.savedObjects.client.resolve.mockResolvedValue({ + saved_object: mockSavedObject, + outcome: 'exactMatch', + }); + + return storage!.get( + { + requestHandlerContext, + version: { + request: 1, + latest: 1, + }, + utils: { + getTransforms: () => transforms, + }, + }, + mockSavedObject.id + ); + }, + create: (mockSavedObject: SavedObject<{}>) => { + requestHandlerCoreContext.savedObjects.client.create.mockResolvedValue(mockSavedObject); + + return storage!.create( + { + requestHandlerContext, + version: { + request: 1, + latest: 1, + }, + utils: { + getTransforms: () => transforms, + }, + }, + mockSavedObject.attributes, + {} + ); + }, + update: (mockSavedObject: SavedObject<{}>) => { + requestHandlerCoreContext.savedObjects.client.update.mockResolvedValue(mockSavedObject); + + return storage!.update( + { + requestHandlerContext, + version: { + request: 1, + latest: 1, + }, + utils: { + getTransforms: () => transforms, + }, + }, + mockSavedObject.id, + mockSavedObject.attributes, + {} + ); + }, + search: (mockSavedObject: SavedObject<{}>) => { + requestHandlerCoreContext.savedObjects.client.find.mockResolvedValue({ + saved_objects: [{ ...mockSavedObject, score: 100 }], + total: 1, + per_page: 10, + page: 1, + }); + + return storage!.search( + { + requestHandlerContext, + version: { + request: 1, + latest: 1, + }, + utils: { + getTransforms: () => transforms, + }, + }, + {}, + {} + ); + }, + mSearch: async (mockSavedObject: SavedObject<{}>) => { + return storage!.mSearch!.toItemResult( + { + requestHandlerContext, + version: { + request: 1, + latest: 1, + }, + utils: { + getTransforms: () => transforms, + }, + }, + { ...mockSavedObject, score: 100 } + ); + }, + }; +}; + +describe('get', () => { + test('returns the storage get() result', async () => { + const get = setup().get; + + const testSavedObject = { + id: 'id', + type: 'test', + references: [], + attributes: { + title: 'title', + description: 'description', + }, + }; + + const result = await get(testSavedObject); + + expect(result).toEqual({ item: testSavedObject, meta: { outcome: 'exactMatch' } }); + }); + + test('filters out unknown attributes', async () => { + const get = setup().get; + + const testSavedObject = { + id: 'id', + type: 'test', + references: [], + attributes: { + title: 'title', + description: 'description', + unknown: 'unknown', + }, + }; + + const result = await get(testSavedObject); + expect(result.item.attributes).not.toHaveProperty('unknown'); + }); + + test('throws response validation error', async () => { + const get = setup({ + storage: new TestSOContentStorage({ throwOnResultValidationError: true }), + }).get; + + const testSavedObject = { + id: 'id', + type: 'test', + references: [], + attributes: { + title: 'title', + description: null, + }, + }; + + await expect(get(testSavedObject)).rejects.toThrowErrorMatchingInlineSnapshot( + `"Invalid response. [item.attributes.description]: expected value of type [string] but got [null]"` + ); + }); + + test('logs response validation error', async () => { + const logger = loggerMock.create(); + const get = setup({ + storage: new TestSOContentStorage({ throwOnResultValidationError: false, logger }), + }).get; + + const testSavedObject = { + id: 'id', + type: 'test', + references: [], + attributes: { + title: 'title', + description: null, + }, + }; + + await expect(get(testSavedObject)).resolves.toBeDefined(); + expect(logger.warn).toBeCalledWith( + `Invalid response. [item.attributes.description]: expected value of type [string] but got [null]` + ); + }); +}); + +describe('create', () => { + test('returns the storage create() result', async () => { + const create = setup().create; + + const testSavedObject = { + id: 'id', + type: 'test', + references: [], + attributes: { + title: 'title', + description: 'description', + }, + }; + + const result = await create(testSavedObject); + + expect(result).toEqual({ item: testSavedObject }); + }); + + test('filters out unknown attributes', async () => { + const create = setup().create; + + const testSavedObject = { + id: 'id', + type: 'test', + references: [], + attributes: { + title: 'title', + description: 'description', + unknown: 'unknown', + }, + }; + + const result = await create(testSavedObject); + expect(result.item.attributes).not.toHaveProperty('unknown'); + }); + + test('throws response validation error', async () => { + const create = setup({ + storage: new TestSOContentStorage({ throwOnResultValidationError: true }), + }).create; + + const testSavedObject = { + id: 'id', + type: 'test', + references: [], + attributes: { + title: 'title', + description: null, + }, + }; + + await expect(create(testSavedObject)).rejects.toThrowErrorMatchingInlineSnapshot( + `"Invalid response. [item.attributes.description]: expected value of type [string] but got [null]"` + ); + }); + + test('logs response validation error', async () => { + const logger = loggerMock.create(); + const create = setup({ + storage: new TestSOContentStorage({ throwOnResultValidationError: false, logger }), + }).create; + + const testSavedObject = { + id: 'id', + type: 'test', + references: [], + attributes: { + title: 'title', + description: null, + }, + }; + + await expect(create(testSavedObject)).resolves.toBeDefined(); + expect(logger.warn).toBeCalledWith( + `Invalid response. [item.attributes.description]: expected value of type [string] but got [null]` + ); + }); +}); + +describe('update', () => { + test('returns the storage update() result', async () => { + const update = setup().update; + + const testSavedObject = { + id: 'id', + type: 'test', + references: [], + attributes: { + title: 'title', + description: 'description', + }, + }; + + const result = await update(testSavedObject); + + expect(result).toEqual({ item: testSavedObject }); + }); + + test('filters out unknown attributes', async () => { + const update = setup().update; + + const testSavedObject = { + id: 'id', + type: 'test', + references: [], + attributes: { + title: 'title', + description: 'description', + unknown: 'unknown', + }, + }; + + const result = await update(testSavedObject); + expect(result.item.attributes).not.toHaveProperty('unknown'); + }); + + test('throws response validation error', async () => { + const update = setup({ + storage: new TestSOContentStorage({ throwOnResultValidationError: true }), + }).update; + + const testSavedObject = { + id: 'id', + type: 'test', + references: [], + attributes: { + title: 'title', + description: null, + }, + }; + + await expect(update(testSavedObject)).rejects.toThrowErrorMatchingInlineSnapshot( + `"Invalid response. [item.attributes.description]: expected value of type [string] but got [null]"` + ); + }); + + test('logs response validation error', async () => { + const logger = loggerMock.create(); + const update = setup({ + storage: new TestSOContentStorage({ throwOnResultValidationError: false, logger }), + }).update; + + const testSavedObject = { + id: 'id', + type: 'test', + references: [], + attributes: { + title: 'title', + description: null, + }, + }; + + await expect(update(testSavedObject)).resolves.toBeDefined(); + expect(logger.warn).toBeCalledWith( + `Invalid response. [item.attributes.description]: expected value of type [string] but got [null]` + ); + }); +}); + +describe('search', () => { + test('returns the storage search() result', async () => { + const search = setup().search; + + const testSavedObject = { + id: 'id', + type: 'test', + references: [], + attributes: { + title: 'title', + description: 'description', + }, + }; + + const result = await search(testSavedObject); + + expect(result).toEqual({ hits: [testSavedObject], pagination: { total: 1 } }); + }); + + test('filters out unknown attributes', async () => { + const search = setup().search; + + const testSavedObject = { + id: 'id', + type: 'test', + references: [], + attributes: { + title: 'title', + description: 'description', + unknown: 'unknown', + }, + }; + + const result = await search(testSavedObject); + expect(result.hits[0].attributes).not.toHaveProperty('unknown'); + }); + + test('throws response validation error', async () => { + const search = setup({ + storage: new TestSOContentStorage({ throwOnResultValidationError: true }), + }).search; + + const testSavedObject = { + id: 'id', + type: 'test', + references: [], + attributes: { + title: 'title', + description: null, + }, + }; + + await expect(search(testSavedObject)).rejects.toThrowErrorMatchingInlineSnapshot( + `"Invalid response. [hits.0.attributes.description]: expected value of type [string] but got [null]"` + ); + }); + + test('logs response validation error', async () => { + const logger = loggerMock.create(); + const update = setup({ + storage: new TestSOContentStorage({ throwOnResultValidationError: false, logger }), + }).search; + + const testSavedObject = { + id: 'id', + type: 'test', + references: [], + attributes: { + title: 'title', + description: null, + }, + }; + + await expect(update(testSavedObject)).resolves.toBeDefined(); + expect(logger.warn).toBeCalledWith( + `Invalid response. [hits.0.attributes.description]: expected value of type [string] but got [null]` + ); + }); +}); + +describe('mSearch', () => { + test('returns the storage mSearch() result', async () => { + const mSearch = setup().mSearch; + + const testSavedObject = { + id: 'id', + type: 'test', + references: [], + attributes: { + title: 'title', + description: 'description', + }, + }; + + const result = await mSearch(testSavedObject); + + expect(result).toEqual(testSavedObject); + }); + + test('filters out unknown attributes', async () => { + const mSearch = setup().mSearch; + + const testSavedObject = { + id: 'id', + type: 'test', + references: [], + attributes: { + title: 'title', + description: 'description', + unknown: 'unknown', + }, + }; + + const result = await mSearch(testSavedObject); + expect(result.attributes).not.toHaveProperty('unknown'); + }); + + test('throws response validation error', async () => { + const mSearch = setup({ + storage: new TestSOContentStorage({ throwOnResultValidationError: true }), + }).mSearch; + + const testSavedObject = { + id: 'id', + type: 'test', + references: [], + attributes: { + title: 'title', + description: null, + }, + }; + + await expect(mSearch(testSavedObject)).rejects.toThrowErrorMatchingInlineSnapshot( + `"Invalid response. [attributes.description]: expected value of type [string] but got [null]"` + ); + }); + + test('logs response validation error', async () => { + const logger = loggerMock.create(); + const mSearch = setup({ + storage: new TestSOContentStorage({ throwOnResultValidationError: false, logger }), + }).mSearch; + + const testSavedObject = { + id: 'id', + type: 'test', + references: [], + attributes: { + title: 'title', + description: null, + }, + }; + + await expect(mSearch(testSavedObject)).resolves.toBeDefined(); + expect(logger.warn).toBeCalledWith( + 'Invalid response. [attributes.description]: expected value of type [string] but got [null]' + ); + }); +}); diff --git a/packages/kbn-content-management-utils/src/saved_object_content_storage.ts b/packages/kbn-content-management-utils/src/saved_object_content_storage.ts index 70cf7c9775863..8ff22a0d9be02 100644 --- a/packages/kbn-content-management-utils/src/saved_object_content_storage.ts +++ b/packages/kbn-content-management-utils/src/saved_object_content_storage.ts @@ -21,6 +21,7 @@ import type { SavedObjectsUpdateOptions, SavedObjectsFindResult, } from '@kbn/core-saved-objects-api-server'; +import type { Logger } from '@kbn/logging'; import { pick } from 'lodash'; import type { CMCrudTypes, @@ -138,6 +139,9 @@ export interface SOContentStorageConstrutorParams { searchArgsToSOFindOptions?: SearchArgsToSOFindOptions; enableMSearch?: boolean; mSearchAdditionalSearchFields?: string[]; + + logger: Logger; + throwOnResultValidationError: boolean; } export abstract class SOContentStorage @@ -157,7 +161,11 @@ export abstract class SOContentStorage enableMSearch, allowedSavedObjectAttributes, mSearchAdditionalSearchFields, + logger, + throwOnResultValidationError, }: SOContentStorageConstrutorParams) { + this.logger = logger; + this.throwOnResultValidationError = throwOnResultValidationError ?? false; this.savedObjectType = savedObjectType; this.cmServicesDefinition = cmServicesDefinition; this.createArgsToSoCreateOptions = @@ -174,16 +182,29 @@ export abstract class SOContentStorage toItemResult: (ctx: StorageContext, savedObject: SavedObjectsFindResult): Types['Item'] => { const transforms = ctx.utils.getTransforms(this.cmServicesDefinition); + const contentItem = savedObjectToItem( + savedObject as SavedObjectsFindResult, + this.allowedSavedObjectAttributes, + false + ); + + const validationError = transforms.mSearch.out.result.validate(contentItem); + if (validationError) { + if (this.throwOnResultValidationError) { + throw Boom.badRequest(`Invalid response. ${validationError.message}`); + } else { + this.logger.warn(`Invalid response. ${validationError.message}`); + } + } + // Validate DB response and DOWN transform to the request version const { value, error: resultError } = transforms.mSearch.out.result.down< Types['Item'], Types['Item'] >( - savedObjectToItem( - savedObject as SavedObjectsFindResult, - this.allowedSavedObjectAttributes, - false - ) + contentItem, + undefined, // do not override version + { validate: false } // validation is done above ); if (resultError) { @@ -196,6 +217,8 @@ export abstract class SOContentStorage } } + private throwOnResultValidationError: boolean; + private logger: Logger; private savedObjectType: SOContentStorageConstrutorParams['savedObjectType']; private cmServicesDefinition: SOContentStorageConstrutorParams['cmServicesDefinition']; private createArgsToSoCreateOptions: CreateArgsToSoCreateOptions; @@ -230,11 +253,24 @@ export abstract class SOContentStorage }, }; + const validationError = transforms.get.out.result.validate(response); + if (validationError) { + if (this.throwOnResultValidationError) { + throw Boom.badRequest(`Invalid response. ${validationError.message}`); + } else { + this.logger.warn(`Invalid response. ${validationError.message}`); + } + } + // Validate DB response and DOWN transform to the request version const { value, error: resultError } = transforms.get.out.result.down< Types['GetOut'], Types['GetOut'] - >(response); + >( + response, + undefined, // do not override version + { validate: false } // validation is done above + ); if (resultError) { throw Boom.badRequest(`Invalid response. ${resultError.message}`); @@ -282,13 +318,28 @@ export abstract class SOContentStorage createOptions ); + const result = { + item: savedObjectToItem(savedObject, this.allowedSavedObjectAttributes, false), + }; + + const validationError = transforms.create.out.result.validate(result); + if (validationError) { + if (this.throwOnResultValidationError) { + throw Boom.badRequest(`Invalid response. ${validationError.message}`); + } else { + this.logger.warn(`Invalid response. ${validationError.message}`); + } + } + // Validate DB response and DOWN transform to the request version const { value, error: resultError } = transforms.create.out.result.down< Types['CreateOut'], Types['CreateOut'] - >({ - item: savedObjectToItem(savedObject, this.allowedSavedObjectAttributes, false), - }); + >( + result, + undefined, // do not override version + { validate: false } // validation is done above + ); if (resultError) { throw Boom.badRequest(`Invalid response. ${resultError.message}`); @@ -333,13 +384,28 @@ export abstract class SOContentStorage updateOptions ); + const result = { + item: savedObjectToItem(partialSavedObject, this.allowedSavedObjectAttributes, true), + }; + + const validationError = transforms.update.out.result.validate(result); + if (validationError) { + if (this.throwOnResultValidationError) { + throw Boom.badRequest(`Invalid response. ${validationError.message}`); + } else { + this.logger.warn(`Invalid response. ${validationError.message}`); + } + } + // Validate DB response and DOWN transform to the request version const { value, error: resultError } = transforms.update.out.result.down< Types['UpdateOut'], Types['UpdateOut'] - >({ - item: savedObjectToItem(partialSavedObject, this.allowedSavedObjectAttributes, true), - }); + >( + result, + undefined, // do not override version + { validate: false } // validation is done above + ); if (resultError) { throw Boom.badRequest(`Invalid response. ${resultError.message}`); @@ -382,20 +448,34 @@ export abstract class SOContentStorage options: optionsToLatest, }); // Execute the query in the DB - const response = await soClient.find(soQuery); + const soResponse = await soClient.find(soQuery); + const response = { + hits: soResponse.saved_objects.map((so) => + savedObjectToItem(so, this.allowedSavedObjectAttributes, false) + ), + pagination: { + total: soResponse.total, + }, + }; + + const validationError = transforms.search.out.result.validate(response); + if (validationError) { + if (this.throwOnResultValidationError) { + throw Boom.badRequest(`Invalid response. ${validationError.message}`); + } else { + this.logger.warn(`Invalid response. ${validationError.message}`); + } + } // Validate the response and DOWN transform to the request version const { value, error: resultError } = transforms.search.out.result.down< Types['SearchOut'], Types['SearchOut'] - >({ - hits: response.saved_objects.map((so) => - savedObjectToItem(so, this.allowedSavedObjectAttributes, false) - ), - pagination: { - total: response.total, - }, - }); + >( + response, + undefined, // do not override version + { validate: false } // validation is done above + ); if (resultError) { throw Boom.badRequest(`Invalid response. ${resultError.message}`); diff --git a/packages/kbn-content-management-utils/tsconfig.json b/packages/kbn-content-management-utils/tsconfig.json index 5a6f68e03a64e..dd279ed3f5284 100644 --- a/packages/kbn-content-management-utils/tsconfig.json +++ b/packages/kbn-content-management-utils/tsconfig.json @@ -21,5 +21,8 @@ "@kbn/core-saved-objects-api-server", "@kbn/config-schema", "@kbn/object-versioning", + "@kbn/logging", + "@kbn/logging-mocks", + "@kbn/core", ] } diff --git a/src/plugins/dashboard/server/content_management/dashboard_storage.ts b/src/plugins/dashboard/server/content_management/dashboard_storage.ts index fbbfa0ef26a47..4391aeaa90563 100644 --- a/src/plugins/dashboard/server/content_management/dashboard_storage.ts +++ b/src/plugins/dashboard/server/content_management/dashboard_storage.ts @@ -8,6 +8,7 @@ import { SOContentStorage, tagsToFindOptions } from '@kbn/content-management-utils'; import { SavedObjectsFindOptions } from '@kbn/core-saved-objects-api-server'; +import type { Logger } from '@kbn/logging'; import { CONTENT_ID } from '../../common/content_management'; import { cmServicesDefinition } from '../../common/content_management/cm_services'; @@ -31,7 +32,13 @@ const searchArgsToSOFindOptions = ( }; export class DashboardStorage extends SOContentStorage { - constructor() { + constructor({ + logger, + throwOnResultValidationError, + }: { + logger: Logger; + throwOnResultValidationError: boolean; + }) { super({ savedObjectType: CONTENT_ID, cmServicesDefinition, @@ -50,6 +57,8 @@ export class DashboardStorage extends SOContentStorage { 'timeTo', 'title', ], + logger, + throwOnResultValidationError, }); } } diff --git a/src/plugins/dashboard/server/plugin.ts b/src/plugins/dashboard/server/plugin.ts index 8a68d406d16c9..e1626c2e72108 100644 --- a/src/plugins/dashboard/server/plugin.ts +++ b/src/plugins/dashboard/server/plugin.ts @@ -45,7 +45,7 @@ export class DashboardPlugin { private readonly logger: Logger; - constructor(initializerContext: PluginInitializerContext) { + constructor(private initializerContext: PluginInitializerContext) { this.logger = initializerContext.logger.get(); } @@ -62,7 +62,10 @@ export class DashboardPlugin plugins.contentManagement.register({ id: CONTENT_ID, - storage: new DashboardStorage(), + storage: new DashboardStorage({ + throwOnResultValidationError: this.initializerContext.env.mode.dev, + logger: this.logger.get('storage'), + }), version: { latest: LATEST_VERSION, }, diff --git a/src/plugins/dashboard/tsconfig.json b/src/plugins/dashboard/tsconfig.json index 79aa7716b0160..82c71e7743ff2 100644 --- a/src/plugins/dashboard/tsconfig.json +++ b/src/plugins/dashboard/tsconfig.json @@ -67,7 +67,8 @@ "@kbn/serverless", "@kbn/no-data-page-plugin", "@kbn/react-kibana-mount", - "@kbn/core-lifecycle-browser" + "@kbn/core-lifecycle-browser", + "@kbn/logging" ], "exclude": ["target/**/*"] } diff --git a/src/plugins/data_views/server/content_management/data_views_storage.ts b/src/plugins/data_views/server/content_management/data_views_storage.ts index bd33b43a45bc1..35a9151f3f69e 100644 --- a/src/plugins/data_views/server/content_management/data_views_storage.ts +++ b/src/plugins/data_views/server/content_management/data_views_storage.ts @@ -7,13 +7,20 @@ */ import { SOContentStorage } from '@kbn/content-management-utils'; +import type { Logger } from '@kbn/logging'; import type { DataViewCrudTypes } from '../../common/content_management'; import { DataViewSOType } from '../../common/content_management'; import { cmServicesDefinition } from '../../common/content_management/cm_services'; export class DataViewsStorage extends SOContentStorage { - constructor() { + constructor({ + logger, + throwOnResultValidationError, + }: { + logger: Logger; + throwOnResultValidationError: boolean; + }) { super({ savedObjectType: DataViewSOType, cmServicesDefinition, @@ -32,6 +39,8 @@ export class DataViewsStorage extends SOContentStorage { 'name', ], mSearchAdditionalSearchFields: ['name'], + logger, + throwOnResultValidationError, }); } } diff --git a/src/plugins/data_views/server/plugin.ts b/src/plugins/data_views/server/plugin.ts index 2be269b1a7636..bbcc5dafc81c2 100644 --- a/src/plugins/data_views/server/plugin.ts +++ b/src/plugins/data_views/server/plugin.ts @@ -61,7 +61,10 @@ export class DataViewsServerPlugin contentManagement.register({ id: DATA_VIEW_SAVED_OBJECT_TYPE, - storage: new DataViewsStorage(), + storage: new DataViewsStorage({ + throwOnResultValidationError: this.initializerContext.env.mode.dev, + logger: this.logger.get('storage'), + }), version: { latest: LATEST_VERSION, }, diff --git a/src/plugins/data_views/tsconfig.json b/src/plugins/data_views/tsconfig.json index 558d22ec5b41f..e5613323bc222 100644 --- a/src/plugins/data_views/tsconfig.json +++ b/src/plugins/data_views/tsconfig.json @@ -32,6 +32,7 @@ "@kbn/content-management-utils", "@kbn/object-versioning", "@kbn/core-saved-objects-server", + "@kbn/logging", ], "exclude": [ "target/**/*", diff --git a/src/plugins/saved_search/server/content_management/saved_search_storage.ts b/src/plugins/saved_search/server/content_management/saved_search_storage.ts index 9d13d52db0271..797430a159159 100644 --- a/src/plugins/saved_search/server/content_management/saved_search_storage.ts +++ b/src/plugins/saved_search/server/content_management/saved_search_storage.ts @@ -7,13 +7,20 @@ */ import { SOContentStorage } from '@kbn/content-management-utils'; +import type { Logger } from '@kbn/logging'; import type { SavedSearchCrudTypes } from '../../common/content_management'; import { SavedSearchType } from '../../common/content_management'; import { cmServicesDefinition } from '../../common/content_management/cm_services'; export class SavedSearchStorage extends SOContentStorage { - constructor() { + constructor({ + logger, + throwOnResultValidationError, + }: { + logger: Logger; + throwOnResultValidationError: boolean; + }) { super({ savedObjectType: SavedSearchType, cmServicesDefinition, @@ -37,6 +44,8 @@ export class SavedSearchStorage extends SOContentStorage { 'rowsPerPage', 'breakdownField', ], + logger, + throwOnResultValidationError, }); } } diff --git a/src/plugins/saved_search/server/index.ts b/src/plugins/saved_search/server/index.ts index b125cf3d1fe52..056de3732b474 100644 --- a/src/plugins/saved_search/server/index.ts +++ b/src/plugins/saved_search/server/index.ts @@ -6,8 +6,10 @@ * Side Public License, v 1. */ +import type { PluginInitializerContext } from '@kbn/core-plugins-server'; import { SavedSearchServerPlugin } from './plugin'; export { getSavedSearch } from './services/saved_searches'; -export const plugin = () => new SavedSearchServerPlugin(); +export const plugin = (initContext: PluginInitializerContext) => + new SavedSearchServerPlugin(initContext); diff --git a/src/plugins/saved_search/server/plugin.ts b/src/plugins/saved_search/server/plugin.ts index 0f3e41894ff22..d09775442fd08 100644 --- a/src/plugins/saved_search/server/plugin.ts +++ b/src/plugins/saved_search/server/plugin.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { CoreSetup, CoreStart, Plugin } from '@kbn/core/server'; +import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/server'; import { StartServicesAccessor } from '@kbn/core/server'; import type { PluginSetup as DataPluginSetup, @@ -37,13 +37,18 @@ export interface SavedSearchServerStartDeps { export class SavedSearchServerPlugin implements Plugin { + constructor(private initializerContext: PluginInitializerContext) {} + public setup( core: CoreSetup, { data, contentManagement, expressions }: SavedSearchPublicSetupDependencies ) { contentManagement.register({ id: SavedSearchType, - storage: new SavedSearchStorage(), + storage: new SavedSearchStorage({ + throwOnResultValidationError: this.initializerContext.env.mode.dev, + logger: this.initializerContext.logger.get('storage'), + }), version: { latest: LATEST_VERSION, }, diff --git a/src/plugins/saved_search/tsconfig.json b/src/plugins/saved_search/tsconfig.json index 491461c2efc5a..7ed2cb4e82119 100644 --- a/src/plugins/saved_search/tsconfig.json +++ b/src/plugins/saved_search/tsconfig.json @@ -29,6 +29,8 @@ "@kbn/saved-objects-plugin", "@kbn/es-query", "@kbn/discover-utils", + "@kbn/logging", + "@kbn/core-plugins-server", ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/lens/server/content_management/lens_storage.ts b/x-pack/plugins/lens/server/content_management/lens_storage.ts index 72f78472356e5..3894ef20af30c 100644 --- a/x-pack/plugins/lens/server/content_management/lens_storage.ts +++ b/x-pack/plugins/lens/server/content_management/lens_storage.ts @@ -9,6 +9,7 @@ import type { SavedObjectsFindOptions } from '@kbn/core-saved-objects-api-server import type { StorageContext } from '@kbn/content-management-plugin/server'; import { SOContentStorage, tagsToFindOptions } from '@kbn/content-management-utils'; import type { SavedObject, SavedObjectReference } from '@kbn/core-saved-objects-api-server'; +import type { Logger } from '@kbn/logging'; import { CONTENT_ID, @@ -82,13 +83,20 @@ function savedObjectToLensSavedObject( } export class LensStorage extends SOContentStorage { - constructor() { + constructor( + private params: { + logger: Logger; + throwOnResultValidationError: boolean; + } + ) { super({ savedObjectType: CONTENT_ID, cmServicesDefinition, searchArgsToSOFindOptions, enableMSearch: true, allowedSavedObjectAttributes: ['title', 'description', 'visualizationType', 'state'], + logger: params.logger, + throwOnResultValidationError: params.throwOnResultValidationError, }); } @@ -134,13 +142,28 @@ export class LensStorage extends SOContentStorage { ...optionsToLatest, }); + const result = { + item: savedObjectToLensSavedObject(savedObject), + }; + + const validationError = transforms.update.out.result.validate(result); + if (validationError) { + if (this.params.throwOnResultValidationError) { + throw Boom.badRequest(`Invalid response. ${validationError.message}`); + } else { + this.params.logger.warn(`Invalid response. ${validationError.message}`); + } + } + // Validate DB response and DOWN transform to the request version const { value, error: resultError } = transforms.update.out.result.down< LensCrudTypes['UpdateOut'], LensCrudTypes['UpdateOut'] - >({ - item: savedObjectToLensSavedObject(savedObject), - }); + >( + result, + undefined, // do not override version + { validate: false } // validation is done above + ); if (resultError) { throw Boom.badRequest(`Invalid response. ${resultError.message}`); diff --git a/x-pack/plugins/lens/server/index.ts b/x-pack/plugins/lens/server/index.ts index 4140c5de37b3b..6b9f823c3bbc6 100644 --- a/x-pack/plugins/lens/server/index.ts +++ b/x-pack/plugins/lens/server/index.ts @@ -5,10 +5,10 @@ * 2.0. */ +import type { PluginInitializerContext } from '@kbn/core-plugins-server'; import { LensServerPlugin } from './plugin'; - export type { LensServerPluginSetup } from './plugin'; -export const plugin = () => new LensServerPlugin(); +export const plugin = (initContext: PluginInitializerContext) => new LensServerPlugin(initContext); export type { LensDocShape715 } from './migrations/types'; diff --git a/x-pack/plugins/lens/server/plugin.tsx b/x-pack/plugins/lens/server/plugin.tsx index c811058511fb1..c7584474dfc2b 100644 --- a/x-pack/plugins/lens/server/plugin.tsx +++ b/x-pack/plugins/lens/server/plugin.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { Plugin, CoreSetup, CoreStart } from '@kbn/core/server'; +import { Plugin, CoreSetup, CoreStart, PluginInitializerContext } from '@kbn/core/server'; import { PluginStart as DataViewsServerPluginStart } from '@kbn/data-views-plugin/server'; import { PluginStart as DataPluginStart, @@ -64,7 +64,7 @@ export interface LensServerPluginSetup { export class LensServerPlugin implements Plugin { private customVisualizationMigrations: CustomVisualizationMigrations = {}; - constructor() {} + constructor(private initializerContext: PluginInitializerContext) {} setup(core: CoreSetup, plugins: PluginSetupContract) { const getFilterMigrations = plugins.data.query.filterManager.getAllMigrations.bind( @@ -79,7 +79,10 @@ export class LensServerPlugin implements Plugin { - constructor() { + constructor({ + logger, + throwOnResultValidationError, + }: { + logger: Logger; + throwOnResultValidationError: boolean; + }) { super({ savedObjectType: CONTENT_ID, cmServicesDefinition, @@ -40,6 +47,8 @@ export class MapsStorage extends SOContentStorage { 'layerListJSON', 'uiStateJSON', ], + logger, + throwOnResultValidationError, }); } } diff --git a/x-pack/plugins/maps/server/plugin.ts b/x-pack/plugins/maps/server/plugin.ts index 8945b7d034377..dffd3e8a23aaa 100644 --- a/x-pack/plugins/maps/server/plugin.ts +++ b/x-pack/plugins/maps/server/plugin.ts @@ -204,7 +204,10 @@ export class MapsPlugin implements Plugin { contentManagement.register({ id: CONTENT_ID, - storage: new MapsStorage(), + storage: new MapsStorage({ + throwOnResultValidationError: this._initializerContext.env.mode.dev, + logger: this._logger.get('storage'), + }), version: { latest: LATEST_VERSION, }, diff --git a/x-pack/plugins/maps/tsconfig.json b/x-pack/plugins/maps/tsconfig.json index 34066a8b8d538..364a6d24473d6 100644 --- a/x-pack/plugins/maps/tsconfig.json +++ b/x-pack/plugins/maps/tsconfig.json @@ -73,6 +73,7 @@ "@kbn/content-management-table-list-view-table", "@kbn/content-management-table-list-view", "@kbn/serverless", + "@kbn/logging", ], "exclude": [ "target/**/*", diff --git a/x-pack/test/functional/apps/lens/group6/error_handling.ts b/x-pack/test/functional/apps/lens/group6/error_handling.ts index f268e829ca5fb..ccdb193b30951 100644 --- a/x-pack/test/functional/apps/lens/group6/error_handling.ts +++ b/x-pack/test/functional/apps/lens/group6/error_handling.ts @@ -142,7 +142,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const errorMessages = await Promise.all(failureElements.map((el) => el.getVisibleText())); expect(errorMessages).to.eql([ - 'Bad Request', + 'Visualization type not found.', 'The visualization type lnsUNKNOWN could not be resolved.', 'Could not find datasource for the visualization', ]); From cb214a792c67507e402b3b20d0fa82c4a9a1b8ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20S=C3=A1nchez?= Date: Thu, 28 Sep 2023 16:36:29 +0200 Subject: [PATCH 25/61] [Fleet][Agent tamper protection] Enables agent tamper protection feature flag (#166794) ## Summary - Enables agent tamper protection feature flag. --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- x-pack/plugins/fleet/common/experimental_features.ts | 2 +- .../agent_policy_advanced_fields/index.test.tsx | 11 ----------- .../sections/agent_policy/list_page/index.test.tsx | 9 --------- .../sections/agents/agent_list_page/index.test.tsx | 9 --------- .../integration_tests/cloud_preconfiguration.test.ts | 12 +++--------- x-pack/plugins/fleet/server/mocks/index.ts | 1 - .../server/routes/uninstall_token/handlers.test.ts | 3 ++- 7 files changed, 6 insertions(+), 41 deletions(-) diff --git a/x-pack/plugins/fleet/common/experimental_features.ts b/x-pack/plugins/fleet/common/experimental_features.ts index 39d7b998953fb..e9d7184928046 100644 --- a/x-pack/plugins/fleet/common/experimental_features.ts +++ b/x-pack/plugins/fleet/common/experimental_features.ts @@ -20,7 +20,7 @@ export const allowedExperimentalValues = Object.freeze({ showIntegrationsSubcategories: true, agentFqdnMode: true, showExperimentalShipperOptions: false, - agentTamperProtectionEnabled: false, + agentTamperProtectionEnabled: true, secretsStorage: true, kafkaOutput: true, }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/index.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/index.test.tsx index ceea82434e1e1..15f4fc928eada 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/index.test.tsx @@ -13,10 +13,6 @@ import type { RenderResult } from '@testing-library/react'; import { createFleetTestRendererMock } from '../../../../../../mock'; import type { TestRenderer } from '../../../../../../mock'; -import { allowedExperimentalValues } from '../../../../../../../common/experimental_features'; - -import { ExperimentalFeaturesService } from '../../../../../../services/experimental_features'; - import { createAgentPolicyMock, createPackagePolicyMock } from '../../../../../../../common/mocks'; import type { AgentPolicy, NewAgentPolicy } from '../../../../../../../common/types'; @@ -51,13 +47,6 @@ describe('Agent policy advanced options content', () => { newAgentPolicy = false, packagePolicy = [createPackagePolicyMock()], } = {}) => { - // remove when feature flag is removed - ExperimentalFeaturesService.init({ - ...allowedExperimentalValues, - // @ts-expect-error ts upgrade v4.7.4 - agentTamperProtectionEnabled: true, - }); - if (newAgentPolicy) { mockAgentPolicy = generateNewAgentPolicyWithDefaults(); } else { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.test.tsx index 97ec62dce1d87..e2e9c11192b0e 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.test.tsx @@ -9,8 +9,6 @@ import React from 'react'; import type { RenderResult } from '@testing-library/react'; import { fireEvent, waitFor } from '@testing-library/react'; -import { allowedExperimentalValues } from '../../../../../../common/experimental_features'; -import { ExperimentalFeaturesService } from '../../../../../services'; import { createFleetTestRendererMock } from '../../../../../mock'; import type { GetAgentPoliciesResponse } from '../../../../../../common'; @@ -37,13 +35,6 @@ describe('AgentPolicyListPage', () => { const render = () => { const renderer = createFleetTestRendererMock(); - // todo: this can be removed when agentTamperProtectionEnabled feature flag is enabled/deleted - ExperimentalFeaturesService.init({ - ...allowedExperimentalValues, - // @ts-expect-error ts upgrade v4.7.4 - agentTamperProtectionEnabled: true, - }); - return renderer.render(); }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.test.tsx index 49b1e74014341..e276023a27674 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.test.tsx @@ -10,8 +10,6 @@ import React from 'react'; import type { RenderResult } from '@testing-library/react'; import { act, fireEvent, waitFor } from '@testing-library/react'; -import { allowedExperimentalValues } from '../../../../../../common/experimental_features'; -import { ExperimentalFeaturesService } from '../../../../../services'; import type { GetAgentPoliciesResponse } from '../../../../../../common'; import { createFleetTestRendererMock } from '../../../../../mock'; import { sendGetAgents, sendGetAgentStatus } from '../../../hooks'; @@ -290,13 +288,6 @@ describe('agent_list_page', () => { const renderer = createFleetTestRendererMock(); - // todo: this can be removed when agentTamperProtectionEnabled feature flag is enabled/deleted - ExperimentalFeaturesService.init({ - ...allowedExperimentalValues, - // @ts-expect-error ts upgrade v4.7.4 - agentTamperProtectionEnabled: true, - }); - renderResult = renderer.render(); await waitFor(() => { diff --git a/x-pack/plugins/fleet/server/integration_tests/cloud_preconfiguration.test.ts b/x-pack/plugins/fleet/server/integration_tests/cloud_preconfiguration.test.ts index 139f07fb999b3..ae19383f37216 100644 --- a/x-pack/plugins/fleet/server/integration_tests/cloud_preconfiguration.test.ts +++ b/x-pack/plugins/fleet/server/integration_tests/cloud_preconfiguration.test.ts @@ -160,9 +160,6 @@ describe('Fleet preconfiguration reset', () => { input['apm-server'].rum.source_mapping.elasticsearch.api_key = ''; } }); - data.agent.protection.signing_key = ''; - data.signed.data = ''; - data.signed.signature = ''; expect(data).toEqual( expect.objectContaining({ @@ -178,8 +175,8 @@ describe('Fleet preconfiguration reset', () => { }, protection: { enabled: false, - signing_key: '', - uninstall_token_hash: '', + signing_key: data.agent.protection.signing_key, + uninstall_token_hash: data.agent.protection.uninstall_token_hash, }, }, id: 'policy-elastic-agent-on-cloud', @@ -337,10 +334,7 @@ describe('Fleet preconfiguration reset', () => { }, revision: 5, secret_references: [], - signed: { - data: '', - signature: '', - }, + signed: data.signed, }) ); }); diff --git a/x-pack/plugins/fleet/server/mocks/index.ts b/x-pack/plugins/fleet/server/mocks/index.ts index 1e3d0e5c52b0a..adc0ecb1931b4 100644 --- a/x-pack/plugins/fleet/server/mocks/index.ts +++ b/x-pack/plugins/fleet/server/mocks/index.ts @@ -71,7 +71,6 @@ export const createAppContextStartContractMock = ( securitySetup: securityMock.createSetup(), securityStart: securityMock.createStart(), logger: loggingSystemMock.create().get(), - // @ts-expect-error ts upgrade v4.7.4 experimentalFeatures: { agentTamperProtectionEnabled: true, diagnosticFileUploadEnabled: true, diff --git a/x-pack/plugins/fleet/server/routes/uninstall_token/handlers.test.ts b/x-pack/plugins/fleet/server/routes/uninstall_token/handlers.test.ts index 3767c9a8d66ee..96bda0ed31ae8 100644 --- a/x-pack/plugins/fleet/server/routes/uninstall_token/handlers.test.ts +++ b/x-pack/plugins/fleet/server/routes/uninstall_token/handlers.test.ts @@ -184,7 +184,8 @@ describe('uninstall token handlers', () => { }); }); - describe('Agent Tamper Protection feature flag', () => { + // TODO: remove it when agentTamperProtectionEnabled FF is removed + describe.skip('Agent Tamper Protection feature flag', () => { let config: { enableExperimental: string[] }; let fakeRouter: jest.Mocked>; let fleetAuthzRouter: FleetAuthzRouter; From da2da33881c7eb86674c0e37b48b333ff1466725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20=C3=81brah=C3=A1m?= Date: Thu, 28 Sep 2023 16:37:53 +0200 Subject: [PATCH 26/61] [fleet] Add OpenAPI definition for GET uninstall-tokens (#159188) ## Summary Adds Open API definition for `GET /api/fleet/uninstall_tokens`, which is hidden behind feature flag for now, but **planned to be enabled for v8.11.0**. This should be merged with: - https://github.com/elastic/kibana/pull/166794 --- .../plugins/fleet/common/openapi/bundled.json | 150 ++++++++++++++++++ .../plugins/fleet/common/openapi/bundled.yaml | 98 ++++++++++++ .../fleet/common/openapi/entrypoint.yaml | 7 + .../openapi/paths/uninstall_tokens.yaml | 57 +++++++ ...uninstall_tokens@{uninstall_token_id}.yaml | 39 +++++ 5 files changed, 351 insertions(+) create mode 100644 x-pack/plugins/fleet/common/openapi/paths/uninstall_tokens.yaml create mode 100644 x-pack/plugins/fleet/common/openapi/paths/uninstall_tokens@{uninstall_token_id}.yaml diff --git a/x-pack/plugins/fleet/common/openapi/bundled.json b/x-pack/plugins/fleet/common/openapi/bundled.json index dfa970fb4b43c..a4604a7d7427b 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.json +++ b/x-pack/plugins/fleet/common/openapi/bundled.json @@ -5415,6 +5415,156 @@ } ] } + }, + "/uninstall_tokens": { + "get": { + "summary": "List metadata for latest uninstall tokens per agent policy", + "tags": [ + "Uninstall tokens" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "policy_id": { + "type": "string" + }, + "created_at": { + "type": "string" + } + }, + "required": [ + "id", + "policy_id", + "created_at" + ] + } + }, + "total": { + "type": "number" + }, + "page": { + "type": "number" + }, + "perPage": { + "type": "number" + } + }, + "required": [ + "items", + "total", + "page", + "perPage" + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/error" + } + }, + "operationId": "get-uninstall-tokens", + "parameters": [ + { + "name": "perPage", + "in": "query", + "description": "The number of items to return", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "minimum": 5 + } + }, + { + "$ref": "#/components/parameters/page_index" + }, + { + "name": "policyId", + "in": "query", + "description": "Partial match filtering for policy IDs", + "required": false, + "schema": { + "type": "string" + } + } + ] + } + }, + "/uninstall_tokens/{uninstallTokenId}": { + "get": { + "summary": "Get one decrypted uninstall token by its ID", + "tags": [ + "Uninstall tokens" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "item": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "token": { + "type": "string" + }, + "policy_id": { + "type": "string" + }, + "created_at": { + "type": "string" + } + }, + "required": [ + "id", + "token", + "policy_id", + "created_at" + ] + } + }, + "required": [ + "item" + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/error" + } + }, + "operationId": "get-uninstall-token", + "parameters": [ + { + "name": "uninstallTokenId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ] + } } }, "components": { diff --git a/x-pack/plugins/fleet/common/openapi/bundled.yaml b/x-pack/plugins/fleet/common/openapi/bundled.yaml index a996c3403810d..be132c9f19e48 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.yaml +++ b/x-pack/plugins/fleet/common/openapi/bundled.yaml @@ -3369,6 +3369,104 @@ paths: name: enrolToken in: query required: false + /uninstall_tokens: + get: + summary: List metadata for latest uninstall tokens per agent policy + tags: + - Uninstall tokens + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + type: object + properties: + id: + type: string + policy_id: + type: string + created_at: + type: string + required: + - id + - policy_id + - created_at + total: + type: number + page: + type: number + perPage: + type: number + required: + - items + - total + - page + - perPage + '400': + $ref: '#/components/responses/error' + operationId: get-uninstall-tokens + parameters: + - name: perPage + in: query + description: The number of items to return + required: false + schema: + type: integer + default: 20 + minimum: 5 + - $ref: '#/components/parameters/page_index' + - name: policyId + in: query + description: Partial match filtering for policy IDs + required: false + schema: + type: string + /uninstall_tokens/{uninstallTokenId}: + get: + summary: Get one decrypted uninstall token by its ID + tags: + - Uninstall tokens + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + item: + type: object + properties: + id: + type: string + token: + type: string + policy_id: + type: string + created_at: + type: string + required: + - id + - token + - policy_id + - created_at + required: + - item + '400': + $ref: '#/components/responses/error' + operationId: get-uninstall-token + parameters: + - name: uninstallTokenId + in: path + required: true + schema: + type: string components: securitySchemes: basicAuth: diff --git a/x-pack/plugins/fleet/common/openapi/entrypoint.yaml b/x-pack/plugins/fleet/common/openapi/entrypoint.yaml index 443caa36feadc..b8a7e024f3c4e 100644 --- a/x-pack/plugins/fleet/common/openapi/entrypoint.yaml +++ b/x-pack/plugins/fleet/common/openapi/entrypoint.yaml @@ -164,6 +164,13 @@ paths: # K8s /kubernetes: $ref: paths/kubernetes.yaml + + # Uninstall tokens + /uninstall_tokens: + $ref: paths/uninstall_tokens.yaml + /uninstall_tokens/{uninstallTokenId}: + $ref: paths/uninstall_tokens@{uninstall_token_id}.yaml + components: securitySchemes: basicAuth: diff --git a/x-pack/plugins/fleet/common/openapi/paths/uninstall_tokens.yaml b/x-pack/plugins/fleet/common/openapi/paths/uninstall_tokens.yaml new file mode 100644 index 0000000000000..daa6727007b2d --- /dev/null +++ b/x-pack/plugins/fleet/common/openapi/paths/uninstall_tokens.yaml @@ -0,0 +1,57 @@ +get: + summary: List metadata for latest uninstall tokens per agent policy + tags: + - Uninstall tokens + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + type: object + properties: + id: + type: string + policy_id: + type: string + created_at: + type: string + required: + - id + - policy_id + - created_at + total: + type: number + page: + type: number + perPage: + type: number + required: + - items + - total + - page + - perPage + '400': + $ref: ../components/responses/error.yaml + operationId: get-uninstall-tokens + parameters: + - name: perPage + in: query + description: The number of items to return + required: false + schema: + type: integer + default: 20 + minimum: 5 + - $ref: ../components/parameters/page_index.yaml + - name: policyId + in: query + description: Partial match filtering for policy IDs + required: false + schema: + type: string diff --git a/x-pack/plugins/fleet/common/openapi/paths/uninstall_tokens@{uninstall_token_id}.yaml b/x-pack/plugins/fleet/common/openapi/paths/uninstall_tokens@{uninstall_token_id}.yaml new file mode 100644 index 0000000000000..549a2c61f542d --- /dev/null +++ b/x-pack/plugins/fleet/common/openapi/paths/uninstall_tokens@{uninstall_token_id}.yaml @@ -0,0 +1,39 @@ +get: + summary: Get one decrypted uninstall token by its ID + tags: + - Uninstall tokens + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + item: + type: object + properties: + id: + type: string + token: + type: string + policy_id: + type: string + created_at: + type: string + required: + - id + - token + - policy_id + - created_at + required: + - item + '400': + $ref: ../components/responses/error.yaml + operationId: get-uninstall-token + parameters: + - name: uninstallTokenId + in: path + required: true + schema: + type: string From 07b206748f15d2322b6e75fca22a3a36fbf020db Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Thu, 28 Sep 2023 10:01:39 -0500 Subject: [PATCH 27/61] skip failing test suite (#167496) --- x-pack/performance/journeys/many_fields_lens_editor.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x-pack/performance/journeys/many_fields_lens_editor.ts b/x-pack/performance/journeys/many_fields_lens_editor.ts index 18af2111115ed..8ad343311b350 100644 --- a/x-pack/performance/journeys/many_fields_lens_editor.ts +++ b/x-pack/performance/journeys/many_fields_lens_editor.ts @@ -9,6 +9,8 @@ import { Journey } from '@kbn/journeys'; import { subj } from '@kbn/test-subj-selector'; export const journey = new Journey({ + // Failing: See https://github.com/elastic/kibana/issues/167496 + skipped: true, kbnArchives: ['x-pack/performance/kbn_archives/lens_many_fields'], esArchives: ['test/functional/fixtures/es_archiver/stress_test'], }) From db58f44defc1d8f76b0520f50152f379240417b9 Mon Sep 17 00:00:00 2001 From: Robert Oskamp Date: Thu, 28 Sep 2023 17:26:34 +0200 Subject: [PATCH 28/61] Add serverless FTR tests to staging quality gate (#167294) ## Summary This PR adds the serverless FTR tests that we already have in the [QA quality gate](https://github.com/elastic/kibana/blob/main/.buildkite/pipelines/quality-gates/pipeline.tests-qa.yaml#L18-L24) to the staging quality gate. ### Details We intentionally decided run the same set of FTR tests again in staging for starters. We're accepting the over-testing here until we have enough confidence and experience with our serverless product stability to decide which set of tests to run in which environment. This PR also explicitly sets the `EC_ENV` and `EC_REGION` environment variables for QA and Staging. It worked fine for QA env so far without setting the environment variable because it fell back on the QAF default values. Setting these values explicitly, makes it more robust. --- .../pipelines/quality-gates/pipeline.tests-qa.yaml | 2 ++ .../quality-gates/pipeline.tests-staging.yaml | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/.buildkite/pipelines/quality-gates/pipeline.tests-qa.yaml b/.buildkite/pipelines/quality-gates/pipeline.tests-qa.yaml index 5321f24ae6e3b..962da8da4d86e 100644 --- a/.buildkite/pipelines/quality-gates/pipeline.tests-qa.yaml +++ b/.buildkite/pipelines/quality-gates/pipeline.tests-qa.yaml @@ -21,6 +21,8 @@ steps: build: env: ENVIRONMENT: ${ENVIRONMENT} + EC_ENV: qa + EC_REGION: aws-eu-west-1 message: "${BUILDKITE_MESSAGE} (triggered by pipeline.tests-qa.yaml)" - group: ":female-detective: Security Solution Tests" diff --git a/.buildkite/pipelines/quality-gates/pipeline.tests-staging.yaml b/.buildkite/pipelines/quality-gates/pipeline.tests-staging.yaml index 6a5edc3a97073..42fa2b34ea84f 100644 --- a/.buildkite/pipelines/quality-gates/pipeline.tests-staging.yaml +++ b/.buildkite/pipelines/quality-gates/pipeline.tests-staging.yaml @@ -21,6 +21,16 @@ steps: NAME_PREFIX: ci_test_kibana-promotion_ message: "${BUILDKITE_MESSAGE} (triggered by pipeline.tests-staging.yaml)" + - label: ":pipeline::kibana::seedling: Trigger Kibana Serverless Tests for ${ENVIRONMENT}" + trigger: appex-qa-serverless-kibana-ftr-tests # https://buildkite.com/elastic/appex-qa-serverless-kibana-ftr-tests + soft_fail: true # Remove this before release or when tests stabilize + build: + env: + ENVIRONMENT: ${ENVIRONMENT} + EC_ENV: staging + EC_REGION: aws-us-east-1 + message: "${BUILDKITE_MESSAGE} (triggered by pipeline.tests-staging.yaml)" + - wait: ~ - label: ":judge::seedling: Trigger Manual Tests Phase" From 274fe1e9d04241aa99b2ad2c44e97f39e2a3f891 Mon Sep 17 00:00:00 2001 From: Jorge Sanz Date: Thu, 28 Sep 2023 17:34:15 +0200 Subject: [PATCH 29/61] [Maps] Update map report image test threshold for new EMS styles (#167162) Updated EMS Styles are waiting to be put into production. They are already available in Elastic staging environment ([preview](maps-staging.elastic.co/?manifest=testing)). This PR is a safe measure to ensure that this change do not break our CI tests. The process has been as follows: 1. Momentarily replaces the EMS Tile Service `tileApiUrl` by our staging server to force the use of the new styles and check which tests break with the slightly different basemaps at [12481c6](https://github.com/elastic/kibana/pull/167162/commits/12481c6ada986cda258f37108f5f0dd6c85f7689) 2. Look for related [broken tests](https://buildkite.com/elastic/kibana-pull-request/builds/161870) ``` Error: expected 0.030813687704837327 to be below 0.03 ``` 4. Adjust the threshold for the dashboard report, since the new value was slightly over the limit [e655b84](https://github.com/elastic/kibana/pull/167162/commits/e655b845695788c67356de115ab6e4627a42b07b) 5. Wait for a green CI (this took a few days because of unrelated issues with Kibana CI) 6. Revert the `tileApiUrl` change to its original value [c0030bc](https://github.com/elastic/kibana/pull/167162/commits/c0030bcff1a1de14860a05c27f26af45fda5e240) --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../functional/apps/dashboard/group3/reporting/screenshots.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/functional/apps/dashboard/group3/reporting/screenshots.ts b/x-pack/test/functional/apps/dashboard/group3/reporting/screenshots.ts index 490ba84c8496c..6ecaa84c96974 100644 --- a/x-pack/test/functional/apps/dashboard/group3/reporting/screenshots.ts +++ b/x-pack/test/functional/apps/dashboard/group3/reporting/screenshots.ts @@ -226,7 +226,7 @@ export default function ({ updateBaselines ); - expect(percentDiff).to.be.lessThan(0.03); + expect(percentDiff).to.be.lessThan(0.035); }); }); }); From f5d223b2530836317956828611fb8973bc31876f Mon Sep 17 00:00:00 2001 From: "Quynh Nguyen (Quinn)" <43350163+qn895@users.noreply.github.com> Date: Thu, 28 Sep 2023 10:54:37 -0500 Subject: [PATCH 30/61] [ML] Fix assertion for delete ingest pipelines api (#167451) --- .../api_integration/apis/ml/trained_models/get_models.ts | 6 +++--- x-pack/test/functional/services/ml/api.ts | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/x-pack/test/api_integration/apis/ml/trained_models/get_models.ts b/x-pack/test/api_integration/apis/ml/trained_models/get_models.ts index 0c1c90751b55d..78f4347cd091e 100644 --- a/x-pack/test/api_integration/apis/ml/trained_models/get_models.ts +++ b/x-pack/test/api_integration/apis/ml/trained_models/get_models.ts @@ -32,16 +32,16 @@ export default ({ getService }: FtrProviderContext) => { }); after(async () => { + await ml.api.cleanMlIndices(); + await esDeleteAllIndices('user-index_dfa*'); + // delete created ingest pipelines await Promise.all( ['dfa_regression_model_alias', ...testModelIds].map((modelId) => ml.api.deleteIngestPipeline(modelId) ) ); - await ml.api.cleanMlIndices(); await ml.testResources.cleanMLSavedObjects(); - - await esDeleteAllIndices('user-index_dfa*'); }); it('returns all trained models with associated pipelines including aliases', async () => { diff --git a/x-pack/test/functional/services/ml/api.ts b/x-pack/test/functional/services/ml/api.ts index e2db084b46276..cf71764ee5397 100644 --- a/x-pack/test/functional/services/ml/api.ts +++ b/x-pack/test/functional/services/ml/api.ts @@ -1504,10 +1504,10 @@ export function MachineLearningAPIProvider({ getService }: FtrProviderContext) { async deleteIngestPipeline(modelId: string, usePrefix: boolean = true) { log.debug(`Deleting ingest pipeline for trained model with id "${modelId}"`); - // const { body, status } = - await esSupertest.delete(`/_ingest/pipeline/${usePrefix ? 'pipeline_' : ''}${modelId}`); - // @todo - // this.assertResponseStatusCode(200, status, body); + const { body, status } = await esSupertest.delete( + `/_ingest/pipeline/${usePrefix ? 'pipeline_' : ''}${modelId}` + ); + this.assertResponseStatusCode(200, status, body); log.debug('> Ingest pipeline deleted'); }, From 7162634f3b88907e2db749002eb13bca319fcef5 Mon Sep 17 00:00:00 2001 From: Saarika Bhasi <55930906+saarikabhasi@users.noreply.github.com> Date: Thu, 28 Sep 2023 12:00:35 -0400 Subject: [PATCH 31/61] Add a Gated form for Workplace Search (#167315) ## Summary This PR adds Gated form when user visit Workplace Search , when` kibana_uis_enabled == false`. User will not be able to able to access any other Workplace search routes other than Overview page. **Note**: Form submission and API call be included in next PR Screen Recordings : https://github.com/elastic/kibana/assets/55930906/672a7b2e-3e5f-4fa1-8535-b5080b3a2dfc https://github.com/elastic/kibana/assets/55930906/7c8129cf-6f50-4039-9b50-b9a655361bd1 ### Checklist Delete any items that are not applicable to this PR. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../common/__mocks__/initial_app_data.ts | 1 + .../common/types/workplace_search.ts | 5 +- .../workplace_search/app_logic.test.ts | 1 + .../workplace_search/index.test.tsx | 11 +- .../applications/workplace_search/index.tsx | 86 ++- .../workplace_search/views/overview/index.ts | 1 + .../views/overview/overview.test.tsx | 17 +- .../views/overview/overview.tsx | 7 +- .../views/overview/workplace_search_gate.tsx | 677 ++++++++++++++++++ .../overview/workplace_search_gate_form.tsx | 65 ++ .../overview/workplace_search_gate_logic.ts | 67 ++ .../lib/enterprise_search_config_api.test.ts | 2 + .../lib/enterprise_search_config_api.ts | 2 + 13 files changed, 895 insertions(+), 47 deletions(-) create mode 100644 x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/workplace_search_gate.tsx create mode 100644 x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/workplace_search_gate_form.tsx create mode 100644 x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/workplace_search_gate_logic.ts diff --git a/x-pack/plugins/enterprise_search/common/__mocks__/initial_app_data.ts b/x-pack/plugins/enterprise_search/common/__mocks__/initial_app_data.ts index 7b8e7b6a585c4..5ed2c6893be5f 100644 --- a/x-pack/plugins/enterprise_search/common/__mocks__/initial_app_data.ts +++ b/x-pack/plugins/enterprise_search/common/__mocks__/initial_app_data.ts @@ -59,6 +59,7 @@ export const DEFAULT_INITIAL_APP_DATA = { organization: { name: 'ACME Donuts', defaultOrgName: 'My Organization', + kibanaUIsEnabled: false, }, account: { id: 'some-id-string', diff --git a/x-pack/plugins/enterprise_search/common/types/workplace_search.ts b/x-pack/plugins/enterprise_search/common/types/workplace_search.ts index 7f30c132076d3..68643436235bb 100644 --- a/x-pack/plugins/enterprise_search/common/types/workplace_search.ts +++ b/x-pack/plugins/enterprise_search/common/types/workplace_search.ts @@ -14,13 +14,14 @@ export interface Account { } export interface Organization { - name: string; defaultOrgName: string; + kibanaUIsEnabled: boolean; + name: string; } export interface WorkplaceSearchInitialData { - organization: Organization; account: Account; + organization: Organization; } export interface ConfiguredLimits { diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/app_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/app_logic.test.ts index 5731a9a829e83..25829856d5d1a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/app_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/app_logic.test.ts @@ -41,6 +41,7 @@ describe('AppLogic', () => { }, organization: { defaultOrgName: 'My Organization', + kibanaUIsEnabled: false, name: 'ACME Donuts', }, }; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.test.tsx index f68d1cb3b3d0b..453a6346f8690 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.test.tsx @@ -89,8 +89,8 @@ describe('WorkplaceSearchConfigured', () => { }); it('renders chrome and header actions', () => { + setMockValues({ organization: { kibanaUIsEnabled: false } }); const wrapper = shallow(); - expect(wrapper.find(Overview)).toHaveLength(1); expect(mockKibanaValues.setChromeIsVisible).toHaveBeenCalledWith(true); @@ -99,13 +99,14 @@ describe('WorkplaceSearchConfigured', () => { it('initializes app data with passed props', () => { const { workplaceSearch } = DEFAULT_INITIAL_APP_DATA; + setMockValues({ organization: { kibanaUIsEnabled: false } }); shallow(); expect(initializeAppData).toHaveBeenCalledWith({ workplaceSearch }); }); it('does not re-initialize app data or re-render header actions', () => { - setMockValues({ hasInitialized: true }); + setMockValues({ hasInitialized: true, organization: { kibanaUIsEnabled: false } }); shallow(); @@ -114,8 +115,14 @@ describe('WorkplaceSearchConfigured', () => { }); it('renders SourceAdded', () => { + setMockValues({ organization: { kibanaUIsEnabled: true } }); const wrapper = shallow(); expect(wrapper.find(SourceAdded)).toHaveLength(1); }); + it('renders Overview when kibanaUIsEnabled is true', () => { + setMockValues({ organization: { kibanaUIsEnabled: false } }); + const wrapper = shallow(); + expect(wrapper.find(Overview)).toHaveLength(1); + }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx index d6dc435efd9a3..74921301669e7 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx @@ -74,7 +74,10 @@ export const WorkplaceSearch: React.FC = (props) => { }; export const WorkplaceSearchConfigured: React.FC = (props) => { - const { hasInitialized } = useValues(AppLogic); + const { + hasInitialized, + organization: { kibanaUIsEnabled }, + } = useValues(AppLogic); const { initializeAppData, setContext } = useActions(AppLogic); const { renderHeaderActions, setChromeIsVisible } = useValues(KibanaLogic); @@ -99,53 +102,58 @@ export const WorkplaceSearchConfigured: React.FC = (props) => { return ( - - - - - - - - - - + {kibanaUIsEnabled && ( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - + + + + + )} + diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/index.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/index.ts index 69c843fe3821e..6e43c4e317075 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/index.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/index.ts @@ -6,3 +6,4 @@ */ export { Overview } from './overview'; +export { WorkplaceSearchGate } from './workplace_search_gate'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/overview.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/overview.test.tsx index 7bd40d6f04a56..9322a9335cc60 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/overview.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/overview.test.tsx @@ -17,6 +17,7 @@ import { OnboardingSteps } from './onboarding_steps'; import { OrganizationStats } from './organization_stats'; import { Overview } from './overview'; import { RecentActivity } from './recent_activity'; +import { WorkplaceSearchGatePage } from './workplace_search_gate_form'; describe('Overview', () => { it('calls initialize function', async () => { @@ -32,8 +33,19 @@ describe('Overview', () => { expect(wrapper.prop('pageHeader')).toBeUndefined(); }); - it('renders onboarding state', () => { - setMockValues({ dataLoading: false }); + it('does not render overview page when kibanaUIsEnabled is false', () => { + setMockValues({ dataLoading: true }); + const wrapper = shallow(); + + expect(wrapper.find(WorkplaceSearchGatePage)).toHaveLength(1); + expect(wrapper.find(OnboardingSteps)).toHaveLength(0); + expect(wrapper.find(OrganizationStats)).toHaveLength(0); + expect(wrapper.find(RecentActivity)).toHaveLength(0); + }); + + it('renders onboarding state when kibanaUIsEnabled is true', () => { + setMockValues({ dataLoading: false, organization: { kibanaUIsEnabled: true } }); + const wrapper = shallow(); expect(wrapper.find(OnboardingSteps)).toHaveLength(1); @@ -50,6 +62,7 @@ describe('Overview', () => { organization: { name: 'foo', defaultOrgName: 'bar', + kibanaUIsEnabled: true, }, }); const wrapper = shallow(); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/overview.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/overview.tsx index c51fdb64b8f26..3bccec0cd66dd 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/overview.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/overview.tsx @@ -19,6 +19,7 @@ import { OnboardingSteps } from './onboarding_steps'; import { OrganizationStats } from './organization_stats'; import { OverviewLogic } from './overview_logic'; import { RecentActivity } from './recent_activity'; +import { WorkplaceSearchGatePage } from './workplace_search_gate_form'; const ONBOARDING_HEADER_TITLE = i18n.translate( 'xpack.enterpriseSearch.workplaceSearch.overviewOnboardingHeader.title', @@ -41,7 +42,7 @@ const HEADER_DESCRIPTION = i18n.translate( export const Overview: React.FC = () => { const { - organization: { name: orgName, defaultOrgName }, + organization: { name: orgName, defaultOrgName, kibanaUIsEnabled }, } = useValues(AppLogic); const { initializeOverview } = useActions(OverviewLogic); @@ -56,7 +57,7 @@ export const Overview: React.FC = () => { const headerTitle = hideOnboarding ? HEADER_TITLE : ONBOARDING_HEADER_TITLE; const headerDescription = hideOnboarding ? HEADER_DESCRIPTION : ONBOARDING_HEADER_DESCRIPTION; - return ( + return kibanaUIsEnabled ? ( { + ) : ( + ); }; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/workplace_search_gate.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/workplace_search_gate.tsx new file mode 100644 index 0000000000000..46b32d2c129aa --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/workplace_search_gate.tsx @@ -0,0 +1,677 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { Fragment } from 'react'; + +import { useActions, useValues } from 'kea'; + +import { + EuiButton, + EuiCallOut, + EuiFlexGroup, + EuiFlexItem, + EuiForm, + EuiFormLabel, + EuiFormRow, + EuiIcon, + EuiLink, + EuiPanel, + EuiSelect, + EuiSpacer, + EuiSuperSelect, + EuiText, + EuiTextArea, +} from '@elastic/eui'; + +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; + +import { WorkplaceSearchGateLogic } from './workplace_search_gate_logic'; + +const getFeature = (id: string) => { + switch (id) { + case featuresList.searchApplication.id: + return featuresList.searchApplication; + case featuresList.contentSources.id: + return featuresList.contentSources; + case featuresList.contentExtraction.id: + return featuresList.contentExtraction; + case featuresList.documentLevelPermissions.id: + return featuresList.documentLevelPermissions; + case featuresList.synonyms.id: + return featuresList.synonyms; + case featuresList.analytics.id: + return featuresList.analytics; + } +}; +const featuresList = { + analytics: { + actionLabel: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.analytics.action.Label', + { + defaultMessage: 'Start with Behavioral Analytics', + } + ), + actionLink: './analytics ', + addOnLearnMoreLabel: undefined, + addOnLearnMoreUrl: undefined, + description: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.analytics.featureDescription', + { + defaultMessage: + "Did you know you can easily analyze your users' searching and clicking behavior with Behavioral Analytics? Instrument your website or application for tracking relevant user actions.", + } + ), + id: 'analytics', + learnMore: 'https://www.elastic.co/guide/en/enterprise-search/current/analytics-overview.html', + title: i18n.translate('xpack.enterpriseSearch.workplaceSearch.gateForm.analytics.featureName', { + defaultMessage: 'Use Behavioral Analytics', + }), + }, + contentExtraction: { + actionLabel: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.connectorExtraction.featureButtonLabel', + { + defaultMessage: 'Use a connector ', + } + ), + actionLink: './content/search_indices/new_index/select_connector', + addOnLearnMoreLabel: undefined, + addOnLearnMoreUrl: undefined, + + description: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.connectorExtraction.featureDescription', + { + defaultMessage: + 'Did you know you have access to powerful content extraction via Elastic connectors! Use our powerful and highly adaptable extraction capabilities to extract contents from your files. ', + } + ), + id: 'contentExtraction', + learnMore: 'https://www.elastic.co/guide/en/enterprise-search/current/connectors.html ', + title: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.connectorExtraction.featureName', + { + defaultMessage: 'Use Elastic connectors', + } + ), + }, + contentSources: { + actionLabel: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.connectorSources.featureButtonLabel', + { + defaultMessage: 'Use a connector ', + } + ), + actionLink: './content/search_indices/new_index/select_connector', + addOnLearnMoreLabel: undefined, + addOnLearnMoreUrl: undefined, + description: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.connectorSources.featureDescription', + { + defaultMessage: + 'Did you know Elastic connectors are now available? You can keep content on your data sources in sync with your search-optimized indices! ', + } + ), + id: 'contentSources', + learnMore: 'https://www.elastic.co/guide/en/enterprise-search/current/connectors.html ', + title: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.connectorSources.featureName', + { + defaultMessage: 'Use Elastic connectors', + } + ), + }, + documentLevelPermissions: { + actionLabel: undefined, + actionLink: undefined, + addOnLearnMoreLabel: undefined, + addOnLearnMoreUrl: undefined, + + description: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.docLevelPermissions.featureDescription', + { + defaultMessage: + 'Did you know you can restrict access to documents in your Elasticsearch indices according to user and group permissions? Return only authorized search results for users with Elastic’s document level security. ', + } + ), + id: 'documentLevelPermissions', + learnMore: 'https://www.elastic.co/guide/en/enterprise-search/current/dls.html', + title: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.docLevelPermissions.featureName', + { + defaultMessage: 'Use Elastic connectors', + } + ), + }, + searchApplication: { + actionLabel: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.searchApplication.action.Label', + { + defaultMessage: 'Create a Search Application', + } + ), + actionLink: './applications/search_applications', + addOnLearnMoreLabel: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.searchApplication.addOn.learnMoreLabel', + { + defaultMessage: 'Search UI', + } + ), + addOnLearnMoreUrl: 'https://www.elastic.co/guide/en/enterprise-search/current/search-ui.html ', + description: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.searchApplication.featureDescription', + { + defaultMessage: + 'Did you know you can restrict access to documents in your Elasticsearch indices according to user and group permissions? Return only authorized search results for users with Elastic’s document level security. ', + } + ), + id: 'searchApplication', + learnMore: 'https://www.elastic.co/guide/en/enterprise-search/current/search-applications.html', + title: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.searchApplication.featureName', + { + defaultMessage: 'Create Search Application', + } + ), + }, + synonyms: { + actionLabel: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.synonyms.action.Label', + { + defaultMessage: 'Search with synonyms', + } + ), + actionLink: + 'https://www.elastic.co/guide/en/elasticsearch/reference/current/search-with-synonyms.html ', + addOnLearnMoreLabel: undefined, + addOnLearnMoreUrl: undefined, + description: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.synonyms.featureDescription', + { + defaultMessage: + 'Did you know you can improve your search experience by searching with synonyms? Use our Synonyms API to easily create and manage synonym sets.', + } + ), + id: 'synonyms', + learnMore: 'https://www.elastic.co/guide/en/elasticsearch/reference/8.10/synonyms-apis.html', + title: i18n.translate('xpack.enterpriseSearch.workplaceSearch.gateForm.synonyms.featureName', { + defaultMessage: 'Search with Synonyms API', + }), + }, +}; + +const EducationPanel: React.FC<{ featureContent: string }> = ({ featureContent }) => { + const feature = getFeature(featureContent); + const { setFeaturesOther } = useActions(WorkplaceSearchGateLogic); + if (feature) { + return ( + + + + + + + + + +

+ {i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.educationalPanel.title', + { + defaultMessage: 'Elasticsearch native equivalent', + } + )} +
+ +
+ + +

+ {i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.educationalPanel.subTitle', + { + defaultMessage: 'Based on your selection we recommend you', + } + )} +

+
+
+ + + + + + +

{feature.description}

+ + {feature.actionLink !== undefined && feature.actionLabel !== undefined && ( + + + {feature.actionLabel} + + + )} + + + + {i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.educationalPanel.learnMore', + { + defaultMessage: 'Learn More', + } + )} + + + + {feature.addOnLearnMoreLabel !== undefined && feature.addOnLearnMoreUrl !== undefined && ( + + + + {feature.addOnLearnMoreLabel} + + + )} + +
+ + ); + } else { + return ( + <> + + + { + setFeaturesOther(e.target.value); + }} + /> + + + ); + } +}; +export const WorkplaceSearchGate: React.FC = () => { + const options = [ + { + dropdownDisplay: ( + + + {i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.contentSource.title', + { + defaultMessage: 'Content sources', + } + )} + + +

+ {i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.contentSource.description', + { + defaultMessage: + 'Extract the content of synced source files to make them searchable', + } + )} +

+
+
+ ), + inputDisplay: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.contentSource.inputDisplay', + { + defaultMessage: 'Content Sources', + } + ), + value: featuresList.contentSources.id, + }, + { + dropdownDisplay: ( + + + {i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.contentExtraction.title', + { + defaultMessage: 'Content extraction', + } + )} + + +

+ {i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.contentExtraction.description', + { + defaultMessage: + 'Extract the content of synced source files to make them searchable', + } + )} +

+
+
+ ), + inputDisplay: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.contentExtraction.inputDisplay', + { + defaultMessage: 'Content extraction', + } + ), + value: featuresList.contentExtraction.id, + }, + { + dropdownDisplay: ( + + + {i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.docLevelPermissions.title', + { + defaultMessage: 'Document-level permissions', + } + )} + + +

+ {i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.docLevelPermissions.description', + { + defaultMessage: 'Control access to specific documents', + } + )} +

+
+
+ ), + inputDisplay: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.docLevelPermissions.inputDisplay', + { + defaultMessage: 'Document-level permissions', + } + ), + value: featuresList.documentLevelPermissions.id, + }, + { + dropdownDisplay: ( + + + {i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.searchApplication.title', + { + defaultMessage: 'An out-of-the-box search experience', + } + )} + + +

+ {i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.searchApplication.description', + { + defaultMessage: 'Easily build search-powered applications', + } + )} +

+
+
+ ), + inputDisplay: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.searchApplication.inputDisplay', + { + defaultMessage: 'An out-of-the-box search experience', + } + ), + value: featuresList.searchApplication.id, + }, + { + dropdownDisplay: ( + + + {i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.synonymns.title', + { + defaultMessage: 'Synonyms', + } + )} + + +

+ {i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.synonymns.description', + { + defaultMessage: 'Link different words or phrases with similar meanings', + } + )} +

+
+
+ ), + inputDisplay: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.synonymns.inputDisplay', + { + defaultMessage: 'Synonyms', + } + ), + value: featuresList.synonyms.id, + }, + { + dropdownDisplay: ( + + + {i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.analytics.title', + { + defaultMessage: 'Analytics', + } + )} + + +

+ {i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.analytics.description', + { + defaultMessage: "Record and review users' interactions with search results", + } + )} +

+
+
+ ), + inputDisplay: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.analytics.inputDisplay', + { + defaultMessage: 'Analytics', + } + ), + value: featuresList.analytics.id, + }, + { + dropdownDisplay: ( + + + {i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.other.title', + { + defaultMessage: 'Other', + } + )} + + +

+ {i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.other.description', + { + defaultMessage: 'Another feature not listed here', + } + )} +

+
+
+ ), + inputDisplay: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.gateForm.superSelect.other.inputDisplay', + { + defaultMessage: 'Other', + } + ), + value: 'other', + }, + ]; + + const { setFormSubmitted, setAdditionalFeedback, setParticipateInUXLabs, setFeature } = + useActions(WorkplaceSearchGateLogic); + + const { feature, participateInUXLabs } = useValues(WorkplaceSearchGateLogic); + + return ( + + + + {i18n.translate('xpack.enterpriseSearch.workplaceSearch.gateForm.features.Label', { + defaultMessage: 'What Workplace Search feature are you looking to use?', + })} + + + + setFeature(value)} + itemLayoutAlign="top" + hasDividers + fullWidth + /> + + {feature && } + + + + + + { + setAdditionalFeedback(e.target.value); + }} + /> + + + + + + + ), + privacyStatementLink: ( + + + + ), + termsOfService: ( + + + + ), + }} + /> + + + + + + + + + setParticipateInUXLabs(e.target.value)} + value={participateInUXLabs} + /> + + + + + + + {i18n.translate('xpack.enterpriseSearch.workplaceSearch.gateForm.submit', { + defaultMessage: 'Submit', + })} + + + + + + ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/workplace_search_gate_form.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/workplace_search_gate_form.tsx new file mode 100644 index 0000000000000..50e4be57c68ef --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/workplace_search_gate_form.tsx @@ -0,0 +1,65 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import { EuiLink } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; + +import { ENTERPRISE_SEARCH_CONTENT_PLUGIN } from '../../../../../common/constants'; + +import { + EnterpriseSearchPageTemplateWrapper, + PageTemplateProps, + useEnterpriseSearchNav, +} from '../../../shared/layout'; +import { SendWorkplaceSearchTelemetry } from '../../../shared/telemetry'; + +import { WorkplaceSearchGate } from './workplace_search_gate'; + +export const WorkplaceSearchGatePage: React.FC = ({ isLoading }) => { + return ( + + {i18n.translate('xpack.enterpriseSearch.workplaceSearch.gateForm.viewBlog', { + defaultMessage: 'blog', + })} + + ), + }} + /> + ), + pageTitle: i18n.translate('xpack.enterpriseSearch.workplaceSearch.gateForm.title', { + defaultMessage: 'Before you begin...', + }), + }} + solutionNav={{ + items: useEnterpriseSearchNav(), + name: ENTERPRISE_SEARCH_CONTENT_PLUGIN.NAME, + }} + isLoading={isLoading} + > + + + + + ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/workplace_search_gate_logic.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/workplace_search_gate_logic.ts new file mode 100644 index 0000000000000..f2eb603421c25 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/workplace_search_gate_logic.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 { kea, MakeLogicType } from 'kea'; + +interface WorkplaceSearchGateValues { + additionalFeedback?: string; + feature: string; + featuresOther?: string; + isFormSubmitted: boolean; + participateInUXLabs?: string; +} +interface WorkplaceSearchGateActions { + setAdditionalFeedback(additionalFeedback: string): { additionalFeedback: string }; + setFeature(feature: string): { feature: string }; + setFeaturesOther(featuresOther: string): { featuresOther: string }; + setFormSubmitted(): void; + setParticipateInUXLabs(participateInUXLabs: string): { participateInUXLabs: boolean }; +} +export const WorkplaceSearchGateLogic = kea< + MakeLogicType +>({ + actions: { + setAdditionalFeedback: (additionalFeedback) => ({ additionalFeedback }), + setFeature: (feature) => ({ feature }), + setFeaturesOther: (featuresOther) => ({ featuresOther }), + setFormSubmitted: () => null, + setParticipateInUXLabs: (participateInUXLabs) => ({ participateInUXLabs }), + }, + path: ['enterprise_search', 'workplace_search', 'gate_form'], + reducers: { + additionalFeedback: [ + '', + { + setAdditionalFeedback: (_, { additionalFeedback }) => additionalFeedback, + }, + ], + feature: [ + '', + { + setFeature: (_, { feature }) => feature, + }, + ], + featuresOther: [ + '', + { + setFeaturesOther: (_, { featuresOther }) => featuresOther, + }, + ], + isFormSubmitted: [ + false, + { + setFormSubmitted: () => true, + }, + ], + participateInUXLabs: [ + '', + { + setParticipateInUXLabs: (_, { participateInUXLabs }) => participateInUXLabs, + }, + ], + }, +}); diff --git a/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.test.ts b/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.test.ts index 6243955ca63ad..ae6f7b4607653 100644 --- a/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.test.ts @@ -96,6 +96,7 @@ describe('callEnterpriseSearchConfigAPI', () => { organization: { name: 'ACME Donuts', default_org_name: 'My Organization', + kibanaUIsEnabled: false, }, account: { id: 'some-id-string', @@ -188,6 +189,7 @@ describe('callEnterpriseSearchConfigAPI', () => { organization: { name: undefined, defaultOrgName: undefined, + kibanaUIsEnabled: false, }, account: { id: undefined, diff --git a/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.ts b/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.ts index 16aa1ab0100b9..90fccce31344b 100644 --- a/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.ts +++ b/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.ts @@ -158,6 +158,8 @@ export const callEnterpriseSearchConfigAPI = async ({ organization: { name: data?.current_user?.workplace_search?.organization?.name, defaultOrgName: data?.current_user?.workplace_search?.organization?.default_org_name, + kibanaUIsEnabled: + data?.current_user?.workplace_search?.organization?.kibana_uis_enabled || false, }, account: { id: data?.current_user?.workplace_search?.account?.id, From 79c42be00cf19bd9693044ce3ec2ec31400e1ca6 Mon Sep 17 00:00:00 2001 From: Paul Tavares <56442535+paul-tavares@users.noreply.github.com> Date: Thu, 28 Sep 2023 12:09:38 -0400 Subject: [PATCH 32/61] [Security Solution][Endpoint] Add missing `system_indices_superuser` role to the Serverless `role.yml` override file (#167450) ## Summary - Adds the missing `system_indices_superuser` role to the `role.yml` file used when starting ES for serverless and using the security solution override files for resources --- .../serverless/es_serverless_resources/roles.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/roles.yml b/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/roles.yml index 005f6e968ffc4..d216adc602c1a 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/roles.yml +++ b/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/roles.yml @@ -1,4 +1,17 @@ --- +system_indices_superuser: + cluster: ['all'] + indices: + - names: ['*'] + privileges: ['all'] + allow_restricted_indices: true + applications: + - application: '*' + privileges: ['*'] + resources: ['*'] + run_as: ['*'] + + #-------------------------------------------------------------------------------------------------- # # FILE SOURCE AT: From 2edc13c2c1c604bf99b5862618c60e9ab93afcbe Mon Sep 17 00:00:00 2001 From: Ryland Herrick Date: Thu, 28 Sep 2023 11:30:27 -0500 Subject: [PATCH 33/61] [Security Solution][Entity Analytics] API Versioning for new EA Routes (#167365) ## Summary * Adds API versioning to all routes involved in new Risk Engine, public and private * Adds missing PLI auth headers for some routes * Updates API invocations to specify an appropriate version header * Does NOT add header to legacy transform-based EA routes ### Checklist - [x] Verify no API calls from the UI were missed - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --- .../public/entity_analytics/api/api.ts | 5 + .../routes/risk_engine_disable_route.ts | 13 +- .../routes/risk_engine_enable_route.ts | 13 +- .../routes/risk_engine_init_route.ts | 13 +- .../routes/risk_engine_status_route.ts | 13 +- .../routes/risk_score_calculation_route.ts | 114 ++++++++-------- .../routes/risk_score_preview_route.ts | 123 ++++++++++-------- .../risk_engine/risk_score_calculation.ts | 1 + .../group10/risk_engine/risk_score_preview.ts | 1 + .../group10/risk_engine/utils.ts | 6 + 10 files changed, 163 insertions(+), 139 deletions(-) diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/api.ts b/x-pack/plugins/security_solution/public/entity_analytics/api/api.ts index e6c261ab6588b..cc2b01f75da57 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/api/api.ts +++ b/x-pack/plugins/security_solution/public/entity_analytics/api/api.ts @@ -34,6 +34,7 @@ export const fetchRiskScorePreview = async ({ params: RiskScorePreviewRequestSchema; }): Promise => { return KibanaServices.get().http.fetch(RISK_SCORE_PREVIEW_URL, { + version: '1', method: 'POST', body: JSON.stringify(params), signal, @@ -49,6 +50,7 @@ export const fetchRiskEngineStatus = async ({ signal?: AbortSignal; }): Promise => { return KibanaServices.get().http.fetch(RISK_ENGINE_STATUS_URL, { + version: '1', method: 'GET', signal, }); @@ -59,6 +61,7 @@ export const fetchRiskEngineStatus = async ({ */ export const initRiskEngine = async (): Promise => { return KibanaServices.get().http.fetch(RISK_ENGINE_INIT_URL, { + version: '1', method: 'POST', }); }; @@ -68,6 +71,7 @@ export const initRiskEngine = async (): Promise => { */ export const enableRiskEngine = async (): Promise => { return KibanaServices.get().http.fetch(RISK_ENGINE_ENABLE_URL, { + version: '1', method: 'POST', }); }; @@ -77,6 +81,7 @@ export const enableRiskEngine = async (): Promise => { */ export const disableRiskEngine = async (): Promise => { return KibanaServices.get().http.fetch(RISK_ENGINE_DISABLE_URL, { + version: '1', method: 'POST', }); }; diff --git a/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_disable_route.ts b/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_disable_route.ts index 480f23139a9ef..b5ae6287c40fd 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_disable_route.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_disable_route.ts @@ -16,15 +16,15 @@ export const riskEngineDisableRoute = ( router: SecuritySolutionPluginRouter, getStartServices: StartServicesAccessor ) => { - router.post( - { + router.versioned + .post({ + access: 'internal', path: RISK_ENGINE_DISABLE_URL, - validate: {}, options: { tags: ['access:securitySolution', `access:${APP_ID}-entity-analytics`], }, - }, - async (context, request, response) => { + }) + .addVersion({ version: '1', validate: {} }, async (context, request, response) => { const siemResponse = buildSiemResponse(response); const [_, { taskManager }] = await getStartServices(); @@ -52,6 +52,5 @@ export const riskEngineDisableRoute = ( body: { message: error.message, full_error: JSON.stringify(e) }, }); } - } - ); + }); }; diff --git a/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_enable_route.ts b/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_enable_route.ts index 311218213b440..af5eb77374bba 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_enable_route.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_enable_route.ts @@ -16,15 +16,15 @@ export const riskEngineEnableRoute = ( router: SecuritySolutionPluginRouter, getStartServices: StartServicesAccessor ) => { - router.post( - { + router.versioned + .post({ + access: 'internal', path: RISK_ENGINE_ENABLE_URL, - validate: {}, options: { tags: ['access:securitySolution', `access:${APP_ID}-entity-analytics`], }, - }, - async (context, request, response) => { + }) + .addVersion({ version: '1', validate: {} }, async (context, request, response) => { const siemResponse = buildSiemResponse(response); const [_, { taskManager }] = await getStartServices(); const securitySolution = await context.securitySolution; @@ -51,6 +51,5 @@ export const riskEngineEnableRoute = ( body: { message: error.message, full_error: JSON.stringify(e) }, }); } - } - ); + }); }; diff --git a/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_init_route.ts b/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_init_route.ts index 5dc83521bc0d6..2a0a5fafc70b0 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_init_route.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_init_route.ts @@ -17,15 +17,15 @@ export const riskEngineInitRoute = ( router: SecuritySolutionPluginRouter, getStartServices: StartServicesAccessor ) => { - router.post( - { + router.versioned + .post({ + access: 'internal', path: RISK_ENGINE_INIT_URL, - validate: {}, options: { tags: ['access:securitySolution', `access:${APP_ID}-entity-analytics`], }, - }, - async (context, request, response) => { + }) + .addVersion({ version: '1', validate: {} }, async (context, request, response) => { const siemResponse = buildSiemResponse(response); const securitySolution = await context.securitySolution; const [_, { taskManager }] = await getStartServices(); @@ -78,6 +78,5 @@ export const riskEngineInitRoute = ( body: { message: error.message, full_error: JSON.stringify(e) }, }); } - } - ); + }); }; diff --git a/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_status_route.ts b/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_status_route.ts index 84d788eb8813c..d741ee5dd23ff 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_status_route.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_status_route.ts @@ -12,15 +12,15 @@ import { RISK_ENGINE_STATUS_URL, APP_ID } from '../../../../common/constants'; import type { SecuritySolutionPluginRouter } from '../../../types'; export const riskEngineStatusRoute = (router: SecuritySolutionPluginRouter) => { - router.get( - { + router.versioned + .get({ + access: 'internal', path: RISK_ENGINE_STATUS_URL, - validate: {}, options: { tags: ['access:securitySolution', `access:${APP_ID}-entity-analytics`], }, - }, - async (context, request, response) => { + }) + .addVersion({ version: '1', validate: {} }, async (context, request, response) => { const siemResponse = buildSiemResponse(response); const securitySolution = await context.securitySolution; @@ -46,6 +46,5 @@ export const riskEngineStatusRoute = (router: SecuritySolutionPluginRouter) => { body: { message: error.message, full_error: JSON.stringify(e) }, }); } - } - ); + }); }; diff --git a/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_score_calculation_route.ts b/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_score_calculation_route.ts index 31d61b2aa36b4..75c88678fd070 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_score_calculation_route.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_score_calculation_route.ts @@ -9,6 +9,7 @@ import type { Logger } from '@kbn/core/server'; import { buildSiemResponse } from '@kbn/lists-plugin/server/routes/utils'; import { transformError } from '@kbn/securitysolution-es-utils'; import { + APP_ID, DEFAULT_RISK_SCORE_PAGE_SIZE, RISK_SCORE_CALCULATION_URL, } from '../../../../common/constants'; @@ -19,72 +20,77 @@ import { riskScoreServiceFactory } from '../risk_score_service'; import { getRiskInputsIndex } from '../get_risk_inputs_index'; export const riskScoreCalculationRoute = (router: SecuritySolutionPluginRouter, logger: Logger) => { - router.post( - { + router.versioned + .post({ path: RISK_SCORE_CALCULATION_URL, - validate: { body: buildRouteValidation(riskScoreCalculationRequestSchema) }, + access: 'public', options: { - tags: ['access:securitySolution'], + tags: ['access:securitySolution', `access:${APP_ID}-entity-analytics`], }, - }, - async (context, request, response) => { - const siemResponse = buildSiemResponse(response); - const securityContext = await context.securitySolution; - const coreContext = await context.core; - const esClient = coreContext.elasticsearch.client.asCurrentUser; - const soClient = coreContext.savedObjects.client; - const spaceId = securityContext.getSpaceId(); - const riskEngineDataClient = securityContext.getRiskEngineDataClient(); - - const riskScoreService = riskScoreServiceFactory({ - esClient, - logger, - riskEngineDataClient, - spaceId, - }); - - const { - after_keys: userAfterKeys, - data_view_id: dataViewId, - debug, - page_size: userPageSize, - identifier_type: identifierType, - filter, - range, - weights, - } = request.body; + }) + .addVersion( + { + version: '2023-10-31', + validate: { request: { body: buildRouteValidation(riskScoreCalculationRequestSchema) } }, + }, + async (context, request, response) => { + const siemResponse = buildSiemResponse(response); + const securityContext = await context.securitySolution; + const coreContext = await context.core; + const esClient = coreContext.elasticsearch.client.asCurrentUser; + const soClient = coreContext.savedObjects.client; + const spaceId = securityContext.getSpaceId(); + const riskEngineDataClient = securityContext.getRiskEngineDataClient(); - try { - const { index, runtimeMappings } = await getRiskInputsIndex({ - dataViewId, + const riskScoreService = riskScoreServiceFactory({ + esClient, logger, - soClient, + riskEngineDataClient, + spaceId, }); - const afterKeys = userAfterKeys ?? {}; - const pageSize = userPageSize ?? DEFAULT_RISK_SCORE_PAGE_SIZE; - - const result = await riskScoreService.calculateAndPersistScores({ - afterKeys, + const { + after_keys: userAfterKeys, + data_view_id: dataViewId, debug, - pageSize, - identifierType, - index, + page_size: userPageSize, + identifier_type: identifierType, filter, range, - runtimeMappings, weights, - }); + } = request.body; - return response.ok({ body: result }); - } catch (e) { - const error = transformError(e); + try { + const { index, runtimeMappings } = await getRiskInputsIndex({ + dataViewId, + logger, + soClient, + }); - return siemResponse.error({ - statusCode: error.statusCode, - body: { message: error.message, full_error: JSON.stringify(e) }, - }); + const afterKeys = userAfterKeys ?? {}; + const pageSize = userPageSize ?? DEFAULT_RISK_SCORE_PAGE_SIZE; + + const result = await riskScoreService.calculateAndPersistScores({ + afterKeys, + debug, + pageSize, + identifierType, + index, + filter, + range, + runtimeMappings, + weights, + }); + + return response.ok({ body: result }); + } catch (e) { + const error = transformError(e); + + return siemResponse.error({ + statusCode: error.statusCode, + body: { message: error.message, full_error: JSON.stringify(e) }, + }); + } } - } - ); + ); }; diff --git a/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_score_preview_route.ts b/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_score_preview_route.ts index 224ccee95b60c..9a1a5f2b83d7c 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_score_preview_route.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_score_preview_route.ts @@ -9,7 +9,11 @@ import type { Logger } from '@kbn/core/server'; import { buildSiemResponse } from '@kbn/lists-plugin/server/routes/utils'; import { transformError } from '@kbn/securitysolution-es-utils'; -import { DEFAULT_RISK_SCORE_PAGE_SIZE, RISK_SCORE_PREVIEW_URL } from '../../../../common/constants'; +import { + APP_ID, + DEFAULT_RISK_SCORE_PAGE_SIZE, + RISK_SCORE_PREVIEW_URL, +} from '../../../../common/constants'; import { riskScorePreviewRequestSchema } from '../../../../common/risk_engine/risk_score_preview/request_schema'; import type { SecuritySolutionPluginRouter } from '../../../types'; import { buildRouteValidation } from '../../../utils/build_validation/route_validation'; @@ -17,73 +21,78 @@ import { riskScoreServiceFactory } from '../risk_score_service'; import { getRiskInputsIndex } from '../get_risk_inputs_index'; export const riskScorePreviewRoute = (router: SecuritySolutionPluginRouter, logger: Logger) => { - router.post( - { + router.versioned + .post({ + access: 'internal', path: RISK_SCORE_PREVIEW_URL, - validate: { body: buildRouteValidation(riskScorePreviewRequestSchema) }, options: { - tags: ['access:securitySolution'], + tags: ['access:securitySolution', `access:${APP_ID}-entity-analytics`], }, - }, - async (context, request, response) => { - const siemResponse = buildSiemResponse(response); - const securityContext = await context.securitySolution; - const coreContext = await context.core; - const esClient = coreContext.elasticsearch.client.asCurrentUser; - const soClient = coreContext.savedObjects.client; - const spaceId = securityContext.getSpaceId(); - const riskEngineDataClient = securityContext.getRiskEngineDataClient(); - - const riskScoreService = riskScoreServiceFactory({ - esClient, - logger, - riskEngineDataClient, - spaceId, - }); - - const { - after_keys: userAfterKeys, - data_view_id: dataViewId, - debug, - page_size: userPageSize, - identifier_type: identifierType, - filter, - range: userRange, - weights, - } = request.body; + }) + .addVersion( + { + version: '1', + validate: { request: { body: buildRouteValidation(riskScorePreviewRequestSchema) } }, + }, + async (context, request, response) => { + const siemResponse = buildSiemResponse(response); + const securityContext = await context.securitySolution; + const coreContext = await context.core; + const esClient = coreContext.elasticsearch.client.asCurrentUser; + const soClient = coreContext.savedObjects.client; + const spaceId = securityContext.getSpaceId(); + const riskEngineDataClient = securityContext.getRiskEngineDataClient(); - try { - const { index, runtimeMappings } = await getRiskInputsIndex({ - dataViewId, + const riskScoreService = riskScoreServiceFactory({ + esClient, logger, - soClient, + riskEngineDataClient, + spaceId, }); - const afterKeys = userAfterKeys ?? {}; - const range = userRange ?? { start: 'now-15d', end: 'now' }; - const pageSize = userPageSize ?? DEFAULT_RISK_SCORE_PAGE_SIZE; - - const result = await riskScoreService.calculateScores({ - afterKeys, + const { + after_keys: userAfterKeys, + data_view_id: dataViewId, debug, + page_size: userPageSize, + identifier_type: identifierType, filter, - identifierType, - index, - pageSize, - range, - runtimeMappings, + range: userRange, weights, - }); + } = request.body; - return response.ok({ body: result }); - } catch (e) { - const error = transformError(e); + try { + const { index, runtimeMappings } = await getRiskInputsIndex({ + dataViewId, + logger, + soClient, + }); - return siemResponse.error({ - statusCode: error.statusCode, - body: { message: error.message, full_error: JSON.stringify(e) }, - }); + const afterKeys = userAfterKeys ?? {}; + const range = userRange ?? { start: 'now-15d', end: 'now' }; + const pageSize = userPageSize ?? DEFAULT_RISK_SCORE_PAGE_SIZE; + + const result = await riskScoreService.calculateScores({ + afterKeys, + debug, + filter, + identifierType, + index, + pageSize, + range, + runtimeMappings, + weights, + }); + + return response.ok({ body: result }); + } catch (e) { + const error = transformError(e); + + return siemResponse.error({ + statusCode: error.statusCode, + body: { message: error.message, full_error: JSON.stringify(e) }, + }); + } } - } - ); + ); }; diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/risk_score_calculation.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/risk_score_calculation.ts index 1f504cce21be4..31a00c92593df 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/risk_score_calculation.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/risk_score_calculation.ts @@ -38,6 +38,7 @@ export default ({ getService }: FtrProviderContext): void => { const { body: result } = await supertest .post(RISK_SCORE_CALCULATION_URL) .set('kbn-xsrf', 'true') + .set('elastic-api-version', '2023-10-31') .send(body) .expect(200); return result; diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/risk_score_preview.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/risk_score_preview.ts index 4a61643293dec..31f8a86efc56e 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/risk_score_preview.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/risk_score_preview.ts @@ -36,6 +36,7 @@ export default ({ getService }: FtrProviderContext): void => { const defaultBody = { data_view_id: '.alerts-security.alerts-default' }; const { body: result } = await supertest .post(RISK_SCORE_PREVIEW_URL) + .set('elastic-api-version', '1') .set('kbn-xsrf', 'true') .send({ ...defaultBody, ...body }) .expect(200); diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/utils.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/utils.ts index 0d0cbd3d36d06..4671c0006113c 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/utils.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/utils.ts @@ -427,6 +427,7 @@ export const riskEngineRouteHelpersFactory = ( await supertest .post(routeWithNamespace(RISK_ENGINE_INIT_URL, namespace)) .set('kbn-xsrf', 'true') + .set('elastic-api-version', '1') .send() .expect(200), @@ -434,6 +435,7 @@ export const riskEngineRouteHelpersFactory = ( await supertest .get(routeWithNamespace(RISK_ENGINE_STATUS_URL, namespace)) .set('kbn-xsrf', 'true') + .set('elastic-api-version', '1') .send() .expect(200), @@ -441,6 +443,7 @@ export const riskEngineRouteHelpersFactory = ( await supertest .post(routeWithNamespace(RISK_ENGINE_ENABLE_URL, namespace)) .set('kbn-xsrf', 'true') + .set('elastic-api-version', '1') .send() .expect(200), @@ -448,6 +451,7 @@ export const riskEngineRouteHelpersFactory = ( await supertest .post(routeWithNamespace(RISK_ENGINE_DISABLE_URL, namespace)) .set('kbn-xsrf', 'true') + .set('elastic-api-version', '1') .send() .expect(200), }); @@ -460,12 +464,14 @@ export const installLegacyRiskScore = async ({ await supertest .post('/internal/risk_score') .set('kbn-xsrf', 'true') + .set('elastic-api-version', '1') .send({ riskScoreEntity: 'host' }) .expect(200); await supertest .post('/internal/risk_score') .set('kbn-xsrf', 'true') + .set('elastic-api-version', '1') .send({ riskScoreEntity: 'user' }) .expect(200); From 9d6ec1a7cb030b25732c61be19d11d8401cd235e Mon Sep 17 00:00:00 2001 From: Kevin Logan <56395104+kevinlog@users.noreply.github.com> Date: Thu, 28 Sep 2023 12:37:15 -0400 Subject: [PATCH 34/61] [Security Solution] Correct the license_uuid reference name in the Endpoint Policy (#167194) ## Summary Correct the `license_uuid` field name in the Endpoint Policy. Before, it was named `license_uid`, but the Endpoint expects `license_uuid`. This PR in intended to be backported to `8.10.3` which brings up an interesting problem since we already have a migration added to `main` for the `8.11` release. After talking with the kibana-core team, my approach is to add the migration for this bug fix to this PR. Then, to keep the `modelVersions` consistent, I will backport all `modelVersions` to `8.10.3` to keep the migrations consistent. Keeping these consistent is important so that both users upgrading from `8.10.x` in ESS and the Serverless line all remain in sync. The end result is that the policies inside of of `8.10.3` will have an extra field that will be unused until `8.11.0` The following `8.10.3` backport for this will include the extra migration and I will request reviews for it since it will be more than a normal backport. Policy: ![image](https://github.com/elastic/kibana/assets/56395104/888e364b-e835-4a76-8ee3-68d8ed1f055b) ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../group2/check_registered_types.test.ts | 2 +- .../fleet/server/saved_objects/index.ts | 16 ++ .../security_solution/to_v8_11_0_2.test.ts | 167 ++++++++++++++++++ .../security_solution/to_v8_11_0_2.ts | 65 +++++++ .../common/endpoint/models/policy_config.ts | 2 +- .../models/policy_config_helpers.test.ts | 2 +- .../common/endpoint/types/index.ts | 2 +- .../policy/store/policy_details/index.test.ts | 2 +- .../fleet_integration.test.ts | 10 +- .../fleet_integration/fleet_integration.ts | 6 +- 10 files changed, 261 insertions(+), 13 deletions(-) create mode 100644 x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v8_11_0_2.test.ts create mode 100644 x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v8_11_0_2.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group2/check_registered_types.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group2/check_registered_types.test.ts index 594c4faa9337f..ac24ad4dc05fe 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group2/check_registered_types.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group2/check_registered_types.test.ts @@ -106,7 +106,7 @@ describe('checking migration metadata changes on all registered SO types', () => "ingest-agent-policies": "f11cc19275f4c3e4ee7c5cd6423b6706b21b989d", "ingest-download-sources": "279a68147e62e4d8858c09ad1cf03bd5551ce58d", "ingest-outputs": "b4e636b13a5d0f89f0400fb67811d4cca4736eb0", - "ingest-package-policies": "af9e8d523a6f3ae5b8c9adcfba391ff405dfa374", + "ingest-package-policies": "8ec637429836f80f1fcc798bcee7c5916eceaed5", "ingest_manager_settings": "64955ef1b7a9ffa894d4bb9cf863b5602bfa6885", "inventory-view": "b8683c8e352a286b4aca1ab21003115a4800af83", "kql-telemetry": "93c1d16c1a0dfca9c8842062cf5ef8f62ae401ad", diff --git a/x-pack/plugins/fleet/server/saved_objects/index.ts b/x-pack/plugins/fleet/server/saved_objects/index.ts index b7cf55510285f..b21af06c38349 100644 --- a/x-pack/plugins/fleet/server/saved_objects/index.ts +++ b/x-pack/plugins/fleet/server/saved_objects/index.ts @@ -36,6 +36,11 @@ import { migrateSyntheticsPackagePolicyToV8100 } from './migrations/synthetics/t import { migratePackagePolicyEvictionsFromV8100 } from './migrations/security_solution/to_v8_10_0'; +import { + migratePackagePolicyEvictionsFromV81102, + migratePackagePolicyToV81102, +} from './migrations/security_solution/to_v8_11_0_2'; + import { migrateAgentPolicyToV7100, migratePackagePolicyToV7100, @@ -335,6 +340,17 @@ const getSavedObjectTypes = (): { [key: string]: SavedObjectsType } => ({ forwardCompatibility: migratePackagePolicyEvictionsFromV8110, }, }, + '3': { + changes: [ + { + type: 'data_backfill', + backfillFn: migratePackagePolicyToV81102, + }, + ], + schemas: { + forwardCompatibility: migratePackagePolicyEvictionsFromV81102, + }, + }, }, migrations: { '7.10.0': migratePackagePolicyToV7100, diff --git a/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v8_11_0_2.test.ts b/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v8_11_0_2.test.ts new file mode 100644 index 0000000000000..c6ee0ad133fcc --- /dev/null +++ b/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v8_11_0_2.test.ts @@ -0,0 +1,167 @@ +/* + * 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 { SavedObjectUnsanitizedDoc } from '@kbn/core/server'; + +import type { SavedObjectModelTransformationContext } from '@kbn/core-saved-objects-server'; + +import type { PackagePolicy } from '../../../../common'; + +import { migratePackagePolicyToV81102 as migration } from './to_v8_11_0_2'; +import { migratePackagePolicyEvictionsFromV81102 as eviction } from './to_v8_11_0_2'; + +describe('8.11.0-2 Endpoint Package Policy migration', () => { + const policyDoc = ({ meta = {} }) => { + return { + id: 'mock-saved-object-id', + attributes: { + name: 'Some Policy Name', + package: { + name: 'endpoint', + title: '', + version: '', + }, + id: 'endpoint', + policy_id: '', + enabled: true, + namespace: '', + revision: 0, + updated_at: '', + updated_by: '', + created_at: '', + created_by: '', + inputs: [ + { + type: 'endpoint', + enabled: true, + streams: [], + config: { + policy: { + value: { + meta: { + license: '', + cloud: false, + cluster_uuid: 'qwe', + cluster_name: 'clusterName', + ...meta, + }, + windows: {}, + mac: {}, + linux: {}, + }, + }, + }, + }, + ], + }, + type: ' nested', + }; + }; + + it('adds a new field `license_uuid` that takes the value of `license_uid` if it exists', () => { + const initialDoc = policyDoc({ meta: { license_uid: 'existing_uuid' } }); + + const migratedDoc = policyDoc({ + meta: { license_uid: 'existing_uuid', license_uuid: 'existing_uuid' }, + }); + + expect(migration(initialDoc, {} as SavedObjectModelTransformationContext)).toEqual({ + attributes: { + inputs: migratedDoc.attributes.inputs, + }, + }); + }); + + it('adds a new field `license_uuid` that takes an empty value if `existing_uid` does not exist', () => { + const initialDoc = policyDoc({}); + + const migratedDoc = policyDoc({ + meta: { license_uuid: '' }, + }); + + expect(migration(initialDoc, {} as SavedObjectModelTransformationContext)).toEqual({ + attributes: { + inputs: migratedDoc.attributes.inputs, + }, + }); + }); + + it('removes `license_uuid` for backwards compatibility', () => { + const initialDoc = policyDoc({ + meta: { license_uuid: 'existing_uuid' }, + }); + + const migratedDoc = policyDoc({}); + + expect(eviction(initialDoc.attributes)).toEqual(migratedDoc.attributes); + }); + + it('does not modify non-endpoint package policies', () => { + const doc: SavedObjectUnsanitizedDoc = { + id: 'mock-saved-object-id', + attributes: { + name: 'Some Policy Name', + package: { + name: 'notEndpoint', + title: '', + version: '', + }, + id: 'notEndpoint', + policy_id: '', + enabled: true, + namespace: '', + revision: 0, + updated_at: '', + updated_by: '', + created_at: '', + created_by: '', + inputs: [ + { + type: 'notEndpoint', + enabled: true, + streams: [], + config: {}, + }, + ], + }, + type: ' nested', + }; + + expect( + migration( + doc, + {} as SavedObjectModelTransformationContext + ) as SavedObjectUnsanitizedDoc + ).toEqual({ + attributes: { + name: 'Some Policy Name', + package: { + name: 'notEndpoint', + title: '', + version: '', + }, + id: 'notEndpoint', + policy_id: '', + enabled: true, + namespace: '', + revision: 0, + updated_at: '', + updated_by: '', + created_at: '', + created_by: '', + inputs: [ + { + type: 'notEndpoint', + enabled: true, + streams: [], + config: {}, + }, + ], + }, + }); + }); +}); diff --git a/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v8_11_0_2.ts b/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v8_11_0_2.ts new file mode 100644 index 0000000000000..2d858f3a7d222 --- /dev/null +++ b/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v8_11_0_2.ts @@ -0,0 +1,65 @@ +/* + * 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 { SavedObjectUnsanitizedDoc } from '@kbn/core/server'; + +import type { SavedObjectModelDataBackfillFn } from '@kbn/core-saved-objects-server'; + +import { omit } from 'lodash'; + +import type { SavedObjectModelVersionForwardCompatibilityFn } from '@kbn/core-saved-objects-server'; + +import type { PackagePolicy } from '../../../../common'; + +export const migratePackagePolicyToV81102: SavedObjectModelDataBackfillFn< + PackagePolicy, + PackagePolicy +> = (packagePolicyDoc) => { + if (packagePolicyDoc.attributes.package?.name !== 'endpoint') { + return { attributes: packagePolicyDoc.attributes }; + } + + const updatedPackagePolicyDoc: SavedObjectUnsanitizedDoc = packagePolicyDoc; + + const input = updatedPackagePolicyDoc.attributes.inputs[0]; + + if (input && input.config) { + const policy = input.config.policy.value; + + const newMetaValues = { + license_uuid: policy?.meta?.license_uid ? policy.meta.license_uid : '', + }; + + policy.meta = policy?.meta ? { ...policy.meta, ...newMetaValues } : newMetaValues; + } + + return { + attributes: { + inputs: updatedPackagePolicyDoc.attributes.inputs, + }, + }; +}; + +export const migratePackagePolicyEvictionsFromV81102: SavedObjectModelVersionForwardCompatibilityFn = + (unknownAttributes) => { + const attributes = unknownAttributes as PackagePolicy; + if (attributes.package?.name !== 'endpoint') { + return attributes; + } + + const updatedAttributes = attributes; + + const input = updatedAttributes.inputs[0]; + + if (input && input.config) { + const policy = input.config.policy.value; + + policy.meta = omit(policy.meta, ['license_uuid']); + } + + return updatedAttributes; + }; diff --git a/x-pack/plugins/security_solution/common/endpoint/models/policy_config.ts b/x-pack/plugins/security_solution/common/endpoint/models/policy_config.ts index ec1f9840962da..6a4686a842afe 100644 --- a/x-pack/plugins/security_solution/common/endpoint/models/policy_config.ts +++ b/x-pack/plugins/security_solution/common/endpoint/models/policy_config.ts @@ -22,7 +22,7 @@ export const policyFactory = ( return { meta: { license, - license_uid: licenseUid, + license_uuid: licenseUid, cluster_uuid: clusterUuid, cluster_name: clusterName, cloud, diff --git a/x-pack/plugins/security_solution/common/endpoint/models/policy_config_helpers.test.ts b/x-pack/plugins/security_solution/common/endpoint/models/policy_config_helpers.test.ts index 8b1480656bbb4..8e1c4e087c827 100644 --- a/x-pack/plugins/security_solution/common/endpoint/models/policy_config_helpers.test.ts +++ b/x-pack/plugins/security_solution/common/endpoint/models/policy_config_helpers.test.ts @@ -196,7 +196,7 @@ export const eventsOnlyPolicy = (): PolicyConfig => ({ meta: { license: '', cloud: false, - license_uid: '', + license_uuid: '', cluster_name: '', cluster_uuid: '', serverless: false, diff --git a/x-pack/plugins/security_solution/common/endpoint/types/index.ts b/x-pack/plugins/security_solution/common/endpoint/types/index.ts index e50fd5aa089ff..8f195b926e1f0 100644 --- a/x-pack/plugins/security_solution/common/endpoint/types/index.ts +++ b/x-pack/plugins/security_solution/common/endpoint/types/index.ts @@ -942,7 +942,7 @@ export interface PolicyConfig { meta: { license: string; cloud: boolean; - license_uid: string; + license_uuid: string; cluster_uuid: string; cluster_name: string; serverless: boolean; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts b/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts index 27c86e0e6ca0a..1c7a8e0b18a61 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts +++ b/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts @@ -273,7 +273,7 @@ describe('policy details: ', () => { meta: { license: '', cloud: false, - license_uid: '', + license_uuid: '', cluster_name: '', cluster_uuid: '', serverless: false, diff --git a/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts b/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts index b91bfae4eb405..db45f29e1bb88 100644 --- a/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts +++ b/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts @@ -574,7 +574,7 @@ describe('ingest_integration tests ', () => { const infoResponse = { cluster_name: 'updated-name', cluster_uuid: 'updated-uuid', - license_uid: 'updated-uid', + license_uuid: 'updated-uuid', name: 'name', tagline: 'tagline', version: { @@ -602,7 +602,7 @@ describe('ingest_integration tests ', () => { mockPolicy.meta.license = 'platinum'; // license is set to emit platinum mockPolicy.meta.cluster_name = 'updated-name'; mockPolicy.meta.cluster_uuid = 'updated-uuid'; - mockPolicy.meta.license_uid = 'updated-uid'; + mockPolicy.meta.license_uuid = 'updated-uid'; mockPolicy.meta.serverless = false; const logger = loggingSystemMock.create().get('ingest_integration.test'); const callback = getPackagePolicyUpdateCallback( @@ -621,7 +621,7 @@ describe('ingest_integration tests ', () => { policyConfig.inputs[0]!.config!.policy.value.meta.license = 'gold'; policyConfig.inputs[0]!.config!.policy.value.meta.cluster_name = 'original-name'; policyConfig.inputs[0]!.config!.policy.value.meta.cluster_uuid = 'original-uuid'; - policyConfig.inputs[0]!.config!.policy.value.meta.license_uid = 'original-uid'; + policyConfig.inputs[0]!.config!.policy.value.meta.license_uuid = 'original-uid'; policyConfig.inputs[0]!.config!.policy.value.meta.serverless = true; const updatedPolicyConfig = await callback( policyConfig, @@ -639,7 +639,7 @@ describe('ingest_integration tests ', () => { mockPolicy.meta.license = 'platinum'; // license is set to emit platinum mockPolicy.meta.cluster_name = 'updated-name'; mockPolicy.meta.cluster_uuid = 'updated-uuid'; - mockPolicy.meta.license_uid = 'updated-uid'; + mockPolicy.meta.license_uuid = 'updated-uid'; mockPolicy.meta.serverless = false; const logger = loggingSystemMock.create().get('ingest_integration.test'); const callback = getPackagePolicyUpdateCallback( @@ -657,7 +657,7 @@ describe('ingest_integration tests ', () => { policyConfig.inputs[0]!.config!.policy.value.meta.license = 'platinum'; policyConfig.inputs[0]!.config!.policy.value.meta.cluster_name = 'updated-name'; policyConfig.inputs[0]!.config!.policy.value.meta.cluster_uuid = 'updated-uuid'; - policyConfig.inputs[0]!.config!.policy.value.meta.license_uid = 'updated-uid'; + policyConfig.inputs[0]!.config!.policy.value.meta.license_uuid = 'updated-uid'; policyConfig.inputs[0]!.config!.policy.value.meta.serverless = false; const updatedPolicyConfig = await callback( policyConfig, diff --git a/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.ts b/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.ts index ce6ff450a6869..23da392b96eb0 100644 --- a/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.ts +++ b/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.ts @@ -59,7 +59,7 @@ const shouldUpdateMetaValues = ( currentCloudInfo: boolean, currentClusterName: string, currentClusterUUID: string, - currentLicenseUID: string, + currentLicenseUUID: string, currentIsServerlessEnabled: boolean ) => { return ( @@ -67,7 +67,7 @@ const shouldUpdateMetaValues = ( endpointPackagePolicy.meta.cloud !== currentCloudInfo || endpointPackagePolicy.meta.cluster_name !== currentClusterName || endpointPackagePolicy.meta.cluster_uuid !== currentClusterUUID || - endpointPackagePolicy.meta.license_uid !== currentLicenseUID || + endpointPackagePolicy.meta.license_uuid !== currentLicenseUUID || endpointPackagePolicy.meta.serverless !== currentIsServerlessEnabled ); }; @@ -238,7 +238,7 @@ export const getPackagePolicyUpdateCallback = ( newEndpointPackagePolicy.meta.cloud = cloud?.isCloudEnabled; newEndpointPackagePolicy.meta.cluster_name = esClientInfo.cluster_name; newEndpointPackagePolicy.meta.cluster_uuid = esClientInfo.cluster_uuid; - newEndpointPackagePolicy.meta.license_uid = licenseService.getLicenseUID(); + newEndpointPackagePolicy.meta.license_uuid = licenseService.getLicenseUID(); newEndpointPackagePolicy.meta.serverless = cloud?.isServerlessEnabled; endpointIntegrationData.inputs[0].config.policy.value = newEndpointPackagePolicy; From 6ac03d739ac1f31f58bea67de9e79d98d6c6a313 Mon Sep 17 00:00:00 2001 From: Davis Plumlee <56367316+dplumlee@users.noreply.github.com> Date: Thu, 28 Sep 2023 12:46:11 -0400 Subject: [PATCH 35/61] [Security Solution] Coverage overview test plan (#165530) --- .../coverage_overview_dashboard.md | 202 ++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management/coverage_overview_dashboard.md diff --git a/x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management/coverage_overview_dashboard.md b/x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management/coverage_overview_dashboard.md new file mode 100644 index 0000000000000..08f23aceda9b9 --- /dev/null +++ b/x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management/coverage_overview_dashboard.md @@ -0,0 +1,202 @@ +# Coverage Overview Dashboard + +This is a test plan for the Mitre Att&ck coverage overview dashboard + +Status: `in progress`. The current test plan matches `Milestone 1 - MVP` of the [Protections/Detections Coverage Overview Page](https://github.com/elastic/security-team/issues/2905) epic. The plan will be built upon further as more feature are added in later milestones. + +## Useful information + +### Tickets + +- [Protections/Detections Coverage Overview Page](https://github.com/elastic/security-team/issues/2905) epic +- [Add test coverage for Protections/Detections Coverage Overview](https://github.com/elastic/kibana/issues/162250) +- [Write a test plan for Protections/Detections Coverage Overview](https://github.com/elastic/kibana/issues/162248) + +### Terminology + +- **MITRE ATT&CK**: The [3rd party framework](https://attack.mitre.org/) the dashboard is built upon. It is a knowledge base of attack tactics and techniques adversaries use in real world applications. + +- **Tactic**: A generalized category or process that adversaries use to attack a system. Envelops many relevant Mitre Att&ck techniques + +- **Technique**: A specific technique adversaries use to attack a system. Can belong to one or more different Mitre Tactics and can potentially contain one or more sub-techniques further describing the process. + +- **Rule Activity**: The filter type defining rule status, current options are `enabled` and `disabled`. + +- **Rule Source**: The filter type defining rule type, current options are `prebuilt`(from elastic prebuilt rules package) and `custom`(created by user) + +-**Initial filter state**: The filters present on initial page load. Rule activity will be set to `enabled`, rule source will be set to `prebuilt` and `custom` simultaneously. + +-**Dashboard containing the rule data**: The normal render of the coverage overview dashboard. Any returned rule data mapped correctly to the tile layout of all the MITRE data in a colored grid + +### Assumptions + +- Currently all scenarios below only apply to rules that have correctly mapped `threat` fields (unmapped fields or `threat` fields that don't contain current versioned Mitre Att&ck data will not be displayed in the dashboard) +- The feature is available under the Basic license +- "Rules" will be referring to Security rules only (unless stated otherwise) +- Page always loads with initial filter state + +### Non-functional requirements + +- Number of rules needs to be under 10k due to [an issue](https://github.com/elastic/kibana/issues/160698) + +## Scenarios + +### Coverage overview workflow: base cases + +#### **Scenario: No rules installed** + +**Automation**: 1 e2e test + 1 unit test + 1 integration test. + +```Gherkin +Given no rules installed/created +When user navigates to Coverage Overview page +Then an empty grid of all Mitre tactics and techniques is displayed +``` + +#### **Scenario: Rules installed** + +**Automation**: 1 e2e test + 2 integration test + +```Gherkin +Given prebuilt rules installed and/or custom rules created +And rules enabled +When user navigates to Coverage Overview page +Then page should render all rule data in grid +And color tiles according to filters and dashboard legend + +CASE: Test case should work with non-security rules both present and not present in system +``` + +#### **Scenario: User clicks on tile** + +**Automation**: 1 e2e test + 1 unit test. + +```Gherkin +Given prebuilt rules installed and/or custom rules created +And rules enabled +When user navigates to Coverage Overview page +And clicks on technique tile with non zero rules +Then the popover should display the same number of rule names under their corresponding rule activity section +And each name should link to its own rule details page +And popover title should link to corresponding MITRE technique definition +``` + +#### **Scenario: User clicks on expand/collapse cells button** + +**Automation**: 1 unit test. + +```Gherkin +Given prebuilt rules installed and/or custom rules created +And rules enabled +When user navigates to Coverage Overview page +And clicks on expand cells +Then the grid should display expanded cell view for each tile +And each tile should contain the correct number for enabled/disabled rule count display +``` + +#### **Scenario: User updates from 7.x to 8.x** + +**Automation**: Manual testing. + +```Gherkin +Given user is on `7.x` version of kibana +And has prebuilt rules installed and/or custom rules created +When user upgrades to `8.x` version of kibana +And navigates to the coverage overview page +Then no errors should be thrown when displaying the dashboard containing the rule data +``` + +### Coverage overview workflow: filters + +#### **Scenario: No filters are present** + +**Automation**: 1 integration test. + +```Gherkin +Given coverage overview page is loaded with rule data +When no filters or search term are present +Then the dashboard is rendered according to the rule data +``` + +#### **Scenario: Users enables filters** + +**Automation**: integration tests + e2e tests. + +```Gherkin +Given coverage overview page is loaded with rule data +When filter(s) is/are enabled +Then all filtered rule data is fetched and dashboard containing the rule data is rendered + +CASE: Filtering should work for all permutations of activity and source filters + +Examples: + | type | + | enabled | + | disabled | + | prebuilt | + | custom | + | enabled and disabled | + | prebuilt and custom | + | all | +``` + +#### **Scenario: Search term filter present** + +**Automation**: 1 integration test + 1 e2e test. + +```Gherkin +Given coverage overview page is loaded with rule data +When search term filter is present in search box +And user submits the search +Then only search-filtered rule data is fetched and rendered +``` + +### Coverage overview workflow: rule enabling + +#### **Scenario: User can't enable all rules when no disabled rules** + +**Automation**: 1 unit test. + +```Gherkin +Given coverage overview page is loaded with rule data +When user clicks on a technique tile with no disabled rules +Then "enable all disabled" button should be disabled +``` + +#### **Scenario: User enables all rules for technique** + +**Automation**: 1 e2e test. + +```Gherkin +Given coverage overview page is loaded with rule data +When user clicks on a technique tile with X disabled rules +And clicks "enable all disabled" button +Then all X disabled rules hould be enabled +And user should see success toast message for X rules enabled +And page should update data +``` + +#### **Scenario: User can't enable rules when they don't have CRUD privileges** + +**Automation**: 1 unit test. + +```Gherkin +Given coverage overview page is loaded with rule data +And user that doesn't have CRUD permissions +When user clicks on a technique tile with disabled rules +Then "enable all disabled" button should be disabled +``` + +### Error handling + +#### **Scenario: Error is handled when API error is returned** + +**Automation**: 2 e2e test. + +```Gherkin +Given a user navigates to coverage overview page +And any error is returned from coverage overview API +Then error is handled and displayed via a toast + +CASE: Should work for valid and invalid API body +``` From 726f212d0c4bc262d00aea455538ee9c7006ba5e Mon Sep 17 00:00:00 2001 From: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com> Date: Thu, 28 Sep 2023 18:53:31 +0200 Subject: [PATCH 36/61] [Tags] Prevent duplicates (#167072) --- .buildkite/ftr_configs.yml | 1 + .../saved_objects_tagging_oss/common/types.ts | 1 + .../public/api.mock.ts | 1 + .../components/edition_modal/create_modal.tsx | 39 +++-- .../edition_modal/create_or_edit_modal.tsx | 24 ++- .../components/edition_modal/edit_modal.tsx | 45 ++++-- .../components/edition_modal/open_modal.tsx | 14 +- .../edition_modal/use_validation.ts | 143 ++++++++++++++++++ .../public/components/edition_modal/utils.ts | 9 ++ .../public/management/actions/edit.ts | 2 +- .../public/management/tag_management_page.tsx | 4 +- .../saved_objects_tagging/public/plugin.ts | 3 +- .../public/services/tags/tags_client.mock.ts | 1 + .../public/services/tags/tags_client.ts | 9 ++ .../public/ui_api/components.ts | 6 +- .../public/ui_api/index.ts | 13 +- .../server/routes/internal/find_tags.ts | 2 +- .../server/routes/tags/create_tag.ts | 8 + .../server/routes/tags/update_tag.ts | 8 + .../server/services/tags/tags_client.mock.ts | 1 + .../server/services/tags/tags_client.ts | 24 ++- .../security_and_spaces/apis/test_utils.ts | 26 +++- .../tagging_api/apis/create.ts | 21 +++ .../api_integration/tagging_api/apis/index.ts | 1 - .../tagging_api/apis/update.ts | 33 ++++ .../tagging_usage_collection/config.ts | 36 +++++ .../tagging_usage_collection/services.ts | 15 ++ .../tests.ts} | 3 +- 28 files changed, 451 insertions(+), 42 deletions(-) create mode 100644 x-pack/plugins/saved_objects_tagging/public/components/edition_modal/use_validation.ts create mode 100644 x-pack/test/saved_object_tagging/api_integration/tagging_usage_collection/config.ts create mode 100644 x-pack/test/saved_object_tagging/api_integration/tagging_usage_collection/services.ts rename x-pack/test/saved_object_tagging/api_integration/{tagging_api/apis/usage_collection.ts => tagging_usage_collection/tests.ts} (94%) diff --git a/.buildkite/ftr_configs.yml b/.buildkite/ftr_configs.yml index b25f6f1bf44ac..309bf005084c9 100644 --- a/.buildkite/ftr_configs.yml +++ b/.buildkite/ftr_configs.yml @@ -357,6 +357,7 @@ enabled: - x-pack/test/saved_object_api_integration/spaces_only/config.ts - x-pack/test/saved_object_tagging/api_integration/security_and_spaces/config.ts - x-pack/test/saved_object_tagging/api_integration/tagging_api/config.ts + - x-pack/test/saved_object_tagging/api_integration/tagging_usage_collection/config.ts - x-pack/test/saved_object_tagging/functional/config.ts - x-pack/test/saved_objects_field_count/config.ts - x-pack/test/search_sessions_integration/config.ts diff --git a/src/plugins/saved_objects_tagging_oss/common/types.ts b/src/plugins/saved_objects_tagging_oss/common/types.ts index e62639659b5f4..046e187a6b9d7 100644 --- a/src/plugins/saved_objects_tagging_oss/common/types.ts +++ b/src/plugins/saved_objects_tagging_oss/common/types.ts @@ -35,6 +35,7 @@ export interface ITagsClient { create(attributes: TagAttributes, options?: CreateTagOptions): Promise; get(id: string): Promise; getAll(options?: GetAllTagsOptions): Promise; + findByName(name: string, options?: { exact?: boolean }): Promise; delete(id: string): Promise; update(id: string, attributes: TagAttributes): Promise; } diff --git a/src/plugins/saved_objects_tagging_oss/public/api.mock.ts b/src/plugins/saved_objects_tagging_oss/public/api.mock.ts index e96aa2277b0a5..f481319ec7fb0 100644 --- a/src/plugins/saved_objects_tagging_oss/public/api.mock.ts +++ b/src/plugins/saved_objects_tagging_oss/public/api.mock.ts @@ -16,6 +16,7 @@ const createClientMock = () => { getAll: jest.fn(), delete: jest.fn(), update: jest.fn(), + findByName: jest.fn(), }; return mock; diff --git a/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/create_modal.tsx b/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/create_modal.tsx index ed4b73c3ea0d3..9f270771b3cc7 100644 --- a/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/create_modal.tsx +++ b/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/create_modal.tsx @@ -6,17 +6,22 @@ */ import React, { FC, useState, useCallback } from 'react'; +import { first, lastValueFrom } from 'rxjs'; +import { i18n } from '@kbn/i18n'; +import type { NotificationsStart } from '@kbn/core/public'; + import { ITagsClient, Tag, TagAttributes } from '../../../common/types'; -import { TagValidation } from '../../../common/validation'; import { isServerValidationError } from '../../services/tags'; import { getRandomColor, validateTag } from './utils'; import { CreateOrEditModal } from './create_or_edit_modal'; +import { useValidation } from './use_validation'; interface CreateTagModalProps { defaultValues?: Partial; onClose: () => void; onSave: (tag: Tag) => void; tagClient: ITagsClient; + notifications: NotificationsStart; } const getDefaultAttributes = (providedDefaults?: Partial): TagAttributes => ({ @@ -26,22 +31,21 @@ const getDefaultAttributes = (providedDefaults?: Partial): TagAtt ...providedDefaults, }); -const initialValidation: TagValidation = { - valid: true, - warnings: [], - errors: {}, -}; - export const CreateTagModal: FC = ({ defaultValues, tagClient, + notifications, onClose, onSave, }) => { - const [validation, setValidation] = useState(initialValidation); const [tagAttributes, setTagAttributes] = useState( getDefaultAttributes(defaultValues) ); + const { validation, setValidation, onNameChange, validation$, isValidating } = useValidation({ + tagAttributes, + tagClient, + validateDuplicateNameOnMount: true, + }); const setField = useCallback( (field: T) => @@ -55,6 +59,14 @@ export const CreateTagModal: FC = ({ ); const onSubmit = useCallback(async () => { + const { hasDuplicateNameError } = await lastValueFrom( + validation$.pipe(first((v) => v.isValidating === false)) + ); + + if (hasDuplicateNameError) { + return; + } + const clientValidation = validateTag(tagAttributes); setValidation(clientValidation); if (!clientValidation.valid) { @@ -68,18 +80,27 @@ export const CreateTagModal: FC = ({ // if e is IHttpFetchError, actual server error payload is in e.body if (isServerValidationError(e.body)) { setValidation(e.body.attributes); + } else { + notifications.toasts.addDanger({ + title: i18n.translate('xpack.savedObjectsTagging.saveTagErrorTitle', { + defaultMessage: 'An error occurred creating tag', + }), + text: e.body.message, + }); } } - }, [tagAttributes, tagClient, onSave]); + }, [validation$, tagAttributes, setValidation, tagClient, onSave, notifications.toasts]); return ( ); }; diff --git a/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/create_or_edit_modal.tsx b/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/create_or_edit_modal.tsx index f972220843b47..0b5e838213959 100644 --- a/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/create_or_edit_modal.tsx +++ b/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/create_or_edit_modal.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { FC, useState, useCallback, useMemo } from 'react'; +import React, { FC, useState, useCallback, useMemo, useRef } from 'react'; import { EuiButtonEmpty, EuiButton, @@ -27,6 +27,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; +import useDebounce from 'react-use/lib/useDebounce'; import { TagAttributes, TagValidation, @@ -40,16 +41,23 @@ import { getRandomColor, useIfMounted } from './utils'; interface CreateOrEditModalProps { onClose: () => void; onSubmit: () => Promise; + onNameChange: ( + name: string, + options?: { debounced?: boolean; hasBeenModified?: boolean } + ) => Promise; mode: 'create' | 'edit'; tag: TagAttributes; validation: TagValidation; + isValidating: boolean; setField: (field: T) => (value: TagAttributes[T]) => void; } export const CreateOrEditModal: FC = ({ onClose, onSubmit, + onNameChange, validation, + isValidating, setField, tag, mode, @@ -57,6 +65,7 @@ export const CreateOrEditModal: FC = ({ const optionalMessageId = htmlIdGenerator()(); const ifMounted = useIfMounted(); const [submitting, setSubmitting] = useState(false); + const lastNameValue = useRef(tag.name); // we don't want this value to change when the user edits the tag // eslint-disable-next-line react-hooks/exhaustive-deps @@ -68,6 +77,8 @@ export const CreateOrEditModal: FC = ({ tag.description !== initialTag.description, [initialTag, tag] ); + const nameHasBeenModified = tag.name !== lastNameValue.current; + const setName = useMemo(() => setField('name'), [setField]); const setColor = useMemo(() => setField('color'), [setField]); const setDescription = useMemo(() => setField('description'), [setField]); @@ -91,6 +102,15 @@ export const CreateOrEditModal: FC = ({ }); }, [ifMounted, onSubmit]); + useDebounce( + () => { + onNameChange(tag.name, { debounced: true, hasBeenModified: nameHasBeenModified }); + lastNameValue.current = tag.name; + }, + 300, + [tag.name, nameHasBeenModified] + ); + return ( @@ -130,6 +150,7 @@ export const CreateOrEditModal: FC = ({ maxLength={tagNameMaxLength} value={tag.name} onChange={(e) => setName(e.target.value)} + isLoading={isValidating} data-test-subj="createModalField-name" /> @@ -238,6 +259,7 @@ export const CreateOrEditModal: FC = ({ fill data-test-subj="createModalConfirmButton" onClick={onFormSubmit} + isLoading={submitting} isDisabled={submitting || (isEdit && !tagHasBeenModified)} > {isEdit ? ( diff --git a/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/edit_modal.tsx b/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/edit_modal.tsx index 4f0e956e6561c..d3419e831c18a 100644 --- a/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/edit_modal.tsx +++ b/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/edit_modal.tsx @@ -6,33 +6,40 @@ */ import React, { FC, useState, useCallback } from 'react'; +import { i18n } from '@kbn/i18n'; +import type { NotificationsStart } from '@kbn/core/public'; +import { first, lastValueFrom } from 'rxjs'; import { ITagsClient, Tag, TagAttributes } from '../../../common/types'; -import { TagValidation } from '../../../common/validation'; import { isServerValidationError } from '../../services/tags'; import { CreateOrEditModal } from './create_or_edit_modal'; import { validateTag } from './utils'; +import { useValidation } from './use_validation'; interface EditTagModalProps { tag: Tag; onClose: () => void; onSave: (tag: Tag) => void; tagClient: ITagsClient; + notifications: NotificationsStart; } -const initialValidation: TagValidation = { - valid: true, - warnings: [], - errors: {}, -}; - const getAttributes = (tag: Tag): TagAttributes => { const { id, ...attributes } = tag; return attributes; }; -export const EditTagModal: FC = ({ tag, onSave, onClose, tagClient }) => { - const [validation, setValidation] = useState(initialValidation); +export const EditTagModal: FC = ({ + tag, + onSave, + onClose, + tagClient, + notifications, +}) => { const [tagAttributes, setTagAttributes] = useState(getAttributes(tag)); + const { validation, setValidation, onNameChange, isValidating, validation$ } = useValidation({ + tagAttributes, + tagClient, + }); const setField = useCallback( (field: T) => @@ -46,8 +53,17 @@ export const EditTagModal: FC = ({ tag, onSave, onClose, tagC ); const onSubmit = useCallback(async () => { + const { hasDuplicateNameError } = await lastValueFrom( + validation$.pipe(first((v) => v.isValidating === false)) + ); + + if (hasDuplicateNameError) { + return; + } + const clientValidation = validateTag(tagAttributes); setValidation(clientValidation); + if (!clientValidation.valid) { return; } @@ -59,18 +75,27 @@ export const EditTagModal: FC = ({ tag, onSave, onClose, tagC // if e is IHttpFetchError, actual server error payload is in e.body if (isServerValidationError(e.body)) { setValidation(e.body.attributes); + } else { + notifications.toasts.addDanger({ + title: i18n.translate('xpack.savedObjectsTagging.editTagErrorTitle', { + defaultMessage: 'An error occurred editing tag', + }), + text: e.body.message, + }); } } - }, [tagAttributes, tagClient, onSave, tag]); + }, [validation$, tagAttributes, setValidation, tagClient, tag.id, onSave, notifications.toasts]); return ( ); }; diff --git a/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/open_modal.tsx b/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/open_modal.tsx index 66ec3139a89f9..9fb8dc28c466e 100644 --- a/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/open_modal.tsx +++ b/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/open_modal.tsx @@ -7,13 +7,19 @@ import React from 'react'; import { EuiDelayRender, EuiLoadingSpinner } from '@elastic/eui'; -import { OverlayStart, OverlayRef, ThemeServiceStart } from '@kbn/core/public'; +import type { + OverlayStart, + OverlayRef, + ThemeServiceStart, + NotificationsStart, +} from '@kbn/core/public'; import { toMountPoint } from '@kbn/kibana-react-plugin/public'; import { Tag, TagAttributes } from '../../../common/types'; import { ITagInternalClient } from '../../services'; interface GetModalOpenerOptions { overlays: OverlayStart; + notifications: NotificationsStart; theme: ThemeServiceStart; tagClient: ITagInternalClient; } @@ -40,7 +46,7 @@ const LazyEditTagModal = React.lazy(() => ); export const getCreateModalOpener = - ({ overlays, theme, tagClient }: GetModalOpenerOptions): CreateModalOpener => + ({ overlays, theme, tagClient, notifications }: GetModalOpenerOptions): CreateModalOpener => async ({ onCreate, defaultValues }: OpenCreateModalOptions) => { const modal = overlays.openModal( toMountPoint( @@ -55,6 +61,7 @@ export const getCreateModalOpener = onCreate(tag); }} tagClient={tagClient} + notifications={notifications} /> , { theme$: theme.theme$ } @@ -69,7 +76,7 @@ interface OpenEditModalOptions { } export const getEditModalOpener = - ({ overlays, theme, tagClient }: GetModalOpenerOptions) => + ({ overlays, theme, tagClient, notifications }: GetModalOpenerOptions) => async ({ tagId, onUpdate }: OpenEditModalOptions) => { const tag = await tagClient.get(tagId); @@ -86,6 +93,7 @@ export const getEditModalOpener = onUpdate(saved); }} tagClient={tagClient} + notifications={notifications} /> , { theme$: theme.theme$ } diff --git a/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/use_validation.ts b/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/use_validation.ts new file mode 100644 index 0000000000000..0d386e7aaa5a0 --- /dev/null +++ b/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/use_validation.ts @@ -0,0 +1,143 @@ +/* + * 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 { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { BehaviorSubject } from 'rxjs'; +import useObservable from 'react-use/lib/useObservable'; + +import { type TagValidation, validateTagName } from '../../../common'; +import type { ITagsClient, TagAttributes } from '../../../common/types'; +import { duplicateTagNameErrorMessage, validateTag } from './utils'; + +const initialValidation: TagValidation = { + valid: true, + warnings: [], + errors: {}, +}; + +export const useValidation = ({ + tagAttributes, + tagClient, + validateDuplicateNameOnMount = false, +}: { + tagAttributes: TagAttributes; + tagClient: ITagsClient; + validateDuplicateNameOnMount?: boolean; +}) => { + const isMounted = useRef(false); + const [validation, setValidation] = useState(initialValidation); + const { + errors: { name: nameError }, + } = validation; + + const validation$ = useMemo( + () => + new BehaviorSubject({ + isValidating: false, + hasDuplicateNameError: false, + }), + [] + ); + + const { isValidating = false } = useObservable(validation$) ?? {}; + + const setIsValidating = useCallback( + (value: boolean) => { + validation$.next({ + ...validation$.value, + isValidating: value, + }); + }, + [validation$] + ); + + const validateDuplicateTagName = useCallback( + async (name: string) => { + const error = validateTagName(name); + if (error) { + return; + } + + const existingTag = await tagClient.findByName(name, { exact: true }); + + if (existingTag) { + setValidation((prev) => ({ + ...prev, + valid: false, + errors: { + ...prev.errors, + name: duplicateTagNameErrorMessage, + }, + })); + } + + setIsValidating(false); + }, + [tagClient, setIsValidating] + ); + + const onNameChange = useCallback( + async ( + name: string, + { + debounced = false, + hasBeenModified = true, + }: { debounced?: boolean; hasBeenModified?: boolean } = {} + ) => { + setIsValidating(true); + + if (debounced) { + if (hasBeenModified) { + await validateDuplicateTagName(name); + } + setIsValidating(false); + } + }, + [setIsValidating, validateDuplicateTagName] + ); + + useEffect(() => { + if (isMounted.current) { + onNameChange(tagAttributes.name); + } + }, [onNameChange, tagAttributes.name]); + + useEffect(() => { + if (isMounted.current) { + setValidation(validateTag(tagAttributes)); + } + }, [tagAttributes]); + + useEffect(() => { + if (validateDuplicateNameOnMount && tagAttributes.name && !isMounted.current) { + setIsValidating(true); + validateDuplicateTagName(tagAttributes.name); + } + isMounted.current = true; + }, [ + validateDuplicateNameOnMount, + tagAttributes.name, + validateDuplicateTagName, + validation$, + setIsValidating, + ]); + + useEffect(() => { + validation$.next({ + ...validation$.value, + hasDuplicateNameError: nameError === duplicateTagNameErrorMessage, + }); + }, [nameError, validation$]); + + return { + validation, + setValidation, + isValidating, + validation$, + onNameChange, + }; +}; diff --git a/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/utils.ts b/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/utils.ts index 52258be0600f3..62ae1023c5b84 100644 --- a/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/utils.ts +++ b/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/utils.ts @@ -6,6 +6,8 @@ */ import { useCallback, useEffect, useRef } from 'react'; +import { i18n } from '@kbn/i18n'; + import { TagAttributes, TagValidation, @@ -21,6 +23,13 @@ export const getRandomColor = (): string => { return '#' + String(Math.floor(Math.random() * 16777215).toString(16)).padStart(6, '0'); }; +export const duplicateTagNameErrorMessage = i18n.translate( + 'xpack.savedObjectsTagging.validation.name.duplicateError', + { + defaultMessage: 'Name has already been taken.', + } +); + export const validateTag = (tag: TagAttributes): TagValidation => { const validation: TagValidation = { valid: true, diff --git a/x-pack/plugins/saved_objects_tagging/public/management/actions/edit.ts b/x-pack/plugins/saved_objects_tagging/public/management/actions/edit.ts index 57955c05a2ac4..f0b8e1ed5ec0d 100644 --- a/x-pack/plugins/saved_objects_tagging/public/management/actions/edit.ts +++ b/x-pack/plugins/saved_objects_tagging/public/management/actions/edit.ts @@ -27,7 +27,7 @@ export const getEditAction = ({ tagClient, fetchTags, }: GetEditActionOptions): TagAction => { - const editModalOpener = getEditModalOpener({ overlays, theme, tagClient }); + const editModalOpener = getEditModalOpener({ overlays, theme, tagClient, notifications }); return { id: 'edit', name: ({ name }) => diff --git a/x-pack/plugins/saved_objects_tagging/public/management/tag_management_page.tsx b/x-pack/plugins/saved_objects_tagging/public/management/tag_management_page.tsx index 3bad8d82b664c..8093d59a29bd2 100644 --- a/x-pack/plugins/saved_objects_tagging/public/management/tag_management_page.tsx +++ b/x-pack/plugins/saved_objects_tagging/public/management/tag_management_page.tsx @@ -75,8 +75,8 @@ export const TagManagementPage: FC = ({ }); const createModalOpener = useMemo( - () => getCreateModalOpener({ overlays, theme, tagClient }), - [overlays, theme, tagClient] + () => getCreateModalOpener({ overlays, theme, tagClient, notifications }), + [overlays, theme, tagClient, notifications] ); const tableActions = useMemo(() => { diff --git a/x-pack/plugins/saved_objects_tagging/public/plugin.ts b/x-pack/plugins/saved_objects_tagging/public/plugin.ts index 5c93917f476c5..e5ad1dfa5095f 100644 --- a/x-pack/plugins/saved_objects_tagging/public/plugin.ts +++ b/x-pack/plugins/saved_objects_tagging/public/plugin.ts @@ -67,7 +67,7 @@ export class SavedObjectTaggingPlugin return {}; } - public start({ http, application, overlays, theme, analytics }: CoreStart) { + public start({ http, application, overlays, theme, analytics, notifications }: CoreStart) { this.tagCache = new TagsCache({ refreshHandler: () => this.tagClient!.getAll({ asSystemRequest: true }), refreshInterval: this.config.cacheRefreshInterval, @@ -92,6 +92,7 @@ export class SavedObjectTaggingPlugin capabilities: getTagsCapabilities(application.capabilities), overlays, theme, + notifications, }), }; } diff --git a/x-pack/plugins/saved_objects_tagging/public/services/tags/tags_client.mock.ts b/x-pack/plugins/saved_objects_tagging/public/services/tags/tags_client.mock.ts index d7cc52b857dc0..0183be7fc9d21 100644 --- a/x-pack/plugins/saved_objects_tagging/public/services/tags/tags_client.mock.ts +++ b/x-pack/plugins/saved_objects_tagging/public/services/tags/tags_client.mock.ts @@ -15,6 +15,7 @@ const createInternalClientMock = () => { delete: jest.fn(), update: jest.fn(), find: jest.fn(), + findByName: jest.fn(), bulkDelete: jest.fn(), }; diff --git a/x-pack/plugins/saved_objects_tagging/public/services/tags/tags_client.ts b/x-pack/plugins/saved_objects_tagging/public/services/tags/tags_client.ts index 46aa43df7d075..224c658632523 100644 --- a/x-pack/plugins/saved_objects_tagging/public/services/tags/tags_client.ts +++ b/x-pack/plugins/saved_objects_tagging/public/services/tags/tags_client.ts @@ -173,6 +173,15 @@ export class TagsClient implements ITagInternalClient { return response; } + public async findByName(name: string, { exact }: { exact?: boolean } = { exact: false }) { + const { tags = [] } = await this.find({ page: 1, perPage: 10000, search: name }); + if (exact) { + const tag = tags.find((t) => t.name.toLocaleLowerCase() === name.toLocaleLowerCase()); + return tag ?? null; + } + return tags.length > 0 ? tags[0] : null; + } + public async bulkDelete(tagIds: string[]) { const startTime = window.performance.now(); await this.http.post<{}>('/internal/saved_objects_tagging/tags/_bulk_delete', { diff --git a/x-pack/plugins/saved_objects_tagging/public/ui_api/components.ts b/x-pack/plugins/saved_objects_tagging/public/ui_api/components.ts index 36f4f61f4d582..e6a504c49e87d 100644 --- a/x-pack/plugins/saved_objects_tagging/public/ui_api/components.ts +++ b/x-pack/plugins/saved_objects_tagging/public/ui_api/components.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { OverlayStart, ThemeServiceStart } from '@kbn/core/public'; +import { NotificationsStart, OverlayStart, ThemeServiceStart } from '@kbn/core/public'; import { SavedObjectsTaggingApiUiComponent } from '@kbn/saved-objects-tagging-oss-plugin/public'; import { TagsCapabilities } from '../../common'; import { ITagInternalClient, ITagsCache } from '../services'; @@ -22,6 +22,7 @@ export interface GetComponentsOptions { overlays: OverlayStart; theme: ThemeServiceStart; tagClient: ITagInternalClient; + notifications: NotificationsStart; } export const getComponents = ({ @@ -30,8 +31,9 @@ export const getComponents = ({ overlays, theme, tagClient, + notifications, }: GetComponentsOptions): SavedObjectsTaggingApiUiComponent => { - const openCreateModal = getCreateModalOpener({ overlays, theme, tagClient }); + const openCreateModal = getCreateModalOpener({ overlays, theme, tagClient, notifications }); return { TagList: getConnectedTagListComponent({ cache }), TagSelector: getConnectedTagSelectorComponent({ cache, capabilities, openCreateModal }), diff --git a/x-pack/plugins/saved_objects_tagging/public/ui_api/index.ts b/x-pack/plugins/saved_objects_tagging/public/ui_api/index.ts index 8d53135f3f55a..b2dca68d5cc95 100644 --- a/x-pack/plugins/saved_objects_tagging/public/ui_api/index.ts +++ b/x-pack/plugins/saved_objects_tagging/public/ui_api/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { OverlayStart, ThemeServiceStart } from '@kbn/core/public'; +import type { NotificationsStart, OverlayStart, ThemeServiceStart } from '@kbn/core/public'; import { SavedObjectsTaggingApiUi } from '@kbn/saved-objects-tagging-oss-plugin/public'; import { TagsCapabilities } from '../../common'; import { ITagsCache, ITagInternalClient } from '../services'; @@ -29,6 +29,7 @@ interface GetUiApiOptions { capabilities: TagsCapabilities; cache: ITagsCache; client: ITagInternalClient; + notifications: NotificationsStart; } export const getUiApi = ({ @@ -37,8 +38,16 @@ export const getUiApi = ({ client, overlays, theme, + notifications, }: GetUiApiOptions): SavedObjectsTaggingApiUi => { - const components = getComponents({ cache, capabilities, overlays, theme, tagClient: client }); + const components = getComponents({ + cache, + capabilities, + overlays, + theme, + tagClient: client, + notifications, + }); const getTagList = buildGetTagList(cache); diff --git a/x-pack/plugins/saved_objects_tagging/server/routes/internal/find_tags.ts b/x-pack/plugins/saved_objects_tagging/server/routes/internal/find_tags.ts index 32318f39b5a0c..8da060eda0cca 100644 --- a/x-pack/plugins/saved_objects_tagging/server/routes/internal/find_tags.ts +++ b/x-pack/plugins/saved_objects_tagging/server/routes/internal/find_tags.ts @@ -33,7 +33,7 @@ export const registerInternalFindTagsRoute = (router: TagsPluginRouter) => { perPage: query.perPage, search: query.search, type: [tagSavedObjectTypeName], - searchFields: ['title', 'description'], + searchFields: ['name', 'description'], }); const tags = findResponse.saved_objects.map(savedObjectToTag); diff --git a/x-pack/plugins/saved_objects_tagging/server/routes/tags/create_tag.ts b/x-pack/plugins/saved_objects_tagging/server/routes/tags/create_tag.ts index 7b9e6a32d3aea..0c48168eed281 100644 --- a/x-pack/plugins/saved_objects_tagging/server/routes/tags/create_tag.ts +++ b/x-pack/plugins/saved_objects_tagging/server/routes/tags/create_tag.ts @@ -24,6 +24,14 @@ export const registerCreateTagRoute = (router: TagsPluginRouter) => { router.handleLegacyErrors(async (ctx, req, res) => { try { const { tagsClient } = await ctx.tags; + + const existingTag = await tagsClient.findByName(req.body.name, { exact: true }); + if (existingTag) { + return res.conflict({ + body: `A tag with the name "${req.body.name}" already exists.`, + }); + } + const tag = await tagsClient.create(req.body); return res.ok({ body: { diff --git a/x-pack/plugins/saved_objects_tagging/server/routes/tags/update_tag.ts b/x-pack/plugins/saved_objects_tagging/server/routes/tags/update_tag.ts index 67b7d7a6acbda..62f8c73dddc78 100644 --- a/x-pack/plugins/saved_objects_tagging/server/routes/tags/update_tag.ts +++ b/x-pack/plugins/saved_objects_tagging/server/routes/tags/update_tag.ts @@ -28,6 +28,14 @@ export const registerUpdateTagRoute = (router: TagsPluginRouter) => { const { id } = req.params; try { const { tagsClient } = await ctx.tags; + + const existingTag = await tagsClient.findByName(req.body.name, { exact: true }); + if (existingTag && existingTag.id !== id) { + return res.conflict({ + body: `A tag with the name "${req.body.name}" already exists.`, + }); + } + const tag = await tagsClient.update(id, req.body); return res.ok({ body: { diff --git a/x-pack/plugins/saved_objects_tagging/server/services/tags/tags_client.mock.ts b/x-pack/plugins/saved_objects_tagging/server/services/tags/tags_client.mock.ts index e56bf2b963112..9507208971d84 100644 --- a/x-pack/plugins/saved_objects_tagging/server/services/tags/tags_client.mock.ts +++ b/x-pack/plugins/saved_objects_tagging/server/services/tags/tags_client.mock.ts @@ -14,6 +14,7 @@ const createClientMock = () => { getAll: jest.fn(), delete: jest.fn(), update: jest.fn(), + findByName: jest.fn(), }; return mock; diff --git a/x-pack/plugins/saved_objects_tagging/server/services/tags/tags_client.ts b/x-pack/plugins/saved_objects_tagging/server/services/tags/tags_client.ts index 23e1da56d6143..f213f279975a3 100644 --- a/x-pack/plugins/saved_objects_tagging/server/services/tags/tags_client.ts +++ b/x-pack/plugins/saved_objects_tagging/server/services/tags/tags_client.ts @@ -6,7 +6,7 @@ */ import { SavedObjectsClientContract } from '@kbn/core/server'; -import { CreateTagOptions } from '@kbn/saved-objects-tagging-oss-plugin/common/types'; +import { CreateTagOptions, Tag } from '@kbn/saved-objects-tagging-oss-plugin/common/types'; import { TagSavedObject, TagAttributes, ITagsClient } from '../../../common/types'; import { tagSavedObjectTypeName } from '../../../common/constants'; import { TagValidationError } from './errors'; @@ -63,6 +63,28 @@ export class TagsClient implements ITagsClient { return results.map(savedObjectToTag); } + public async findByName( + name: string, + { exact = false }: { exact?: boolean | undefined } = {} + ): Promise { + const response = await this.soClient.find({ + type: this.type, + search: name, + searchFields: ['name'], + perPage: 1000, + }); + + if (response.total === 0) { + return null; + } + + const tag = exact + ? response.saved_objects.find((t) => t.attributes.name.toLowerCase() === name.toLowerCase()) + : response.saved_objects[0]; + + return tag ? savedObjectToTag(tag) : null; + } + public async delete(id: string) { // `removeReferencesTo` security check is the same as a `delete` operation's, so we can use the scoped client here. // If that was to change, we would need to use the internal client instead. A FTR test is ensuring diff --git a/x-pack/test/saved_object_tagging/api_integration/security_and_spaces/apis/test_utils.ts b/x-pack/test/saved_object_tagging/api_integration/security_and_spaces/apis/test_utils.ts index ca821c491c9c4..39c9a8bb22b0b 100644 --- a/x-pack/test/saved_object_tagging/api_integration/security_and_spaces/apis/test_utils.ts +++ b/x-pack/test/saved_object_tagging/api_integration/security_and_spaces/apis/test_utils.ts @@ -40,11 +40,23 @@ export const createTags = async ({ getService }: FtrProviderContext) => { export const deleteTags = async ({ getService }: FtrProviderContext) => { const kibanaServer = getService('kibanaServer'); - await kibanaServer.importExport.unload( - 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/rbac_tags/default_space.json' - ); - await kibanaServer.importExport.unload( - 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/rbac_tags/space_1.json', - { space: 'space_1' } - ); + while (true) { + const defaultTags = await kibanaServer.savedObjects.find({ type: 'tag', space: 'default' }); + const spaceTags = await kibanaServer.savedObjects.find({ type: 'tag', space: 'space_1' }); + if (defaultTags.saved_objects.length === 0 && spaceTags.saved_objects.length === 0) { + await new Promise((resolve) => setTimeout(resolve, 1000)); + break; + } + if (defaultTags.saved_objects.length !== 0) { + await kibanaServer.savedObjects.bulkDelete({ + objects: defaultTags.saved_objects.map(({ type, id }) => ({ type, id })), + }); + } + if (spaceTags.saved_objects.length !== 0) { + await kibanaServer.savedObjects.bulkDelete({ + objects: spaceTags.saved_objects.map(({ type, id }) => ({ type, id })), + space: 'space_1', + }); + } + } }; diff --git a/x-pack/test/saved_object_tagging/api_integration/tagging_api/apis/create.ts b/x-pack/test/saved_object_tagging/api_integration/tagging_api/apis/create.ts index 4c867ca50b11e..60cbc51364813 100644 --- a/x-pack/test/saved_object_tagging/api_integration/tagging_api/apis/create.ts +++ b/x-pack/test/saved_object_tagging/api_integration/tagging_api/apis/create.ts @@ -59,6 +59,8 @@ export default function ({ getService }: FtrProviderContext) { }, }); }); + + await supertest.delete(`/api/saved_objects_tagging/tags/${newTagId}`); }); it('should return an error with details when validation failed', async () => { @@ -86,5 +88,24 @@ export default function ({ getService }: FtrProviderContext) { }); }); }); + + it('cannot create a new tag with existing name', async () => { + const existingName = 'tag-1'; + await supertest + .post(`/api/saved_objects_tagging/tags/create`) + .send({ + name: existingName, + description: 'some desc', + color: '#000000', + }) + .expect(409) + .then(({ body }) => { + expect(body).to.eql({ + statusCode: 409, + error: 'Conflict', + message: `A tag with the name "${existingName}" already exists.`, + }); + }); + }); }); } diff --git a/x-pack/test/saved_object_tagging/api_integration/tagging_api/apis/index.ts b/x-pack/test/saved_object_tagging/api_integration/tagging_api/apis/index.ts index f291d2537ed02..e8b16d5878f2d 100644 --- a/x-pack/test/saved_object_tagging/api_integration/tagging_api/apis/index.ts +++ b/x-pack/test/saved_object_tagging/api_integration/tagging_api/apis/index.ts @@ -14,6 +14,5 @@ export default function ({ loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./create')); loadTestFile(require.resolve('./update')); loadTestFile(require.resolve('./bulk_assign')); - loadTestFile(require.resolve('./usage_collection')); }); } diff --git a/x-pack/test/saved_object_tagging/api_integration/tagging_api/apis/update.ts b/x-pack/test/saved_object_tagging/api_integration/tagging_api/apis/update.ts index 2efe8184ed7c9..b75513bb001da 100644 --- a/x-pack/test/saved_object_tagging/api_integration/tagging_api/apis/update.ts +++ b/x-pack/test/saved_object_tagging/api_integration/tagging_api/apis/update.ts @@ -61,6 +61,39 @@ export default function ({ getService }: FtrProviderContext) { }); }); + it('should not allow updating tag name to an existing name', async () => { + const existingName = 'tag-3'; + await supertest + .post(`/api/saved_objects_tagging/tags/tag-2`) + .send({ + name: existingName, + description: 'updated desc', + color: '#123456', + }) + .expect(409) + .then(({ body }) => { + expect(body).to.eql({ + statusCode: 409, + error: 'Conflict', + message: `A tag with the name "${existingName}" already exists.`, + }); + }); + + await supertest + .get(`/api/saved_objects_tagging/tags/tag-3`) + .expect(200) + .then(({ body }) => { + expect(body).to.eql({ + tag: { + id: 'tag-3', + name: 'tag-3', + description: 'Last but not least', + color: '#000000', + }, + }); + }); + }); + it('should return a 404 when trying to update a non existing tag', async () => { await supertest .post(`/api/saved_objects_tagging/tags/unknown-tag-id`) diff --git a/x-pack/test/saved_object_tagging/api_integration/tagging_usage_collection/config.ts b/x-pack/test/saved_object_tagging/api_integration/tagging_usage_collection/config.ts new file mode 100644 index 0000000000000..22edd56fffdbc --- /dev/null +++ b/x-pack/test/saved_object_tagging/api_integration/tagging_usage_collection/config.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 { FtrConfigProviderContext } from '@kbn/test'; +import { services } from './services'; + +// eslint-disable-next-line import/no-default-export +export default async function ({ readConfigFile }: FtrConfigProviderContext) { + const apiIntegrationConfig = await readConfigFile( + require.resolve('../../../api_integration/config.ts') + ); + + return { + testFiles: [require.resolve('./tests')], + servers: apiIntegrationConfig.get('servers'), + services, + junit: { + reportName: 'X-Pack Saved Object Tagging Usage Collection', + }, + esTestCluster: { + ...apiIntegrationConfig.get('esTestCluster'), + license: 'trial', + }, + kbnTestServer: { + ...apiIntegrationConfig.get('kbnTestServer'), + serverArgs: [ + ...apiIntegrationConfig.get('kbnTestServer.serverArgs'), + '--server.xsrf.disableProtection=true', + ], + }, + }; +} diff --git a/x-pack/test/saved_object_tagging/api_integration/tagging_usage_collection/services.ts b/x-pack/test/saved_object_tagging/api_integration/tagging_usage_collection/services.ts new file mode 100644 index 0000000000000..194d6ec533066 --- /dev/null +++ b/x-pack/test/saved_object_tagging/api_integration/tagging_usage_collection/services.ts @@ -0,0 +1,15 @@ +/* + * 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 { GenericFtrProviderContext } from '@kbn/test'; +import { services as apiIntegrationServices } from '../../../api_integration/services'; + +export const services = { + ...apiIntegrationServices, +}; + +export type FtrProviderContext = GenericFtrProviderContext; diff --git a/x-pack/test/saved_object_tagging/api_integration/tagging_api/apis/usage_collection.ts b/x-pack/test/saved_object_tagging/api_integration/tagging_usage_collection/tests.ts similarity index 94% rename from x-pack/test/saved_object_tagging/api_integration/tagging_api/apis/usage_collection.ts rename to x-pack/test/saved_object_tagging/api_integration/tagging_usage_collection/tests.ts index d5d042ad9f956..b8dab8d648333 100644 --- a/x-pack/test/saved_object_tagging/api_integration/tagging_api/apis/usage_collection.ts +++ b/x-pack/test/saved_object_tagging/api_integration/tagging_usage_collection/tests.ts @@ -6,7 +6,7 @@ */ import expect from '@kbn/expect'; -import { FtrProviderContext } from '../services'; +import { FtrProviderContext } from './services'; // eslint-disable-next-line import/no-default-export export default function ({ getService }: FtrProviderContext) { @@ -15,6 +15,7 @@ export default function ({ getService }: FtrProviderContext) { describe('saved_object_tagging usage collector data', () => { beforeEach(async () => { + await kibanaServer.savedObjects.cleanStandardList(); await kibanaServer.importExport.load( 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/usage_collection/data.json' ); From 549195ce4f9b6242b39c364041c84500ab520aea Mon Sep 17 00:00:00 2001 From: jennypavlova Date: Thu, 28 Sep 2023 19:02:34 +0200 Subject: [PATCH 37/61] [Infra UI] Replace node details flyout with asset details flyout in the inventory page (#166965) Closes #161754 Closes #166807 To make the testing and review easier I merged the old components [cleanup PR](https://github.com/jennypavlova/kibana/pull/5) into this one ## Summary This PR replaces the old node details view with the asset details flyout ### Old ![image](https://github.com/elastic/kibana/assets/14139027/ffbead5b-6f89-4397-b1a4-2ade74f7f227) ### New ![image](https://github.com/elastic/kibana/assets/14139027/89fa52cd-a462-499e-900a-e26c70d17791) ### Testing 1. Go to inventory 2. Click on a host in the waffle map 3. Click on any **host** - These changes are related only if a `Host` is selected- in the case of a pod the view shouldn't be changed: ![image](https://github.com/elastic/kibana/assets/14139027/d1b90b65-1bbf-4fbf-a0c6-6b95afe6162e) 4. Check the new flyout functionality https://github.com/elastic/kibana/assets/14139027/3557821c-7964-466e-8514-84c2f81bc2fd Note: the selected host should have a border like in the previous version (this I fixed in the [last commit](https://github.com/elastic/kibana/pull/166965/commits/ff4753aa06863488074fab82616951bcb4644140)) so it should be added if there is a selected node: image --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../asset_details_tabs.tsx} | 4 +- .../asset_details/hooks/use_process_list.ts | 79 +++ .../hooks/use_process_list_row_chart.ts | 55 +++ .../tabs/processes/process_row.tsx | 0 .../tabs/processes/process_row_charts.tsx | 16 +- .../tabs/processes/processes_table.tsx | 4 +- .../host_details_flyout/flyout_wrapper.tsx | 4 +- .../components/node_details/overlay.tsx | 233 --------- .../node_details/tabs/anomalies/anomalies.tsx | 29 -- .../components/node_details/tabs/logs.tsx | 110 ----- .../tabs/metrics/chart_header.tsx | 63 --- .../tabs/metrics/chart_section.tsx | 103 ---- .../node_details/tabs/metrics/index.tsx | 8 - .../node_details/tabs/metrics/metrics.tsx | 460 ------------------ .../tabs/metrics/time_dropdown.tsx | 56 --- .../tabs/metrics/translations.tsx | 66 --- .../node_details/tabs/osquery/index.tsx | 63 --- .../node_details/tabs/processes/index.tsx | 171 ------- .../tabs/processes/parse_search_string.ts | 39 -- .../tabs/processes/processes_table.tsx | 311 ------------ .../tabs/processes/state_badge.tsx | 29 -- .../node_details/tabs/processes/states.ts | 34 -- .../tabs/processes/summary_table.tsx | 93 ---- .../node_details/tabs/processes/types.ts | 23 - .../tabs/properties/build_fields.ts | 117 ----- .../node_details/tabs/properties/index.tsx | 131 ----- .../node_details/tabs/properties/table.tsx | 167 ------- .../components/node_details/tabs/shared.tsx | 27 - .../components/nodes_overview.tsx | 17 + .../waffle/asset_details_flyout.tsx | 60 +++ .../components/waffle/group_of_groups.tsx | 2 + .../components/waffle/group_of_nodes.tsx | 18 +- .../inventory_view/components/waffle/map.tsx | 4 + .../inventory_view/components/waffle/node.tsx | 322 +++--------- .../components/waffle/node_square.tsx | 199 ++++++++ .../use_asset_details_flyout_url_state.ts | 48 ++ .../metric_detail/asset_detail_page.tsx | 44 +- .../translations/translations/fr-FR.json | 28 -- .../translations/translations/ja-JP.json | 28 -- .../translations/translations/zh-CN.json | 28 -- .../test/functional/apps/infra/home_page.ts | 96 +++- .../functional/page_objects/asset_details.ts | 5 + .../page_objects/infra_home_page.ts | 10 +- 43 files changed, 676 insertions(+), 2728 deletions(-) rename x-pack/plugins/infra/public/{pages/metrics/hosts/components/host_details_flyout/tabs.ts => common/asset_details_config/asset_details_tabs.tsx} (90%) create mode 100644 x-pack/plugins/infra/public/components/asset_details/hooks/use_process_list.ts create mode 100644 x-pack/plugins/infra/public/components/asset_details/hooks/use_process_list_row_chart.ts rename x-pack/plugins/infra/public/{pages/metrics/inventory_view/components/node_details => components/asset_details}/tabs/processes/process_row.tsx (100%) rename x-pack/plugins/infra/public/{pages/metrics/inventory_view/components/node_details => components/asset_details}/tabs/processes/process_row_charts.tsx (85%) delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/overlay.tsx delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/anomalies/anomalies.tsx delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/logs.tsx delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/chart_header.tsx delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/chart_section.tsx delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/index.tsx delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/metrics.tsx delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/time_dropdown.tsx delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/translations.tsx delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/osquery/index.tsx delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/index.tsx delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/parse_search_string.ts delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/processes_table.tsx delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/state_badge.tsx delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/states.ts delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/summary_table.tsx delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/types.ts delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/build_fields.ts delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/index.tsx delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/table.tsx delete mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/shared.tsx create mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/asset_details_flyout.tsx create mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/node_square.tsx create mode 100644 x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_asset_details_flyout_url_state.ts diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/host_details_flyout/tabs.ts b/x-pack/plugins/infra/public/common/asset_details_config/asset_details_tabs.tsx similarity index 90% rename from x-pack/plugins/infra/public/pages/metrics/hosts/components/host_details_flyout/tabs.ts rename to x-pack/plugins/infra/public/common/asset_details_config/asset_details_tabs.tsx index 6ce0eeddbcb00..09e5cf2684075 100644 --- a/x-pack/plugins/infra/public/pages/metrics/hosts/components/host_details_flyout/tabs.ts +++ b/x-pack/plugins/infra/public/common/asset_details_config/asset_details_tabs.tsx @@ -6,9 +6,9 @@ */ import { i18n } from '@kbn/i18n'; -import { ContentTabIds, type Tab } from '../../../../../components/asset_details/types'; +import { ContentTabIds, type Tab } from '../../components/asset_details/types'; -export const orderedFlyoutTabs: Tab[] = [ +export const commonFlyoutTabs: Tab[] = [ { id: ContentTabIds.OVERVIEW, name: i18n.translate('xpack.infra.nodeDetails.tabs.overview.title', { diff --git a/x-pack/plugins/infra/public/components/asset_details/hooks/use_process_list.ts b/x-pack/plugins/infra/public/components/asset_details/hooks/use_process_list.ts new file mode 100644 index 0000000000000..97d567bb7066c --- /dev/null +++ b/x-pack/plugins/infra/public/components/asset_details/hooks/use_process_list.ts @@ -0,0 +1,79 @@ +/* + * 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 createContainter from 'constate'; +import { fold } from 'fp-ts/lib/Either'; +import { identity } from 'fp-ts/lib/function'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { useEffect } from 'react'; +import { ProcessListAPIResponse, ProcessListAPIResponseRT } from '../../../../common/http_api'; +import { throwErrors, createPlainError } from '../../../../common/runtime_types'; +import { useHTTPRequest } from '../../../hooks/use_http_request'; +import { useSourceContext } from '../../../containers/metrics_source'; + +export interface SortBy { + name: string; + isAscending: boolean; +} + +export function useProcessList( + hostTerm: Record, + to: number, + sortBy: SortBy, + searchFilter: object +) { + const { createDerivedIndexPattern } = useSourceContext(); + const indexPattern = createDerivedIndexPattern().title; + + const decodeResponse = (response: any) => { + return pipe( + ProcessListAPIResponseRT.decode(response), + fold(throwErrors(createPlainError), identity) + ); + }; + + const parsedSortBy = + sortBy.name === 'runtimeLength' + ? { + ...sortBy, + name: 'startTime', + } + : sortBy; + + const { error, loading, response, makeRequest } = useHTTPRequest( + '/api/metrics/process_list', + 'POST', + JSON.stringify({ + hostTerm, + indexPattern, + to, + sortBy: parsedSortBy, + searchFilter, + }), + decodeResponse + ); + + useEffect(() => { + makeRequest(); + }, [makeRequest]); + + return { + error: (error && error.message) || null, + loading, + response, + makeRequest, + }; +} + +function useProcessListParams(props: { hostTerm: Record; to: number }) { + const { hostTerm, to } = props; + const { createDerivedIndexPattern } = useSourceContext(); + const indexPattern = createDerivedIndexPattern().title; + return { hostTerm, indexPattern, to }; +} +const ProcessListContext = createContainter(useProcessListParams); +export const [ProcessListContextProvider, useProcessListContext] = ProcessListContext; diff --git a/x-pack/plugins/infra/public/components/asset_details/hooks/use_process_list_row_chart.ts b/x-pack/plugins/infra/public/components/asset_details/hooks/use_process_list_row_chart.ts new file mode 100644 index 0000000000000..f964167b8eb18 --- /dev/null +++ b/x-pack/plugins/infra/public/components/asset_details/hooks/use_process_list_row_chart.ts @@ -0,0 +1,55 @@ +/* + * 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 { fold } from 'fp-ts/lib/Either'; +import { identity } from 'fp-ts/lib/function'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { useEffect, useState } from 'react'; +import { + ProcessListAPIChartResponse, + ProcessListAPIChartResponseRT, +} from '../../../../common/http_api'; +import { throwErrors, createPlainError } from '../../../../common/runtime_types'; +import { useHTTPRequest } from '../../../hooks/use_http_request'; +import { useProcessListContext } from './use_process_list'; + +export function useProcessListRowChart(command: string) { + const [inErrorState, setInErrorState] = useState(false); + const decodeResponse = (response: any) => { + return pipe( + ProcessListAPIChartResponseRT.decode(response), + fold(throwErrors(createPlainError), identity) + ); + }; + const { hostTerm, indexPattern, to } = useProcessListContext(); + + const { error, loading, response, makeRequest } = useHTTPRequest( + '/api/metrics/process_list/chart', + 'POST', + JSON.stringify({ + hostTerm, + indexPattern, + to, + command, + }), + decodeResponse + ); + + useEffect(() => setInErrorState(true), [error]); + useEffect(() => setInErrorState(false), [loading]); + + useEffect(() => { + makeRequest(); + }, [makeRequest]); + + return { + error: inErrorState, + loading, + response, + makeRequest, + }; +} diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/process_row.tsx b/x-pack/plugins/infra/public/components/asset_details/tabs/processes/process_row.tsx similarity index 100% rename from x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/process_row.tsx rename to x-pack/plugins/infra/public/components/asset_details/tabs/processes/process_row.tsx diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/process_row_charts.tsx b/x-pack/plugins/infra/public/components/asset_details/tabs/processes/process_row_charts.tsx similarity index 85% rename from x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/process_row_charts.tsx rename to x-pack/plugins/infra/public/components/asset_details/tabs/processes/process_row_charts.tsx index b19a859f196ea..e59aacf03c9d5 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/process_row_charts.tsx +++ b/x-pack/plugins/infra/public/components/asset_details/tabs/processes/process_row_charts.tsx @@ -19,15 +19,15 @@ import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { first, last } from 'lodash'; import moment from 'moment'; import React, { useMemo } from 'react'; -import { useTimelineChartTheme } from '../../../../../../../utils/use_timeline_chart_theme'; -import { Color } from '../../../../../../../../common/color_palette'; -import { createFormatter } from '../../../../../../../../common/formatters'; -import { MetricsExplorerAggregation } from '../../../../../../../../common/http_api'; -import { calculateDomain } from '../../../../../metrics_explorer/components/helpers/calculate_domain'; -import { MetricExplorerSeriesChart } from '../../../../../metrics_explorer/components/series_chart'; -import { MetricsExplorerChartType } from '../../../../../metrics_explorer/hooks/use_metrics_explorer_options'; -import { useProcessListRowChart } from '../../../../hooks/use_process_list_row_chart'; +import { calculateDomain } from '../../../../pages/metrics/metrics_explorer/components/helpers/calculate_domain'; +import { useProcessListRowChart } from '../../hooks/use_process_list_row_chart'; +import { useTimelineChartTheme } from '../../../../utils/use_timeline_chart_theme'; +import { MetricExplorerSeriesChart } from '../../../../pages/metrics/metrics_explorer/components/series_chart'; +import { Color } from '../../../../../common/color_palette'; +import { createFormatter } from '../../../../../common/formatters'; +import { MetricsExplorerAggregation } from '../../../../../common/http_api'; import { Process } from './types'; +import { MetricsExplorerChartType } from '../../../../../common/metrics_explorer_views/types'; interface Props { command: string; diff --git a/x-pack/plugins/infra/public/components/asset_details/tabs/processes/processes_table.tsx b/x-pack/plugins/infra/public/components/asset_details/tabs/processes/processes_table.tsx index 95bfce420e784..cf2f97d37b33c 100644 --- a/x-pack/plugins/infra/public/components/asset_details/tabs/processes/processes_table.tsx +++ b/x-pack/plugins/infra/public/components/asset_details/tabs/processes/processes_table.tsx @@ -30,9 +30,9 @@ import { css } from '@emotion/react'; import { EuiTableRow } from '@elastic/eui'; import { EuiIcon } from '@elastic/eui'; import { FORMATTERS } from '../../../../../common/formatters'; -import type { SortBy } from '../../../../pages/metrics/inventory_view/hooks/use_process_list'; +import type { SortBy } from '../../hooks/use_process_list'; import type { Process } from './types'; -import { ProcessRow } from '../../../../pages/metrics/inventory_view/components/node_details/tabs/processes/process_row'; +import { ProcessRow } from './process_row'; import { StateBadge } from './state_badge'; import { STATE_ORDER } from './states'; import type { ProcessListAPIResponse } from '../../../../../common/http_api'; diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/host_details_flyout/flyout_wrapper.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/host_details_flyout/flyout_wrapper.tsx index 1fab43b5cd144..4015e536a786e 100644 --- a/x-pack/plugins/infra/public/pages/metrics/hosts/components/host_details_flyout/flyout_wrapper.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/host_details_flyout/flyout_wrapper.tsx @@ -10,7 +10,7 @@ import { useSourceContext } from '../../../../../containers/metrics_source'; import { useUnifiedSearchContext } from '../../hooks/use_unified_search'; import type { HostNodeRow } from '../../hooks/use_hosts_table'; import { AssetDetails } from '../../../../../components/asset_details/asset_details'; -import { orderedFlyoutTabs } from './tabs'; +import { commonFlyoutTabs } from '../../../../../common/asset_details_config/asset_details_tabs'; export interface Props { node: HostNodeRow; @@ -31,7 +31,7 @@ export const FlyoutWrapper = ({ node: { name }, closeFlyout }: Props) => { showActionsColumn: true, }, }} - tabs={orderedFlyoutTabs} + tabs={commonFlyoutTabs} links={['apmServices', 'nodeDetails']} renderMode={{ mode: 'flyout', diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/overlay.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/overlay.tsx deleted file mode 100644 index 7614b46014378..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/overlay.tsx +++ /dev/null @@ -1,233 +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 { EuiPortal, EuiTabs, EuiTab, EuiPanel, EuiTitle, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n-react'; -import React, { useMemo, useState } from 'react'; -import { EuiFlexGroup, EuiFlexItem, EuiButtonEmpty } from '@elastic/eui'; -import { EuiOutsideClickDetector } from '@elastic/eui'; -import { EuiIcon, EuiButtonIcon } from '@elastic/eui'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; -import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { useLinkProps } from '@kbn/observability-shared-plugin/public'; -import { InfraWaffleMapNode, InfraWaffleMapOptions } from '../../../../../lib/lib'; -import { InventoryItemType } from '../../../../../../common/inventory_models/types'; -import { MetricsTab } from './tabs/metrics/metrics'; -import { LogsTab } from './tabs/logs'; -import { ProcessesTab } from './tabs/processes'; -import { PropertiesTab } from './tabs/properties'; -import { AnomaliesTab } from './tabs/anomalies/anomalies'; -import { OsqueryTab } from './tabs/osquery'; -import { OVERLAY_Y_START, OVERLAY_BOTTOM_MARGIN } from './tabs/shared'; -import { useNodeDetailsRedirect } from '../../../../link_to'; -import { findInventoryModel } from '../../../../../../common/inventory_models'; -import { navigateToUptime } from '../../lib/navigate_to_uptime'; -import { InfraClientCoreStart, InfraClientStartDeps } from '../../../../../types'; - -interface Props { - isOpen: boolean; - onClose(): void; - options: InfraWaffleMapOptions; - currentTime: number; - node: InfraWaffleMapNode; - nodeType: InventoryItemType; - openAlertFlyout(): void; -} -export const NodeContextPopover = ({ - isOpen, - node, - nodeType, - currentTime, - options, - onClose, - openAlertFlyout, -}: Props) => { - // eslint-disable-next-line react-hooks/exhaustive-deps - const tabConfigs = [MetricsTab, LogsTab, ProcessesTab, PropertiesTab, AnomaliesTab, OsqueryTab]; - const inventoryModel = findInventoryModel(nodeType); - const nodeDetailFrom = currentTime - inventoryModel.metrics.defaultTimeRangeInSeconds * 1000; - const { application, share } = useKibana().services; - const { getNodeDetailUrl } = useNodeDetailsRedirect(); - const uiCapabilities = application?.capabilities; - const canCreateAlerts = useMemo( - () => Boolean(uiCapabilities?.infrastructure?.save), - [uiCapabilities] - ); - - const tabs = useMemo(() => { - return tabConfigs.map((m) => { - const TabContent = m.content; - return { - ...m, - content: ( - - ), - }; - }); - }, [tabConfigs, node, nodeType, currentTime, onClose, options]); - - const [selectedTab, setSelectedTab] = useState(0); - - const nodeDetailMenuItemLinkProps = useLinkProps({ - ...getNodeDetailUrl({ - assetType: nodeType, - assetId: node.id, - search: { - from: nodeDetailFrom, - to: currentTime, - name: node.name, - }, - }), - }); - const apmField = nodeType === 'host' ? 'host.hostname' : inventoryModel.fields.id; - const apmTracesMenuItemLinkProps = useLinkProps({ - app: 'apm', - hash: 'traces', - search: { - kuery: `${apmField}:"${node.id}"`, - }, - }); - - if (!isOpen) { - return null; - } - - return ( - - - - - - - -

{node.name}

-
-
- - - {canCreateAlerts && ( - - - - - - )} - - - - - - - - - - -
- - - {tabs.map((tab, i) => ( - setSelectedTab(i)} - > - {tab.name} - - ))} - - {' '} - - - navigateToUptime(share.url.locators, nodeType, node)}> - {' '} - - - -
- {tabs[selectedTab].content} -
-
-
- ); -}; - -const OverlayHeader = euiStyled.div` - padding-top: ${(props) => props.theme.eui.euiSizeM}; - padding-right: ${(props) => props.theme.eui.euiSizeM}; - padding-left: ${(props) => props.theme.eui.euiSizeM}; - background-color: ${(props) => props.theme.eui.euiPageBackgroundColor}; - box-shadow: inset 0 -1px ${(props) => props.theme.eui.euiBorderColor}; -`; - -const OverlayPanel = euiStyled(EuiPanel).attrs({ paddingSize: 'none' })` - display: flex; - flex-direction: column; - position: absolute; - right: 16px; - top: ${OVERLAY_Y_START}px; - width: 100%; - max-width: 720px; - z-index: 2; - max-height: calc(100vh - ${OVERLAY_Y_START + OVERLAY_BOTTOM_MARGIN}px); - overflow: hidden; - - @media (max-width: 752px) { - border-radius: 0px !important; - left: 0px; - right: 0px; - top: 97px; - bottom: 0; - max-height: calc(100vh - 97px); - max-width: 100%; - } -`; - -const OverlayTitle = euiStyled(EuiFlexItem)` - overflow: hidden; - & h4 { - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; - } -`; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/anomalies/anomalies.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/anomalies/anomalies.tsx deleted file mode 100644 index 40dad03f73366..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/anomalies/anomalies.tsx +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; -import React from 'react'; -import { AnomaliesTable } from '../../../ml/anomaly_detection/anomalies_table/anomalies_table'; -import { TabContent, TabProps } from '../shared'; - -const TabComponent = (props: TabProps) => { - const { node, onClose } = props; - - return ( - - - - ); -}; - -export const AnomaliesTab = { - id: 'anomalies', - name: i18n.translate('xpack.infra.nodeDetails.tabs.anomalies', { - defaultMessage: 'Anomalies', - }), - content: TabComponent, -}; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/logs.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/logs.tsx deleted file mode 100644 index ddbf4ae52788b..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/logs.tsx +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { useCallback, useMemo, useState } from 'react'; -import useDebounce from 'react-use/lib/useDebounce'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { i18n } from '@kbn/i18n'; -import { EuiFieldSearch } from '@elastic/eui'; -import { EuiFlexGroup } from '@elastic/eui'; -import { EuiFlexItem } from '@elastic/eui'; -import { EuiButtonEmpty } from '@elastic/eui'; -import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app'; -import { LogStream } from '@kbn/logs-shared-plugin/public'; -import { useKibanaContextForPlugin } from '../../../../../../hooks/use_kibana'; -import { TabContent, TabProps } from './shared'; -import { useWaffleOptionsContext } from '../../../hooks/use_waffle_options'; -import { findInventoryFields } from '../../../../../../../common/inventory_models'; - -const TabComponent = (props: TabProps) => { - const { services } = useKibanaContextForPlugin(); - const { locators } = services; - const [textQuery, setTextQuery] = useState(''); - const [textQueryDebounced, setTextQueryDebounced] = useState(''); - const endTimestamp = props.currentTime; - const startTimestamp = endTimestamp - 60 * 60 * 1000; // 60 minutes - const { nodeType } = useWaffleOptionsContext(); - const { node } = props; - - useDebounce(() => setTextQueryDebounced(textQuery), textQueryThrottleInterval, [textQuery]); - - const filter = useMemo(() => { - const query = [ - `${findInventoryFields(nodeType).id}: "${node.id}"`, - ...(textQueryDebounced !== '' ? [textQueryDebounced] : []), - ].join(' and '); - - return { - language: 'kuery', - query, - }; - }, [nodeType, node.id, textQueryDebounced]); - - const onQueryChange = useCallback((e: React.ChangeEvent) => { - setTextQuery(e.target.value); - }, []); - - const logsUrl = useMemo(() => { - return locators.nodeLogsLocator.getRedirectUrl({ - nodeType, - nodeId: node.id, - time: startTimestamp, - filter: textQueryDebounced, - }); - }, [locators.nodeLogsLocator, node.id, nodeType, startTimestamp, textQueryDebounced]); - - return ( - - - - - - - - - - - - - - - - ); -}; - -export const LogsTab = { - id: 'logs', - name: i18n.translate('xpack.infra.nodeDetails.tabs.logs', { - defaultMessage: 'Logs', - }), - content: TabComponent, -}; - -const textQueryThrottleInterval = 1000; // milliseconds diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/chart_header.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/chart_header.tsx deleted file mode 100644 index 2c371691f4587..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/chart_header.tsx +++ /dev/null @@ -1,63 +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 { EuiText } from '@elastic/eui'; -import { EuiFlexItem } from '@elastic/eui'; -import React from 'react'; -import { EuiFlexGroup } from '@elastic/eui'; -import { EuiIcon } from '@elastic/eui'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; -import { colorTransformer } from '../../../../../../../../common/color_palette'; -import { MetricsExplorerOptionsMetric } from '../../../../../metrics_explorer/hooks/use_metrics_explorer_options'; - -interface Props { - title: string; - metrics: MetricsExplorerOptionsMetric[]; -} - -export const ChartHeader = ({ title, metrics }: Props) => { - return ( - - - -

{title}

-
-
- - - {metrics.map((chartMetric) => ( - - - - - - - {chartMetric.label} - - - - ))} - - -
- ); -}; - -const HeaderItem = euiStyled(EuiFlexItem).attrs({ grow: 1 })` - overflow: hidden; -`; - -const H4 = euiStyled('h4')` - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -`; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/chart_section.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/chart_section.tsx deleted file mode 100644 index e078f25d60437..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/chart_section.tsx +++ /dev/null @@ -1,103 +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 { - Axis, - Chart, - ChartSizeArray, - PointerUpdateListener, - Position, - Settings, - TickFormatter, - TooltipProps, - Tooltip, -} from '@elastic/charts'; -import moment from 'moment'; -import React from 'react'; -import { useTimelineChartTheme } from '../../../../../../../utils/use_timeline_chart_theme'; -import { MetricsExplorerSeries } from '../../../../../../../../common/http_api'; -import { MetricExplorerSeriesChart } from '../../../../../metrics_explorer/components/series_chart'; -import { - MetricsExplorerChartType, - MetricsExplorerOptionsMetric, -} from '../../../../../metrics_explorer/hooks/use_metrics_explorer_options'; -import { ChartHeader } from './chart_header'; - -const CHART_SIZE: ChartSizeArray = ['100%', 160]; - -interface Props { - title: string; - style: MetricsExplorerChartType; - chartRef: React.Ref; - series: ChartSectionSeries[]; - tickFormatterForTime: TickFormatter; - tickFormatter: TickFormatter; - onPointerUpdate: PointerUpdateListener; - domain: { max: number; min: number }; - stack?: boolean; -} - -export interface ChartSectionSeries { - metric: MetricsExplorerOptionsMetric; - series: MetricsExplorerSeries; -} - -export const ChartSection = ({ - title, - style, - chartRef, - series, - tickFormatterForTime, - tickFormatter, - onPointerUpdate, - domain, - stack = false, -}: Props) => { - const chartTheme = useTimelineChartTheme(); - const metrics = series.map((chartSeries) => chartSeries.metric); - const tooltipProps: TooltipProps = { - headerFormatter: ({ value }) => moment(value).format('Y-MM-DD HH:mm:ss.SSS'), - }; - - return ( - <> - - - {series.map((chartSeries, index) => ( - - ))} - - - - - - - ); -}; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/index.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/index.tsx deleted file mode 100644 index 6cc79a1c32375..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/index.tsx +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export * from './metrics'; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/metrics.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/metrics.tsx deleted file mode 100644 index 6e8908bf2362a..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/metrics.tsx +++ /dev/null @@ -1,460 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import { i18n } from '@kbn/i18n'; -import { Chart, niceTimeFormatter, PointerEvent } from '@elastic/charts'; -import { EuiLoadingChart, EuiSpacer, EuiFlexGrid, EuiFlexItem } from '@elastic/eui'; -import { first, last } from 'lodash'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; -import { TabContent, TabProps } from '../shared'; -import { useSnapshot } from '../../../../hooks/use_snaphot'; -import { useWaffleOptionsContext } from '../../../../hooks/use_waffle_options'; -import { useSourceContext } from '../../../../../../../containers/metrics_source'; -import { findInventoryFields } from '../../../../../../../../common/inventory_models'; -import { convertKueryToElasticSearchQuery } from '../../../../../../../utils/kuery'; -import { SnapshotMetricType } from '../../../../../../../../common/inventory_models/types'; -import { - MetricsExplorerChartType, - MetricsExplorerOptionsMetric, -} from '../../../../../metrics_explorer/hooks/use_metrics_explorer_options'; -import { Color } from '../../../../../../../../common/color_palette'; -import { - MetricsExplorerAggregation, - MetricsExplorerSeries, -} from '../../../../../../../../common/http_api'; -import { createInventoryMetricFormatter } from '../../../../lib/create_inventory_metric_formatter'; -import { calculateDomain } from '../../../../../metrics_explorer/components/helpers/calculate_domain'; -import { ChartSection } from './chart_section'; -import { - SYSTEM_METRIC_NAME, - USER_METRIC_NAME, - INBOUND_METRIC_NAME, - OUTBOUND_METRIC_NAME, - USED_MEMORY_METRIC_NAME, - FREE_MEMORY_METRIC_NAME, - CPU_CHART_TITLE, - LOAD_CHART_TITLE, - MEMORY_CHART_TITLE, - NETWORK_CHART_TITLE, - LOG_RATE_METRIC_NAME, - LOG_RATE_CHART_TITLE, -} from './translations'; -import { TimeDropdown } from './time_dropdown'; -import { getCustomMetricLabel } from '../../../../../../../../common/formatters/get_custom_metric_label'; -import { createFormatterForMetric } from '../../../../../metrics_explorer/components/helpers/create_formatter_for_metric'; - -const ONE_HOUR = 60 * 60 * 1000; - -const TabComponent = (props: TabProps) => { - const cpuChartRef = useRef(null); - const networkChartRef = useRef(null); - const memoryChartRef = useRef(null); - const loadChartRef = useRef(null); - const logRateChartRef = useRef(null); - const customMetricRefs = useRef>({}); - const [time, setTime] = useState(ONE_HOUR); - const chartRefs = useMemo(() => { - const refs = [cpuChartRef, networkChartRef, memoryChartRef, loadChartRef, logRateChartRef]; - return [...refs, customMetricRefs]; - }, [ - cpuChartRef, - networkChartRef, - memoryChartRef, - loadChartRef, - logRateChartRef, - customMetricRefs, - ]); - const { sourceId, createDerivedIndexPattern } = useSourceContext(); - const { nodeType, accountId, region, customMetrics } = useWaffleOptionsContext(); - const { currentTime, node } = props; - const derivedIndexPattern = useMemo( - () => createDerivedIndexPattern(), - [createDerivedIndexPattern] - ); - let filter = `${findInventoryFields(nodeType).id}: "${node.id}"`; - - if (filter) { - filter = convertKueryToElasticSearchQuery(filter, derivedIndexPattern); - } - - const buildCustomMetric = useCallback( - (field: string, id: string, aggregation: string = 'avg') => ({ - type: 'custom' as SnapshotMetricType, - aggregation, - field, - id, - }), - [] - ); - - const updateTime = useCallback( - (e: React.ChangeEvent) => { - setTime(Number(e.currentTarget.value)); - }, - [setTime] - ); - - const timeRange = { - interval: '1m', - to: currentTime, - from: currentTime - time, - ignoreLookback: true, - }; - - const defaultMetrics: Array<{ type: SnapshotMetricType }> = [ - { type: 'rx' }, - { type: 'tx' }, - buildCustomMetric('system.cpu.user.pct', 'user'), - buildCustomMetric('system.cpu.system.pct', 'system'), - buildCustomMetric('system.load.1', 'load1m'), - buildCustomMetric('system.load.5', 'load5m'), - buildCustomMetric('system.load.15', 'load15m'), - buildCustomMetric('system.memory.actual.used.bytes', 'usedMemory'), - buildCustomMetric('system.memory.actual.free', 'freeMemory'), - buildCustomMetric('system.cpu.cores', 'cores', 'max'), - ]; - - const { nodes, reload } = useSnapshot({ - filterQuery: filter, - metrics: [...defaultMetrics, ...customMetrics], - groupBy: [], - nodeType, - sourceId, - currentTime, - accountId, - region, - sendRequestImmediately: false, - timerange: timeRange, - }); - - const { nodes: logRateNodes, reload: reloadLogRate } = useSnapshot({ - filterQuery: filter, - metrics: [{ type: 'logRate' }], - groupBy: [], - nodeType, - sourceId, - currentTime, - accountId, - region, - sendRequestImmediately: false, - timerange: timeRange, - }); - - const getDomain = useCallback( - (timeseries: MetricsExplorerSeries, ms: MetricsExplorerOptionsMetric[]) => { - const dataDomain = timeseries ? calculateDomain(timeseries, ms, false) : null; - return dataDomain - ? { - max: dataDomain.max * 1.1, // add 10% headroom. - min: dataDomain.min, - } - : { max: 0, min: 0 }; - }, - [] - ); - - const dateFormatter = useCallback((timeseries: MetricsExplorerSeries) => { - if (!timeseries) return () => ''; - const firstTimestamp = first(timeseries.rows)?.timestamp; - const lastTimestamp = last(timeseries.rows)?.timestamp; - - if (firstTimestamp == null || lastTimestamp == null) { - return (value: number) => `${value}`; - } - - return niceTimeFormatter([firstTimestamp, lastTimestamp]); - }, []); - - const networkFormatter = useMemo(() => createInventoryMetricFormatter({ type: 'rx' }), []); - const cpuFormatter = useMemo(() => createInventoryMetricFormatter({ type: 'cpu' }), []); - const memoryFormatter = useMemo( - () => createInventoryMetricFormatter({ type: 's3BucketSize' }), - [] - ); - const loadFormatter = useMemo(() => createInventoryMetricFormatter({ type: 'load' }), []); - const logRateFormatter = useMemo(() => createInventoryMetricFormatter({ type: 'logRate' }), []); - - const mergeTimeseries = useCallback((...series: MetricsExplorerSeries[]) => { - const base = series[0]; - const otherSeries = series.slice(1); - base.rows = base.rows.map((b, rowIdx) => { - const newRow = { ...b }; - otherSeries.forEach((o, idx) => { - newRow[`metric_${idx + 1}`] = o.rows[rowIdx].metric_0; - }); - return newRow; - }); - return base; - }, []); - - const buildChartMetricLabels = useCallback( - (labels: string[], aggregation: MetricsExplorerAggregation) => { - const baseMetric = { - color: Color.color0, - aggregation, - label: 'System', - }; - - return labels.map((label, idx) => { - return { ...baseMetric, color: Color[`color${idx}` as Color], label }; - }); - }, - [] - ); - - const pointerUpdate = useCallback( - (event: PointerEvent) => { - chartRefs.forEach((ref) => { - if (ref.current) { - if (ref.current instanceof Chart) { - ref.current.dispatchExternalPointerEvent(event); - } else { - const charts = Object.values(ref.current); - charts.forEach((c) => { - if (c) { - c.dispatchExternalPointerEvent(event); - } - }); - } - } - }); - }, - [chartRefs] - ); - - const getTimeseries = useCallback( - (metricName: string) => { - if (!nodes || !nodes.length) { - return null; - } - return nodes[0].metrics.find((m) => m.name === metricName)!.timeseries!; - }, - [nodes] - ); - - const getLogRateTimeseries = useCallback(() => { - if (!logRateNodes) { - return null; - } - if (logRateNodes.length === 0) { - return { rows: [], columns: [], id: '0' }; - } - return logRateNodes[0].metrics.find((m) => m.name === 'logRate')!.timeseries!; - }, [logRateNodes]); - - const systemMetricsTs = useMemo(() => getTimeseries('system'), [getTimeseries]); - const userMetricsTs = useMemo(() => getTimeseries('user'), [getTimeseries]); - const rxMetricsTs = useMemo(() => getTimeseries('rx'), [getTimeseries]); - const txMetricsTs = useMemo(() => getTimeseries('tx'), [getTimeseries]); - const load1mMetricsTs = useMemo(() => getTimeseries('load1m'), [getTimeseries]); - const load5mMetricsTs = useMemo(() => getTimeseries('load5m'), [getTimeseries]); - const load15mMetricsTs = useMemo(() => getTimeseries('load15m'), [getTimeseries]); - const usedMemoryMetricsTs = useMemo(() => getTimeseries('usedMemory'), [getTimeseries]); - const freeMemoryMetricsTs = useMemo(() => getTimeseries('freeMemory'), [getTimeseries]); - const coresMetricsTs = useMemo(() => getTimeseries('cores'), [getTimeseries]); - const logRateMetricsTs = useMemo(() => getLogRateTimeseries(), [getLogRateTimeseries]); - - useEffect(() => { - reload(); - reloadLogRate(); - }, [time, reload, reloadLogRate]); - - if ( - !systemMetricsTs || - !userMetricsTs || - !rxMetricsTs || - !txMetricsTs || - !load1mMetricsTs || - !load5mMetricsTs || - !load15mMetricsTs || - !usedMemoryMetricsTs || - !freeMemoryMetricsTs || - !logRateMetricsTs - ) { - return ; - } - - const cpuChartMetrics = buildChartMetricLabels([SYSTEM_METRIC_NAME, USER_METRIC_NAME], 'avg'); - const logRateChartMetrics = buildChartMetricLabels([LOG_RATE_METRIC_NAME], 'rate'); - const networkChartMetrics = buildChartMetricLabels( - [INBOUND_METRIC_NAME, OUTBOUND_METRIC_NAME], - 'rate' - ); - const loadChartMetrics = buildChartMetricLabels(['1m', '5m', '15m'], 'avg'); - const memoryChartMetrics = buildChartMetricLabels( - [USED_MEMORY_METRIC_NAME, FREE_MEMORY_METRIC_NAME], - 'rate' - ); - - systemMetricsTs.rows = systemMetricsTs.rows.slice().map((r, idx) => { - const metric = r.metric_0 as number | undefined; - const cores = coresMetricsTs!.rows[idx].metric_0 as number | undefined; - if (metric && cores) { - r.metric_0 = metric / cores; - } - return r; - }); - - userMetricsTs.rows = userMetricsTs.rows.slice().map((r, idx) => { - const metric = r.metric_0 as number | undefined; - const cores = coresMetricsTs!.rows[idx].metric_0 as number | undefined; - if (metric && cores) { - r.metric_0 = metric / cores; - } - return r; - }); - const cpuTimeseries = mergeTimeseries(systemMetricsTs, userMetricsTs); - const logRateTimeseries = mergeTimeseries(logRateMetricsTs); - const networkTimeseries = mergeTimeseries(rxMetricsTs, txMetricsTs); - const loadTimeseries = mergeTimeseries(load1mMetricsTs, load5mMetricsTs, load15mMetricsTs); - const memoryTimeseries = mergeTimeseries(usedMemoryMetricsTs, freeMemoryMetricsTs); - - const formatter = dateFormatter(rxMetricsTs); - - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - {customMetrics.map((c) => { - const metricTS = getTimeseries(c.id); - const chartMetrics = buildChartMetricLabels([c.field], c.aggregation); - if (!metricTS) return null; - return ( - - { - customMetricRefs.current[c.id] = r; - }} - series={[{ metric: chartMetrics[0], series: metricTS }]} - tickFormatterForTime={formatter} - tickFormatter={createFormatterForMetric(c)} - onPointerUpdate={pointerUpdate} - domain={getDomain(mergeTimeseries(metricTS), chartMetrics)} - stack={true} - /> - - ); - })} - - - ); -}; - -const ChartGridItem = euiStyled(EuiFlexItem)` - overflow: hidden -`; - -const LoadingPlaceholder = () => { - return ( -
- -
- ); -}; - -export const MetricsTab = { - id: 'metrics', - name: i18n.translate('xpack.infra.nodeDetails.tabs.metrics', { - defaultMessage: 'Metrics', - }), - content: TabComponent, -}; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/time_dropdown.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/time_dropdown.tsx deleted file mode 100644 index a7e9aef892e04..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/time_dropdown.tsx +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { EuiSelect } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; - -interface Props { - value: number; - onChange(event: React.ChangeEvent): void; -} - -export const TimeDropdown = (props: Props) => ( - -); diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/translations.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/translations.tsx deleted file mode 100644 index 940d97918b181..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/metrics/translations.tsx +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; - -export const SYSTEM_METRIC_NAME = i18n.translate('xpack.infra.nodeDetails.metrics.system', { - defaultMessage: 'System', -}); - -export const USER_METRIC_NAME = i18n.translate('xpack.infra.nodeDetails.metrics.user', { - defaultMessage: 'User', -}); - -export const INBOUND_METRIC_NAME = i18n.translate('xpack.infra.nodeDetails.metrics.inbound', { - defaultMessage: 'Inbound', -}); - -export const OUTBOUND_METRIC_NAME = i18n.translate('xpack.infra.nodeDetails.metrics.outbound', { - defaultMessage: 'Outbound', -}); - -export const USED_MEMORY_METRIC_NAME = i18n.translate('xpack.infra.nodeDetails.metrics.used', { - defaultMessage: 'Used', -}); - -export const CACHED_MEMORY_METRIC_NAME = i18n.translate('xpack.infra.nodeDetails.metrics.cached', { - defaultMessage: 'Cached', -}); - -export const FREE_MEMORY_METRIC_NAME = i18n.translate('xpack.infra.nodeDetails.metrics.free', { - defaultMessage: 'Free', -}); - -export const NETWORK_CHART_TITLE = i18n.translate( - 'xpack.infra.nodeDetails.metrics.charts.networkTitle', - { - defaultMessage: 'Network', - } -); -export const MEMORY_CHART_TITLE = i18n.translate( - 'xpack.infra.nodeDetails.metrics.charts.memoryTitle', - { - defaultMessage: 'Memory', - } -); -export const CPU_CHART_TITLE = i18n.translate('xpack.infra.nodeDetails.metrics.fcharts.cpuTitle', { - defaultMessage: 'CPU', -}); -export const LOAD_CHART_TITLE = i18n.translate('xpack.infra.nodeDetails.metrics.charts.loadTitle', { - defaultMessage: 'Load', -}); - -export const LOG_RATE_METRIC_NAME = i18n.translate('xpack.infra.nodeDetails.metrics.logRate', { - defaultMessage: 'Log Rate', -}); - -export const LOG_RATE_CHART_TITLE = i18n.translate( - 'xpack.infra.nodeDetails.metrics.charts.logRateTitle', - { - defaultMessage: 'Log Rate', - } -); diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/osquery/index.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/osquery/index.tsx deleted file mode 100644 index 7339043ffa98f..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/osquery/index.tsx +++ /dev/null @@ -1,63 +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 { EuiSkeletonText } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import React, { useMemo } from 'react'; -import { useKibanaContextForPlugin } from '../../../../../../../hooks/use_kibana'; -import { TabContent, TabProps } from '../shared'; -import { useSourceContext } from '../../../../../../../containers/metrics_source'; -import { InventoryItemType } from '../../../../../../../../common/inventory_models/types'; -import { useMetadata } from '../../../../../../../components/asset_details/hooks/use_metadata'; -import { useWaffleTimeContext } from '../../../../hooks/use_waffle_time'; - -const TabComponent = (props: TabProps) => { - const nodeId = props.node.id; - const nodeType = props.nodeType as InventoryItemType; - const { sourceId } = useSourceContext(); - const { currentTimeRange } = useWaffleTimeContext(); - const { loading, metadata } = useMetadata({ - assetId: nodeId, - assetType: nodeType, - sourceId, - timeRange: currentTimeRange, - }); - const { - services: { osquery }, - } = useKibanaContextForPlugin(); - - // @ts-expect-error - const OsqueryAction = osquery?.OsqueryAction; - - // avoids component rerender when resizing the popover - const content = useMemo(() => { - // TODO: Add info when Osquery plugin is not available - if (loading || !OsqueryAction) { - return ( - - - - ); - } - - return ( - - - - ); - }, [OsqueryAction, loading, metadata]); - - return content; -}; - -export const OsqueryTab = { - id: 'osquery', - name: i18n.translate('xpack.infra.nodeDetails.tabs.osquery', { - defaultMessage: 'Osquery', - }), - content: TabComponent, -}; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/index.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/index.tsx deleted file mode 100644 index 2d4ef39864a45..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/index.tsx +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { useMemo, useState, useCallback } from 'react'; -import { debounce } from 'lodash'; -import { i18n } from '@kbn/i18n'; -import { - EuiSearchBar, - EuiSpacer, - EuiEmptyPrompt, - EuiButton, - EuiText, - EuiIconTip, - Query, -} from '@elastic/eui'; -import { getFieldByType } from '../../../../../../../../common/inventory_models'; -import { - useProcessList, - SortBy, - ProcessListContextProvider, -} from '../../../../hooks/use_process_list'; -import { TabContent, TabProps } from '../shared'; -import { STATE_NAMES } from './states'; -import { SummaryTable } from './summary_table'; -import { ProcessesTable } from './processes_table'; -import { parseSearchString } from './parse_search_string'; - -const TabComponent = ({ currentTime, node, nodeType }: TabProps) => { - const [searchBarState, setSearchBarState] = useState(Query.MATCH_ALL); - const [searchFilter, setSearchFilter] = useState(''); - const [sortBy, setSortBy] = useState({ - name: 'cpu', - isAscending: false, - }); - - const hostTerm = useMemo(() => { - const field = getFieldByType(nodeType) ?? nodeType; - return { [field]: node.name }; - }, [node, nodeType]); - - const { - loading, - error, - response, - makeRequest: reload, - } = useProcessList(hostTerm, currentTime, sortBy, parseSearchString(searchFilter)); - - const debouncedSearchOnChange = useMemo( - () => debounce<(queryText: string) => void>((queryText) => setSearchFilter(queryText), 500), - [setSearchFilter] - ); - - const searchBarOnChange = useCallback( - ({ query, queryText }) => { - setSearchBarState(query); - debouncedSearchOnChange(queryText); - }, - [setSearchBarState, debouncedSearchOnChange] - ); - - const clearSearchBar = useCallback(() => { - setSearchBarState(Query.MATCH_ALL); - setSearchFilter(''); - }, [setSearchBarState, setSearchFilter]); - - return ( - - - - - -

- {i18n.translate('xpack.infra.metrics.nodeDetails.processesHeader', { - defaultMessage: 'Top processes', - })}{' '} - -

-
- - ({ - value, - view, - })), - }, - ]} - /> - - {!error ? ( - - ) : ( - - {i18n.translate('xpack.infra.metrics.nodeDetails.processListError', { - defaultMessage: 'Unable to load process data', - })} - - } - actions={ - - {i18n.translate('xpack.infra.metrics.nodeDetails.processListRetry', { - defaultMessage: 'Try again', - })} - - } - /> - )} -
-
- ); -}; - -export const ProcessesTab = { - id: 'processes', - name: i18n.translate('xpack.infra.metrics.nodeDetails.tabs.processes', { - defaultMessage: 'Processes', - }), - content: TabComponent, -}; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/parse_search_string.ts b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/parse_search_string.ts deleted file mode 100644 index 7112dbed917a6..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/parse_search_string.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export const parseSearchString = (query: string) => { - if (query.trim() === '') { - return [ - { - match_all: {}, - }, - ]; - } - const elements = query - .split(' ') - .map((s) => s.trim()) - .filter(Boolean); - const stateFilter = elements.filter((s) => s.startsWith('state=')); - const cmdlineFilters = elements.filter((s) => !s.startsWith('state=')); - return [ - ...cmdlineFilters.map((clause) => ({ - query_string: { - fields: ['system.process.cmdline'], - query: `*${escapeReservedCharacters(clause)}*`, - minimum_should_match: 1, - }, - })), - ...stateFilter.map((state) => ({ - match: { - 'system.process.state': state.replace('state=', ''), - }, - })), - ]; -}; - -const escapeReservedCharacters = (clause: string) => - clause.replace(/([+\-=!\(\)\{\}\[\]^"~*?:\\/!]|&&|\|\|)/g, '\\$1'); diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/processes_table.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/processes_table.tsx deleted file mode 100644 index c85cc1577fa7f..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/processes_table.tsx +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { useMemo, useState, useCallback } from 'react'; -import { omit } from 'lodash'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { - EuiTable, - EuiTableHeader, - EuiTableBody, - EuiTableHeaderCell, - EuiTableRowCell, - EuiLoadingChart, - EuiEmptyPrompt, - EuiText, - EuiLink, - EuiButton, - SortableProperties, - LEFT_ALIGNMENT, - RIGHT_ALIGNMENT, -} from '@elastic/eui'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; -import { ProcessListAPIResponse } from '../../../../../../../../common/http_api'; -import { FORMATTERS } from '../../../../../../../../common/formatters'; -import { SortBy } from '../../../../hooks/use_process_list'; -import { Process } from './types'; -import { ProcessRow } from './process_row'; -import { StateBadge } from './state_badge'; -import { STATE_ORDER } from './states'; - -interface TableProps { - processList: ProcessListAPIResponse['processList']; - currentTime: number; - isLoading: boolean; - sortBy: SortBy; - setSortBy: (s: SortBy) => void; - clearSearchBar: () => void; -} - -function useSortableProperties( - sortablePropertyItems: Array<{ - name: string; - getValue: (obj: T) => any; - isAscending: boolean; - }>, - defaultSortProperty: string, - callback: (s: SortBy) => void -) { - const [sortableProperties] = useState>( - new SortableProperties(sortablePropertyItems, defaultSortProperty) - ); - - return { - updateSortableProperties: useCallback( - (property) => { - sortableProperties.sortOn(property); - callback(omit(sortableProperties.getSortedProperty(), 'getValue')); - }, - [sortableProperties, callback] - ), - }; -} - -export const ProcessesTable = ({ - processList, - currentTime, - isLoading, - sortBy, - setSortBy, - clearSearchBar, -}: TableProps) => { - const { updateSortableProperties } = useSortableProperties( - [ - { - name: 'startTime', - getValue: (item: any) => Date.parse(item.startTime), - isAscending: true, - }, - { - name: 'cpu', - getValue: (item: any) => item.cpu, - isAscending: false, - }, - { - name: 'memory', - getValue: (item: any) => item.memory, - isAscending: false, - }, - ], - 'cpu', - setSortBy - ); - - const currentItems = useMemo( - () => - processList.sort( - (a, b) => STATE_ORDER.indexOf(a.state) - STATE_ORDER.indexOf(b.state) - ) as Process[], - [processList] - ); - - if (isLoading) return ; - - if (currentItems.length === 0) - return ( - - {i18n.translate('xpack.infra.metrics.nodeDetails.noProcesses', { - defaultMessage: 'No processes found', - })} - - } - body={ - - - - - ), - }} - /> - - } - actions={ - - {i18n.translate('xpack.infra.metrics.nodeDetails.noProcessesClearFilters', { - defaultMessage: 'Clear filters', - })} - - } - /> - ); - - return ( - <> - - - - {columns.map((column) => ( - updateSortableProperties(column.field) : undefined} - isSorted={sortBy.name === column.field} - isSortAscending={sortBy.name === column.field && sortBy.isAscending} - > - {column.name} - - ))} - - - - - - - ); -}; - -const LoadingPlaceholder = () => { - return ( -
- -
- ); -}; - -interface TableBodyProps { - items: Process[]; - currentTime: number; -} -const ProcessesTableBody = ({ items, currentTime }: TableBodyProps) => ( - <> - {items.map((item, i) => { - const cells = columns.map((column) => ( - - {column.render ? column.render(item[column.field], currentTime) : item[column.field]} - - )); - return ; - })} - -); - -const StyledTableBody = euiStyled(EuiTableBody)` - & .euiTableCellContent { - padding-top: 0; - padding-bottom: 0; - - } -`; - -const ONE_MINUTE = 60 * 1000; -const ONE_HOUR = ONE_MINUTE * 60; -const RuntimeCell = ({ startTime, currentTime }: { startTime: number; currentTime: number }) => { - const runtimeLength = currentTime - startTime; - let remainingRuntimeMS = runtimeLength; - const runtimeHours = Math.floor(remainingRuntimeMS / ONE_HOUR); - remainingRuntimeMS -= runtimeHours * ONE_HOUR; - const runtimeMinutes = Math.floor(remainingRuntimeMS / ONE_MINUTE); - remainingRuntimeMS -= runtimeMinutes * ONE_MINUTE; - const runtimeSeconds = Math.floor(remainingRuntimeMS / 1000); - remainingRuntimeMS -= runtimeSeconds * 1000; - - const runtimeDisplayHours = runtimeHours ? `${runtimeHours}:` : ''; - const runtimeDisplayMinutes = runtimeMinutes < 10 ? `0${runtimeMinutes}:` : `${runtimeMinutes}:`; - const runtimeDisplaySeconds = runtimeSeconds < 10 ? `0${runtimeSeconds}` : runtimeSeconds; - - return <>{`${runtimeDisplayHours}${runtimeDisplayMinutes}${runtimeDisplaySeconds}`}; -}; - -const columns: Array<{ - field: keyof Process; - name: string; - sortable: boolean; - render?: Function; - width?: string | number; - textOnly?: boolean; - align?: typeof RIGHT_ALIGNMENT | typeof LEFT_ALIGNMENT; -}> = [ - { - field: 'state', - name: i18n.translate('xpack.infra.metrics.nodeDetails.processes.columnLabelState', { - defaultMessage: 'State', - }), - sortable: false, - render: (state: string) => , - width: 84, - textOnly: false, - }, - { - field: 'command', - name: i18n.translate('xpack.infra.metrics.nodeDetails.processes.columnLabelCommand', { - defaultMessage: 'Command', - }), - sortable: false, - width: '40%', - render: (command: string) => {command}, - }, - { - field: 'startTime', - name: i18n.translate('xpack.infra.metrics.nodeDetails.processes.columnLabelTime', { - defaultMessage: 'Time', - }), - align: RIGHT_ALIGNMENT, - sortable: true, - render: (startTime: number, currentTime: number) => ( - - ), - }, - { - field: 'cpu', - name: i18n.translate('xpack.infra.metrics.nodeDetails.processes.columnLabelCPU', { - defaultMessage: 'CPU', - }), - sortable: true, - render: (value: number) => FORMATTERS.percent(value), - }, - { - field: 'memory', - name: i18n.translate('xpack.infra.metrics.nodeDetails.processes.columnLabelMemory', { - defaultMessage: 'Mem.', - }), - sortable: true, - render: (value: number) => FORMATTERS.percent(value), - }, -]; - -const CodeLine = euiStyled.div` - font-family: ${(props) => props.theme.eui.euiCodeFontFamily}; - font-size: ${(props) => props.theme.eui.euiFontSizeS}; - white-space: pre; - overflow: hidden; - text-overflow: ellipsis; -`; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/state_badge.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/state_badge.tsx deleted file mode 100644 index 47049c7d9c893..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/state_badge.tsx +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { EuiBadge } from '@elastic/eui'; -import { STATE_NAMES } from './states'; - -export const StateBadge = ({ state }: { state: string }) => { - switch (state) { - case 'running': - return {STATE_NAMES.running}; - case 'sleeping': - return {STATE_NAMES.sleeping}; - case 'dead': - return {STATE_NAMES.dead}; - case 'stopped': - return {STATE_NAMES.stopped}; - case 'idle': - return {STATE_NAMES.idle}; - case 'zombie': - return {STATE_NAMES.zombie}; - default: - return {STATE_NAMES.unknown}; - } -}; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/states.ts b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/states.ts deleted file mode 100644 index ea944cd8bb8c0..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/states.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; - -export const STATE_NAMES = { - running: i18n.translate('xpack.infra.metrics.nodeDetails.processes.stateRunning', { - defaultMessage: 'Running', - }), - sleeping: i18n.translate('xpack.infra.metrics.nodeDetails.processes.stateSleeping', { - defaultMessage: 'Sleeping', - }), - dead: i18n.translate('xpack.infra.metrics.nodeDetails.processes.stateDead', { - defaultMessage: 'Dead', - }), - stopped: i18n.translate('xpack.infra.metrics.nodeDetails.processes.stateStopped', { - defaultMessage: 'Stopped', - }), - idle: i18n.translate('xpack.infra.metrics.nodeDetails.processes.stateIdle', { - defaultMessage: 'Idle', - }), - zombie: i18n.translate('xpack.infra.metrics.nodeDetails.processes.stateZombie', { - defaultMessage: 'Zombie', - }), - unknown: i18n.translate('xpack.infra.metrics.nodeDetails.processes.stateUnknown', { - defaultMessage: 'Unknown', - }), -}; - -export const STATE_ORDER = ['running', 'sleeping', 'stopped', 'idle', 'dead', 'zombie', 'unknown']; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/summary_table.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/summary_table.tsx deleted file mode 100644 index 61e5cde421181..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/summary_table.tsx +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { useMemo } from 'react'; -import { mapValues } from 'lodash'; -import { i18n } from '@kbn/i18n'; -import { - EuiLoadingSpinner, - EuiFlexGroup, - EuiFlexItem, - EuiDescriptionList, - EuiDescriptionListTitle, - EuiDescriptionListDescription, - EuiHorizontalRule, -} from '@elastic/eui'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; -import { ProcessListAPIResponse } from '../../../../../../../../common/http_api'; -import { STATE_NAMES } from './states'; - -interface Props { - processSummary: ProcessListAPIResponse['summary']; - isLoading: boolean; -} - -type SummaryRecord = { - total: number; -} & Record; - -const NOT_AVAILABLE_LABEL = i18n.translate('xpack.infra.notAvailableLabel', { - defaultMessage: 'N/A', -}); - -const processSummaryNotAvailable = { - total: NOT_AVAILABLE_LABEL, - running: NOT_AVAILABLE_LABEL, - sleeping: NOT_AVAILABLE_LABEL, - dead: NOT_AVAILABLE_LABEL, - stopped: NOT_AVAILABLE_LABEL, - idle: NOT_AVAILABLE_LABEL, - zombie: NOT_AVAILABLE_LABEL, - unknown: NOT_AVAILABLE_LABEL, -}; - -export const SummaryTable = ({ processSummary, isLoading }: Props) => { - const summary = !processSummary?.total ? processSummaryNotAvailable : processSummary; - - const processCount = useMemo( - () => - ({ - total: isLoading ? -1 : summary.total, - ...mapValues(STATE_NAMES, () => (isLoading ? -1 : 0)), - ...(isLoading ? {} : summary), - } as SummaryRecord), - [summary, isLoading] - ); - return ( - <> - - {Object.entries(processCount).map(([field, value]) => ( - - - {columnTitles[field as keyof SummaryRecord]} - - {value === -1 ? : value} - - - - ))} - - - - ); -}; - -const columnTitles = { - total: i18n.translate('xpack.infra.metrics.nodeDetails.processes.headingTotalProcesses', { - defaultMessage: 'Total processes', - }), - ...STATE_NAMES, -}; - -const LoadingSpinner = euiStyled(EuiLoadingSpinner).attrs({ size: 'm' })` - margin-top: 2px; - margin-bottom: 3px; -`; - -const ColumnTitle = euiStyled(EuiDescriptionListTitle)` - white-space: nowrap; -`; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/types.ts b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/types.ts deleted file mode 100644 index 1b38ac3829960..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/types.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { MetricsExplorerSeries } from '../../../../../../../../common/http_api'; -import { STATE_NAMES } from './states'; - -export interface Process { - command: string; - cpu: number; - memory: number; - startTime: number; - state: keyof typeof STATE_NAMES; - pid: number; - user: string; - timeseries: { - [x: string]: MetricsExplorerSeries; - }; - apmTrace?: string; // Placeholder -} diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/build_fields.ts b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/build_fields.ts deleted file mode 100644 index 8b77242055a1f..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/build_fields.ts +++ /dev/null @@ -1,117 +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 { InfraMetadata } from '../../../../../../../../common/http_api'; - -export const getFields = (metadata: InfraMetadata, group: 'cloud' | 'host' | 'agent') => { - switch (group) { - case 'host': - return prune([ - { - name: 'host.architecture', - value: metadata.info?.host?.architecture, - }, - { - name: 'host.hostname', - value: metadata.info?.host?.name, - }, - { - name: 'host.id', - value: metadata.info?.host?.id, - }, - { - name: 'host.ip', - value: metadata.info?.host?.ip, - }, - { - name: 'host.mac', - value: metadata.info?.host?.mac, - }, - { - name: 'host.name', - value: metadata.info?.host?.name, - }, - { - name: 'host.os.build', - value: metadata.info?.host?.os?.build, - }, - { - name: 'host.os.family', - value: metadata.info?.host?.os?.family, - }, - { - name: 'host.os.name', - value: metadata.info?.host?.os?.name, - }, - { - name: 'host.os.kernel', - value: metadata.info?.host?.os?.kernel, - }, - { - name: 'host.os.platform', - value: metadata.info?.host?.os?.platform, - }, - { - name: 'host.os.version', - value: metadata.info?.host?.os?.version, - }, - ]); - case 'cloud': - return prune([ - { - name: 'cloud.account.id', - value: metadata.info?.cloud?.account?.id, - }, - { - name: 'cloud.account.name', - value: metadata.info?.cloud?.account?.name, - }, - { - name: 'cloud.availability_zone', - value: metadata.info?.cloud?.availability_zone, - }, - { - name: 'cloud.instance.id', - value: metadata.info?.cloud?.instance?.id, - }, - { - name: 'cloud.instance.name', - value: metadata.info?.cloud?.instance?.name, - }, - { - name: 'cloud.machine.type', - value: metadata.info?.cloud?.machine?.type, - }, - { - name: 'cloud.provider', - value: metadata.info?.cloud?.provider, - }, - { - name: 'cloud.region', - value: metadata.info?.cloud?.region, - }, - ]); - case 'agent': - return prune([ - { - name: 'agent.id', - value: metadata.info?.agent?.id, - }, - { - name: 'agent.version', - value: metadata.info?.agent?.version, - }, - { - name: 'agent.policy', - value: metadata.info?.agent?.policy, - }, - ]); - } -}; - -const prune = (fields: Array<{ name: string; value: string | string[] | undefined }>) => - fields.filter((f) => !!f.value); diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/index.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/index.tsx deleted file mode 100644 index c8550a4d05163..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/index.tsx +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { useCallback, useMemo } from 'react'; -import { i18n } from '@kbn/i18n'; -import { EuiLoadingChart } from '@elastic/eui'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; -import { TabContent, TabProps } from '../shared'; -import { useSourceContext } from '../../../../../../../containers/metrics_source'; -import { InventoryItemType } from '../../../../../../../../common/inventory_models/types'; -import { useMetadata } from '../../../../../../../components/asset_details/hooks/use_metadata'; -import { getFields } from './build_fields'; -import { useWaffleTimeContext } from '../../../../hooks/use_waffle_time'; -import { Table } from './table'; -import { useWaffleFiltersContext } from '../../../../hooks/use_waffle_filters'; - -const TabComponent = (props: TabProps) => { - const nodeId = props.node.id; - const nodeType = props.nodeType as InventoryItemType; - const { sourceId } = useSourceContext(); - const { currentTimeRange } = useWaffleTimeContext(); - const { applyFilterQuery } = useWaffleFiltersContext(); - const { loading: metadataLoading, metadata } = useMetadata({ - assetId: nodeId, - assetType: nodeType, - sourceId, - timeRange: currentTimeRange, - }); - - const hostFields = useMemo(() => { - if (!metadata) return null; - return getFields(metadata, 'host'); - }, [metadata]); - - const cloudFields = useMemo(() => { - if (!metadata) return null; - return getFields(metadata, 'cloud'); - }, [metadata]); - - const agentFields = useMemo(() => { - if (!metadata) return null; - return getFields(metadata, 'agent'); - }, [metadata]); - - const onFilter = useCallback( - (item: { name: string; value: string }) => { - applyFilterQuery({ - kind: 'kuery', - expression: `${item.name}: "${item.value}"`, - }); - }, - [applyFilterQuery] - ); - - if (metadataLoading) { - return ; - } - - return ( - - {hostFields && hostFields.length > 0 && ( - - - - )} - {cloudFields && cloudFields.length > 0 && ( - -
- - )} - {agentFields && agentFields.length > 0 && ( - -
- - )} - - ); -}; - -const TableWrapper = euiStyled.div` - &:not(:last-child) { - margin-bottom: 16px - } -`; - -const LoadingPlaceholder = () => { - return ( -
- -
- ); -}; - -export const PropertiesTab = { - id: 'properties', - name: i18n.translate('xpack.infra.nodeDetails.tabs.metadata.title', { - defaultMessage: 'Metadata', - }), - content: TabComponent, -}; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/table.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/table.tsx deleted file mode 100644 index 01b047f2e3664..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/table.tsx +++ /dev/null @@ -1,167 +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 { - EuiText, - EuiToolTip, - EuiButtonIcon, - EuiFlexGroup, - EuiFlexItem, - EuiLink, - EuiBasicTable, - EuiSpacer, -} from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import React, { useMemo } from 'react'; -import { FormattedMessage } from '@kbn/i18n-react'; -import useToggle from 'react-use/lib/useToggle'; - -interface Row { - name: string; - value: string | string[] | undefined; -} - -interface Props { - rows: Row[]; - title: string; - onClick(item: Row): void; -} - -export const Table = (props: Props) => { - const { rows, title, onClick } = props; - const columns = useMemo( - () => [ - { - field: 'name', - name: '', - width: '35%', - sortable: false, - render: (name: string, item: Row) => ( - - {item.name} - - ), - }, - { - field: 'value', - name: '', - width: '65%', - sortable: false, - render: (_name: string, item: Row) => { - return ( - - - - - onClick(item)} - /> - - - - - - - - ); - }, - }, - ], - [onClick] - ); - - return ( - <> - -

{title}

-
- - - - ); -}; - -class TableWithoutHeader extends EuiBasicTable { - renderTableHead() { - return <>; - } -} - -interface ExpandableContentProps { - values: string | string[] | undefined; -} - -const ExpandableContent = (props: ExpandableContentProps) => { - const { values } = props; - const [isExpanded, toggle] = useToggle(false); - - const list = Array.isArray(values) ? values : [values]; - const [first, ...others] = list; - const hasOthers = others.length > 0; - const shouldShowMore = hasOthers && !isExpanded; - - return ( - -
- {first} - {shouldShowMore && ( - <> - {' ... '} - - - - - )} -
- {isExpanded && others.map((item) => {item})} - {hasOthers && isExpanded && ( - - - {i18n.translate('xpack.infra.nodeDetails.tabs.metadata.seeLess', { - defaultMessage: 'Show less', - })} - - - )} -
- ); -}; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/shared.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/shared.tsx deleted file mode 100644 index 2d65ef9c01fc6..0000000000000 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/shared.tsx +++ /dev/null @@ -1,27 +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 { euiStyled } from '@kbn/kibana-react-plugin/common'; -import { InventoryItemType } from '../../../../../../../common/inventory_models/types'; -import { InfraWaffleMapOptions, InfraWaffleMapNode } from '../../../../../../lib/lib'; - -export interface TabProps { - options: InfraWaffleMapOptions; - currentTime: number; - node: InfraWaffleMapNode; - nodeType: InventoryItemType; - onClose(): void; -} - -export const OVERLAY_Y_START = 266; -export const OVERLAY_BOTTOM_MARGIN = 16; -export const TabContent = euiStyled.div` - padding: ${(props) => props.theme.eui.euiSizeM}; - flex: 1; - overflow-y: auto; - overflow-x: hidden; -`; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/nodes_overview.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/nodes_overview.tsx index c7d5e425efbab..a0ffd01ceee4f 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/nodes_overview.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/nodes_overview.tsx @@ -19,6 +19,8 @@ import { TableView } from './table_view'; import { SnapshotNode } from '../../../../../common/http_api/snapshot_api'; import { calculateBoundsFromNodes } from '../lib/calculate_bounds_from_nodes'; import { Legend } from './waffle/legend'; +import { useAssetDetailsFlyoutState } from '../hooks/use_asset_details_flyout_url_state'; +import { AssetDetailsFlyout } from './waffle/asset_details_flyout'; export interface KueryFilterQuery { kind: 'kuery'; @@ -57,6 +59,12 @@ export const NodesOverview = ({ showLoading, }: Props) => { const currentBreakpoint = useCurrentEuiBreakpoint(); + const [{ detailsItemId }, setFlyoutUrlState] = useAssetDetailsFlyoutState(); + + const closeFlyout = useCallback( + () => setFlyoutUrlState({ detailsItemId: null }), + [setFlyoutUrlState] + ); const handleDrilldown = useCallback( (filter: string) => { @@ -123,6 +131,7 @@ export const NodesOverview = ({ + {nodeType === 'host' && detailsItemId && ( + + )} void; + currentTime: number; +} + +const ONE_HOUR = 60 * 60 * 1000; + +const flyoutTabs = [ + ...commonFlyoutTabs, + { + id: ContentTabIds.LINK_TO_APM, + name: i18n.translate('xpack.infra.nodeDetails.tabs.linkToApm', { + defaultMessage: 'APM', + }), + }, +]; + +export const AssetDetailsFlyout = ({ assetName, assetType, closeFlyout, currentTime }: Props) => { + const { source } = useSourceContext(); + + return source ? ( + + ) : null; +}; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/group_of_groups.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/group_of_groups.tsx index 634d98f28d8b5..76dd103a25d1a 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/group_of_groups.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/group_of_groups.tsx @@ -25,6 +25,7 @@ interface Props { bounds: InfraWaffleMapBounds; nodeType: InventoryItemType; currentTime: number; + detailsItemId: string | null; } export const GroupOfGroups: React.FC = (props) => { @@ -43,6 +44,7 @@ export const GroupOfGroups: React.FC = (props) => { bounds={props.bounds} nodeType={props.nodeType} currentTime={props.currentTime} + detailsItemId={props.detailsItemId} /> ))} diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/group_of_nodes.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/group_of_nodes.tsx index 043586b682693..1fe78bfdc142d 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/group_of_nodes.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/group_of_nodes.tsx @@ -17,6 +17,7 @@ import { import { GroupName } from './group_name'; import { Node } from './node'; import { InventoryItemType } from '../../../../../../common/inventory_models/types'; +import { useAssetDetailsFlyoutState } from '../../hooks/use_asset_details_flyout_url_state'; interface Props { onDrilldown: (filter: string) => void; @@ -27,6 +28,7 @@ interface Props { bounds: InfraWaffleMapBounds; nodeType: InventoryItemType; currentTime: number; + detailsItemId: string | null; } // custom comparison function for rendering the nodes to prevent unncessary rerendering @@ -42,8 +44,20 @@ const isEqualGroupOfNodes = (prevProps: Props, nextProps: Props) => { }; export const GroupOfNodes = React.memo( - ({ group, options, formatter, onDrilldown, isChild = false, bounds, nodeType, currentTime }) => { + ({ + group, + options, + formatter, + onDrilldown, + isChild = false, + bounds, + nodeType, + currentTime, + detailsItemId, + }) => { const width = group.width > 200 ? group.width : 200; + const [_, setFlyoutUrlState] = useAssetDetailsFlyoutState(); + return ( @@ -59,6 +73,8 @@ export const GroupOfNodes = React.memo( bounds={bounds} nodeType={nodeType} currentTime={currentTime} + detailsItemId={detailsItemId} + setFlyoutUrlState={setFlyoutUrlState} /> )) ) : ( diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/map.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/map.tsx index 6a0a6dad79eab..ceff6663fd7c3 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/map.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/map.tsx @@ -30,6 +30,7 @@ interface Props { dataBounds: InfraWaffleMapBounds; bottomMargin: number; staticHeight: boolean; + detailsItemId: string | null; } export const Map: React.FC = ({ @@ -43,6 +44,7 @@ export const Map: React.FC = ({ dataBounds, bottomMargin, staticHeight, + detailsItemId, }) => { const sortedNodes = sortNodes(options.sort, nodes); const map = nodesToWaffleMap(sortedNodes); @@ -70,6 +72,7 @@ export const Map: React.FC = ({ bounds={bounds} nodeType={nodeType} currentTime={currentTime} + detailsItemId={detailsItemId} /> ); } @@ -85,6 +88,7 @@ export const Map: React.FC = ({ bounds={bounds} nodeType={nodeType} currentTime={currentTime} + detailsItemId={detailsItemId} /> ); } diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/node.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/node.tsx index 0eda4c4b72cd1..c539d8faaf3e2 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/node.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/node.tsx @@ -5,14 +5,11 @@ * 2.0. */ -import { darken, readableColor } from 'polished'; import React from 'react'; -import { i18n } from '@kbn/i18n'; - import { first } from 'lodash'; import { EuiPopover, EuiToolTip } from '@elastic/eui'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import { useBoolean } from '../../../../../hooks/use_boolean'; import { InfraWaffleMapBounds, InfraWaffleMapNode, @@ -21,20 +18,10 @@ import { import { ConditionalToolTip } from './conditional_tooltip'; import { colorFromValue } from '../../lib/color_from_value'; import { InventoryItemType } from '../../../../../../common/inventory_models/types'; -import { NodeContextPopover } from '../node_details/overlay'; import { NodeContextMenu } from './node_context_menu'; -import { AlertFlyout } from '../../../../../alerting/inventory/components/alert_flyout'; -import { findInventoryFields } from '../../../../../../common/inventory_models'; - -const initialState = { - isPopoverOpen: false, - isOverlayOpen: false, - isAlertFlyoutVisible: false, - isToolTipOpen: false, -}; - -type State = Readonly; +import { NodeSquare } from './node_square'; +import { type AssetDetailsFlyoutPropertiesUpdater } from '../../hooks/use_asset_details_flyout_url_state'; interface Props { squareSize: number; @@ -44,247 +31,78 @@ interface Props { bounds: InfraWaffleMapBounds; nodeType: InventoryItemType; currentTime: number; + setFlyoutUrlState: AssetDetailsFlyoutPropertiesUpdater; + detailsItemId: string | null; } -export class Node extends React.PureComponent { - public readonly state: State = initialState; - public render() { - const { nodeType, node, options, squareSize, bounds, formatter, currentTime } = this.props; - const { isPopoverOpen, isAlertFlyoutVisible, isToolTipOpen } = this.state; - const metric = first(node.metrics); - const valueMode = squareSize > 70; - const ellipsisMode = squareSize > 30; - const rawValue = (metric && metric.value) || 0; - const color = colorFromValue(options.legend, rawValue, bounds); - const value = formatter(rawValue); - const nodeAriaLabel = i18n.translate('xpack.infra.node.ariaLabel', { - defaultMessage: '{nodeName}, click to open menu', - values: { nodeName: node.name }, - }); - - const nodeBorder = this.state.isOverlayOpen ? { border: 'solid 4px #000' } : undefined; - - const bigSquare = ( - - - - {valueMode ? ( - - - - {value} - - - ) : ( - ellipsisMode && ( - - - - ) - )} - - - - ); - - const smallSquare = ( - - ); - - const nodeSquare = valueMode || ellipsisMode ? bigSquare : smallSquare; - - return ( - <> - {isPopoverOpen ? ( - - - - ) : isToolTipOpen ? ( - - } - > - {nodeSquare} - - ) : ( - nodeSquare - )} +export const Node = ({ + nodeType, + node, + options, + squareSize, + bounds, + formatter, + currentTime, + setFlyoutUrlState, + detailsItemId, +}: Props) => { + const [isToolTipOpen, { off: hideToolTip, on: showToolTip }] = useBoolean(false); + const [isPopoverOpen, { off: closePopover, toggle: togglePopover }] = useBoolean(false); + + const metric = first(node.metrics); + const rawValue = (metric && metric.value) || 0; + const color = colorFromValue(options.legend, rawValue, bounds); + const value = formatter(rawValue); + + const toggleAssetPopover = () => { + if (nodeType === 'host') { + setFlyoutUrlState({ detailsItemId: node.name }); + } else { + togglePopover(); + } + }; - {this.state.isOverlayOpen && ( - + ); + + return ( + <> + {isPopoverOpen ? ( + + - )} - - {isAlertFlyoutVisible && ( - - )} - - ); - } - - private openAlertFlyout = () => { - this.setState({ - isOverlayOpen: false, - isAlertFlyoutVisible: true, - }); - }; - - private setAlertFlyoutVisible = (isOpen: boolean) => { - this.setState({ - isAlertFlyoutVisible: isOpen, - }); - }; - - private togglePopover = () => { - const { nodeType } = this.props; - if (nodeType === 'host') { - this.toggleNewOverlay(); - } else { - this.setState((prevState) => ({ isPopoverOpen: !prevState.isPopoverOpen })); - } - }; - - private toggleNewOverlay = () => { - this.setState((prevState) => ({ - isPopoverOpen: !prevState.isOverlayOpen === true ? false : prevState.isPopoverOpen, - isOverlayOpen: !prevState.isOverlayOpen, - })); - }; - - private closePopover = () => { - if (this.state.isPopoverOpen) { - this.setState({ isPopoverOpen: false }); - } - }; - private showToolTip = () => { - this.setState({ isToolTipOpen: true }); - }; - private hideToolTip = () => { - this.setState({ isToolTipOpen: false }); - }; -} - -const NodeContainer = euiStyled.div` - position: relative; - cursor: pointer; -`; -const NodeContainerSmall = euiStyled.div` - cursor: pointer; - position: relative; - background-color: ${(props) => darken(0.1, props.color)}; - border-radius: 3px; - margin: 2px; - box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2); -`; - -interface ColorProps { - color: string; -} - -const SquareOuter = euiStyled.div` - position: absolute; - top: 4px; - left: 4px; - bottom: 4px; - right: 4px; - background-color: ${(props) => darken(0.1, props.color)}; - border-radius: 3px; - box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2); -`; - -const SquareInner = euiStyled.div` - position: absolute; - top: 0; - right: 0; - bottom: 2px; - left: 0; - border-radius: 3px; - background-color: ${(props) => props.color}; -`; - -const ValueInner = euiStyled.button` - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - display: flex; - line-height: 1.2em; - align-items: center; - align-content: center; - padding: 1em; - overflow: hidden; - flex-wrap: wrap; - width: 100%; - border: none; - &:focus { - outline: none !important; - border: ${(params) => params.theme?.eui.euiFocusRingSize} solid - ${(params) => params.theme?.eui.euiFocusRingColor}; - box-shadow: none; - } -`; - -const SquareTextContent = euiStyled.div` - text-align: center; - width: 100%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - flex: 1 0 auto; - color: ${(props) => readableColor(props.color)}; -`; - -const Value = euiStyled(SquareTextContent)` - font-weight: bold; - font-size: 0.9em; - line-height: 1.2em; -`; - -const Label = euiStyled(SquareTextContent)` - font-size: 0.7em; - margin-bottom: 0.7em; -`; + + ) : isToolTipOpen ? ( + } + > + {nodeSquare} + + ) : ( + nodeSquare + )} + + ); +}; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/node_square.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/node_square.tsx new file mode 100644 index 0000000000000..cb97b563af929 --- /dev/null +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/node_square.tsx @@ -0,0 +1,199 @@ +/* + * 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 { darken, readableColor } from 'polished'; +import React, { CSSProperties } from 'react'; + +import { i18n } from '@kbn/i18n'; + +import { css } from '@emotion/react'; +import { euiThemeVars } from '@kbn/ui-theme'; +import { DispatchWithOptionalAction } from '../../../../../hooks/use_boolean'; + +const SquareTextContentStyles = (color: string) => ` + text-align: center; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + flex: 1 0 auto; + color: ${readableColor(color)}; +`; +const styles = { + nodeContainerSmall: (color: string) => ` + cursor: pointer; + position: relative; + background-color: ${darken(0.1, color)}; + border-radius: 3px; + margin: 2px; + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2); + `, + valueInner: ` + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + display: flex; + line-height: 1.2em; + align-items: center; + align-content: center; + padding: 1em; + overflow: hidden; + flex-wrap: wrap; + width: 100%; + border: none; + &:focus { + outline: none !important; + border: ${euiThemeVars.euiFocusRingSize} solid ${euiThemeVars.euiFocusRingColor}; + box-shadow: none; + } + `, + squareOuter: (color: string) => ` + position: absolute; + top: 4px; + left: 4px; + bottom: 4px; + right: 4px; + background-color: ${darken(0.1, color)}; + border-radius: 3px; + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2); + `, + squareInner: (color: string) => ` + position: absolute; + top: 0; + right: 0; + bottom: 2px; + left: 0; + border-radius: 3px; + background-color: ${color}; + `, + label: (color: string) => ` + font-size: 0.7em; + margin-bottom: 0.7em; + ${SquareTextContentStyles(color)} + `, + value: (color: string) => ` + font-weight: bold; + font-size: 0.9em; + line-height: 1.2em; + ${SquareTextContentStyles(color)} + `, +}; + +export const NodeSquare = ({ + squareSize, + togglePopover, + showToolTip, + hideToolTip, + color, + nodeName, + value, + showBorder, +}: { + squareSize: number; + togglePopover: DispatchWithOptionalAction; + showToolTip: () => void; + hideToolTip: () => void; + color: string; + nodeName: string; + value: string; + showBorder?: boolean; +}) => { + const valueMode = squareSize > 70; + const ellipsisMode = squareSize > 30; + const nodeAriaLabel = i18n.translate('xpack.infra.node.ariaLabel', { + defaultMessage: '{nodeName}, click to open menu', + values: { nodeName }, + }); + const style: CSSProperties | undefined = showBorder ? { border: 'solid 4px #000' } : undefined; + + return valueMode || ellipsisMode ? ( +
+
+
+ {valueMode ? ( + + ) : ( + ellipsisMode && ( + + ) + )} +
+
+
+ ) : ( +
+ ); +}; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_asset_details_flyout_url_state.ts b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_asset_details_flyout_url_state.ts new file mode 100644 index 0000000000000..7847cfc0da268 --- /dev/null +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_asset_details_flyout_url_state.ts @@ -0,0 +1,48 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import * as rt from 'io-ts'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { fold } from 'fp-ts/lib/Either'; +import { constant, identity } from 'fp-ts/lib/function'; +import { useUrlState } from '../../../../utils/use_url_state'; + +export const GET_DEFAULT_PROPERTIES: AssetDetailsFlyoutProperties = { + detailsItemId: null, +}; + +const ASSET_DETAILS_FLYOUT_URL_STATE_KEY = 'assetDetailsFlyout'; + +export const useAssetDetailsFlyoutState = (): [ + AssetDetailsFlyoutProperties, + AssetDetailsFlyoutPropertiesUpdater +] => { + const [urlState, setUrlState] = useUrlState({ + defaultState: { + ...GET_DEFAULT_PROPERTIES, + }, + decodeUrlState, + encodeUrlState, + urlStateKey: ASSET_DETAILS_FLYOUT_URL_STATE_KEY, + }); + + return [urlState, setUrlState]; +}; + +const AssetDetailsFlyoutStateRT = rt.type({ + detailsItemId: rt.union([rt.string, rt.null]), +}); + +export type AssetDetailsFlyoutState = rt.TypeOf; +export type AssetDetailsFlyoutPropertiesUpdater = (params: AssetDetailsFlyoutState) => void; + +type AssetDetailsFlyoutProperties = rt.TypeOf; + +const encodeUrlState = AssetDetailsFlyoutStateRT.encode; +const decodeUrlState = (value: unknown) => { + return pipe(AssetDetailsFlyoutStateRT.decode(value), fold(constant(undefined), identity)); +}; diff --git a/x-pack/plugins/infra/public/pages/metrics/metric_detail/asset_detail_page.tsx b/x-pack/plugins/infra/public/pages/metrics/metric_detail/asset_detail_page.tsx index d5ba376a514bb..f5809c0857353 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metric_detail/asset_detail_page.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metric_detail/asset_detail_page.tsx @@ -7,54 +7,14 @@ import React from 'react'; import { useRouteMatch } from 'react-router-dom'; -import { i18n } from '@kbn/i18n'; import { NoRemoteCluster } from '../../../components/empty_states'; import { SourceErrorPage } from '../../../components/source_error_page'; import { SourceLoadingPage } from '../../../components/source_loading_page'; import { useSourceContext } from '../../../containers/metrics_source'; -import { ContentTabIds, type Tab } from '../../../components/asset_details/types'; import type { InventoryItemType } from '../../../../common/inventory_models/types'; import { AssetDetails } from '../../../components/asset_details/asset_details'; import { MetricsPageTemplate } from '../page_template'; - -const orderedFlyoutTabs: Tab[] = [ - { - id: ContentTabIds.OVERVIEW, - name: i18n.translate('xpack.infra.nodeDetails.tabs.overview.title', { - defaultMessage: 'Overview', - }), - }, - { - id: ContentTabIds.METADATA, - name: i18n.translate('xpack.infra.nodeDetails.tabs.metadata.title', { - defaultMessage: 'Metadata', - }), - }, - { - id: ContentTabIds.PROCESSES, - name: i18n.translate('xpack.infra.metrics.nodeDetails.tabs.processes', { - defaultMessage: 'Processes', - }), - }, - { - id: ContentTabIds.LOGS, - name: i18n.translate('xpack.infra.nodeDetails.tabs.logs.title', { - defaultMessage: 'Logs', - }), - }, - { - id: ContentTabIds.ANOMALIES, - name: i18n.translate('xpack.infra.nodeDetails.tabs.anomalies', { - defaultMessage: 'Anomalies', - }), - }, - { - id: ContentTabIds.OSQUERY, - name: i18n.translate('xpack.infra.nodeDetails.tabs.osquery', { - defaultMessage: 'Osquery', - }), - }, -]; +import { commonFlyoutTabs } from '../../../common/asset_details_config/asset_details_tabs'; export const AssetDetailPage = () => { const { isLoading, loadSourceFailureMessage, loadSource, source } = useSourceContext(); @@ -91,7 +51,7 @@ export const AssetDetailPage = () => { id: nodeId, }} assetType={nodeType} - tabs={orderedFlyoutTabs} + tabs={commonFlyoutTabs} links={['apmServices']} renderMode={{ mode: 'page', diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 8981de9b982c7..a9a7ce2caa70c 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -18741,9 +18741,7 @@ "xpack.infra.hostsViewPage.tabs.metricsCharts.tx": "Réseau sortant (TX)", "xpack.infra.hostsViewPage.tooltip.whatAreTheseMetricsLink": "Que sont ces indicateurs ?", "xpack.infra.infra.nodeDetails.apmTabLabel": "APM", - "xpack.infra.infra.nodeDetails.createAlertLink": "Créer une règle d'inventaire", "xpack.infra.infra.nodeDetails.openAsPage": "Ouvrir en tant que page", - "xpack.infra.infra.nodeDetails.updtimeTabLabel": "Uptime", "xpack.infra.inventory.alerting.groupActionVariableDescription": "Nom des données de reporting du groupe", "xpack.infra.inventoryModel.container.displayName": "Conteneurs Docker", "xpack.infra.inventoryModel.container.singularDisplayName": "Conteneur Docker", @@ -19233,7 +19231,6 @@ "xpack.infra.metrics.nodeDetails.processes.stateZombie": "Zombie", "xpack.infra.metrics.nodeDetails.processes.viewTraceInAPM": "Afficher la trace dans APM", "xpack.infra.metrics.nodeDetails.processesHeader": "Processus principaux", - "xpack.infra.metrics.nodeDetails.processesHeader.tooltipBody": "Le tableau ci-dessous agrège les principaux processus de consommation de CPU et de mémoire. Il n'affiche pas tous les processus.", "xpack.infra.metrics.nodeDetails.processesHeader.tooltipLabel": "Plus d'infos", "xpack.infra.metrics.nodeDetails.processListError": "Impossible de charger les données de processus", "xpack.infra.metrics.nodeDetails.processListRetry": "Réessayer", @@ -19381,41 +19378,16 @@ "xpack.infra.nodeDetails.labels.showMoreDetails": "Afficher plus de détails", "xpack.infra.nodeDetails.logs.openLogsLink": "Ouvrir dans Logs", "xpack.infra.nodeDetails.logs.textFieldPlaceholder": "Rechercher les entrées de logs...", - "xpack.infra.nodeDetails.metrics.cached": "En cache", - "xpack.infra.nodeDetails.metrics.charts.loadTitle": "Charge", - "xpack.infra.nodeDetails.metrics.charts.logRateTitle": "Taux de log", - "xpack.infra.nodeDetails.metrics.charts.memoryTitle": "Mémoire", - "xpack.infra.nodeDetails.metrics.charts.networkTitle": "Réseau", - "xpack.infra.nodeDetails.metrics.fcharts.cpuTitle": "CPU", - "xpack.infra.nodeDetails.metrics.free": "Gratuit", - "xpack.infra.nodeDetails.metrics.inbound": "Entrant", - "xpack.infra.nodeDetails.metrics.last15Minutes": "15 dernières minutes", - "xpack.infra.nodeDetails.metrics.last24Hours": "Dernières 24 heures", - "xpack.infra.nodeDetails.metrics.last3Hours": "3 dernières heures", - "xpack.infra.nodeDetails.metrics.last7Days": "7 derniers jours", - "xpack.infra.nodeDetails.metrics.lastHour": "Dernière heure", - "xpack.infra.nodeDetails.metrics.logRate": "Taux de log", - "xpack.infra.nodeDetails.metrics.outbound": "Sortant", - "xpack.infra.nodeDetails.metrics.system": "Système", - "xpack.infra.nodeDetails.metrics.used": "Utilisé", - "xpack.infra.nodeDetails.metrics.user": "Utilisateur", "xpack.infra.nodeDetails.no": "Non", "xpack.infra.nodeDetails.tabs.anomalies": "Anomalies", "xpack.infra.nodeDetails.tabs.logs": "Logs", "xpack.infra.nodeDetails.tabs.logs.title": "Logs", - "xpack.infra.nodeDetails.tabs.metadata.agentHeader": "Agent", - "xpack.infra.nodeDetails.tabs.metadata.cloudHeader": "Cloud", - "xpack.infra.nodeDetails.tabs.metadata.filterAriaLabel": "Filtre", - "xpack.infra.nodeDetails.tabs.metadata.hostsHeader": "Hôtes", "xpack.infra.nodeDetails.tabs.metadata.seeLess": "Afficher moins", - "xpack.infra.nodeDetails.tabs.metadata.setFilterTooltip": "Afficher l'événement avec filtre", "xpack.infra.nodeDetails.tabs.metadata.title": "Métadonnées", - "xpack.infra.nodeDetails.tabs.metrics": "Indicateurs", "xpack.infra.nodeDetails.tabs.osquery": "Osquery", "xpack.infra.nodeDetails.yes": "Oui", "xpack.infra.nodesToWaffleMap.groupsWithGroups.allName": "Tous", "xpack.infra.nodesToWaffleMap.groupsWithNodes.allName": "Tous", - "xpack.infra.notAvailableLabel": "S. O.", "xpack.infra.openView.actionNames.deleteConfirmation": "Supprimer la vue ?", "xpack.infra.openView.cancelButton": "Annuler", "xpack.infra.openView.columnNames.actions": "Actions", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 41665e626fc8c..42eb7d822fdbd 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -18755,9 +18755,7 @@ "xpack.infra.hostsViewPage.tabs.metricsCharts.tx": "ネットワーク送信(TX)", "xpack.infra.hostsViewPage.tooltip.whatAreTheseMetricsLink": "これらのメトリックは何か。", "xpack.infra.infra.nodeDetails.apmTabLabel": "APM", - "xpack.infra.infra.nodeDetails.createAlertLink": "インベントリルールの作成", "xpack.infra.infra.nodeDetails.openAsPage": "ページとして開く", - "xpack.infra.infra.nodeDetails.updtimeTabLabel": "アップタイム", "xpack.infra.inventory.alerting.groupActionVariableDescription": "データを報告するグループの名前", "xpack.infra.inventoryModel.container.displayName": "Dockerコンテナー", "xpack.infra.inventoryModel.container.singularDisplayName": "Docker コンテナー", @@ -19247,7 +19245,6 @@ "xpack.infra.metrics.nodeDetails.processes.stateZombie": "ゾンビ", "xpack.infra.metrics.nodeDetails.processes.viewTraceInAPM": "APM でトレースを表示", "xpack.infra.metrics.nodeDetails.processesHeader": "上位のプロセス", - "xpack.infra.metrics.nodeDetails.processesHeader.tooltipBody": "次の表は、上位の CPU および上位のメモリ消費プロセスの集計です。一部のプロセスは表示されません。", "xpack.infra.metrics.nodeDetails.processesHeader.tooltipLabel": "詳細", "xpack.infra.metrics.nodeDetails.processListError": "プロセスデータを読み込めません", "xpack.infra.metrics.nodeDetails.processListRetry": "再試行", @@ -19395,41 +19392,16 @@ "xpack.infra.nodeDetails.labels.showMoreDetails": "他の詳細を表示", "xpack.infra.nodeDetails.logs.openLogsLink": "ログで開く", "xpack.infra.nodeDetails.logs.textFieldPlaceholder": "ログエントリーを検索...", - "xpack.infra.nodeDetails.metrics.cached": "キャッシュ", - "xpack.infra.nodeDetails.metrics.charts.loadTitle": "読み込み", - "xpack.infra.nodeDetails.metrics.charts.logRateTitle": "ログレート", - "xpack.infra.nodeDetails.metrics.charts.memoryTitle": "メモリー", - "xpack.infra.nodeDetails.metrics.charts.networkTitle": "ネットワーク", - "xpack.infra.nodeDetails.metrics.fcharts.cpuTitle": "CPU", - "xpack.infra.nodeDetails.metrics.free": "空き", - "xpack.infra.nodeDetails.metrics.inbound": "受信", - "xpack.infra.nodeDetails.metrics.last15Minutes": "過去15分間", - "xpack.infra.nodeDetails.metrics.last24Hours": "過去 24 時間", - "xpack.infra.nodeDetails.metrics.last3Hours": "過去 3 時間", - "xpack.infra.nodeDetails.metrics.last7Days": "過去 7 日間", - "xpack.infra.nodeDetails.metrics.lastHour": "過去 1 時間", - "xpack.infra.nodeDetails.metrics.logRate": "ログレート", - "xpack.infra.nodeDetails.metrics.outbound": "送信", - "xpack.infra.nodeDetails.metrics.system": "システム", - "xpack.infra.nodeDetails.metrics.used": "使用中", - "xpack.infra.nodeDetails.metrics.user": "ユーザー", "xpack.infra.nodeDetails.no": "いいえ", "xpack.infra.nodeDetails.tabs.anomalies": "異常", "xpack.infra.nodeDetails.tabs.logs": "ログ", "xpack.infra.nodeDetails.tabs.logs.title": "ログ", - "xpack.infra.nodeDetails.tabs.metadata.agentHeader": "エージェント", - "xpack.infra.nodeDetails.tabs.metadata.cloudHeader": "クラウド", - "xpack.infra.nodeDetails.tabs.metadata.filterAriaLabel": "フィルター", - "xpack.infra.nodeDetails.tabs.metadata.hostsHeader": "ホスト", "xpack.infra.nodeDetails.tabs.metadata.seeLess": "簡易表示", - "xpack.infra.nodeDetails.tabs.metadata.setFilterTooltip": "フィルターでイベントを表示", "xpack.infra.nodeDetails.tabs.metadata.title": "メタデータ", - "xpack.infra.nodeDetails.tabs.metrics": "メトリック", "xpack.infra.nodeDetails.tabs.osquery": "Osquery", "xpack.infra.nodeDetails.yes": "はい", "xpack.infra.nodesToWaffleMap.groupsWithGroups.allName": "すべて", "xpack.infra.nodesToWaffleMap.groupsWithNodes.allName": "すべて", - "xpack.infra.notAvailableLabel": "N/A", "xpack.infra.openView.actionNames.deleteConfirmation": "ビューを削除しますか?", "xpack.infra.openView.cancelButton": "キャンセル", "xpack.infra.openView.columnNames.actions": "アクション", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 33625a62a6356..61fcbaa2bbbd0 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -18755,9 +18755,7 @@ "xpack.infra.hostsViewPage.tabs.metricsCharts.tx": "网络出站数据 (TX)", "xpack.infra.hostsViewPage.tooltip.whatAreTheseMetricsLink": "这些指标是什么?", "xpack.infra.infra.nodeDetails.apmTabLabel": "APM", - "xpack.infra.infra.nodeDetails.createAlertLink": "创建库存规则", "xpack.infra.infra.nodeDetails.openAsPage": "以页面形式打开", - "xpack.infra.infra.nodeDetails.updtimeTabLabel": "运行时间", "xpack.infra.inventory.alerting.groupActionVariableDescription": "报告数据的组名称", "xpack.infra.inventoryModel.container.displayName": "Docker 容器", "xpack.infra.inventoryModel.container.singularDisplayName": "Docker 容器", @@ -19247,7 +19245,6 @@ "xpack.infra.metrics.nodeDetails.processes.stateZombie": "僵停", "xpack.infra.metrics.nodeDetails.processes.viewTraceInAPM": "在 APM 中查看跟踪", "xpack.infra.metrics.nodeDetails.processesHeader": "排序靠前的进程", - "xpack.infra.metrics.nodeDetails.processesHeader.tooltipBody": "下表聚合了 CPU 和内存消耗靠前的进程。不显示所有进程。", "xpack.infra.metrics.nodeDetails.processesHeader.tooltipLabel": "更多信息", "xpack.infra.metrics.nodeDetails.processListError": "无法加载进程数据", "xpack.infra.metrics.nodeDetails.processListRetry": "重试", @@ -19395,41 +19392,16 @@ "xpack.infra.nodeDetails.labels.showMoreDetails": "显示更多详情", "xpack.infra.nodeDetails.logs.openLogsLink": "在日志中打开", "xpack.infra.nodeDetails.logs.textFieldPlaceholder": "搜索日志条目......", - "xpack.infra.nodeDetails.metrics.cached": "已缓存", - "xpack.infra.nodeDetails.metrics.charts.loadTitle": "加载", - "xpack.infra.nodeDetails.metrics.charts.logRateTitle": "日志速率", - "xpack.infra.nodeDetails.metrics.charts.memoryTitle": "内存", - "xpack.infra.nodeDetails.metrics.charts.networkTitle": "网络", - "xpack.infra.nodeDetails.metrics.fcharts.cpuTitle": "CPU", - "xpack.infra.nodeDetails.metrics.free": "可用", - "xpack.infra.nodeDetails.metrics.inbound": "入站", - "xpack.infra.nodeDetails.metrics.last15Minutes": "过去 15 分钟", - "xpack.infra.nodeDetails.metrics.last24Hours": "过去 24 小时", - "xpack.infra.nodeDetails.metrics.last3Hours": "过去 3 小时", - "xpack.infra.nodeDetails.metrics.last7Days": "过去 7 天", - "xpack.infra.nodeDetails.metrics.lastHour": "过去一小时", - "xpack.infra.nodeDetails.metrics.logRate": "日志速率", - "xpack.infra.nodeDetails.metrics.outbound": "出站", - "xpack.infra.nodeDetails.metrics.system": "系统", - "xpack.infra.nodeDetails.metrics.used": "已使用", - "xpack.infra.nodeDetails.metrics.user": "用户", "xpack.infra.nodeDetails.no": "否", "xpack.infra.nodeDetails.tabs.anomalies": "异常", "xpack.infra.nodeDetails.tabs.logs": "日志", "xpack.infra.nodeDetails.tabs.logs.title": "日志", - "xpack.infra.nodeDetails.tabs.metadata.agentHeader": "代理", - "xpack.infra.nodeDetails.tabs.metadata.cloudHeader": "云", - "xpack.infra.nodeDetails.tabs.metadata.filterAriaLabel": "筛选", - "xpack.infra.nodeDetails.tabs.metadata.hostsHeader": "主机", "xpack.infra.nodeDetails.tabs.metadata.seeLess": "显示更少", - "xpack.infra.nodeDetails.tabs.metadata.setFilterTooltip": "使用筛选查看事件", "xpack.infra.nodeDetails.tabs.metadata.title": "元数据", - "xpack.infra.nodeDetails.tabs.metrics": "指标", "xpack.infra.nodeDetails.tabs.osquery": "Osquery", "xpack.infra.nodeDetails.yes": "是", "xpack.infra.nodesToWaffleMap.groupsWithGroups.allName": "全部", "xpack.infra.nodesToWaffleMap.groupsWithNodes.allName": "全部", - "xpack.infra.notAvailableLabel": "不可用", "xpack.infra.openView.actionNames.deleteConfirmation": "删除视图?", "xpack.infra.openView.cancelButton": "取消", "xpack.infra.openView.columnNames.actions": "操作", diff --git a/x-pack/test/functional/apps/infra/home_page.ts b/x-pack/test/functional/apps/infra/home_page.ts index a6dc2754de359..80ae3d2a59b8b 100644 --- a/x-pack/test/functional/apps/infra/home_page.ts +++ b/x-pack/test/functional/apps/infra/home_page.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { parse } from 'url'; import { KUBERNETES_TOUR_STORAGE_KEY } from '@kbn/infra-plugin/public/pages/metrics/inventory_view/components/kubernetes_tour'; import { FtrProviderContext } from '../../ftr_provider_context'; import { DATES, INVENTORY_PATH } from './constants'; @@ -18,7 +19,14 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); const browser = getService('browser'); const retry = getService('retry'); - const pageObjects = getPageObjects(['common', 'header', 'infraHome', 'infraSavedViews']); + const pageObjects = getPageObjects([ + 'common', + 'header', + 'infraHome', + 'timePicker', + 'assetDetails', + 'infraSavedViews', + ]); const kibanaServer = getService('kibanaServer'); const testSubjects = getService('testSubjects'); @@ -119,6 +127,92 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.infraHome.getWaffleMap(); // await pageObjects.infraHome.getWaffleMapTooltips(); see https://github.com/elastic/kibana/issues/137903 }); + + describe('Asset Details flyout', () => { + before(async () => { + await pageObjects.infraHome.goToTime(DATE_WITH_DATA); + await pageObjects.infraHome.getWaffleMap(); + await pageObjects.infraHome.inputAddHostNameFilter('demo-stack-nginx-01'); + await pageObjects.infraHome.clickOnNode(); + }); + + describe('Overview Tab', () => { + before(async () => { + await pageObjects.assetDetails.clickOverviewTab(); + }); + + [ + { metric: 'cpuUsage', value: '0.8%' }, + { metric: 'normalizedLoad1m', value: '1.4%' }, + { metric: 'memoryUsage', value: '18.0%' }, + { metric: 'diskSpaceUsage', value: '17.5%' }, + ].forEach(({ metric, value }) => { + it(`${metric} tile should show ${value}`, async () => { + await retry.tryForTime(3 * 1000, async () => { + const tileValue = await pageObjects.assetDetails.getAssetDetailsKPITileValue( + metric + ); + expect(tileValue).to.eql(value); + }); + }); + }); + + it('should render 9 charts in the Metrics section', async () => { + const hosts = await pageObjects.assetDetails.getAssetDetailsMetricsCharts(); + expect(hosts.length).to.equal(9); + }); + + it('should show alerts', async () => { + await pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.assetDetails.overviewAlertsTitleExists(); + }); + }); + + describe('Metadata Tab', () => { + before(async () => { + await pageObjects.assetDetails.clickMetadataTab(); + }); + + it('should show metadata table', async () => { + await pageObjects.assetDetails.metadataTableExists(); + }); + }); + + describe('Logs Tab', () => { + before(async () => { + await pageObjects.assetDetails.clickLogsTab(); + }); + + after(async () => { + await retry.try(async () => { + await pageObjects.infraHome.closeFlyout(); + }); + }); + + it('should render logs tab', async () => { + await pageObjects.assetDetails.logsExists(); + }); + }); + + describe('APM Link Tab', () => { + before(async () => { + await pageObjects.infraHome.clickOnNode(); + await pageObjects.assetDetails.clickApmTabLink(); + }); + + it('should navigate to APM traces', async () => { + const url = parse(await browser.getCurrentUrl()); + const query = decodeURIComponent(url.query ?? ''); + const kuery = 'kuery=host.hostname:"demo-stack-nginx-01"'; + + expect(url.pathname).to.eql('/app/apm/traces'); + expect(query).to.contain(kuery); + + await returnTo(INVENTORY_PATH); + }); + }); + }); + it('shows query suggestions', async () => { await pageObjects.infraHome.goToTime(DATE_WITH_DATA); await pageObjects.infraHome.clickQueryBar(); diff --git a/x-pack/test/functional/page_objects/asset_details.ts b/x-pack/test/functional/page_objects/asset_details.ts index f7f666208275c..637199b8e623b 100644 --- a/x-pack/test/functional/page_objects/asset_details.ts +++ b/x-pack/test/functional/page_objects/asset_details.ts @@ -180,5 +180,10 @@ export function AssetDetailsProvider({ getService }: FtrProviderContext) { async clickOsqueryTab() { return testSubjects.click('infraAssetDetailsOsqueryTab'); }, + + // APM Tab link + async clickApmTabLink() { + return testSubjects.click('infraAssetDetailsApmServicesLinkTab'); + }, }; } diff --git a/x-pack/test/functional/page_objects/infra_home_page.ts b/x-pack/test/functional/page_objects/infra_home_page.ts index 2f3d0209d857f..31fb805b69d22 100644 --- a/x-pack/test/functional/page_objects/infra_home_page.ts +++ b/x-pack/test/functional/page_objects/infra_home_page.ts @@ -105,7 +105,7 @@ export function InfraHomePageProvider({ getService, getPageObjects }: FtrProvide async clickOnNodeDetailsFlyoutOpenAsPage() { await retry.try(async () => { - await testSubjects.click('infraNodeContextPopoverOpenAsPageButton'); + await testSubjects.click('infraAssetDetailsOpenAsPageButton'); }); }, @@ -434,6 +434,14 @@ export function InfraHomePageProvider({ getService, getPageObjects }: FtrProvide await queryBar.type('h'); }, + async inputAddHostNameFilter(hostName: string) { + await this.enterSearchTerm(`host.name:"${hostName}"`); + }, + + async clickOnNode() { + return testSubjects.click('nodeContainer'); + }, + async ensureSuggestionsPanelVisible() { await testSubjects.find('infraSuggestionsPanel'); }, From bfd1a1307663c5d1a0f5cd3ddf34f9399869c360 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 28 Sep 2023 13:11:49 -0400 Subject: [PATCH 38/61] skip failing test suite (#156941) --- x-pack/test/fleet_api_integration/apis/epm/install_endpoint.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/fleet_api_integration/apis/epm/install_endpoint.ts b/x-pack/test/fleet_api_integration/apis/epm/install_endpoint.ts index 2ba688dfb8bf5..892f89f7c2bb6 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/install_endpoint.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/install_endpoint.ts @@ -15,7 +15,8 @@ export default function (providerContext: FtrProviderContext) { * There are a few features that are only currently supported for the Endpoint * package due to security concerns. */ - describe('Install endpoint package', () => { + // Failing: See https://github.com/elastic/kibana/issues/156941 + describe.skip('Install endpoint package', () => { const { getService } = providerContext; skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); From 1a8c2f3958859ad4f2a7d6e5ff257f568f06bd13 Mon Sep 17 00:00:00 2001 From: Jordan <51442161+JordanSh@users.noreply.github.com> Date: Thu, 28 Sep 2023 20:24:03 +0300 Subject: [PATCH 39/61] [Cloud Security] Fixed vuln dashboard counters (#167511) --- .../public/components/csp_counter_card.tsx | 18 +++-- .../public/components/vuln_counter_card.tsx | 76 +++++++++++++++++++ .../vulnerability_statistics.tsx | 6 +- 3 files changed, 91 insertions(+), 9 deletions(-) create mode 100644 x-pack/plugins/cloud_security_posture/public/components/vuln_counter_card.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/csp_counter_card.tsx b/x-pack/plugins/cloud_security_posture/public/components/csp_counter_card.tsx index 9b07c0f3edded..e41ead46f52af 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/csp_counter_card.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/csp_counter_card.tsx @@ -17,11 +17,17 @@ export interface CspCounterCardProps { description: EuiStatProps['description']; } -export const CspCounterCard = (counter: CspCounterCardProps) => { +export const CspCounterCard = ({ + id, + button, + title, + titleColor, + description, +}: CspCounterCardProps) => { const { euiTheme } = useEuiTheme(); return ( - + { }, }} titleSize="s" - title={counter.title} - titleColor={counter.titleColor} + title={title} + titleColor={titleColor} descriptionElement="h6" - description={counter.description} + description={description} /> - {counter.button} + {button} ); }; diff --git a/x-pack/plugins/cloud_security_posture/public/components/vuln_counter_card.tsx b/x-pack/plugins/cloud_security_posture/public/components/vuln_counter_card.tsx new file mode 100644 index 0000000000000..5344ccd597d5f --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/components/vuln_counter_card.tsx @@ -0,0 +1,76 @@ +/* + * 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, { MouseEventHandler } from 'react'; +import { EuiPanel, EuiStat, useEuiTheme, EuiIcon } from '@elastic/eui'; +import type { EuiStatProps } from '@elastic/eui'; +import { css } from '@emotion/react'; + +export interface VulnCounterCardProps { + id: string; + title: EuiStatProps['title']; + titleColor?: EuiStatProps['titleColor']; + description: EuiStatProps['description']; + onClick?: MouseEventHandler; +} + +export const VulnCounterCard = ({ + id, + title, + titleColor, + description, + onClick, +}: VulnCounterCardProps) => { + const { euiTheme } = useEuiTheme(); + + return ( + + + {onClick && ( + + )} + + ); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_statistics.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_statistics.tsx index 28abc994539d0..1552ed2821bb8 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_statistics.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_statistics.tsx @@ -7,18 +7,18 @@ import React, { useMemo } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiHealth } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { VulnCounterCard, type VulnCounterCardProps } from '../../components/vuln_counter_card'; import { VULNERABILITIES_SEVERITY } from '../../../common/constants'; import { useVulnerabilityDashboardApi } from '../../common/api/use_vulnerability_dashboard_api'; import { useNavigateVulnerabilities } from '../../common/hooks/use_navigate_findings'; import { CompactFormattedNumber } from '../../components/compact_formatted_number'; import { getSeverityStatusColor } from '../../common/utils/get_vulnerability_colors'; -import { CspCounterCard } from '../../components/csp_counter_card'; export const VulnerabilityStatistics = () => { const navToVulnerabilities = useNavigateVulnerabilities(); const getVulnerabilityDashboard = useVulnerabilityDashboardApi(); - const stats = useMemo( + const stats: VulnCounterCardProps[] = useMemo( () => [ { id: 'critical-count-stat', @@ -110,7 +110,7 @@ export const VulnerabilityStatistics = () => { {stats.map((stat) => ( - + ))} From 76b832e12ecca5d24545d17a979c47c9ae8ce67f Mon Sep 17 00:00:00 2001 From: Clint Andrew Hall Date: Thu, 28 Sep 2023 13:24:15 -0400 Subject: [PATCH 40/61] [feature] Implement Setting Categories in Advanced Settings in serverless (#167447) ## Summary This PR follows #166460 by adding Category panels to the Form. Screenshot 2023-09-27 at 3 36 16 PM ## Notes This PR is divided into several commits, the first few being prerequisite codemods. I recommend reviewing each commit separately, as the codemods might obscure the actual component work. - [e78586f - Make SettingType pre-defined to clean up references](https://github.com/elastic/kibana/commit/e78586fe44e41e2c6f369a4061d2105b7333b144) - This makes the `SettingType` optional, to clean up areas where the generic need not be specific. - [80a9988 - [codemod] Make onFieldChange and onInputChange more distinct](https://github.com/elastic/kibana/commit/80a998851655141556b791a6b3e0a38e0775d25d) - The `onChange` handlers weren't very clear as you work your way up the component tree. This makes the implementation and usage easier to understand, (and easier to [replace with state management](https://github.com/elastic/kibana/issues/166579)). - [5d0beff - [fix] Fix logged errors in form tests](https://github.com/elastic/kibana/commit/5d0beff00c1859c6a5ac47839c168222956b710b) - This fixes some logged errors in the Form from `Monaco` and from some missing `act` and `waitFor` calls. --- .github/CODEOWNERS | 1 + package.json | 1 + packages/kbn-management/settings/README.mdx | 2 +- .../components/field_category/README.mdx | 12 + .../__stories__/categories.stories.tsx | 56 +++++ .../__stories__/category.stories.tsx | 83 +++++++ .../__stories__/use_category_story.tsx | 63 +++++ .../components/field_category/categories.tsx | 54 +++++ .../components/field_category/category.tsx | 67 ++++++ .../field_category/clear_query_link.tsx | 59 +++++ .../components/field_category/index.ts | 17 ++ .../components/field_category/jest.config.js | 13 ++ .../components/field_category/kibana.jsonc | 5 + .../components/field_category/package.json | 6 + .../components/field_category/services.tsx | 33 +++ .../components/field_category/tsconfig.json | 25 ++ .../components/field_category/types.ts | 23 ++ .../field_input/__stories__/common.tsx | 8 +- .../field_input/field_input.test.tsx | 6 +- .../components/field_input/field_input.tsx | 216 +++++++++--------- .../field_input/input/array_input.test.tsx | 12 +- .../field_input/input/array_input.tsx | 4 +- .../field_input/input/boolean_input.test.tsx | 12 +- .../field_input/input/boolean_input.tsx | 6 +- .../field_input/input/code_editor_input.tsx | 4 +- .../input/color_picker_input.test.tsx | 17 +- .../field_input/input/color_picker_input.tsx | 4 +- .../field_input/input/image_input.test.tsx | 10 +- .../field_input/input/image_input.tsx | 4 +- .../input/json_editor_input.test.tsx | 30 +-- .../input/markdown_editor_input.test.tsx | 10 +- .../field_input/input/number_input.test.tsx | 13 +- .../field_input/input/number_input.tsx | 4 +- .../field_input/input/select_input.test.tsx | 13 +- .../field_input/input/select_input.tsx | 4 +- .../field_input/input/text_input.test.tsx | 10 +- .../field_input/input/text_input.tsx | 4 +- .../settings/components/field_input/types.ts | 6 +- .../settings/components/field_row/README.mdx | 2 +- .../field_row/__stories__/common.tsx | 18 +- .../components/field_row/field_row.test.tsx | 38 +-- .../components/field_row/field_row.tsx | 32 +-- .../field_row/footer/reset_link.test.tsx | 4 +- .../field_row/footer/reset_link.tsx | 2 +- .../settings/components/field_row/index.ts | 3 +- .../settings/components/field_row/types.ts | 11 - .../settings/components/form/form.test.tsx | 48 ++-- .../settings/components/form/form.tsx | 28 +-- .../settings/components/form/mocks/index.ts | 1 - .../settings/components/form/services.tsx | 18 +- .../form/storybook/form.stories.tsx | 18 +- .../settings/components/form/tsconfig.json | 2 + .../settings/components/form/types.ts | 4 +- .../settings/components/form/use_save.ts | 6 +- .../field_definition/get_definitions.ts | 6 +- .../field_definition/is/field_definition.ts | 3 +- .../field_definition/is/unsaved_change.ts | 3 +- .../kbn-management/settings/types/category.ts | 16 ++ .../settings/types/field_definition.ts | 5 +- .../kbn-management/settings/types/index.ts | 17 +- .../kbn-management/settings/types/metadata.ts | 6 +- .../settings/types/setting_type.ts | 2 +- .../settings/types/unsaved_change.ts | 4 +- .../utilities/category/categorize_fields.ts | 22 ++ .../utilities/category/get_category_name.ts | 54 +++++ .../settings/utilities/category/index.ts | 10 + .../settings/utilities/field/use_update.ts | 20 +- .../settings/utilities/index.ts | 3 + .../mocks/settings.mock.ts} | 24 +- .../utilities/setting/is_default_value.ts | 4 +- .../utilities/setting/normalize_settings.ts | 6 +- .../settings/utilities/tsconfig.json | 1 + .../storybook/config/preview.ts | 16 ++ tsconfig.base.json | 2 + yarn.lock | 4 + 75 files changed, 1037 insertions(+), 343 deletions(-) create mode 100644 packages/kbn-management/settings/components/field_category/README.mdx create mode 100644 packages/kbn-management/settings/components/field_category/__stories__/categories.stories.tsx create mode 100644 packages/kbn-management/settings/components/field_category/__stories__/category.stories.tsx create mode 100644 packages/kbn-management/settings/components/field_category/__stories__/use_category_story.tsx create mode 100644 packages/kbn-management/settings/components/field_category/categories.tsx create mode 100644 packages/kbn-management/settings/components/field_category/category.tsx create mode 100644 packages/kbn-management/settings/components/field_category/clear_query_link.tsx create mode 100644 packages/kbn-management/settings/components/field_category/index.ts create mode 100644 packages/kbn-management/settings/components/field_category/jest.config.js create mode 100644 packages/kbn-management/settings/components/field_category/kibana.jsonc create mode 100644 packages/kbn-management/settings/components/field_category/package.json create mode 100644 packages/kbn-management/settings/components/field_category/services.tsx create mode 100644 packages/kbn-management/settings/components/field_category/tsconfig.json create mode 100644 packages/kbn-management/settings/components/field_category/types.ts create mode 100644 packages/kbn-management/settings/types/category.ts create mode 100644 packages/kbn-management/settings/utilities/category/categorize_fields.ts create mode 100644 packages/kbn-management/settings/utilities/category/get_category_name.ts create mode 100644 packages/kbn-management/settings/utilities/category/index.ts rename packages/kbn-management/settings/{components/form/mocks/settings.ts => utilities/mocks/settings.mock.ts} (79%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 89f769c0f12ec..8f9261eb8aede 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -484,6 +484,7 @@ packages/kbn-managed-vscode-config @elastic/kibana-operations packages/kbn-managed-vscode-config-cli @elastic/kibana-operations packages/kbn-management/cards_navigation @elastic/platform-deployment-management src/plugins/management @elastic/platform-deployment-management +packages/kbn-management/settings/components/field_category @elastic/platform-deployment-management packages/kbn-management/settings/components/field_input @elastic/platform-deployment-management packages/kbn-management/settings/components/field_row @elastic/platform-deployment-management packages/kbn-management/settings/components/form @elastic/platform-deployment-management diff --git a/package.json b/package.json index 4792c66f475ab..f2d5295783e26 100644 --- a/package.json +++ b/package.json @@ -506,6 +506,7 @@ "@kbn/logstash-plugin": "link:x-pack/plugins/logstash", "@kbn/management-cards-navigation": "link:packages/kbn-management/cards_navigation", "@kbn/management-plugin": "link:src/plugins/management", + "@kbn/management-settings-components-field-category": "link:packages/kbn-management/settings/components/field_category", "@kbn/management-settings-components-field-input": "link:packages/kbn-management/settings/components/field_input", "@kbn/management-settings-components-field-row": "link:packages/kbn-management/settings/components/field_row", "@kbn/management-settings-components-form": "link:packages/kbn-management/settings/components/form", diff --git a/packages/kbn-management/settings/README.mdx b/packages/kbn-management/settings/README.mdx index fa541b6719091..5e867dd59d490 100644 --- a/packages/kbn-management/settings/README.mdx +++ b/packages/kbn-management/settings/README.mdx @@ -4,7 +4,7 @@ These packages comprise the Management Advanced Settings application. The sourc ## Notes -**Be aware**: the functional flow logic we've adopted for these components is not one I would encourage, specifically, using "drilled" onChange handlers and utilizing a composing-component-based store. Ideally, we'd use a Redux store, or, at the very least, a React reducer. +**Be aware**: the functional flow logic we've adopted for these components is not one I would encourage, specifically, using "drilled" onFieldChange handlers and utilizing a composing-component-based store. Ideally, we'd use a Redux store, or, at the very least, a React reducer. In the interest of time and compatibility, we've opted to use the pattern from the original components in `advancedSettings`. We plan to revisit the state management and prop-drilling when `advancedSettings` is refactored with these components. diff --git a/packages/kbn-management/settings/components/field_category/README.mdx b/packages/kbn-management/settings/components/field_category/README.mdx new file mode 100644 index 0000000000000..64f57e84b1b99 --- /dev/null +++ b/packages/kbn-management/settings/components/field_category/README.mdx @@ -0,0 +1,12 @@ +--- +id: management/settings/components/fieldCategory +slug: /management/settings/components/field-category +title: Management Settings Field Category Component +description: A package containing components for rendering field rows in collections organized by their category. +tags: ['management', 'settings'] +date: 2023-10-25 +--- + +## Description + +This package contains a component for rendering field rows of `UiSetting` objects in collections organized by their category. It's used primarily by the `Form` component. \ No newline at end of file diff --git a/packages/kbn-management/settings/components/field_category/__stories__/categories.stories.tsx b/packages/kbn-management/settings/components/field_category/__stories__/categories.stories.tsx new file mode 100644 index 0000000000000..6ea4d96fd2b4b --- /dev/null +++ b/packages/kbn-management/settings/components/field_category/__stories__/categories.stories.tsx @@ -0,0 +1,56 @@ +/* + * 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 React from 'react'; +import type { ComponentMeta, Story } from '@storybook/react'; +import { action } from '@storybook/addon-actions'; +import { FieldCategories as Component } from '../categories'; +import { Params, useCategoryStory } from './use_category_story'; +import { FieldCategoryProvider } from '../services'; + +export default { + title: 'Settings/Field Category/Categories', + description: '', + args: { + isFiltered: false, + isSavingEnabled: true, + }, + argTypes: { + isFiltered: { + control: { + type: 'boolean', + }, + }, + isSavingEnabled: { + control: { + type: 'boolean', + }, + }, + }, + parameters: { + backgrounds: { + default: 'ghost', + }, + }, +} as ComponentMeta; + +export const Categories: Story = (params) => { + const { onClearQuery, isSavingEnabled, onFieldChange, unsavedChanges, categorizedFields } = + useCategoryStory(params); + + return ( + + + + ); +}; diff --git a/packages/kbn-management/settings/components/field_category/__stories__/category.stories.tsx b/packages/kbn-management/settings/components/field_category/__stories__/category.stories.tsx new file mode 100644 index 0000000000000..180f3d0b4ce49 --- /dev/null +++ b/packages/kbn-management/settings/components/field_category/__stories__/category.stories.tsx @@ -0,0 +1,83 @@ +/* + * 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 React from 'react'; +import type { ComponentMeta } from '@storybook/react'; +import { action } from '@storybook/addon-actions'; + +import { getSettingsMock } from '@kbn/management-settings-utilities/mocks/settings.mock'; +import { getFieldDefinitions } from '@kbn/management-settings-field-definition'; +import { categorizeFields } from '@kbn/management-settings-utilities'; +import { FieldRow } from '@kbn/management-settings-components-field-row'; + +import { FieldCategory as Component, type FieldCategoryProps as ComponentProps } from '../category'; +import { Params, useCategoryStory } from './use_category_story'; +import { FieldCategoryProvider } from '../services'; + +const settings = getSettingsMock(); + +// Markdown and JSON fields require Monaco, which are *notoriously* slow in Storybook due +// to the lack of a webworker. Until we can resolve it, filter out those fields. +const definitions = getFieldDefinitions(settings, { + isCustom: () => { + return false; + }, + isOverridden: () => { + return false; + }, +}).filter((field) => field.type !== 'json' && field.type !== 'markdown'); + +const categories = Object.keys(categorizeFields(definitions)); + +export default { + title: 'Settings/Field Category/Category', + description: '', + args: { + category: categories[0], + isFiltered: false, + isSavingEnabled: true, + }, + argTypes: { + category: { + control: { + type: 'select', + options: categories, + }, + }, + }, +} as ComponentMeta; + +type FieldCategoryParams = Pick & Params; + +export const Category = ({ isFiltered, category, isSavingEnabled }: FieldCategoryParams) => { + const { onClearQuery, onFieldChange, unsavedChanges } = useCategoryStory({ + isFiltered, + isSavingEnabled, + }); + + const { count, fields } = categorizeFields(definitions)[category]; + const rows = isFiltered ? [fields[0]] : fields; + + return ( + + + {rows.map((field) => ( + + ))} + + + ); +}; diff --git a/packages/kbn-management/settings/components/field_category/__stories__/use_category_story.tsx b/packages/kbn-management/settings/components/field_category/__stories__/use_category_story.tsx new file mode 100644 index 0000000000000..73962fe9ed16c --- /dev/null +++ b/packages/kbn-management/settings/components/field_category/__stories__/use_category_story.tsx @@ -0,0 +1,63 @@ +/* + * 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 React from 'react'; +import { useArgs } from '@storybook/client-api'; +import { action } from '@storybook/addon-actions'; + +import { getSettingsMock } from '@kbn/management-settings-utilities/mocks/settings.mock'; +import { getFieldDefinitions } from '@kbn/management-settings-field-definition'; +import { categorizeFields } from '@kbn/management-settings-utilities'; +import { UnsavedFieldChanges, OnFieldChangeFn } from '@kbn/management-settings-types'; + +export interface Params { + isFiltered: boolean; + isSavingEnabled: boolean; +} + +export const useCategoryStory = ({ isFiltered, isSavingEnabled }: Params) => { + const [_args, updateArgs] = useArgs(); + const settings = getSettingsMock(); + + // Markdown and JSON fields require Monaco, which are *notoriously* slow in Storybook due + // to the lack of a webworker. Until we can resolve it, filter out those fields. + const definitions = getFieldDefinitions(settings, { + isCustom: () => { + return false; + }, + isOverridden: () => { + return false; + }, + }).filter((field) => field.type !== 'json' && field.type !== 'markdown'); + + const categorizedFields = categorizeFields(definitions); + + if (isFiltered) { + Object.keys(categorizedFields).forEach((category) => { + categorizedFields[category].fields = categorizedFields[category].fields.slice(0, 1); + }); + } + + const onClearQuery = () => updateArgs({ isFiltered: false }); + + const [unsavedChanges, setUnsavedChanges] = React.useState({}); + + const onFieldChange: OnFieldChangeFn = (id, change) => { + action('onFieldChange')(id, change); + + if (!change) { + const { [id]: unsavedChange, ...rest } = unsavedChanges; + setUnsavedChanges(rest); + return; + } + + setUnsavedChanges((changes) => ({ ...changes, [id]: change })); + }; + + return { onClearQuery, onFieldChange, isSavingEnabled, unsavedChanges, categorizedFields }; +}; diff --git a/packages/kbn-management/settings/components/field_category/categories.tsx b/packages/kbn-management/settings/components/field_category/categories.tsx new file mode 100644 index 0000000000000..c732c29c4e4a2 --- /dev/null +++ b/packages/kbn-management/settings/components/field_category/categories.tsx @@ -0,0 +1,54 @@ +/* + * 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 React from 'react'; + +import { CategorizedFields, UnsavedFieldChanges } from '@kbn/management-settings-types'; + +import { FieldRow, FieldRowProps } from '@kbn/management-settings-components-field-row'; +import { FieldCategory, type FieldCategoryProps } from './category'; + +/** + * Props for the {@link FieldCategories} component. + */ +export interface FieldCategoriesProps + extends Pick, + Pick { + /** Categorized fields for display. */ + categorizedFields: CategorizedFields; + /** And unsaved changes currently managed by the parent component. */ + unsavedChanges?: UnsavedFieldChanges; +} + +/** + * Convenience component for displaying a set of {@link FieldCategory} components, given + * a set of categorized fields. + * + * @param {FieldCategoriesProps} props props to pass to the {@link FieldCategories} component. + */ +export const FieldCategories = ({ + categorizedFields, + unsavedChanges = {}, + onClearQuery, + isSavingEnabled, + onFieldChange, +}: FieldCategoriesProps) => ( + <> + {Object.entries(categorizedFields).map(([category, { count, fields }]) => ( + + {fields.map((field) => ( + + ))} + + ))} + +); diff --git a/packages/kbn-management/settings/components/field_category/category.tsx b/packages/kbn-management/settings/components/field_category/category.tsx new file mode 100644 index 0000000000000..47465c2ab0288 --- /dev/null +++ b/packages/kbn-management/settings/components/field_category/category.tsx @@ -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 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 React, { ReactElement, Children } from 'react'; + +import { EuiFlexGroup, EuiFlexItem, EuiSplitPanel, EuiTitle, useEuiTheme } from '@elastic/eui'; + +import { getCategoryName } from '@kbn/management-settings-utilities'; +import type { FieldRowProps } from '@kbn/management-settings-components-field-row'; +import { css } from '@emotion/react'; +import { ClearQueryLink, ClearQueryLinkProps } from './clear_query_link'; + +/** + * Props for a {@link FieldCategory} component. + */ +export interface FieldCategoryProps + extends Pick { + /** The name of the category. */ + category: string; + /** Children-- should be {@link FieldRow} components. */ + children: + | ReactElement + | Array>; +} + +/** + * Component for displaying a container of fields pertaining to a single + * category. + * @param props - the props to pass to the {@link FieldCategory} component. + */ +export const FieldCategory = (props: FieldCategoryProps) => { + const { category, fieldCount, onClearQuery, children } = props; + const { + euiTheme: { size }, + } = useEuiTheme(); + + const displayCount = Children.count(children); + + const panelCSS = css` + & + & { + margin-top: ${size.l}; + } + `; + + return ( + + + + + +

{getCategoryName(category)}

+
+
+ + + +
+
+ {children} +
+ ); +}; diff --git a/packages/kbn-management/settings/components/field_category/clear_query_link.tsx b/packages/kbn-management/settings/components/field_category/clear_query_link.tsx new file mode 100644 index 0000000000000..c54b2c9ad52dc --- /dev/null +++ b/packages/kbn-management/settings/components/field_category/clear_query_link.tsx @@ -0,0 +1,59 @@ +/* + * 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 React from 'react'; +import { css } from '@emotion/react'; + +import { EuiLink, EuiText } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; + +/** + * Props for the {@link ClearQueryLink} component. + */ +export interface ClearQueryLinkProps { + /** The total number of fields in the category. */ + fieldCount: number; + /** The number of fields currently being displayed. */ + displayCount: number; + /** Handler to invoke when clearing the current filtering query. */ + onClearQuery: () => void; +} + +/** + * Component for displaying a link to clear the current filtering query. + */ +export const ClearQueryLink = ({ fieldCount, displayCount, onClearQuery }: ClearQueryLinkProps) => { + if (fieldCount === displayCount) { + return null; + } + + const linkCSS = css` + font-style: italic; + `; + + return ( + + + + + + + ), + }} + /> + + ); +}; diff --git a/packages/kbn-management/settings/components/field_category/index.ts b/packages/kbn-management/settings/components/field_category/index.ts new file mode 100644 index 0000000000000..38e0e914bfa89 --- /dev/null +++ b/packages/kbn-management/settings/components/field_category/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 { FieldCategories, type FieldCategoriesProps } from './categories'; +export { FieldCategory, type FieldCategoryProps } from './category'; +export type { ClearQueryLinkProps } from './clear_query_link'; +export type { FieldCategoryKibanaDependencies, FieldCategoryServices } from './types'; +export { + FieldCategoryKibanaProvider, + FieldCategoryProvider, + type FieldCategoryProviderProps, +} from './services'; diff --git a/packages/kbn-management/settings/components/field_category/jest.config.js b/packages/kbn-management/settings/components/field_category/jest.config.js new file mode 100644 index 0000000000000..6569a209f7277 --- /dev/null +++ b/packages/kbn-management/settings/components/field_category/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', + rootDir: '../../../../..', + roots: ['/packages/kbn-management/settings/components/field_category'], +}; diff --git a/packages/kbn-management/settings/components/field_category/kibana.jsonc b/packages/kbn-management/settings/components/field_category/kibana.jsonc new file mode 100644 index 0000000000000..ac8859b05df4b --- /dev/null +++ b/packages/kbn-management/settings/components/field_category/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-common", + "id": "@kbn/management-settings-components-field-category", + "owner": "@elastic/platform-deployment-management" +} diff --git a/packages/kbn-management/settings/components/field_category/package.json b/packages/kbn-management/settings/components/field_category/package.json new file mode 100644 index 0000000000000..d8b9345da3086 --- /dev/null +++ b/packages/kbn-management/settings/components/field_category/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/management-settings-components-field-category", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-management/settings/components/field_category/services.tsx b/packages/kbn-management/settings/components/field_category/services.tsx new file mode 100644 index 0000000000000..2ff805196ec02 --- /dev/null +++ b/packages/kbn-management/settings/components/field_category/services.tsx @@ -0,0 +1,33 @@ +/* + * 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 React from 'react'; + +import { + FieldRowProvider, + FieldRowKibanaProvider, +} from '@kbn/management-settings-components-field-row'; + +import type { FieldCategoryServices } from './types'; + +/** + * Props for {@link FieldCategoryProvider}. + */ +export interface FieldCategoryProviderProps extends FieldCategoryServices { + children: React.ReactNode; +} + +/** + * React Provider that provides services to a {@link FieldCategory} component and its dependents. + */ +export const FieldCategoryProvider = FieldRowProvider; + +/** + * Kibana-specific Provider that maps Kibana plugins and services to a {@link FieldCategoryProvider}. + */ +export const FieldCategoryKibanaProvider = FieldRowKibanaProvider; diff --git a/packages/kbn-management/settings/components/field_category/tsconfig.json b/packages/kbn-management/settings/components/field_category/tsconfig.json new file mode 100644 index 0000000000000..8b4e9b1566b31 --- /dev/null +++ b/packages/kbn-management/settings/components/field_category/tsconfig.json @@ -0,0 +1,25 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/management-settings-utilities", + "@kbn/management-settings-field-definition", + "@kbn/management-settings-components-field-row", + "@kbn/management-settings-types", + "@kbn/i18n-react", + ] +} diff --git a/packages/kbn-management/settings/components/field_category/types.ts b/packages/kbn-management/settings/components/field_category/types.ts new file mode 100644 index 0000000000000..3f726f18300b9 --- /dev/null +++ b/packages/kbn-management/settings/components/field_category/types.ts @@ -0,0 +1,23 @@ +/* + * 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 { + FieldRowServices, + FieldRowKibanaDependencies, +} from '@kbn/management-settings-components-field-row'; + +/** + * Contextual services used by a {@link FieldCategory} component and its dependents. + */ +export type FieldCategoryServices = FieldRowServices; + +/** + * An interface containing a collection of Kibana plugins and services required to + * render a {@link FieldCategory} component and its dependents. + */ +export type FieldCategoryKibanaDependencies = FieldRowKibanaDependencies; diff --git a/packages/kbn-management/settings/components/field_input/__stories__/common.tsx b/packages/kbn-management/settings/components/field_input/__stories__/common.tsx index 399a125822a35..39daed80f40b8 100644 --- a/packages/kbn-management/settings/components/field_input/__stories__/common.tsx +++ b/packages/kbn-management/settings/components/field_input/__stories__/common.tsx @@ -13,7 +13,7 @@ import { action } from '@storybook/addon-actions'; import { EuiPanel } from '@elastic/eui'; import { UiSettingsType } from '@kbn/core-ui-settings-common'; import { - OnChangeFn, + OnInputChangeFn, SettingType, UiSettingMetadata, UnsavedFieldChange, @@ -108,17 +108,17 @@ export const getInputStory = (type: SettingType, params: Params = {}) => { setting, }); - const onChange: OnChangeFn = (newChange) => { + const onInputChange: OnInputChangeFn = (newChange) => { setUnsavedChange(newChange); - action('onChange')({ + action('onInputChange')({ type, unsavedValue: newChange?.unsavedValue, savedValue: field.savedValue, }); }; - return ; + return ; }; Story.argTypes = { diff --git a/packages/kbn-management/settings/components/field_input/field_input.test.tsx b/packages/kbn-management/settings/components/field_input/field_input.test.tsx index 0305636fd35e6..a946f259cab96 100644 --- a/packages/kbn-management/settings/components/field_input/field_input.test.tsx +++ b/packages/kbn-management/settings/components/field_input/field_input.test.tsx @@ -55,7 +55,7 @@ describe('FieldInput', () => { }, options, } as FieldDefinition, - onChange: jest.fn(), + onInputChange: jest.fn(), isSavingEnabled: true, }; @@ -132,7 +132,7 @@ describe('FieldInput', () => { const { getByTestId } = render(wrap()); const input = getByTestId(`${TEST_SUBJ_PREFIX_FIELD}-${name}`); fireEvent.change(input, { target: { value: 'new value' } }); - expect(props.onChange).toHaveBeenCalledWith({ type: 'string', unsavedValue: 'new value' }); + expect(props.onInputChange).toHaveBeenCalledWith({ type: 'string', unsavedValue: 'new value' }); }); it('disables the input when isDisabled prop is true', () => { @@ -191,7 +191,7 @@ describe('FieldInput', () => { ...defaultProps.field, type: 'foobar', }, - } as unknown as FieldInputProps; + } as unknown as FieldInputProps; expect(() => render(wrap())).toThrowError( 'Unknown or incompatible field type: foobar' diff --git a/packages/kbn-management/settings/components/field_input/field_input.tsx b/packages/kbn-management/settings/components/field_input/field_input.tsx index ae9e3c5c6c536..a5b3fdb4aac55 100644 --- a/packages/kbn-management/settings/components/field_input/field_input.tsx +++ b/packages/kbn-management/settings/components/field_input/field_input.tsx @@ -10,7 +10,7 @@ import React, { useImperativeHandle, useRef } from 'react'; import type { FieldDefinition, - OnChangeFn, + OnInputChangeFn, ResetInputRef, SettingType, UnsavedFieldChange, @@ -56,13 +56,13 @@ import { /** * The props that are passed to the {@link FieldInput} component. */ -export interface FieldInputProps { +export interface FieldInputProps { /** The {@link FieldDefinition} for the component. */ field: Pick, 'type' | 'id' | 'name' | 'ariaAttributes'>; /** An {@link UnsavedFieldChange} for the component, if any. */ unsavedChange?: UnsavedFieldChange; - /** The `onChange` handler for the input. */ - onChange: OnChangeFn; + /** The `onInputChange` handler for the input. */ + onInputChange: OnInputChangeFn; /** True if the input can be saved, false otherwise. */ isSavingEnabled: boolean; /** True if the value within the input is invalid, false otherwise. */ @@ -81,140 +81,136 @@ const getMismatchError = (type: SettingType, unsavedType?: SettingType) => * * @param props The props for the {@link FieldInput} component. */ -export const FieldInput = React.forwardRef>( - (props, ref) => { - const { field, unsavedChange, onChange, isSavingEnabled } = props; - - // Create a ref for those input fields that require an imperative handle. - const inputRef = useRef(null); - - // Create an imperative handle that passes the invocation to any internal input that - // may require it. - useImperativeHandle(ref, () => ({ - reset: () => { - if (inputRef.current) { - inputRef.current.reset(); - } - }, - })); - - const inputProps = { isSavingEnabled, onChange }; - - // These checks might seem excessive or redundant, but they are necessary to ensure that - // the types are honored correctly using type guards. These checks get compiled down to - // checks against the `type` property-- which we were doing in the previous code, albeit - // in an unenforceable way. - // - // Based on the success of a check, we can render the `FieldInput` in a indempotent and - // type-safe way. - // - if (isArrayFieldDefinition(field)) { - // If the composing component mistakenly provides an incompatible `UnsavedFieldChange`, - // we can throw an `Error`. We might consider switching to a `console.error` and not - // rendering the input, but that might be less helpful. - if (!isArrayFieldUnsavedChange(unsavedChange)) { - throw getMismatchError(field.type, unsavedChange?.type); +export const FieldInput = React.forwardRef((props, ref) => { + const { field, unsavedChange, onInputChange, isSavingEnabled } = props; + + // Create a ref for those input fields that require an imperative handle. + const inputRef = useRef(null); + + // Create an imperative handle that passes the invocation to any internal input that + // may require it. + useImperativeHandle(ref, () => ({ + reset: () => { + if (inputRef.current) { + inputRef.current.reset(); } - - return ; + }, + })); + + const inputProps = { isSavingEnabled, onInputChange }; + + // These checks might seem excessive or redundant, but they are necessary to ensure that + // the types are honored correctly using type guards. These checks get compiled down to + // checks against the `type` property-- which we were doing in the previous code, albeit + // in an unenforceable way. + // + // Based on the success of a check, we can render the `FieldInput` in a indempotent and + // type-safe way. + // + if (isArrayFieldDefinition(field)) { + // If the composing component mistakenly provides an incompatible `UnsavedFieldChange`, + // we can throw an `Error`. We might consider switching to a `console.error` and not + // rendering the input, but that might be less helpful. + if (!isArrayFieldUnsavedChange(unsavedChange)) { + throw getMismatchError(field.type, unsavedChange?.type); } - if (isBooleanFieldDefinition(field)) { - if (!isBooleanFieldUnsavedChange(unsavedChange)) { - throw getMismatchError(field.type, unsavedChange?.type); - } + return ; + } - return ; + if (isBooleanFieldDefinition(field)) { + if (!isBooleanFieldUnsavedChange(unsavedChange)) { + throw getMismatchError(field.type, unsavedChange?.type); } - if (isColorFieldDefinition(field)) { - if (!isColorFieldUnsavedChange(unsavedChange)) { - throw getMismatchError(field.type, unsavedChange?.type); - } + return ; + } - return ; + if (isColorFieldDefinition(field)) { + if (!isColorFieldUnsavedChange(unsavedChange)) { + throw getMismatchError(field.type, unsavedChange?.type); } - if (isImageFieldDefinition(field)) { - if (!isImageFieldUnsavedChange(unsavedChange)) { - throw getMismatchError(field.type, unsavedChange?.type); - } + return ; + } - return ; + if (isImageFieldDefinition(field)) { + if (!isImageFieldUnsavedChange(unsavedChange)) { + throw getMismatchError(field.type, unsavedChange?.type); } - if (isJsonFieldDefinition(field)) { - if (!isJsonFieldUnsavedChange(unsavedChange)) { - throw getMismatchError(field.type, unsavedChange?.type); - } + return ; + } - return ( - - ); + if (isJsonFieldDefinition(field)) { + if (!isJsonFieldUnsavedChange(unsavedChange)) { + throw getMismatchError(field.type, unsavedChange?.type); } - if (isMarkdownFieldDefinition(field)) { - if (!isMarkdownFieldUnsavedChange(unsavedChange)) { - throw getMismatchError(field.type, unsavedChange?.type); - } + return ( + + ); + } - return ( - - ); + if (isMarkdownFieldDefinition(field)) { + if (!isMarkdownFieldUnsavedChange(unsavedChange)) { + throw getMismatchError(field.type, unsavedChange?.type); } - if (isNumberFieldDefinition(field)) { - if (!isNumberFieldUnsavedChange(unsavedChange)) { - throw getMismatchError(field.type, unsavedChange?.type); - } + return ( + + ); + } - return ; + if (isNumberFieldDefinition(field)) { + if (!isNumberFieldUnsavedChange(unsavedChange)) { + throw getMismatchError(field.type, unsavedChange?.type); } - if (isSelectFieldDefinition(field)) { - if (!isSelectFieldUnsavedChange(unsavedChange)) { - throw getMismatchError(field.type, unsavedChange?.type); - } - - const { - options: { values: optionValues, labels: optionLabels }, - } = field; + return ; + } - return ( - - ); + if (isSelectFieldDefinition(field)) { + if (!isSelectFieldUnsavedChange(unsavedChange)) { + throw getMismatchError(field.type, unsavedChange?.type); } - if (isStringFieldDefinition(field)) { - if (!isStringFieldUnsavedChange(unsavedChange)) { - throw getMismatchError(field.type, unsavedChange?.type); - } + const { + options: { values: optionValues, labels: optionLabels }, + } = field; - return ; + return ; + } + + if (isStringFieldDefinition(field)) { + if (!isStringFieldUnsavedChange(unsavedChange)) { + throw getMismatchError(field.type, unsavedChange?.type); } - if (isUndefinedFieldDefinition(field)) { - if (!isUndefinedFieldUnsavedChange(unsavedChange)) { - throw getMismatchError(field.type, unsavedChange?.type); - } + return ; + } - return ( - } - unsavedChange={unsavedChange as unknown as UnsavedFieldChange<'string'>} - {...inputProps} - /> - ); + if (isUndefinedFieldDefinition(field)) { + if (!isUndefinedFieldUnsavedChange(unsavedChange)) { + throw getMismatchError(field.type, unsavedChange?.type); } - throw new Error(`Unknown or incompatible field type: ${field.type}`); + return ( + } + unsavedChange={unsavedChange as unknown as UnsavedFieldChange<'string'>} + {...inputProps} + /> + ); } -); + + throw new Error(`Unknown or incompatible field type: ${field.type}`); +}); diff --git a/packages/kbn-management/settings/components/field_input/input/array_input.test.tsx b/packages/kbn-management/settings/components/field_input/input/array_input.test.tsx index 6f80de3039b70..c954035e9c639 100644 --- a/packages/kbn-management/settings/components/field_input/input/array_input.test.tsx +++ b/packages/kbn-management/settings/components/field_input/input/array_input.test.tsx @@ -18,9 +18,9 @@ const name = 'Some array field'; const id = 'some:array:field'; describe('ArrayInput', () => { - const onChange = jest.fn(); + const onInputChange = jest.fn(); const defaultProps: InputProps<'array'> = { - onChange, + onInputChange, field: { name, type: 'array', @@ -35,7 +35,7 @@ describe('ArrayInput', () => { }; beforeEach(() => { - onChange.mockClear(); + onInputChange.mockClear(); }); it('renders without errors', () => { @@ -70,7 +70,7 @@ describe('ArrayInput', () => { expect(input).toHaveValue('foo, bar, baz'); }); - it('only calls onChange when blurred ', () => { + it('only calls onInputChange when blurred ', () => { render(wrap()); const input = screen.getByTestId(`${TEST_SUBJ_PREFIX_FIELD}-${id}`); @@ -78,13 +78,13 @@ describe('ArrayInput', () => { userEvent.type(input, ',baz'); expect(input).toHaveValue('foo, bar,baz'); - expect(defaultProps.onChange).not.toHaveBeenCalled(); + expect(defaultProps.onInputChange).not.toHaveBeenCalled(); act(() => { input.blur(); }); - expect(defaultProps.onChange).toHaveBeenCalledWith({ + expect(defaultProps.onInputChange).toHaveBeenCalledWith({ type: 'array', unsavedValue: ['foo', 'bar', 'baz'], }); diff --git a/packages/kbn-management/settings/components/field_input/input/array_input.tsx b/packages/kbn-management/settings/components/field_input/input/array_input.tsx index dfc92dc980bbd..f2ce42051eb04 100644 --- a/packages/kbn-management/settings/components/field_input/input/array_input.tsx +++ b/packages/kbn-management/settings/components/field_input/input/array_input.tsx @@ -29,7 +29,7 @@ export const ArrayInput = ({ field, unsavedChange, isSavingEnabled, - onChange: onChangeProp, + onInputChange, }: ArrayInputProps) => { const [inputValue] = getFieldInputValue(field, unsavedChange) || []; const [value, setValue] = useState(inputValue?.join(', ')); @@ -39,7 +39,7 @@ export const ArrayInput = ({ setValue(newValue); }; - const onUpdate = useUpdate({ onChange: onChangeProp, field }); + const onUpdate = useUpdate({ onInputChange, field }); useEffect(() => { setValue(inputValue?.join(', ')); diff --git a/packages/kbn-management/settings/components/field_input/input/boolean_input.test.tsx b/packages/kbn-management/settings/components/field_input/input/boolean_input.test.tsx index b9f3ac883421b..49bc4e9367a65 100644 --- a/packages/kbn-management/settings/components/field_input/input/boolean_input.test.tsx +++ b/packages/kbn-management/settings/components/field_input/input/boolean_input.test.tsx @@ -19,9 +19,9 @@ const name = 'Some boolean field'; const id = 'some:boolean:field'; describe('BooleanInput', () => { - const onChange = jest.fn(); + const onInputChange = jest.fn(); const defaultProps: InputProps<'boolean'> = { - onChange, + onInputChange, field: { name, type: 'boolean', @@ -36,7 +36,7 @@ describe('BooleanInput', () => { }; beforeEach(() => { - onChange.mockClear(); + onInputChange.mockClear(); }); it('renders false', () => { @@ -60,16 +60,16 @@ describe('BooleanInput', () => { expect(screen.getByTestId(`${TEST_SUBJ_PREFIX_FIELD}-${id}`)).toBeChecked(); }); - it('calls onChange when toggled', () => { + it('calls onInputChange when toggled', () => { render(wrap()); const input = screen.getByTestId(`${TEST_SUBJ_PREFIX_FIELD}-${id}`); - expect(defaultProps.onChange).not.toHaveBeenCalled(); + expect(defaultProps.onInputChange).not.toHaveBeenCalled(); act(() => { fireEvent.click(input); }); - expect(defaultProps.onChange).toBeCalledWith({ type: 'boolean', unsavedValue: true }); + expect(defaultProps.onInputChange).toBeCalledWith({ type: 'boolean', unsavedValue: true }); act(() => { fireEvent.click(input); diff --git a/packages/kbn-management/settings/components/field_input/input/boolean_input.tsx b/packages/kbn-management/settings/components/field_input/input/boolean_input.tsx index 4f523da8067eb..782bff10a1ee3 100644 --- a/packages/kbn-management/settings/components/field_input/input/boolean_input.tsx +++ b/packages/kbn-management/settings/components/field_input/input/boolean_input.tsx @@ -28,15 +28,15 @@ export const BooleanInput = ({ field, unsavedChange, isSavingEnabled, - onChange: onChangeProp, + onInputChange, }: BooleanInputProps) => { + const onUpdate = useUpdate({ onInputChange, field }); + const onChange: EuiSwitchProps['onChange'] = (event) => { const inputValue = event.target.checked; onUpdate({ type: field.type, unsavedValue: inputValue }); }; - const onUpdate = useUpdate({ onChange: onChangeProp, field }); - const { id, name, ariaAttributes } = field; const { ariaLabel, ariaDescribedBy } = ariaAttributes; const [value] = getFieldInputValue(field, unsavedChange); diff --git a/packages/kbn-management/settings/components/field_input/input/code_editor_input.tsx b/packages/kbn-management/settings/components/field_input/input/code_editor_input.tsx index dc6c1e15043aa..5b9d90154d087 100644 --- a/packages/kbn-management/settings/components/field_input/input/code_editor_input.tsx +++ b/packages/kbn-management/settings/components/field_input/input/code_editor_input.tsx @@ -43,9 +43,9 @@ export const CodeEditorInput = ({ type, isSavingEnabled, defaultValue, - onChange: onChangeProp, + onInputChange, }: CodeEditorInputProps) => { - const onUpdate = useUpdate({ onChange: onChangeProp, field }); + const onUpdate = useUpdate({ onInputChange, field }); const onChange: CodeEditorProps['onChange'] = (inputValue) => { let newUnsavedValue; diff --git a/packages/kbn-management/settings/components/field_input/input/color_picker_input.test.tsx b/packages/kbn-management/settings/components/field_input/input/color_picker_input.test.tsx index 0bd73ad51645c..4214b4b37bdf1 100644 --- a/packages/kbn-management/settings/components/field_input/input/color_picker_input.test.tsx +++ b/packages/kbn-management/settings/components/field_input/input/color_picker_input.test.tsx @@ -15,9 +15,9 @@ const name = 'Some color field'; const id = 'some:color:field'; describe('ColorPickerInput', () => { - const onChange = jest.fn(); + const onInputChange = jest.fn(); const defaultProps: ColorPickerInputProps = { - onChange, + onInputChange, field: { name, type: 'color', @@ -32,7 +32,7 @@ describe('ColorPickerInput', () => { }; beforeEach(() => { - onChange.mockClear(); + onInputChange.mockClear(); }); it('renders without errors', () => { @@ -42,20 +42,23 @@ describe('ColorPickerInput', () => { expect(input).toHaveValue('#000000'); }); - it('calls the onChange prop when the value changes', () => { + it('calls the onInputChange prop when the value changes', () => { const { getByRole } = render(wrap()); const input = getByRole('textbox'); const newValue = '#ffffff'; fireEvent.change(input, { target: { value: newValue } }); - expect(defaultProps.onChange).toHaveBeenCalledWith({ type: 'color', unsavedValue: newValue }); + expect(defaultProps.onInputChange).toHaveBeenCalledWith({ + type: 'color', + unsavedValue: newValue, + }); }); - it('calls the onChange prop with an error when the value is malformed', () => { + it('calls the onInputChange prop with an error when the value is malformed', () => { const { getByRole } = render(wrap()); const input = getByRole('textbox'); const newValue = '#1234'; fireEvent.change(input, { target: { value: newValue } }); - expect(defaultProps.onChange).toHaveBeenCalledWith({ + expect(defaultProps.onInputChange).toHaveBeenCalledWith({ type: 'color', unsavedValue: newValue, isInvalid: true, diff --git a/packages/kbn-management/settings/components/field_input/input/color_picker_input.tsx b/packages/kbn-management/settings/components/field_input/input/color_picker_input.tsx index 8533fc0545eab..41f41ea0638fc 100644 --- a/packages/kbn-management/settings/components/field_input/input/color_picker_input.tsx +++ b/packages/kbn-management/settings/components/field_input/input/color_picker_input.tsx @@ -32,9 +32,9 @@ export const ColorPickerInput = ({ field, unsavedChange, isSavingEnabled, - onChange: onChangeProp, + onInputChange, }: ColorPickerInputProps) => { - const onUpdate = useUpdate({ onChange: onChangeProp, field }); + const onUpdate = useUpdate({ onInputChange, field }); const onChange: EuiColorPickerProps['onChange'] = (newColor, { isValid }) => { const update: UnsavedFieldChange<'color'> = { type: field.type, unsavedValue: newColor }; diff --git a/packages/kbn-management/settings/components/field_input/input/image_input.test.tsx b/packages/kbn-management/settings/components/field_input/input/image_input.test.tsx index cbbec332330d1..3d0c47d177822 100644 --- a/packages/kbn-management/settings/components/field_input/input/image_input.test.tsx +++ b/packages/kbn-management/settings/components/field_input/input/image_input.test.tsx @@ -18,9 +18,9 @@ const name = 'Some image field'; const id = 'some:image:field'; describe('ImageInput', () => { - const onChange = jest.fn(); + const onInputChange = jest.fn(); const defaultProps: ImageInputProps = { - onChange, + onInputChange, field: { name, type: 'image', @@ -35,7 +35,7 @@ describe('ImageInput', () => { }; beforeEach(() => { - onChange.mockClear(); + onInputChange.mockClear(); }); it('renders without errors', () => { @@ -43,7 +43,7 @@ describe('ImageInput', () => { expect(container).toBeInTheDocument(); }); - it('calls the onChange prop when a file is selected', async () => { + it('calls the onInputChange prop when a file is selected', async () => { const { getByTestId } = render(wrap()); const input = getByTestId(`${TEST_SUBJ_PREFIX_FIELD}-${id}`) as HTMLInputElement; const file = new File(['(⌐□_□)'], 'test.png', { type: 'image/png' }); @@ -55,7 +55,7 @@ describe('ImageInput', () => { expect(input.files?.length).toBe(1); // This doesn't work for some reason. - // expect(defaultProps.onChange).toHaveBeenCalledWith({ value: file }); + // expect(defaultProps.onInputChange).toHaveBeenCalledWith({ value: file }); }); it('disables the input when isDisabled prop is true', () => { diff --git a/packages/kbn-management/settings/components/field_input/input/image_input.tsx b/packages/kbn-management/settings/components/field_input/input/image_input.tsx index 286cba2c49d4c..9bcacf620c1fe 100644 --- a/packages/kbn-management/settings/components/field_input/input/image_input.tsx +++ b/packages/kbn-management/settings/components/field_input/input/image_input.tsx @@ -44,7 +44,7 @@ const errorMessage = i18n.translate('management.settings.field.imageChangeErrorM * Component for manipulating an `image` field. */ export const ImageInput = React.forwardRef( - ({ field, unsavedChange, isSavingEnabled, onChange: onChangeProp }, ref) => { + ({ field, unsavedChange, isSavingEnabled, onInputChange }, ref) => { const inputRef = useRef(null); useImperativeHandle(ref, () => ({ @@ -53,7 +53,7 @@ export const ImageInput = React.forwardRef( const { showDanger } = useServices(); - const onUpdate = useUpdate({ onChange: onChangeProp, field }); + const onUpdate = useUpdate({ onInputChange, field }); const onChange: EuiFilePickerProps['onChange'] = async (files: FileList | null) => { if (files === null || !files.length) { diff --git a/packages/kbn-management/settings/components/field_input/input/json_editor_input.test.tsx b/packages/kbn-management/settings/components/field_input/input/json_editor_input.test.tsx index 2cd34de067ffc..800a807f8103a 100644 --- a/packages/kbn-management/settings/components/field_input/input/json_editor_input.test.tsx +++ b/packages/kbn-management/settings/components/field_input/input/json_editor_input.test.tsx @@ -33,9 +33,9 @@ jest.mock('../code_editor', () => ({ })); describe('JsonEditorInput', () => { - const onChange = jest.fn(); + const onInputChange = jest.fn(); const defaultProps: CodeEditorInputProps = { - onChange, + onInputChange, type: 'json', field: { name, @@ -51,7 +51,7 @@ describe('JsonEditorInput', () => { }; beforeEach(() => { - onChange.mockClear(); + onInputChange.mockClear(); }); it('renders without errors', () => { @@ -65,28 +65,28 @@ describe('JsonEditorInput', () => { expect(input).toHaveValue(initialValue); }); - it('calls the onChange prop when the object value changes', () => { + it('calls the onInputChange prop when the object value changes', () => { const { getByTestId } = render(); const input = getByTestId(`${TEST_SUBJ_PREFIX_FIELD}-${id}`); fireEvent.change(input, { target: { value: '{"bar":"foo"}' } }); - expect(defaultProps.onChange).toHaveBeenCalledWith({ + expect(defaultProps.onInputChange).toHaveBeenCalledWith({ type: 'json', unsavedValue: '{"bar":"foo"}', }); }); - it('calls the onChange prop when the object value changes with no value', () => { + it('calls the onInputChange prop when the object value changes with no value', () => { const { getByTestId } = render(); const input = getByTestId(`${TEST_SUBJ_PREFIX_FIELD}-${id}`); fireEvent.change(input, { target: { value: '' } }); - expect(defaultProps.onChange).toHaveBeenCalledWith({ type: 'json', unsavedValue: '' }); + expect(defaultProps.onInputChange).toHaveBeenCalledWith({ type: 'json', unsavedValue: '' }); }); - it('calls the onChange prop with an error when the object value changes to invalid JSON', () => { + it('calls the onInputChange prop with an error when the object value changes to invalid JSON', () => { const { getByTestId } = render(); const input = getByTestId(`${TEST_SUBJ_PREFIX_FIELD}-${id}`); fireEvent.change(input, { target: { value: '{"bar" "foo"}' } }); - expect(defaultProps.onChange).toHaveBeenCalledWith({ + expect(defaultProps.onInputChange).toHaveBeenCalledWith({ type: 'json', unsavedValue: '{"bar" "foo"}', error: 'Invalid JSON syntax', @@ -94,20 +94,20 @@ describe('JsonEditorInput', () => { }); }); - it('calls the onChange prop when the array value changes', () => { + it('calls the onInputChange prop when the array value changes', () => { const props = { ...defaultProps, defaultValue: '["bar", "foo"]', value: undefined }; const { getByTestId } = render(); const input = getByTestId(`${TEST_SUBJ_PREFIX_FIELD}-${id}`); fireEvent.change(input, { target: { value: '["foo", "bar", "baz"]' } }); waitFor(() => - expect(defaultProps.onChange).toHaveBeenCalledWith({ + expect(defaultProps.onInputChange).toHaveBeenCalledWith({ type: 'json', unsavedValue: '["foo", "bar", "baz"]', }) ); }); - it('calls the onChange prop when the array value changes with no value', () => { + it('calls the onInputChange prop when the array value changes with no value', () => { const props = { ...defaultProps, defaultValue: '["bar", "foo"]', @@ -116,15 +116,15 @@ describe('JsonEditorInput', () => { const { getByTestId } = render(); const input = getByTestId(`${TEST_SUBJ_PREFIX_FIELD}-${id}`); fireEvent.change(input, { target: { value: '' } }); - expect(defaultProps.onChange).toHaveBeenCalledWith({ type: 'json', unsavedValue: '' }); + expect(defaultProps.onInputChange).toHaveBeenCalledWith({ type: 'json', unsavedValue: '' }); }); - it('calls the onChange prop with an array when the array value changes to invalid JSON', () => { + it('calls the onInputChange prop with an array when the array value changes to invalid JSON', () => { const props = { ...defaultProps, defaultValue: '["bar", "foo"]', value: undefined }; const { getByTestId } = render(); const input = getByTestId(`${TEST_SUBJ_PREFIX_FIELD}-${id}`); fireEvent.change(input, { target: { value: '["bar", "foo" | "baz"]' } }); - expect(defaultProps.onChange).toHaveBeenCalledWith({ + expect(defaultProps.onInputChange).toHaveBeenCalledWith({ type: 'json', unsavedValue: '["bar", "foo" | "baz"]', error: 'Invalid JSON syntax', diff --git a/packages/kbn-management/settings/components/field_input/input/markdown_editor_input.test.tsx b/packages/kbn-management/settings/components/field_input/input/markdown_editor_input.test.tsx index dd15b250cf1e0..291585e5f149a 100644 --- a/packages/kbn-management/settings/components/field_input/input/markdown_editor_input.test.tsx +++ b/packages/kbn-management/settings/components/field_input/input/markdown_editor_input.test.tsx @@ -33,9 +33,9 @@ jest.mock('../code_editor', () => ({ })); describe('MarkdownEditorInput', () => { - const onChange = jest.fn(); + const onInputChange = jest.fn(); const defaultProps: CodeEditorInputProps = { - onChange, + onInputChange, type: 'markdown', field: { name, @@ -51,7 +51,7 @@ describe('MarkdownEditorInput', () => { }; beforeEach(() => { - onChange.mockClear(); + onInputChange.mockClear(); }); it('renders without errors', () => { @@ -65,11 +65,11 @@ describe('MarkdownEditorInput', () => { expect(input).toHaveValue(initialValue); }); - it('calls the onChange prop when the value changes', () => { + it('calls the onInputChange prop when the value changes', () => { const { getByTestId } = render(); const input = getByTestId(`${TEST_SUBJ_PREFIX_FIELD}-${id}`); fireEvent.change(input, { target: { value: '# New Markdown Title' } }); - expect(defaultProps.onChange).toHaveBeenCalledWith({ + expect(defaultProps.onInputChange).toHaveBeenCalledWith({ type: 'markdown', unsavedValue: '# New Markdown Title', }); diff --git a/packages/kbn-management/settings/components/field_input/input/number_input.test.tsx b/packages/kbn-management/settings/components/field_input/input/number_input.test.tsx index 3fd6518102a46..fa228a48b721e 100644 --- a/packages/kbn-management/settings/components/field_input/input/number_input.test.tsx +++ b/packages/kbn-management/settings/components/field_input/input/number_input.test.tsx @@ -16,9 +16,9 @@ const name = 'Some number field'; const id = 'some:number:field'; describe('NumberInput', () => { - const onChange = jest.fn(); + const onInputChange = jest.fn(); const defaultProps: NumberInputProps = { - onChange, + onInputChange, field: { name, type: 'number', @@ -33,7 +33,7 @@ describe('NumberInput', () => { }; beforeEach(() => { - onChange.mockClear(); + onInputChange.mockClear(); }); it('renders without errors', () => { @@ -65,11 +65,14 @@ describe('NumberInput', () => { expect(input).toHaveValue(4321); }); - it('calls the onChange prop when the value changes', () => { + it('calls the onInputChange prop when the value changes', () => { const { getByTestId } = render(wrap()); const input = getByTestId(`${TEST_SUBJ_PREFIX_FIELD}-${id}`); fireEvent.change(input, { target: { value: '54321' } }); - expect(defaultProps.onChange).toHaveBeenCalledWith({ type: 'number', unsavedValue: 54321 }); + expect(defaultProps.onInputChange).toHaveBeenCalledWith({ + type: 'number', + unsavedValue: 54321, + }); }); it('disables the input when isDisabled prop is true', () => { diff --git a/packages/kbn-management/settings/components/field_input/input/number_input.tsx b/packages/kbn-management/settings/components/field_input/input/number_input.tsx index f67e27be505e2..a1929593e3cb5 100644 --- a/packages/kbn-management/settings/components/field_input/input/number_input.tsx +++ b/packages/kbn-management/settings/components/field_input/input/number_input.tsx @@ -26,14 +26,14 @@ export const NumberInput = ({ field, unsavedChange, isSavingEnabled, - onChange: onChangeProp, + onInputChange, }: NumberInputProps) => { const onChange: EuiFieldNumberProps['onChange'] = (event) => { const inputValue = Number(event.target.value); onUpdate({ type: field.type, unsavedValue: inputValue }); }; - const onUpdate = useUpdate({ onChange: onChangeProp, field }); + const onUpdate = useUpdate({ onInputChange, field }); const { id, name, ariaAttributes } = field; const { ariaLabel, ariaDescribedBy } = ariaAttributes; diff --git a/packages/kbn-management/settings/components/field_input/input/select_input.test.tsx b/packages/kbn-management/settings/components/field_input/input/select_input.test.tsx index ca2e875a65604..e77d2a2cbfe49 100644 --- a/packages/kbn-management/settings/components/field_input/input/select_input.test.tsx +++ b/packages/kbn-management/settings/components/field_input/input/select_input.test.tsx @@ -16,9 +16,9 @@ const name = 'Some select field'; const id = 'some:select:field'; describe('SelectInput', () => { - const onChange = jest.fn(); + const onInputChange = jest.fn(); const defaultProps: SelectInputProps = { - onChange, + onInputChange, field: { name, type: 'select', @@ -39,7 +39,7 @@ describe('SelectInput', () => { }; beforeEach(() => { - onChange.mockClear(); + onInputChange.mockClear(); }); it('renders without errors', () => { @@ -49,11 +49,14 @@ describe('SelectInput', () => { expect(input).toHaveValue('option2'); }); - it('calls the onChange prop when the value changes', () => { + it('calls the onInputChange prop when the value changes', () => { const { getByTestId } = render(wrap()); const input = getByTestId(`${TEST_SUBJ_PREFIX_FIELD}-${id}`); fireEvent.change(input, { target: { value: 'option3' } }); - expect(defaultProps.onChange).toHaveBeenCalledWith({ type: 'select', unsavedValue: 'option3' }); + expect(defaultProps.onInputChange).toHaveBeenCalledWith({ + type: 'select', + unsavedValue: 'option3', + }); }); it('disables the input when isDisabled prop is true', () => { diff --git a/packages/kbn-management/settings/components/field_input/input/select_input.tsx b/packages/kbn-management/settings/components/field_input/input/select_input.tsx index bd53fb9913ec5..9421d4d3e83b1 100644 --- a/packages/kbn-management/settings/components/field_input/input/select_input.tsx +++ b/packages/kbn-management/settings/components/field_input/input/select_input.tsx @@ -30,7 +30,7 @@ export interface SelectInputProps extends InputProps<'select'> { export const SelectInput = ({ field, unsavedChange, - onChange: onChangeProp, + onInputChange, optionLabels = {}, optionValues: optionsProp, isSavingEnabled, @@ -53,7 +53,7 @@ export const SelectInput = ({ onUpdate({ type: field.type, unsavedValue: inputValue }); }; - const onUpdate = useUpdate({ onChange: onChangeProp, field }); + const onUpdate = useUpdate({ onInputChange, field }); const { id, ariaAttributes } = field; const { ariaLabel, ariaDescribedBy } = ariaAttributes; diff --git a/packages/kbn-management/settings/components/field_input/input/text_input.test.tsx b/packages/kbn-management/settings/components/field_input/input/text_input.test.tsx index 9dcdb8a04d5ea..e0d2eb75fca90 100644 --- a/packages/kbn-management/settings/components/field_input/input/text_input.test.tsx +++ b/packages/kbn-management/settings/components/field_input/input/text_input.test.tsx @@ -16,9 +16,9 @@ const name = 'Some text field'; const id = 'some:text:field'; describe('TextInput', () => { - const onChange = jest.fn(); + const onInputChange = jest.fn(); const defaultProps: TextInputProps = { - onChange, + onInputChange, field: { name, type: 'string', @@ -33,7 +33,7 @@ describe('TextInput', () => { }; beforeEach(() => { - onChange.mockClear(); + onInputChange.mockClear(); }); it('renders without errors', () => { @@ -47,11 +47,11 @@ describe('TextInput', () => { expect(input).toHaveValue('initial value'); }); - it('calls the onChange prop when the value changes', () => { + it('calls the onInputChange prop when the value changes', () => { const { getByTestId } = render(); const input = getByTestId(`${TEST_SUBJ_PREFIX_FIELD}-${id}`); fireEvent.change(input, { target: { value: 'new value' } }); - expect(defaultProps.onChange).toHaveBeenCalledWith({ + expect(defaultProps.onInputChange).toHaveBeenCalledWith({ type: 'string', unsavedValue: 'new value', }); diff --git a/packages/kbn-management/settings/components/field_input/input/text_input.tsx b/packages/kbn-management/settings/components/field_input/input/text_input.tsx index f4f9450e9577f..711d7aa808344 100644 --- a/packages/kbn-management/settings/components/field_input/input/text_input.tsx +++ b/packages/kbn-management/settings/components/field_input/input/text_input.tsx @@ -26,14 +26,14 @@ export const TextInput = ({ field, unsavedChange, isSavingEnabled, - onChange: onChangeProp, + onInputChange, }: TextInputProps) => { const onChange: EuiFieldTextProps['onChange'] = (event) => { const inputValue = event.target.value; onUpdate({ type: field.type, unsavedValue: inputValue }); }; - const onUpdate = useUpdate({ onChange: onChangeProp, field }); + const onUpdate = useUpdate({ onInputChange, field }); const { id, name, ariaAttributes } = field; const { ariaLabel, ariaDescribedBy } = ariaAttributes; diff --git a/packages/kbn-management/settings/components/field_input/types.ts b/packages/kbn-management/settings/components/field_input/types.ts index e5d5c11e2f199..fc4d311a3d210 100644 --- a/packages/kbn-management/settings/components/field_input/types.ts +++ b/packages/kbn-management/settings/components/field_input/types.ts @@ -8,7 +8,7 @@ import { FieldDefinition, - OnChangeFn, + OnInputChangeFn, SettingType, UnsavedFieldChange, } from '@kbn/management-settings-types'; @@ -44,6 +44,6 @@ export interface InputProps { >; unsavedChange?: UnsavedFieldChange; isSavingEnabled: boolean; - /** The `onChange` handler. */ - onChange: OnChangeFn; + /** The `onInputChange` handler. */ + onInputChange: OnInputChangeFn; } diff --git a/packages/kbn-management/settings/components/field_row/README.mdx b/packages/kbn-management/settings/components/field_row/README.mdx index 6fe238938407c..d8febe27dd674 100644 --- a/packages/kbn-management/settings/components/field_row/README.mdx +++ b/packages/kbn-management/settings/components/field_row/README.mdx @@ -19,7 +19,7 @@ For reference, this is an example of the current Advanced Settings UI: ## Implementation -A `FormRow` represents a single UiSetting, and is responsible for rendering the UiSetting's label, description, and equivalent value input. It displays the state of any unsaved change, (e.g. error). It also handles the logic for updating the UiSetting's value in a consuming component through the `onChange` handler. +A `FormRow` represents a single UiSetting, and is responsible for rendering the UiSetting's label, description, and equivalent value input. It displays the state of any unsaved change, (e.g. error). It also handles the logic for updating the UiSetting's value in a consuming component through the `onFieldChange` handler.
Anatomy of a `FormRow`
diff --git a/packages/kbn-management/settings/components/field_row/__stories__/common.tsx b/packages/kbn-management/settings/components/field_row/__stories__/common.tsx index 58e145146cc40..e8c51d075c21d 100644 --- a/packages/kbn-management/settings/components/field_row/__stories__/common.tsx +++ b/packages/kbn-management/settings/components/field_row/__stories__/common.tsx @@ -12,12 +12,15 @@ import { action } from '@storybook/addon-actions'; import { EuiPanel } from '@elastic/eui'; import { SettingType, UnsavedFieldChange } from '@kbn/management-settings-types'; -import { KnownTypeToMetadata, UiSettingMetadata } from '@kbn/management-settings-types/metadata'; +import { + KnownTypeToMetadata, + UiSettingMetadata, + OnFieldChangeFn, +} from '@kbn/management-settings-types'; import { getDefaultValue, getUserValue } from '@kbn/management-settings-utilities/storybook'; import { getFieldDefinition } from '@kbn/management-settings-field-definition'; import { FieldRow as Component, FieldRow } from '../field_row'; import { FieldRowProvider } from '../services'; -import { RowOnChangeFn } from '../types'; /** * Props for a {@link FieldInput} Storybook story. @@ -103,10 +106,7 @@ export const storyArgs = { * @param type The type of the UiSetting for this {@link FieldRow}. * @returns A Storybook Story. */ -export const getFieldRowStory = ( - type: SettingType, - settingFields?: Partial> -) => { +export const getFieldRowStory = (type: SettingType, settingFields?: Partial) => { const Story = ({ isCustom, isDeprecated, @@ -143,17 +143,17 @@ export const getFieldRowStory = ( }, }); - const onChange: RowOnChangeFn = (_id, newChange) => { + const onFieldChange: OnFieldChangeFn = (_id, newChange) => { setUnsavedChange(newChange); - action('onChange')({ + action('onFieldChange')({ type, unsavedValue: newChange?.unsavedValue, savedValue: field.savedValue, }); }; - return ; + return ; }; // In Kibana, the image default value is never anything other than null. There would be a number diff --git a/packages/kbn-management/settings/components/field_row/field_row.test.tsx b/packages/kbn-management/settings/components/field_row/field_row.test.tsx index afa425d2a459a..e64d32366409e 100644 --- a/packages/kbn-management/settings/components/field_row/field_row.test.tsx +++ b/packages/kbn-management/settings/components/field_row/field_row.test.tsx @@ -198,7 +198,7 @@ describe('Field', () => { wrap( ) @@ -212,7 +212,7 @@ describe('Field', () => { wrap( ) @@ -243,7 +243,7 @@ describe('Field', () => { setting, params: { isOverridden: true }, })} - onChange={handleChange} + onFieldChange={handleChange} isSavingEnabled={true} /> ) @@ -265,7 +265,7 @@ describe('Field', () => { id, setting, })} - onChange={handleChange} + onFieldChange={handleChange} isSavingEnabled={false} /> ) @@ -288,7 +288,7 @@ describe('Field', () => { userValue: userValues[type] as any, }, })} - onChange={handleChange} + onFieldChange={handleChange} isSavingEnabled={true} /> ) @@ -319,7 +319,7 @@ describe('Field', () => { setting, params: { isCustom: true }, })} - onChange={handleChange} + onFieldChange={handleChange} isSavingEnabled={true} /> ) @@ -341,7 +341,7 @@ describe('Field', () => { type, unsavedValue: userValues[type] as any, }} - onChange={handleChange} + onFieldChange={handleChange} isSavingEnabled={true} /> ) @@ -373,7 +373,7 @@ describe('Field', () => { }); const { getByTestId } = render( - wrap() + wrap() ); const input = getByTestId(`${DATA_TEST_SUBJ_RESET_PREFIX}-${field.id}`); @@ -395,7 +395,7 @@ describe('Field', () => { ) @@ -408,12 +408,12 @@ describe('Field', () => { }); }); - it('should fire onChange when input changes', () => { + it('should fire onFieldChange when input changes', () => { const setting = settings.string; const field = getFieldDefinition({ id: setting.name || setting.type, setting }); const { getByTestId } = render( - wrap() + wrap() ); const input = getByTestId(`${TEST_SUBJ_PREFIX_FIELD}-${field.id}`); @@ -424,12 +424,12 @@ describe('Field', () => { }); }); - it('should fire onChange with an error when input changes with invalid value', () => { + it('should fire onFieldChange with an error when input changes with invalid value', () => { const setting = settings.color; const field = getFieldDefinition({ id: setting.name || setting.type, setting }); const { getByTestId } = render( - wrap() + wrap() ); const input = getByTestId(`euiColorPickerAnchor ${TEST_SUBJ_PREFIX_FIELD}-${field.id}`); @@ -451,7 +451,7 @@ describe('Field', () => { wrap( { const { getByTestId } = render( wrap( - + ) ); @@ -512,7 +516,7 @@ describe('Field', () => { }); const { getByTestId, getByAltText } = render( - wrap() + wrap() ); const link = getByTestId(`${DATA_TEST_SUBJ_CHANGE_LINK_PREFIX}-${field.id}`); @@ -534,7 +538,7 @@ describe('Field', () => { wrap( diff --git a/packages/kbn-management/settings/components/field_row/field_row.tsx b/packages/kbn-management/settings/components/field_row/field_row.tsx index 9058511c955d1..3592e634ade5e 100644 --- a/packages/kbn-management/settings/components/field_row/field_row.tsx +++ b/packages/kbn-management/settings/components/field_row/field_row.tsx @@ -21,7 +21,8 @@ import type { ResetInputRef, SettingType, UnsavedFieldChange, - OnChangeFn, + OnInputChangeFn, + OnFieldChangeFn, } from '@kbn/management-settings-types'; import { isImageFieldDefinition } from '@kbn/management-settings-field-definition'; import { FieldInput } from '@kbn/management-settings-components-field-input'; @@ -30,12 +31,11 @@ import { hasUnsavedChange } from '@kbn/management-settings-utilities'; import { FieldDescription } from './description'; import { FieldTitle } from './title'; import { useFieldStyles } from './field_row.styles'; -import { RowOnChangeFn } from './types'; import { FieldInputFooter } from './footer'; export const DATA_TEST_SUBJ_SCREEN_READER_MESSAGE = 'fieldRowScreenReaderMessage'; -type Definition = Pick< +type Definition = Pick< FieldDefinition, | 'ariaAttributes' | 'defaultValue' @@ -57,18 +57,18 @@ type Definition = Pick< */ export interface FieldRowProps { /** The {@link FieldDefinition} corresponding the setting. */ - field: Definition; + field: Definition; /** True if saving settings is enabled, false otherwise. */ isSavingEnabled: boolean; - /** The {@link OnChangeFn} handler. */ - onChange: RowOnChangeFn; + /** The {@link OnInputChangeFn} handler. */ + onFieldChange: OnFieldChangeFn; /** * The onClear handler, if a value is cleared to an empty or default state. * @param id The id relating to the field to clear. */ onClear?: (id: string) => void; /** The {@link UnsavedFieldChange} corresponding to any unsaved change to the field. */ - unsavedChange?: UnsavedFieldChange; + unsavedChange?: UnsavedFieldChange; } /** @@ -76,7 +76,7 @@ export interface FieldRowProps { * @param props The {@link FieldRowProps} for the {@link FieldRow} component. */ export const FieldRow = (props: FieldRowProps) => { - const { isSavingEnabled, onChange: onChangeProp, field, unsavedChange } = props; + const { isSavingEnabled, onFieldChange, field, unsavedChange } = props; const { id, groupId, isOverridden, unsavedFieldId } = field; const { cssFieldFormGroup } = useFieldStyles({ field, @@ -86,9 +86,9 @@ export const FieldRow = (props: FieldRowProps) => { // Create a ref for those input fields that use a `reset` handle. const ref = useRef(null); - // Route any change to the `onChange` handler, along with the field id. - const onChange: OnChangeFn = (update) => { - onChangeProp(id, update); + // Route any change to the `onFieldChange` handler, along with the field id. + const onInputChange: OnInputChangeFn = (update) => { + onFieldChange(id, update); }; const onReset = () => { @@ -97,9 +97,9 @@ export const FieldRow = (props: FieldRowProps) => { const update = { type: field.type, unsavedValue: field.defaultValue }; if (hasUnsavedChange(field, update)) { - onChange(update); + onInputChange(update); } else { - onChange(); + onInputChange(); } }; @@ -111,9 +111,9 @@ export const FieldRow = (props: FieldRowProps) => { // Indicate a field is being cleared for a new value by setting its unchanged // value to`undefined`. Currently, this only applies to `image` fields. if (field.savedValue !== undefined && field.savedValue !== null) { - onChange({ type: field.type, unsavedValue: undefined }); + onInputChange({ type: field.type, unsavedValue: undefined }); } else { - onChange(); + onInputChange(); } }; @@ -162,7 +162,7 @@ export const FieldRow = (props: FieldRowProps) => { {unsavedScreenReaderMessage} diff --git a/packages/kbn-management/settings/components/field_row/footer/reset_link.test.tsx b/packages/kbn-management/settings/components/field_row/footer/reset_link.test.tsx index 2704e9e33d743..74f87aadca816 100644 --- a/packages/kbn-management/settings/components/field_row/footer/reset_link.test.tsx +++ b/packages/kbn-management/settings/components/field_row/footer/reset_link.test.tsx @@ -9,13 +9,11 @@ import React from 'react'; import { render, fireEvent } from '@testing-library/react'; -import { SettingType } from '@kbn/management-settings-types'; - import { wrap } from '../mocks'; import { InputResetLink, InputResetLinkProps } from './reset_link'; describe('InputResetLink', () => { - const defaultProps: InputResetLinkProps = { + const defaultProps: InputResetLinkProps = { field: { type: 'string', id: 'test', diff --git a/packages/kbn-management/settings/components/field_row/footer/reset_link.tsx b/packages/kbn-management/settings/components/field_row/footer/reset_link.tsx index 35a34350e0be8..778995085d981 100644 --- a/packages/kbn-management/settings/components/field_row/footer/reset_link.tsx +++ b/packages/kbn-management/settings/components/field_row/footer/reset_link.tsx @@ -21,7 +21,7 @@ import { isFieldDefaultValue } from '@kbn/management-settings-utilities'; /** * Props for a {@link InputResetLink} component. */ -export interface InputResetLinkProps { +export interface InputResetLinkProps { /** The {@link FieldDefinition} corresponding the setting. */ field: Pick< FieldDefinition, diff --git a/packages/kbn-management/settings/components/field_row/index.ts b/packages/kbn-management/settings/components/field_row/index.ts index 98c64f1cd494d..6bcbcf409d1be 100644 --- a/packages/kbn-management/settings/components/field_row/index.ts +++ b/packages/kbn-management/settings/components/field_row/index.ts @@ -6,12 +6,11 @@ * Side Public License, v 1. */ -export { FieldRow, type FieldRowProps as FieldProps } from './field_row'; +export { FieldRow, type FieldRowProps } from './field_row'; export { FieldRowProvider, FieldRowKibanaProvider, type FieldRowProviderProps } from './services'; export type { FieldRowServices, FieldRowKibanaDependencies, - RowOnChangeFn, KibanaDependencies, Services, } from './types'; diff --git a/packages/kbn-management/settings/components/field_row/types.ts b/packages/kbn-management/settings/components/field_row/types.ts index d353cd91fba49..a483763e79571 100644 --- a/packages/kbn-management/settings/components/field_row/types.ts +++ b/packages/kbn-management/settings/components/field_row/types.ts @@ -12,7 +12,6 @@ import type { FieldInputServices, FieldInputKibanaDependencies, } from '@kbn/management-settings-components-field-input'; -import { SettingType, UnsavedFieldChange } from '@kbn/management-settings-types'; /** * Contextual services used by a {@link FieldRow} component. @@ -43,13 +42,3 @@ export interface KibanaDependencies { * render a {@link FieldRow} component and its dependents. */ export type FieldRowKibanaDependencies = KibanaDependencies & FieldInputKibanaDependencies; - -/** - * An `onChange` handler for a {@link FieldRow} component. - * @param id A unique id corresponding to the particular setting being changed. - * @param change The {@link UnsavedFieldChange} corresponding to any unsaved change to the field. - */ -export type RowOnChangeFn = ( - id: string, - change?: UnsavedFieldChange -) => void; diff --git a/packages/kbn-management/settings/components/form/form.test.tsx b/packages/kbn-management/settings/components/form/form.test.tsx index 2f1cbdb80bcac..0e149938e2146 100644 --- a/packages/kbn-management/settings/components/form/form.test.tsx +++ b/packages/kbn-management/settings/components/form/form.test.tsx @@ -7,22 +7,20 @@ */ import React from 'react'; -import { fireEvent, render, waitFor } from '@testing-library/react'; +import { act, fireEvent, render, waitFor } from '@testing-library/react'; import { FieldDefinition, SettingType } from '@kbn/management-settings-types'; import { getFieldDefinitions } from '@kbn/management-settings-field-definition'; +import { getSettingsMock } from '@kbn/management-settings-utilities/mocks/settings.mock'; +import { TEST_SUBJ_PREFIX_FIELD } from '@kbn/management-settings-components-field-input/input'; import { Form } from './form'; -import { wrap, getSettingsMock, createFormServicesMock, uiSettingsClientMock } from './mocks'; -import { TEST_SUBJ_PREFIX_FIELD } from '@kbn/management-settings-components-field-input/input'; +import { wrap, createFormServicesMock, uiSettingsClientMock } from './mocks'; import { DATA_TEST_SUBJ_SAVE_BUTTON, DATA_TEST_SUBJ_CANCEL_BUTTON } from './bottom_bar/bottom_bar'; import { FormServices } from './types'; const settingsMock = getSettingsMock(); -const fields: Array> = getFieldDefinitions( - settingsMock, - uiSettingsClientMock -); +const fields: FieldDefinition[] = getFieldDefinitions(settingsMock, uiSettingsClientMock); describe('Form', () => { beforeEach(() => { @@ -78,14 +76,18 @@ describe('Form', () => { fireEvent.change(input, { target: { value: 'test' } }); const saveButton = getByTestId(DATA_TEST_SUBJ_SAVE_BUTTON); - fireEvent.click(saveButton); + act(() => { + fireEvent.click(saveButton); + }); - expect(services.saveChanges).toHaveBeenCalledWith({ - string: { type: 'string', unsavedValue: 'test' }, + await waitFor(() => { + expect(services.saveChanges).toHaveBeenCalledWith({ + string: { type: 'string', unsavedValue: 'test' }, + }); }); }); - it('clears changes when Cancel button is clicked', () => { + it('clears changes when Cancel button is clicked', async () => { const { getByTestId } = render(wrap(
)); const testFieldType = 'string'; @@ -93,12 +95,16 @@ describe('Form', () => { fireEvent.change(input, { target: { value: 'test' } }); const cancelButton = getByTestId(DATA_TEST_SUBJ_CANCEL_BUTTON); - fireEvent.click(cancelButton); + act(() => { + fireEvent.click(cancelButton); + }); - expect(input).toHaveValue(settingsMock[testFieldType].value); + await waitFor(() => { + expect(input).toHaveValue(settingsMock[testFieldType].value); + }); }); - it('fires showError when saving is unsuccessful', () => { + it('fires showError when saving is unsuccessful', async () => { const services: FormServices = createFormServicesMock(); const saveChangesWithError = jest.fn(() => { throw new Error('Unable to save'); @@ -114,15 +120,19 @@ describe('Form', () => { fireEvent.change(input, { target: { value: 'test' } }); const saveButton = getByTestId(DATA_TEST_SUBJ_SAVE_BUTTON); - fireEvent.click(saveButton); + act(() => { + fireEvent.click(saveButton); + }); - expect(testServices.showError).toHaveBeenCalled(); + await waitFor(() => { + expect(testServices.showError).toHaveBeenCalled(); + }); }); it('fires showReloadPagePrompt when changing a reloadPageRequired setting', async () => { const services: FormServices = createFormServicesMock(); // Make all settings require a page reload - const testFields: Array> = getFieldDefinitions( + const testFields: FieldDefinition[] = getFieldDefinitions( getSettingsMock(true), uiSettingsClientMock ); @@ -135,7 +145,9 @@ describe('Form', () => { fireEvent.change(input, { target: { value: 'test' } }); const saveButton = getByTestId(DATA_TEST_SUBJ_SAVE_BUTTON); - fireEvent.click(saveButton); + act(() => { + fireEvent.click(saveButton); + }); await waitFor(() => { expect(services.showReloadPagePrompt).toHaveBeenCalled(); diff --git a/packages/kbn-management/settings/components/form/form.tsx b/packages/kbn-management/settings/components/form/form.tsx index fabc80755cad8..0bc9d2c96fb29 100644 --- a/packages/kbn-management/settings/components/form/form.tsx +++ b/packages/kbn-management/settings/components/form/form.tsx @@ -9,9 +9,10 @@ import React, { Fragment } from 'react'; import type { FieldDefinition } from '@kbn/management-settings-types'; -import { FieldRow, RowOnChangeFn } from '@kbn/management-settings-components-field-row'; -import { SettingType, UnsavedFieldChange } from '@kbn/management-settings-types'; +import { FieldCategories } from '@kbn/management-settings-components-field-category'; +import { UnsavedFieldChange, OnFieldChangeFn } from '@kbn/management-settings-types'; import { isEmpty } from 'lodash'; +import { categorizeFields } from '@kbn/management-settings-utilities'; import { BottomBar } from './bottom_bar'; import { useSave } from './use_save'; @@ -20,7 +21,7 @@ import { useSave } from './use_save'; */ export interface FormProps { /** A list of {@link FieldDefinition} corresponding to settings to be displayed in the form. */ - fields: Array>; + fields: FieldDefinition[]; /** True if saving settings is enabled, false otherwise. */ isSavingEnabled: boolean; } @@ -32,9 +33,9 @@ export interface FormProps { export const Form = (props: FormProps) => { const { fields, isSavingEnabled } = props; - const [unsavedChanges, setUnsavedChanges] = React.useState< - Record> - >({}); + const [unsavedChanges, setUnsavedChanges] = React.useState>( + {} + ); const [isLoading, setIsLoading] = React.useState(false); @@ -53,7 +54,7 @@ export const Form = (props: FormProps) => { setIsLoading(false); }; - const onChange: RowOnChangeFn = (id, change) => { + const onFieldChange: OnFieldChangeFn = (id, change) => { if (!change) { const { [id]: unsavedChange, ...rest } = unsavedChanges; setUnsavedChanges(rest); @@ -63,15 +64,16 @@ export const Form = (props: FormProps) => { setUnsavedChanges((changes) => ({ ...changes, [id]: change })); }; - const fieldRows = fields.map((field) => { - const { id: key } = field; - const unsavedChange = unsavedChanges[key]; - return ; - }); + const categorizedFields = categorizeFields(fields); + + /** TODO - Querying is not enabled yet. */ + const onClearQuery = () => {}; return ( -
{fieldRows}
+ {!isEmpty(unsavedChanges) && ( { return ( - {children} + {children} ); }; @@ -47,7 +47,7 @@ export const FormKibanaProvider: FC = ({ children, ...de return ( >) => { + saveChanges: (changes: Record) => { const arr = Object.entries(changes).map(([key, value]) => settings.client.set(key, value.unsavedValue) ); @@ -57,7 +57,9 @@ export const FormKibanaProvider: FC = ({ children, ...de showReloadPagePrompt: () => toasts.add(reloadPageToast(theme, i18nStart)), }} > - {children} + + {children} + ); }; diff --git a/packages/kbn-management/settings/components/form/storybook/form.stories.tsx b/packages/kbn-management/settings/components/form/storybook/form.stories.tsx index 5ba4a57d8a2f3..060ddd6355340 100644 --- a/packages/kbn-management/settings/components/form/storybook/form.stories.tsx +++ b/packages/kbn-management/settings/components/form/storybook/form.stories.tsx @@ -6,12 +6,13 @@ * Side Public License, v 1. */ import React from 'react'; -import { EuiPanel } from '@elastic/eui'; import { action } from '@storybook/addon-actions'; import { ComponentMeta } from '@storybook/react'; -import { FieldDefinition, SettingType } from '@kbn/management-settings-types'; +import { FieldDefinition } from '@kbn/management-settings-types'; import { getFieldDefinitions } from '@kbn/management-settings-field-definition'; -import { getSettingsMock, uiSettingsClientMock } from '../mocks'; +import { getSettingsMock } from '@kbn/management-settings-utilities/mocks/settings.mock'; + +import { uiSettingsClientMock } from '../mocks'; import { Form as Component } from '../form'; import { FormProvider } from '../services'; @@ -37,12 +38,15 @@ export default { showError={action('showError')} showReloadPagePrompt={action('showReloadPagePrompt')} > - - - + ), ], + parameters: { + backgrounds: { + default: 'ghost', + }, + }, } as ComponentMeta; interface FormStoryProps { @@ -53,7 +57,7 @@ interface FormStoryProps { } export const Form = ({ isSavingEnabled, requirePageReload }: FormStoryProps) => { - const fields: Array> = getFieldDefinitions( + const fields: FieldDefinition[] = getFieldDefinitions( getSettingsMock(requirePageReload), uiSettingsClientMock ); diff --git a/packages/kbn-management/settings/components/form/tsconfig.json b/packages/kbn-management/settings/components/form/tsconfig.json index 359e5560fd2e4..cfd8fe3ac53b0 100644 --- a/packages/kbn-management/settings/components/form/tsconfig.json +++ b/packages/kbn-management/settings/components/form/tsconfig.json @@ -30,5 +30,7 @@ "@kbn/core-theme-browser", "@kbn/core-ui-settings-browser", "@kbn/management-settings-components-field-input", + "@kbn/management-settings-components-field-category", + "@kbn/management-settings-utilities", ] } diff --git a/packages/kbn-management/settings/components/form/types.ts b/packages/kbn-management/settings/components/form/types.ts index 2e803cbd74cb5..155420f5effe2 100644 --- a/packages/kbn-management/settings/components/form/types.ts +++ b/packages/kbn-management/settings/components/form/types.ts @@ -10,7 +10,7 @@ import type { FieldRowKibanaDependencies, FieldRowServices, } from '@kbn/management-settings-components-field-row'; -import { SettingType, UnsavedFieldChange } from '@kbn/management-settings-types'; +import { UnsavedFieldChange } from '@kbn/management-settings-types'; import { SettingsStart } from '@kbn/core-ui-settings-browser'; import { I18nStart } from '@kbn/core-i18n-browser'; import { ThemeServiceStart } from '@kbn/core-theme-browser'; @@ -20,7 +20,7 @@ import { ToastsStart } from '@kbn/core-notifications-browser'; * Contextual services used by a {@link Form} component. */ export interface Services { - saveChanges: (changes: Record>) => void; + saveChanges: (changes: Record) => void; showError: (message: string) => void; showReloadPagePrompt: () => void; } diff --git a/packages/kbn-management/settings/components/form/use_save.ts b/packages/kbn-management/settings/components/form/use_save.ts index ebd1981eb57d9..f0679f31aca20 100644 --- a/packages/kbn-management/settings/components/form/use_save.ts +++ b/packages/kbn-management/settings/components/form/use_save.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import type { FieldDefinition, SettingType } from '@kbn/management-settings-types'; +import type { FieldDefinition } from '@kbn/management-settings-types'; import { isEmpty } from 'lodash'; import { i18n } from '@kbn/i18n'; import { UnsavedFieldChange } from '@kbn/management-settings-types'; @@ -14,7 +14,7 @@ import { useServices } from './services'; export interface UseSaveParameters { /** All {@link FieldDefinition} in the form. */ - fields: Array>; + fields: FieldDefinition[]; /** The function to invoke for clearing all unsaved changes. */ clearChanges: () => void; } @@ -28,7 +28,7 @@ export interface UseSaveParameters { export const useSave = (params: UseSaveParameters) => { const { saveChanges, showError, showReloadPagePrompt } = useServices(); - return async (changes: Record>) => { + return async (changes: Record) => { if (isEmpty(changes)) { return; } diff --git a/packages/kbn-management/settings/field_definition/get_definitions.ts b/packages/kbn-management/settings/field_definition/get_definitions.ts index 83d604db294cf..e84c05b03f07d 100644 --- a/packages/kbn-management/settings/field_definition/get_definitions.ts +++ b/packages/kbn-management/settings/field_definition/get_definitions.ts @@ -7,7 +7,7 @@ */ import { IUiSettingsClient } from '@kbn/core-ui-settings-browser'; -import { FieldDefinition, SettingType, UiSettingMetadata } from '@kbn/management-settings-types'; +import { FieldDefinition, UiSettingMetadata } from '@kbn/management-settings-types'; import { getFieldDefinition } from './get_definition'; type SettingsClient = Pick; @@ -21,9 +21,9 @@ type SettingsClient = Pick; * @returns An array of {@link FieldDefinition} objects. */ export const getFieldDefinitions = ( - settings: Record>, + settings: Record, client: SettingsClient -): Array> => +): FieldDefinition[] => Object.entries(settings).map(([id, setting]) => getFieldDefinition({ id, diff --git a/packages/kbn-management/settings/field_definition/is/field_definition.ts b/packages/kbn-management/settings/field_definition/is/field_definition.ts index 52c6e83468177..364cb4940f0d2 100644 --- a/packages/kbn-management/settings/field_definition/is/field_definition.ts +++ b/packages/kbn-management/settings/field_definition/is/field_definition.ts @@ -26,13 +26,12 @@ import { MarkdownFieldDefinition, NumberFieldDefinition, SelectFieldDefinition, - SettingType, StringFieldDefinition, UndefinedFieldDefinition, } from '@kbn/management-settings-types'; /** Simplifed type for a {@link FieldDefinition} */ -type Definition = Pick, 'type'>; +type Definition = Pick; /** * Returns `true` if the given {@link FieldDefinition} is an {@link ArrayFieldDefinition}, diff --git a/packages/kbn-management/settings/field_definition/is/unsaved_change.ts b/packages/kbn-management/settings/field_definition/is/unsaved_change.ts index 6af63db17e36a..a88e0842bb095 100644 --- a/packages/kbn-management/settings/field_definition/is/unsaved_change.ts +++ b/packages/kbn-management/settings/field_definition/is/unsaved_change.ts @@ -27,12 +27,11 @@ import { SelectUnsavedFieldChange, StringUnsavedFieldChange, UndefinedUnsavedFieldChange, - SettingType, UnsavedFieldChange, } from '@kbn/management-settings-types'; /** Simplifed type for a {@link UnsavedFieldChange} */ -type Change = UnsavedFieldChange; +type Change = UnsavedFieldChange; /** * Returns `true` if the given {@link FieldUnsavedChange} is an {@link ArrayUnsavedFieldChange}, diff --git a/packages/kbn-management/settings/types/category.ts b/packages/kbn-management/settings/types/category.ts new file mode 100644 index 0000000000000..fe5d4910e426f --- /dev/null +++ b/packages/kbn-management/settings/types/category.ts @@ -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. + */ + +import { FieldDefinition } from './field_definition'; + +export interface CategorizedFields { + [category: string]: { + count: number; + fields: FieldDefinition[]; + }; +} diff --git a/packages/kbn-management/settings/types/field_definition.ts b/packages/kbn-management/settings/types/field_definition.ts index eb34df3b67868..2da9168b6401e 100644 --- a/packages/kbn-management/settings/types/field_definition.ts +++ b/packages/kbn-management/settings/types/field_definition.ts @@ -20,7 +20,10 @@ import { KnownTypeToValue, SettingType } from './setting_type'; * representing a UiSetting). * @public */ -export interface FieldDefinition | null> { +export interface FieldDefinition< + T extends SettingType = SettingType, + V = KnownTypeToValue | null +> { /** UX ARIA attributes derived from the setting. */ ariaAttributes: { /** The `aria-label` attribute for the field input. */ diff --git a/packages/kbn-management/settings/types/index.ts b/packages/kbn-management/settings/types/index.ts index 08cd1ae1df3bb..7f8afb8073a5c 100644 --- a/packages/kbn-management/settings/types/index.ts +++ b/packages/kbn-management/settings/types/index.ts @@ -51,6 +51,7 @@ export type { StringUnsavedFieldChange, UndefinedUnsavedFieldChange, UnsavedFieldChange, + UnsavedFieldChanges, } from './unsaved_change'; export type { @@ -64,6 +65,8 @@ export type { Value, } from './setting_type'; +export type { CategorizedFields } from './category'; + /** * A React `ref` that indicates an input can be reset using an * imperative handle. @@ -76,4 +79,16 @@ export type ResetInputRef = { * A function that is called when the value of a {@link FieldInput} changes. * @param change The {@link UnsavedFieldChange} passed to the handler. */ -export type OnChangeFn = (change?: UnsavedFieldChange) => void; +export type OnInputChangeFn = ( + change?: UnsavedFieldChange +) => void; + +/** + * An `onFieldChange` handler when a Field changes. + * @param id A unique id corresponding to the particular setting being changed. + * @param change The {@link UnsavedFieldChange} corresponding to any unsaved change to the field. + */ +export type OnFieldChangeFn = ( + id: string, + change?: UnsavedFieldChange +) => void; diff --git a/packages/kbn-management/settings/types/metadata.ts b/packages/kbn-management/settings/types/metadata.ts index c0a79549039de..48ff816230ce1 100644 --- a/packages/kbn-management/settings/types/metadata.ts +++ b/packages/kbn-management/settings/types/metadata.ts @@ -21,8 +21,10 @@ export type UiSetting = PublicUiSettingsParams & UserProvidedValues; * * @public */ -export interface UiSettingMetadata | null> - extends UiSetting { +export interface UiSettingMetadata< + T extends SettingType = SettingType, + V = KnownTypeToValue | null +> extends UiSetting { /** * The type of setting being represented. * @see{@link SettingType} diff --git a/packages/kbn-management/settings/types/setting_type.ts b/packages/kbn-management/settings/types/setting_type.ts index da297c6d94171..92db0744ac83e 100644 --- a/packages/kbn-management/settings/types/setting_type.ts +++ b/packages/kbn-management/settings/types/setting_type.ts @@ -63,7 +63,7 @@ export type Value = string | boolean | number | Array | undefin * given {@link SettingType}. * @public */ -export type KnownTypeToValue = +export type KnownTypeToValue = T extends 'color' | 'image' | 'json' | 'markdown' | 'select' | 'string' ? string : T extends 'boolean' ? boolean : T extends 'number' | 'bigint' ? number : diff --git a/packages/kbn-management/settings/types/unsaved_change.ts b/packages/kbn-management/settings/types/unsaved_change.ts index 3bd815187f70a..0b5a02e241931 100644 --- a/packages/kbn-management/settings/types/unsaved_change.ts +++ b/packages/kbn-management/settings/types/unsaved_change.ts @@ -13,7 +13,7 @@ import { KnownTypeToValue, SettingType } from './setting_type'; * yet been saved. * @public */ -export interface UnsavedFieldChange { +export interface UnsavedFieldChange { /** * The type of setting. * @see {@link SettingType} @@ -125,3 +125,5 @@ export type KnownTypeToUnsavedChange = T extends 'string' ? StringUnsavedFieldChange: T extends 'undefined' ? UndefinedUnsavedFieldChange : never; + +export type UnsavedFieldChanges = Record; diff --git a/packages/kbn-management/settings/utilities/category/categorize_fields.ts b/packages/kbn-management/settings/utilities/category/categorize_fields.ts new file mode 100644 index 0000000000000..a705d5f872266 --- /dev/null +++ b/packages/kbn-management/settings/utilities/category/categorize_fields.ts @@ -0,0 +1,22 @@ +/* + * 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 { CategorizedFields, FieldDefinition } from '@kbn/management-settings-types'; + +export const categorizeFields = (fields: FieldDefinition[]): CategorizedFields => { + // Group settings by category + return fields.reduce((grouped: CategorizedFields, field) => { + const category = field.categories[0]; + const group = grouped[category] || { count: 0, fields: [] }; + group.fields = [...group.fields, field]; + group.count = group.fields.length; + grouped[category] = group; + + return grouped; + }, {}); +}; diff --git a/packages/kbn-management/settings/utilities/category/get_category_name.ts b/packages/kbn-management/settings/utilities/category/get_category_name.ts new file mode 100644 index 0000000000000..8355f001f7bbd --- /dev/null +++ b/packages/kbn-management/settings/utilities/category/get_category_name.ts @@ -0,0 +1,54 @@ +/* + * 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 { i18n } from '@kbn/i18n'; + +const upperFirst = (str = '') => str.replace(/^./, (strng) => strng.toUpperCase()); + +const names: Record = { + general: i18n.translate('management.settings.categoryNames.generalLabel', { + defaultMessage: 'General', + }), + machineLearning: i18n.translate('management.settings.categoryNames.machineLearningLabel', { + defaultMessage: 'Machine Learning', + }), + observability: i18n.translate('management.settings.categoryNames.observabilityLabel', { + defaultMessage: 'Observability', + }), + timelion: i18n.translate('management.settings.categoryNames.timelionLabel', { + defaultMessage: 'Timelion', + }), + notifications: i18n.translate('management.settings.categoryNames.notificationsLabel', { + defaultMessage: 'Notifications', + }), + visualizations: i18n.translate('management.settings.categoryNames.visualizationsLabel', { + defaultMessage: 'Visualizations', + }), + discover: i18n.translate('management.settings.categoryNames.discoverLabel', { + defaultMessage: 'Discover', + }), + dashboard: i18n.translate('management.settings.categoryNames.dashboardLabel', { + defaultMessage: 'Dashboard', + }), + reporting: i18n.translate('management.settings.categoryNames.reportingLabel', { + defaultMessage: 'Reporting', + }), + search: i18n.translate('management.settings.categoryNames.searchLabel', { + defaultMessage: 'Search', + }), + securitySolution: i18n.translate('management.settings.categoryNames.securitySolutionLabel', { + defaultMessage: 'Security Solution', + }), + enterpriseSearch: i18n.translate('management.settings.categoryNames.enterpriseSearchLabel', { + defaultMessage: 'Enterprise Search', + }), +}; + +export function getCategoryName(category?: string) { + return category ? names[category] || upperFirst(category) : ''; +} diff --git a/packages/kbn-management/settings/utilities/category/index.ts b/packages/kbn-management/settings/utilities/category/index.ts new file mode 100644 index 0000000000000..c562a888e0cbe --- /dev/null +++ b/packages/kbn-management/settings/utilities/category/index.ts @@ -0,0 +1,10 @@ +/* + * 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 { categorizeFields } from './categorize_fields'; +export { getCategoryName } from './get_category_name'; diff --git a/packages/kbn-management/settings/utilities/field/use_update.ts b/packages/kbn-management/settings/utilities/field/use_update.ts index 4744d59dd90e7..c330ff25d7f4d 100644 --- a/packages/kbn-management/settings/utilities/field/use_update.ts +++ b/packages/kbn-management/settings/utilities/field/use_update.ts @@ -6,31 +6,33 @@ * Side Public License, v 1. */ -import type { FieldDefinition, SettingType, OnChangeFn } from '@kbn/management-settings-types'; +import type { FieldDefinition, SettingType, OnInputChangeFn } from '@kbn/management-settings-types'; import { hasUnsavedChange } from './has_unsaved_change'; export interface UseUpdateParameters { - /** The {@link OnChangeFn} to invoke. */ - onChange: OnChangeFn; + /** The {@link OnInputChangeFn} to invoke. */ + onInputChange: OnInputChangeFn; /** The {@link FieldDefinition} to use to create an update. */ field: Pick, 'defaultValue' | 'savedValue'>; } /** - * Hook to provide a standard {@link OnChangeFn} that will send an update to the + * Hook to provide a standard {@link OnInputChangeFn} that will send an update to the * field. * * @param params The {@link UseUpdateParameters} to use. - * @returns An {@link OnChangeFn} that will send an update to the field. + * @returns An {@link OnInputChangeFn} that will send an update to the field. */ -export const useUpdate = (params: UseUpdateParameters): OnChangeFn => { - const { onChange, field } = params; +export const useUpdate = ( + params: UseUpdateParameters +): OnInputChangeFn => { + const { onInputChange, field } = params; return (update) => { if (hasUnsavedChange(field, update)) { - onChange(update); + onInputChange(update); } else { - onChange(); + onInputChange(); } }; }; diff --git a/packages/kbn-management/settings/utilities/index.ts b/packages/kbn-management/settings/utilities/index.ts index 4e4523f66eb59..60cb17e47206f 100644 --- a/packages/kbn-management/settings/utilities/index.ts +++ b/packages/kbn-management/settings/utilities/index.ts @@ -7,6 +7,7 @@ */ export { isSettingDefaultValue, normalizeSettings } from './setting'; + export { getFieldInputValue, hasUnsavedChange, @@ -14,3 +15,5 @@ export { useUpdate, type UseUpdateParameters, } from './field'; + +export { categorizeFields, getCategoryName } from './category'; diff --git a/packages/kbn-management/settings/components/form/mocks/settings.ts b/packages/kbn-management/settings/utilities/mocks/settings.mock.ts similarity index 79% rename from packages/kbn-management/settings/components/form/mocks/settings.ts rename to packages/kbn-management/settings/utilities/mocks/settings.mock.ts index e22f24e4a1a09..ca2a2892836ce 100644 --- a/packages/kbn-management/settings/components/form/mocks/settings.ts +++ b/packages/kbn-management/settings/utilities/mocks/settings.mock.ts @@ -14,13 +14,15 @@ type Settings = { /** * A utility function returning a representative set of UiSettings. - * @param requirePageReload The value of the `requirePageReload` param for all settings. + * @param requiresPageReload The value of the `requirePageReload` param for all settings. */ -export const getSettingsMock = (requirePageReload: boolean = false): Settings => { +export const getSettingsMock = ( + requiresPageReload: boolean = false, + readonly: boolean = false +): Settings => { const defaults = { - requiresPageReload: requirePageReload, - readonly: false, - category: ['category'], + requiresPageReload, + readonly, }; return { @@ -29,7 +31,8 @@ export const getSettingsMock = (requirePageReload: boolean = false): Settings => name: 'array:test:setting', type: 'array', userValue: null, - value: ['example_value'], + value: ['foo', 'bar', 'baz'], + category: ['general', 'dashboard'], ...defaults, }, boolean: { @@ -38,6 +41,7 @@ export const getSettingsMock = (requirePageReload: boolean = false): Settings => type: 'boolean', userValue: null, value: true, + category: ['general', 'dashboard'], ...defaults, }, color: { @@ -46,6 +50,7 @@ export const getSettingsMock = (requirePageReload: boolean = false): Settings => type: 'color', userValue: null, value: '#FF00CC', + category: ['general', 'dashboard'], ...defaults, }, image: { @@ -54,6 +59,7 @@ export const getSettingsMock = (requirePageReload: boolean = false): Settings => type: 'image', userValue: null, value: '', + category: ['dashboard', 'discover'], ...defaults, }, number: { @@ -62,6 +68,7 @@ export const getSettingsMock = (requirePageReload: boolean = false): Settings => type: 'number', userValue: null, value: 1, + category: ['dashboard', 'discover'], ...defaults, }, json: { @@ -70,6 +77,7 @@ export const getSettingsMock = (requirePageReload: boolean = false): Settings => type: 'json', userValue: null, value: '{"foo": "bar"}', + category: ['dashboard', 'discover'], ...defaults, }, markdown: { @@ -78,6 +86,7 @@ export const getSettingsMock = (requirePageReload: boolean = false): Settings => type: 'markdown', userValue: null, value: '', + category: ['notifications', 'search'], ...defaults, }, select: { @@ -92,6 +101,7 @@ export const getSettingsMock = (requirePageReload: boolean = false): Settings => type: 'select', userValue: null, value: 'apple', + category: ['notifications', 'search'], ...defaults, }, string: { @@ -100,6 +110,7 @@ export const getSettingsMock = (requirePageReload: boolean = false): Settings => type: 'string', userValue: null, value: 'hello world', + category: ['notifications', 'search'], ...defaults, }, undefined: { @@ -108,6 +119,7 @@ export const getSettingsMock = (requirePageReload: boolean = false): Settings => type: 'undefined', userValue: null, value: undefined, + category: ['notifications', 'search'], ...defaults, }, }; diff --git a/packages/kbn-management/settings/utilities/setting/is_default_value.ts b/packages/kbn-management/settings/utilities/setting/is_default_value.ts index b59467b7410ac..9c6dbe0077521 100644 --- a/packages/kbn-management/settings/utilities/setting/is_default_value.ts +++ b/packages/kbn-management/settings/utilities/setting/is_default_value.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { SettingType, UiSettingMetadata, Value } from '@kbn/management-settings-types'; +import { UiSettingMetadata, Value } from '@kbn/management-settings-types'; import isEqual from 'lodash/isEqual'; /** @@ -17,7 +17,7 @@ import isEqual from 'lodash/isEqual'; * @returns True if the provided value is equal to the setting's default value, false otherwise. */ export const isSettingDefaultValue = ( - setting: UiSettingMetadata, + setting: UiSettingMetadata, userValue: Value = setting.userValue ) => { const { value } = setting; diff --git a/packages/kbn-management/settings/utilities/setting/normalize_settings.ts b/packages/kbn-management/settings/utilities/setting/normalize_settings.ts index fa247151c7751..e4083ab58c96b 100644 --- a/packages/kbn-management/settings/utilities/setting/normalize_settings.ts +++ b/packages/kbn-management/settings/utilities/setting/normalize_settings.ts @@ -92,10 +92,8 @@ const deriveValue = (type: SettingType, value: unknown): Value => { * may be missing the `type` or `value` properties. * @returns A mapped collection of normalized {@link UiSetting} objects. */ -export const normalizeSettings = ( - rawSettings: RawSettings -): Record> => { - const normalizedSettings: Record> = {}; +export const normalizeSettings = (rawSettings: RawSettings): Record => { + const normalizedSettings: Record = {}; const entries = Object.entries(rawSettings); diff --git a/packages/kbn-management/settings/utilities/tsconfig.json b/packages/kbn-management/settings/utilities/tsconfig.json index 1247d2cd18707..c97a0448689a3 100644 --- a/packages/kbn-management/settings/utilities/tsconfig.json +++ b/packages/kbn-management/settings/utilities/tsconfig.json @@ -17,5 +17,6 @@ ], "kbn_references": [ "@kbn/management-settings-types", + "@kbn/i18n", ] } diff --git a/packages/kbn-management/storybook/config/preview.ts b/packages/kbn-management/storybook/config/preview.ts index ee65b88614fb9..032af90b7dd5b 100644 --- a/packages/kbn-management/storybook/config/preview.ts +++ b/packages/kbn-management/storybook/config/preview.ts @@ -20,3 +20,19 @@ import jest from 'jest-mock'; /* @ts-expect-error TS doesn't see jest as a property of window, and I don't want to edit our global config. */ window.jest = jest; + +export const parameters = { + backgrounds: { + default: 'body', + values: [ + { + name: 'body', + value: '##f7f8fc', + }, + { + name: 'ghost', + value: '#fff', + }, + ], + }, +}; diff --git a/tsconfig.base.json b/tsconfig.base.json index bb2aec9d5819f..02071396e272f 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -962,6 +962,8 @@ "@kbn/management-cards-navigation/*": ["packages/kbn-management/cards_navigation/*"], "@kbn/management-plugin": ["src/plugins/management"], "@kbn/management-plugin/*": ["src/plugins/management/*"], + "@kbn/management-settings-components-field-category": ["packages/kbn-management/settings/components/field_category"], + "@kbn/management-settings-components-field-category/*": ["packages/kbn-management/settings/components/field_category/*"], "@kbn/management-settings-components-field-input": ["packages/kbn-management/settings/components/field_input"], "@kbn/management-settings-components-field-input/*": ["packages/kbn-management/settings/components/field_input/*"], "@kbn/management-settings-components-field-row": ["packages/kbn-management/settings/components/field_row"], diff --git a/yarn.lock b/yarn.lock index 9c52f8dd23ae4..55ccb83905494 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4867,6 +4867,10 @@ version "0.0.0" uid "" +"@kbn/management-settings-components-field-category@link:packages/kbn-management/settings/components/field_category": + version "0.0.0" + uid "" + "@kbn/management-settings-components-field-input@link:packages/kbn-management/settings/components/field_input": version "0.0.0" uid "" From 4221e79ff9be547b84aa06872071f604778dbf70 Mon Sep 17 00:00:00 2001 From: Shahzad Date: Thu, 28 Sep 2023 19:24:42 +0200 Subject: [PATCH 41/61] [Uptime] Filter out run once documents (#166704) --- .../common/requests/get_certs_request_body.ts | 3 + .../common/requests/get_certs_request_body.ts | 3 + .../uptime/server/legacy_uptime/lib/lib.ts | 2 +- .../get_monitor_duration.test.ts.snap | 14 + .../lib/requests/get_certs.test.ts | 14 + .../lib/requests/get_latest_monitor.test.ts | 9 + .../lib/requests/get_latest_monitor.ts | 7 +- .../requests/get_monitor_availability.test.ts | 45 ++ .../lib/requests/get_monitor_availability.ts | 11 +- .../lib/requests/get_monitor_duration.ts | 6 + .../lib/requests/get_monitor_locations.ts | 11 +- .../lib/requests/get_monitor_status.test.ts | 45 ++ .../lib/requests/get_monitor_status.ts | 11 +- .../lib/requests/get_ping_histogram.ts | 15 +- .../lib/requests/get_pings.test.ts | 202 +++----- .../legacy_uptime/lib/requests/get_pings.ts | 44 +- .../api_integration/apis/uptime/constants.ts | 4 +- .../apis/uptime/get_all_pings.ts | 21 +- .../monitor_states_real_data.snap | 480 +++++++++--------- .../uptime/rest/monitor_states_real_data.ts | 2 +- 20 files changed, 501 insertions(+), 448 deletions(-) diff --git a/x-pack/plugins/synthetics/common/requests/get_certs_request_body.ts b/x-pack/plugins/synthetics/common/requests/get_certs_request_body.ts index 4b0e92a6b9959..f14137e4f77b3 100644 --- a/x-pack/plugins/synthetics/common/requests/get_certs_request_body.ts +++ b/x-pack/plugins/synthetics/common/requests/get_certs_request_body.ts @@ -7,6 +7,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import DateMath from '@kbn/datemath'; +import { EXCLUDE_RUN_ONCE_FILTER, SUMMARY_FILTER } from '../constants/client_defaults'; import type { CertificatesResults } from '../../server/queries/get_certs'; import { CertResult, GetCertsParams, Ping } from '../runtime_types'; import { createEsQuery } from '../utils/es_search'; @@ -79,6 +80,8 @@ export const getCertsRequestBody = ({ } : {}), filter: [ + SUMMARY_FILTER, + EXCLUDE_RUN_ONCE_FILTER, ...(filters ? [filters] : []), ...(monitorIds && monitorIds.length > 0 ? [{ terms: { 'monitor.id': monitorIds } }] diff --git a/x-pack/plugins/uptime/common/requests/get_certs_request_body.ts b/x-pack/plugins/uptime/common/requests/get_certs_request_body.ts index 7a57f8ab13d41..84b65d9d54915 100644 --- a/x-pack/plugins/uptime/common/requests/get_certs_request_body.ts +++ b/x-pack/plugins/uptime/common/requests/get_certs_request_body.ts @@ -7,6 +7,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import DateMath from '@kbn/datemath'; +import { EXCLUDE_RUN_ONCE_FILTER, SUMMARY_FILTER } from '../constants/client_defaults'; import { CertResult, GetCertsParams, Ping } from '../runtime_types'; import { createEsQuery } from '../utils/es_search'; @@ -79,6 +80,8 @@ export const getCertsRequestBody = ({ } : {}), filter: [ + SUMMARY_FILTER, + EXCLUDE_RUN_ONCE_FILTER, ...(filters ? [filters] : []), ...(monitorIds && monitorIds.length > 0 ? [{ terms: { 'monitor.id': monitorIds } }] diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/lib.ts b/x-pack/plugins/uptime/server/legacy_uptime/lib/lib.ts index ae5ceca74fdd1..15f2530667d7d 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/lib.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/lib.ts @@ -185,7 +185,7 @@ export class UptimeEsClient { const showInspectData = (isInspectorEnabled || this.isDev) && path !== API_URLS.DYNAMIC_SETTINGS; - if (showInspectData) { + if (showInspectData && this.inspectableEsQueries.length > 0) { return { _inspect: this.inspectableEsQueries }; } return {}; diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_duration.test.ts.snap b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_duration.test.ts.snap index 0570802954511..eb8499391abc5 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_duration.test.ts.snap +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_duration.test.ts.snap @@ -30,6 +30,20 @@ Array [ "query": Object { "bool": Object { "filter": Array [ + Object { + "exists": Object { + "field": "summary", + }, + }, + Object { + "bool": Object { + "must_not": Object { + "exists": Object { + "field": "run_once", + }, + }, + }, + }, Object { "range": Object { "@timestamp": Object { diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_certs.test.ts b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_certs.test.ts index f9523c09e43a1..fe6ed1fc5f4f8 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_certs.test.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_certs.test.ts @@ -184,6 +184,20 @@ describe('getCerts', () => { "query": Object { "bool": Object { "filter": Array [ + Object { + "exists": Object { + "field": "summary", + }, + }, + Object { + "bool": Object { + "must_not": Object { + "exists": Object { + "field": "run_once", + }, + }, + }, + }, Object { "exists": Object { "field": "tls.server.hash.sha256", diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_latest_monitor.test.ts b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_latest_monitor.test.ts index f276384a86c74..8070e5142516d 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_latest_monitor.test.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_latest_monitor.test.ts @@ -24,6 +24,15 @@ describe('getLatestMonitor', () => { field: 'summary', }, }, + { + bool: { + must_not: { + exists: { + field: 'run_once', + }, + }, + }, + }, { range: { '@timestamp': { diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_latest_monitor.ts b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_latest_monitor.ts index b560d64be3274..a4e69121887d1 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_latest_monitor.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_latest_monitor.ts @@ -6,6 +6,10 @@ */ import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { + EXCLUDE_RUN_ONCE_FILTER, + SUMMARY_FILTER, +} from '../../../../common/constants/client_defaults'; import { UMElasticsearchQueryFn } from '../adapters'; import { Ping } from '../../../../common/runtime_types'; @@ -34,7 +38,8 @@ export const getLatestMonitor: UMElasticsearchQueryFn { "field": "summary", }, }, + Object { + "bool": Object { + "must_not": Object { + "exists": Object { + "field": "run_once", + }, + }, + }, + }, Object { "range": Object { "@timestamp": Object { @@ -384,6 +393,15 @@ describe('monitor availability', () => { "field": "summary", }, }, + Object { + "bool": Object { + "must_not": Object { + "exists": Object { + "field": "run_once", + }, + }, + }, + }, Object { "range": Object { "@timestamp": Object { @@ -710,6 +728,15 @@ describe('monitor availability', () => { "field": "summary", }, }, + Object { + "bool": Object { + "must_not": Object { + "exists": Object { + "field": "run_once", + }, + }, + }, + }, Object { "range": Object { "@timestamp": Object { @@ -813,6 +840,15 @@ describe('monitor availability', () => { "field": "summary", }, }, + Object { + "bool": Object { + "must_not": Object { + "exists": Object { + "field": "run_once", + }, + }, + }, + }, Object { "range": Object { "@timestamp": Object { @@ -940,6 +976,15 @@ describe('monitor availability', () => { "field": "summary", }, }, + Object { + "bool": Object { + "must_not": Object { + "exists": Object { + "field": "run_once", + }, + }, + }, + }, Object { "range": Object { "@timestamp": Object { diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_availability.ts b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_availability.ts index 93816938dc887..2fde5666a44df 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_availability.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_availability.ts @@ -5,6 +5,10 @@ * 2.0. */ +import { + EXCLUDE_RUN_ONCE_FILTER, + SUMMARY_FILTER, +} from '../../../../common/constants/client_defaults'; import { UMElasticsearchQueryFn } from '../adapters'; import { GetMonitorAvailabilityParams, Ping } from '../../../../common/runtime_types'; import { asMutableArray } from '../../../../common/utils/as_mutable_array'; @@ -62,11 +66,8 @@ export const getMonitorAvailability: UMElasticsearchQueryFn< query: { bool: { filter: [ - { - exists: { - field: 'summary', - }, - }, + SUMMARY_FILTER, + EXCLUDE_RUN_ONCE_FILTER, { range: { '@timestamp': { diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_duration.ts b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_duration.ts index a5bc973308381..cb0ab17f656fc 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_duration.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_duration.ts @@ -6,6 +6,10 @@ */ import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { + EXCLUDE_RUN_ONCE_FILTER, + SUMMARY_FILTER, +} from '../../../../common/constants/client_defaults'; import { UMElasticsearchQueryFn } from '../adapters'; import { LocationDurationLine, MonitorDurationResult } from '../../../../common/types'; import { QUERY, UNNAMED_LOCATION } from '../../../../common/constants'; @@ -30,6 +34,8 @@ export const getMonitorDurationChart: UMElasticsearchQueryFn< query: { bool: { filter: [ + SUMMARY_FILTER, + EXCLUDE_RUN_ONCE_FILTER, { range: { '@timestamp': { gte: dateStart, lte: dateEnd } } }, { term: { 'monitor.id': monitorId } }, { range: { 'monitor.duration.us': { gt: 0 } } }, diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_locations.ts b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_locations.ts index bb06a3680b7a6..659eec8bb375a 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_locations.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_locations.ts @@ -5,6 +5,10 @@ * 2.0. */ +import { + EXCLUDE_RUN_ONCE_FILTER, + SUMMARY_FILTER, +} from '../../../../common/constants/client_defaults'; import { UMElasticsearchQueryFn } from '../adapters'; import { MonitorLocations, MonitorLocation } from '../../../../common/runtime_types'; import { UNNAMED_LOCATION } from '../../../../common/constants'; @@ -43,11 +47,8 @@ export const getMonitorLocations: UMElasticsearchQueryFn< 'monitor.id': monitorId, }, }, - { - exists: { - field: 'summary', - }, - }, + SUMMARY_FILTER, + EXCLUDE_RUN_ONCE_FILTER, { range: { '@timestamp': { diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_status.test.ts b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_status.test.ts index 1bb37fbb6cf9e..2ceda7dc03ace 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_status.test.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_status.test.ts @@ -150,6 +150,15 @@ describe('getMonitorStatus', () => { "field": "summary", }, }, + Object { + "bool": Object { + "must_not": Object { + "exists": Object { + "field": "run_once", + }, + }, + }, + }, Object { "range": Object { "summary.down": Object { @@ -291,6 +300,15 @@ describe('getMonitorStatus', () => { "field": "summary", }, }, + Object { + "bool": Object { + "must_not": Object { + "exists": Object { + "field": "run_once", + }, + }, + }, + }, Object { "range": Object { "summary.down": Object { @@ -469,6 +487,15 @@ describe('getMonitorStatus', () => { "field": "summary", }, }, + Object { + "bool": Object { + "must_not": Object { + "exists": Object { + "field": "run_once", + }, + }, + }, + }, Object { "range": Object { "summary.down": Object { @@ -640,6 +667,15 @@ describe('getMonitorStatus', () => { "field": "summary", }, }, + Object { + "bool": Object { + "must_not": Object { + "exists": Object { + "field": "run_once", + }, + }, + }, + }, Object { "range": Object { "summary.down": Object { @@ -786,6 +822,15 @@ describe('getMonitorStatus', () => { "field": "summary", }, }, + Object { + "bool": Object { + "must_not": Object { + "exists": Object { + "field": "run_once", + }, + }, + }, + }, Object { "range": Object { "summary.down": Object { diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_status.ts b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_status.ts index 93d03029ee5a4..1c99d1a6dd022 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_status.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_status.ts @@ -9,6 +9,10 @@ import { JsonObject } from '@kbn/utility-types'; import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { PromiseType } from 'utility-types'; import { formatDurationFromTimeUnitChar, TimeUnitChar } from '@kbn/observability-plugin/common'; +import { + EXCLUDE_RUN_ONCE_FILTER, + SUMMARY_FILTER, +} from '../../../../common/constants/client_defaults'; import { asMutableArray } from '../../../../common/utils/as_mutable_array'; import { UMElasticsearchQueryFn } from '../adapters'; import { Ping } from '../../../../common/runtime_types/ping'; @@ -91,11 +95,8 @@ const executeQueryParams = async ({ query: { bool: { filter: [ - { - exists: { - field: 'summary', - }, - }, + SUMMARY_FILTER, + EXCLUDE_RUN_ONCE_FILTER, { range: { 'summary.down': { diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_ping_histogram.ts b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_ping_histogram.ts index 339e7cc661aa3..a8dcb9e8adc4e 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_ping_histogram.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_ping_histogram.ts @@ -12,7 +12,10 @@ import { QUERY } from '../../../../common/constants'; import { UMElasticsearchQueryFn } from '../adapters/framework'; import { createEsQuery } from '../../../../common/utils/es_search'; import { getHistogramInterval } from '../../../../common/lib/get_histogram_interval'; -import { EXCLUDE_RUN_ONCE_FILTER } from '../../../../common/constants/client_defaults'; +import { + EXCLUDE_RUN_ONCE_FILTER, + SUMMARY_FILTER, +} from '../../../../common/constants/client_defaults'; export const getPingHistogram: UMElasticsearchQueryFn< GetPingHistogramParams, @@ -47,15 +50,7 @@ export const getPingHistogram: UMElasticsearchQueryFn< body: { query: { bool: { - filter: [ - ...filter, - { - exists: { - field: 'summary', - }, - }, - EXCLUDE_RUN_ONCE_FILTER, - ], + filter: [...filter, SUMMARY_FILTER, EXCLUDE_RUN_ONCE_FILTER], }, }, size: 0, diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_pings.test.ts b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_pings.test.ts index 65735be5e5e64..eac84470ca190 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_pings.test.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_pings.test.ts @@ -130,35 +130,25 @@ describe('getAll', () => { "bool": Object { "filter": Array [ Object { - "range": Object { - "@timestamp": Object { - "gte": "now-1h", - "lte": "now", - }, + "exists": Object { + "field": "summary", }, }, - ], - "must_not": Array [ Object { "bool": Object { - "filter": Array [ - Object { - "term": Object { - "monitor.type": "browser", - }, + "must_not": Object { + "exists": Object { + "field": "run_once", }, - Object { - "bool": Object { - "must_not": Array [ - Object { - "exists": Object { - "field": "summary", - }, - }, - ], - }, - }, - ], + }, + }, + }, + Object { + "range": Object { + "@timestamp": Object { + "gte": "now-1h", + "lte": "now", + }, }, }, ], @@ -202,35 +192,25 @@ describe('getAll', () => { "bool": Object { "filter": Array [ Object { - "range": Object { - "@timestamp": Object { - "gte": "now-1h", - "lte": "now", - }, + "exists": Object { + "field": "summary", }, }, - ], - "must_not": Array [ Object { "bool": Object { - "filter": Array [ - Object { - "term": Object { - "monitor.type": "browser", - }, - }, - Object { - "bool": Object { - "must_not": Array [ - Object { - "exists": Object { - "field": "summary", - }, - }, - ], - }, + "must_not": Object { + "exists": Object { + "field": "run_once", }, - ], + }, + }, + }, + Object { + "range": Object { + "@timestamp": Object { + "gte": "now-1h", + "lte": "now", + }, }, }, ], @@ -274,35 +254,25 @@ describe('getAll', () => { "bool": Object { "filter": Array [ Object { - "range": Object { - "@timestamp": Object { - "gte": "now-1h", - "lte": "now", - }, + "exists": Object { + "field": "summary", }, }, - ], - "must_not": Array [ Object { "bool": Object { - "filter": Array [ - Object { - "term": Object { - "monitor.type": "browser", - }, - }, - Object { - "bool": Object { - "must_not": Array [ - Object { - "exists": Object { - "field": "summary", - }, - }, - ], - }, + "must_not": Object { + "exists": Object { + "field": "run_once", }, - ], + }, + }, + }, + Object { + "range": Object { + "@timestamp": Object { + "gte": "now-1h", + "lte": "now", + }, }, }, ], @@ -345,6 +315,20 @@ describe('getAll', () => { "query": Object { "bool": Object { "filter": Array [ + Object { + "exists": Object { + "field": "summary", + }, + }, + Object { + "bool": Object { + "must_not": Object { + "exists": Object { + "field": "run_once", + }, + }, + }, + }, Object { "range": Object { "@timestamp": Object { @@ -359,30 +343,6 @@ describe('getAll', () => { }, }, ], - "must_not": Array [ - Object { - "bool": Object { - "filter": Array [ - Object { - "term": Object { - "monitor.type": "browser", - }, - }, - Object { - "bool": Object { - "must_not": Array [ - Object { - "exists": Object { - "field": "summary", - }, - }, - ], - }, - }, - ], - }, - }, - ], }, }, "size": 25, @@ -420,15 +380,11 @@ describe('getAll', () => { expect(mockEsClient.search.mock.calls[0][0].body.query.bool.filter[1]).toMatchInlineSnapshot(` Object { "bool": Object { - "must_not": Array [ - Object { - "terms": Object { - "observer.geo.name": Array [ - "fairbanks", - ], - }, + "must_not": Object { + "exists": Object { + "field": "run_once", }, - ], + }, }, } `); @@ -467,6 +423,20 @@ describe('getAll', () => { "query": Object { "bool": Object { "filter": Array [ + Object { + "exists": Object { + "field": "summary", + }, + }, + Object { + "bool": Object { + "must_not": Object { + "exists": Object { + "field": "run_once", + }, + }, + }, + }, Object { "range": Object { "@timestamp": Object { @@ -481,30 +451,6 @@ describe('getAll', () => { }, }, ], - "must_not": Array [ - Object { - "bool": Object { - "filter": Array [ - Object { - "term": Object { - "monitor.type": "browser", - }, - }, - Object { - "bool": Object { - "must_not": Array [ - Object { - "exists": Object { - "field": "summary", - }, - }, - ], - }, - }, - ], - }, - }, - ], }, }, "size": 25, diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_pings.ts b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_pings.ts index 4cedef1eacee2..2e94992b0d7f0 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_pings.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_pings.ts @@ -6,6 +6,10 @@ */ import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { + EXCLUDE_RUN_ONCE_FILTER, + SUMMARY_FILTER, +} from '../../../../common/constants/client_defaults'; import { UMElasticsearchQueryFn } from '../adapters/framework'; import { GetPingsParams, @@ -16,43 +20,6 @@ import { const DEFAULT_PAGE_SIZE = 25; -/** - * This branch of filtering is used for monitors of type `browser`. This monitor - * type represents an unbounded set of steps, with each `check_group` representing - * a distinct journey. The document containing the `summary` field is indexed last, and - * contains the data necessary for querying a journey. - * - * Because of this, when querying for "pings", it is important that we treat `browser` summary - * checks as the "ping" we want. Without this filtering, we will receive >= N pings for a journey - * of N steps, because an individual step may also contain multiple documents. - */ -const REMOVE_NON_SUMMARY_BROWSER_CHECKS = { - must_not: [ - { - bool: { - filter: [ - { - term: { - 'monitor.type': 'browser', - }, - }, - { - bool: { - must_not: [ - { - exists: { - field: 'summary', - }, - }, - ], - }, - }, - ], - }, - }, - ], -}; - function isStringArray(value: unknown): value is string[] { if (!Array.isArray(value)) return false; // are all array items strings @@ -79,11 +46,12 @@ export const getPings: UMElasticsearchQueryFn = a query: { bool: { filter: [ + SUMMARY_FILTER, + EXCLUDE_RUN_ONCE_FILTER, { range: { '@timestamp': { gte: from, lte: to } } }, ...(monitorId ? [{ term: { 'monitor.id': monitorId } }] : []), ...(status ? [{ term: { 'monitor.status': status } }] : []), ] as QueryDslQueryContainer[], - ...REMOVE_NON_SUMMARY_BROWSER_CHECKS, }, }, sort: [{ '@timestamp': { order: (sort ?? 'desc') as 'asc' | 'desc' } }], diff --git a/x-pack/test/api_integration/apis/uptime/constants.ts b/x-pack/test/api_integration/apis/uptime/constants.ts index 89fa3657848ab..2ec80d8d7ed76 100644 --- a/x-pack/test/api_integration/apis/uptime/constants.ts +++ b/x-pack/test/api_integration/apis/uptime/constants.ts @@ -7,5 +7,5 @@ import moment from 'moment'; -export const PINGS_DATE_RANGE_START = moment('2018-10-30T00:00:23.889Z').valueOf(); -export const PINGS_DATE_RANGE_END = moment('2018-10-31T00:00:00.889Z').valueOf(); +export const PINGS_DATE_RANGE_START = moment('2019-09-11T03:31:04.396Z').valueOf(); +export const PINGS_DATE_RANGE_END = moment('2020-10-31T00:00:00.889Z').valueOf(); diff --git a/x-pack/test/api_integration/apis/uptime/get_all_pings.ts b/x-pack/test/api_integration/apis/uptime/get_all_pings.ts index a7547d61992f2..4004fa1626eb1 100644 --- a/x-pack/test/api_integration/apis/uptime/get_all_pings.ts +++ b/x-pack/test/api_integration/apis/uptime/get_all_pings.ts @@ -16,7 +16,7 @@ export default function ({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); describe('get_all_pings', () => { - const archive = 'x-pack/test/functional/es_archives/uptime/pings'; + const archive = 'x-pack/test/functional/es_archives/uptime/full_heartbeat'; before('load heartbeat data', async () => await esArchiver.load(archive)); after('unload heartbeat data', async () => await esArchiver.unload(archive)); @@ -31,9 +31,10 @@ export default function ({ getService }: FtrProviderContext) { }) .expect(200); - expect(apiResponse.total).to.be(2); - expect(apiResponse.pings.length).to.be(2); - expect(apiResponse.pings[0].monitor.id).to.be('http@https://www.github.com/'); + expect(apiResponse.total).to.be(1931); + expect(apiResponse.pings.length).to.be(25); + expect(apiResponse.pings[0].monitor.id).to.be('0074-up'); + expect(apiResponse.pings[0].url.full).to.be('http://localhost:5678/pattern?r=200x1'); }); it('should sort pings according to timestamp', async () => { @@ -46,10 +47,10 @@ export default function ({ getService }: FtrProviderContext) { }) .expect(200); - expect(apiResponse.total).to.be(2); - expect(apiResponse.pings.length).to.be(2); - expect(apiResponse.pings[0]['@timestamp']).to.be('2018-10-30T14:49:23.889Z'); - expect(apiResponse.pings[1]['@timestamp']).to.be('2018-10-30T18:51:56.792Z'); + expect(apiResponse.total).to.be(1931); + expect(apiResponse.pings.length).to.be(25); + expect(apiResponse.pings[0]['@timestamp']).to.be('2019-09-11T03:31:04.396Z'); + expect(apiResponse.pings[1]['@timestamp']).to.be('2019-09-11T03:31:04.396Z'); }); it('should return results of n length', async () => { @@ -63,9 +64,9 @@ export default function ({ getService }: FtrProviderContext) { }) .expect(200); - expect(apiResponse.total).to.be(2); + expect(apiResponse.total).to.be(1931); expect(apiResponse.pings.length).to.be(1); - expect(apiResponse.pings[0].monitor.id).to.be('http@https://www.github.com/'); + expect(apiResponse.pings[0].monitor.id).to.be('0074-up'); }); it('should miss pings outside of date range', async () => { diff --git a/x-pack/test/api_integration/apis/uptime/rest/__snapshots__/monitor_states_real_data.snap b/x-pack/test/api_integration/apis/uptime/rest/__snapshots__/monitor_states_real_data.snap index 5bdccdcbb0c49..5429132fc346f 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/__snapshots__/monitor_states_real_data.snap +++ b/x-pack/test/api_integration/apis/uptime/rest/__snapshots__/monitor_states_real_data.snap @@ -1,280 +1,276 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`uptime uptime REST endpoints with real-world data monitor states endpoint will fetch monitor state data for the given down filters 1`] = ` -Object { - "nextPagePagination": "{\\"cursorDirection\\":\\"AFTER\\",\\"sortOrder\\":\\"ASC\\",\\"cursorKey\\":{\\"monitor_id\\":\\"0020-down\\"}}", - "prevPagePagination": null, - "summaries": Array [ - Object { - "monitor_id": "0010-down", - "state": Object { - "error": Object { - "message": "400 Bad Request", - "type": "validate", +Array [ + Object { + "monitor_id": "0010-down", + "state": Object { + "error": Object { + "message": "400 Bad Request", + "type": "validate", + }, + "monitor": Object { + "checkGroup": "d76f07d1-d445-11e9-88e3-3e80641b9c71", + "duration": Object { + "us": 37926, }, - "monitor": Object { - "checkGroup": "d76f07d1-d445-11e9-88e3-3e80641b9c71", - "duration": Object { - "us": 37926, - }, - "name": "", - "type": "http", + "name": "", + "type": "http", + }, + "observer": Object { + "geo": Object { + "name": Array [ + "mpls", + ], }, - "observer": Object { - "geo": Object { - "name": Array [ - "mpls", - ], + }, + "summary": Object { + "down": 1, + "status": "down", + "up": 0, + }, + "summaryPings": Array [ + Object { + "@timestamp": "2019-09-11T03:40:34.371Z", + "agent": Object { + "ephemeral_id": "412a92a8-2142-4b1a-a7a2-1afd32e12f85", + "hostname": "avc-x1x", + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4", + "type": "heartbeat", + "version": "8.0.0", }, - }, - "summary": Object { - "down": 1, - "status": "down", - "up": 0, - }, - "summaryPings": Array [ - Object { - "@timestamp": "2019-09-11T03:40:34.371Z", - "agent": Object { - "ephemeral_id": "412a92a8-2142-4b1a-a7a2-1afd32e12f85", - "hostname": "avc-x1x", - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4", - "type": "heartbeat", - "version": "8.0.0", - }, - "docId": "rZtoHm0B0I9WX_CznN_V", - "ecs": Object { - "version": "1.1.0", - }, - "error": Object { - "message": "400 Bad Request", - "type": "validate", - }, - "event": Object { - "dataset": "uptime", - }, - "host": Object { - "name": "avc-x1x", + "docId": "rZtoHm0B0I9WX_CznN_V", + "ecs": Object { + "version": "1.1.0", + }, + "error": Object { + "message": "400 Bad Request", + "type": "validate", + }, + "event": Object { + "dataset": "uptime", + }, + "host": Object { + "name": "avc-x1x", + }, + "http": Object { + "response": Object { + "body": Object { + "bytes": 3, + "content": "400", + "hash": "26d228663f13a88592a12d16cf9587caab0388b262d6d9f126ed62f9333aca94", + }, + "status_code": 400, }, - "http": Object { - "response": Object { - "body": Object { - "bytes": 3, - "content": "400", - "hash": "26d228663f13a88592a12d16cf9587caab0388b262d6d9f126ed62f9333aca94", - }, - "status_code": 400, + "rtt": Object { + "content": Object { + "us": 41, }, - "rtt": Object { - "content": Object { - "us": 41, - }, - "response_header": Object { - "us": 36777, - }, - "total": Object { - "us": 37821, - }, - "validate": Object { - "us": 36818, - }, - "write_request": Object { - "us": 53, - }, + "response_header": Object { + "us": 36777, }, - }, - "monitor": Object { - "check_group": "d76f07d1-d445-11e9-88e3-3e80641b9c71", - "duration": Object { - "us": 37926, + "total": Object { + "us": 37821, }, - "id": "0010-down", - "ip": "127.0.0.1", - "name": "", - "status": "down", - "type": "http", - }, - "observer": Object { - "geo": Object { - "location": "37.926868, -78.024902", - "name": "mpls", + "validate": Object { + "us": 36818, }, - "hostname": "avc-x1x", - }, - "resolve": Object { - "ip": "127.0.0.1", - "rtt": Object { - "us": 56, + "write_request": Object { + "us": 53, }, }, - "summary": Object { - "down": 1, - "up": 0, + }, + "monitor": Object { + "check_group": "d76f07d1-d445-11e9-88e3-3e80641b9c71", + "duration": Object { + "us": 37926, }, - "tcp": Object { - "rtt": Object { - "connect": Object { - "us": 890, - }, - }, + "id": "0010-down", + "ip": "127.0.0.1", + "name": "", + "status": "down", + "type": "http", + }, + "observer": Object { + "geo": Object { + "location": "37.926868, -78.024902", + "name": "mpls", }, - "timestamp": "2019-09-11T03:40:34.371Z", - "url": Object { - "domain": "localhost", - "full": "http://localhost:5678/pattern?r=400x1", - "path": "/pattern", - "port": 5678, - "query": "r=400x1", - "scheme": "http", + "hostname": "avc-x1x", + }, + "resolve": Object { + "ip": "127.0.0.1", + "rtt": Object { + "us": 56, }, }, - ], - "timestamp": "2019-09-11T03:40:34.371Z", - "url": Object { - "domain": "localhost", - "full": "http://localhost:5678/pattern?r=400x1", - "path": "/pattern", - "port": 5678, - "query": "r=400x1", - "scheme": "http", + "summary": Object { + "down": 1, + "up": 0, + }, + "tcp": Object { + "rtt": Object { + "connect": Object { + "us": 890, + }, + }, + }, + "timestamp": "2019-09-11T03:40:34.371Z", + "url": Object { + "domain": "localhost", + "full": "http://localhost:5678/pattern?r=400x1", + "path": "/pattern", + "port": 5678, + "query": "r=400x1", + "scheme": "http", + }, }, + ], + "timestamp": "2019-09-11T03:40:34.371Z", + "url": Object { + "domain": "localhost", + "full": "http://localhost:5678/pattern?r=400x1", + "path": "/pattern", + "port": 5678, + "query": "r=400x1", + "scheme": "http", }, }, - Object { - "monitor_id": "0020-down", - "state": Object { - "error": Object { - "message": "400 Bad Request", - "type": "validate", + }, + Object { + "monitor_id": "0020-down", + "state": Object { + "error": Object { + "message": "400 Bad Request", + "type": "validate", + }, + "monitor": Object { + "checkGroup": "d7712ecb-d445-11e9-88e3-3e80641b9c71", + "duration": Object { + "us": 14900, }, - "monitor": Object { - "checkGroup": "d7712ecb-d445-11e9-88e3-3e80641b9c71", - "duration": Object { - "us": 14900, - }, - "name": "", - "type": "http", + "name": "", + "type": "http", + }, + "observer": Object { + "geo": Object { + "name": Array [ + "mpls", + ], }, - "observer": Object { - "geo": Object { - "name": Array [ - "mpls", - ], + }, + "summary": Object { + "down": 1, + "status": "down", + "up": 0, + }, + "summaryPings": Array [ + Object { + "@timestamp": "2019-09-11T03:40:34.372Z", + "agent": Object { + "ephemeral_id": "412a92a8-2142-4b1a-a7a2-1afd32e12f85", + "hostname": "avc-x1x", + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4", + "type": "heartbeat", + "version": "8.0.0", }, - }, - "summary": Object { - "down": 1, - "status": "down", - "up": 0, - }, - "summaryPings": Array [ - Object { - "@timestamp": "2019-09-11T03:40:34.372Z", - "agent": Object { - "ephemeral_id": "412a92a8-2142-4b1a-a7a2-1afd32e12f85", - "hostname": "avc-x1x", - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4", - "type": "heartbeat", - "version": "8.0.0", - }, - "docId": "X5toHm0B0I9WX_CznN-6", - "ecs": Object { - "version": "1.1.0", - }, - "error": Object { - "message": "400 Bad Request", - "type": "validate", - }, - "event": Object { - "dataset": "uptime", - }, - "host": Object { - "name": "avc-x1x", + "docId": "X5toHm0B0I9WX_CznN-6", + "ecs": Object { + "version": "1.1.0", + }, + "error": Object { + "message": "400 Bad Request", + "type": "validate", + }, + "event": Object { + "dataset": "uptime", + }, + "host": Object { + "name": "avc-x1x", + }, + "http": Object { + "response": Object { + "body": Object { + "bytes": 3, + "content": "400", + "hash": "26d228663f13a88592a12d16cf9587caab0388b262d6d9f126ed62f9333aca94", + }, + "status_code": 400, }, - "http": Object { - "response": Object { - "body": Object { - "bytes": 3, - "content": "400", - "hash": "26d228663f13a88592a12d16cf9587caab0388b262d6d9f126ed62f9333aca94", - }, - "status_code": 400, + "rtt": Object { + "content": Object { + "us": 54, }, - "rtt": Object { - "content": Object { - "us": 54, - }, - "response_header": Object { - "us": 180, - }, - "total": Object { - "us": 555, - }, - "validate": Object { - "us": 234, - }, - "write_request": Object { - "us": 63, - }, + "response_header": Object { + "us": 180, }, - }, - "monitor": Object { - "check_group": "d7712ecb-d445-11e9-88e3-3e80641b9c71", - "duration": Object { - "us": 14900, + "total": Object { + "us": 555, }, - "id": "0020-down", - "ip": "127.0.0.1", - "name": "", - "status": "down", - "type": "http", - }, - "observer": Object { - "geo": Object { - "location": "37.926868, -78.024902", - "name": "mpls", + "validate": Object { + "us": 234, }, - "hostname": "avc-x1x", - }, - "resolve": Object { - "ip": "127.0.0.1", - "rtt": Object { - "us": 14294, + "write_request": Object { + "us": 63, }, }, - "summary": Object { - "down": 1, - "up": 0, + }, + "monitor": Object { + "check_group": "d7712ecb-d445-11e9-88e3-3e80641b9c71", + "duration": Object { + "us": 14900, }, - "tcp": Object { - "rtt": Object { - "connect": Object { - "us": 105, - }, - }, + "id": "0020-down", + "ip": "127.0.0.1", + "name": "", + "status": "down", + "type": "http", + }, + "observer": Object { + "geo": Object { + "location": "37.926868, -78.024902", + "name": "mpls", }, - "timestamp": "2019-09-11T03:40:34.372Z", - "url": Object { - "domain": "localhost", - "full": "http://localhost:5678/pattern?r=400x1", - "path": "/pattern", - "port": 5678, - "query": "r=400x1", - "scheme": "http", + "hostname": "avc-x1x", + }, + "resolve": Object { + "ip": "127.0.0.1", + "rtt": Object { + "us": 14294, }, }, - ], - "timestamp": "2019-09-11T03:40:34.372Z", - "url": Object { - "domain": "localhost", - "full": "http://localhost:5678/pattern?r=400x1", - "path": "/pattern", - "port": 5678, - "query": "r=400x1", - "scheme": "http", + "summary": Object { + "down": 1, + "up": 0, + }, + "tcp": Object { + "rtt": Object { + "connect": Object { + "us": 105, + }, + }, + }, + "timestamp": "2019-09-11T03:40:34.372Z", + "url": Object { + "domain": "localhost", + "full": "http://localhost:5678/pattern?r=400x1", + "path": "/pattern", + "port": 5678, + "query": "r=400x1", + "scheme": "http", + }, }, + ], + "timestamp": "2019-09-11T03:40:34.372Z", + "url": Object { + "domain": "localhost", + "full": "http://localhost:5678/pattern?r=400x1", + "path": "/pattern", + "port": 5678, + "query": "r=400x1", + "scheme": "http", }, }, - ], -} + }, +] `; diff --git a/x-pack/test/api_integration/apis/uptime/rest/monitor_states_real_data.ts b/x-pack/test/api_integration/apis/uptime/rest/monitor_states_real_data.ts index 1f0e04a74db71..94ef6fdf034bb 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/monitor_states_real_data.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/monitor_states_real_data.ts @@ -85,7 +85,7 @@ export default function ({ getService }: FtrProviderContext) { `${API_URLS.MONITOR_LIST}?dateRangeStart=${from}&dateRangeEnd=${to}&statusFilter=${statusFilter}&pageSize=${size}` ); - expectSnapshot(body).toMatch(); + expectSnapshot(body.summaries).toMatch(); }); it('can navigate forward and backward using pagination', async () => { From d4defbd980616d895dd9a5c2b23b214f13a7dcec Mon Sep 17 00:00:00 2001 From: Philippe Oberti Date: Thu, 28 Sep 2023 12:35:40 -0500 Subject: [PATCH 42/61] Prevalence details paywall (#165435) --- .../components/prevalence_details.test.tsx | 37 +++++++++++++- .../left/components/prevalence_details.tsx | 51 +++++++++++++++---- .../public/flyout/left/components/test_ids.ts | 2 + 3 files changed, 78 insertions(+), 12 deletions(-) diff --git a/x-pack/plugins/security_solution/public/flyout/left/components/prevalence_details.test.tsx b/x-pack/plugins/security_solution/public/flyout/left/components/prevalence_details.test.tsx index b8f09506ef46b..a76fb83074451 100644 --- a/x-pack/plugins/security_solution/public/flyout/left/components/prevalence_details.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/left/components/prevalence_details.test.tsx @@ -18,6 +18,7 @@ import { PREVALENCE_DETAILS_UPSELL_TEST_ID, PREVALENCE_DETAILS_TABLE_USER_PREVALENCE_CELL_TEST_ID, PREVALENCE_DETAILS_TABLE_VALUE_CELL_TEST_ID, + PREVALENCE_DETAILS_TABLE_UPSELL_CELL_TEST_ID, } from './test_ids'; import { usePrevalence } from '../../shared/hooks/use_prevalence'; import { TestProviders } from '../../../common/mock'; @@ -54,6 +55,8 @@ const panelContextValue = { dataFormattedForFieldBrowser: [], } as unknown as LeftPanelContext; +const UPSELL_MESSAGE = 'Host and user prevalence are only available with a'; + const renderPrevalenceDetails = () => render( @@ -70,7 +73,7 @@ describe('PrevalenceDetails', () => { licenseServiceMock.isPlatinumPlus.mockReturnValue(true); }); - it('should render the table with all columns if license is platinum', () => { + it('should render the table with all data if license is platinum', () => { const field1 = 'field1'; const field2 = 'field2'; (usePrevalence as jest.Mock).mockReturnValue({ @@ -117,6 +120,38 @@ describe('PrevalenceDetails', () => { expect(queryByText(NO_DATA_MESSAGE)).not.toBeInTheDocument(); }); + it('should hide data in prevalence columns if license is not platinum', () => { + const field1 = 'field1'; + + licenseServiceMock.isPlatinumPlus.mockReturnValue(false); + (usePrevalence as jest.Mock).mockReturnValue({ + loading: false, + error: false, + data: [ + { + field: field1, + values: ['value1'], + alertCount: 1, + docCount: 1, + hostPrevalence: 0.05, + userPrevalence: 0.1, + }, + ], + }); + + const { getByTestId, getAllByTestId } = renderPrevalenceDetails(); + + expect(getByTestId(PREVALENCE_DETAILS_TABLE_TEST_ID)).toBeInTheDocument(); + expect(getByTestId(PREVALENCE_DETAILS_UPSELL_TEST_ID)).toHaveTextContent(UPSELL_MESSAGE); + expect(getAllByTestId(PREVALENCE_DETAILS_TABLE_UPSELL_CELL_TEST_ID).length).toEqual(2); + expect( + getByTestId(PREVALENCE_DETAILS_TABLE_HOST_PREVALENCE_CELL_TEST_ID) + ).not.toHaveTextContent('5%'); + expect( + getByTestId(PREVALENCE_DETAILS_TABLE_USER_PREVALENCE_CELL_TEST_ID) + ).not.toHaveTextContent('10%'); + }); + it('should render formatted numbers for the alert and document count columns', () => { (usePrevalence as jest.Mock).mockReturnValue({ loading: false, diff --git a/x-pack/plugins/security_solution/public/flyout/left/components/prevalence_details.tsx b/x-pack/plugins/security_solution/public/flyout/left/components/prevalence_details.tsx index 418e895dda3a2..bb92a793506b5 100644 --- a/x-pack/plugins/security_solution/public/flyout/left/components/prevalence_details.tsx +++ b/x-pack/plugins/security_solution/public/flyout/left/components/prevalence_details.tsx @@ -19,6 +19,7 @@ import { EuiSuperDatePicker, EuiText, EuiToolTip, + useEuiTheme, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { FormattedCount } from '../../../common/components/formatted_number'; @@ -36,6 +37,7 @@ import { PREVALENCE_DETAILS_DATE_PICKER_TEST_ID, PREVALENCE_DETAILS_TABLE_TEST_ID, PREVALENCE_DETAILS_UPSELL_TEST_ID, + PREVALENCE_DETAILS_TABLE_UPSELL_CELL_TEST_ID, } from './test_ids'; import { useLeftPanelContext } from '../context'; import { @@ -49,6 +51,19 @@ export const PREVALENCE_TAB_ID = 'prevalence-details'; const DEFAULT_FROM = 'now-30d'; const DEFAULT_TO = 'now'; +/** + * Component that renders a grey box to indicate the user doesn't have proper license to view the actual data + */ +export const LicenseProtectedCell: React.FC = () => { + const { euiTheme } = useEuiTheme(); + return ( +
+ ); +}; + interface PrevalenceDetailsRow extends PrevalenceData { /** * From datetime selected in the date picker to pass to timeline @@ -58,6 +73,10 @@ interface PrevalenceDetailsRow extends PrevalenceData { * To datetime selected in the date picker to pass to timeline */ to: string; + /** + * License to drive the rendering of the last 2 prevalence columns + */ + isPlatinumPlus: boolean; } const columns: Array> = [ @@ -196,7 +215,6 @@ const columns: Array> = [ width: '10%', }, { - field: 'hostPrevalence', name: ( > = [ ), 'data-test-subj': PREVALENCE_DETAILS_TABLE_HOST_PREVALENCE_CELL_TEST_ID, - render: (hostPrevalence: number) => ( - {`${Math.round(hostPrevalence * 100)}%`} + render: (data: PrevalenceDetailsRow) => ( + <> + {data.isPlatinumPlus ? ( + {`${Math.round(data.hostPrevalence * 100)}%`} + ) : ( + + )} + ), width: '10%', }, { - field: 'userPrevalence', name: ( > = [ ), 'data-test-subj': PREVALENCE_DETAILS_TABLE_USER_PREVALENCE_CELL_TEST_ID, - render: (userPrevalence: number) => ( - {`${Math.round(userPrevalence * 100)}%`} + render: (data: PrevalenceDetailsRow) => ( + <> + {data.isPlatinumPlus ? ( + {`${Math.round(data.userPrevalence * 100)}%`} + ) : ( + + )} + ), width: '10%', }, @@ -312,10 +341,10 @@ export const PrevalenceDetails: React.FC = () => { }, }); - // add timeRange to pass it down to timeline + // add timeRange to pass it down to timeline and license to drive the rendering of the last 2 prevalence columns const items = useMemo( - () => data.map((item) => ({ ...item, from: absoluteStart, to: absoluteEnd })), - [data, absoluteStart, absoluteEnd] + () => data.map((item) => ({ ...item, from: absoluteStart, to: absoluteEnd, isPlatinumPlus })), + [data, absoluteStart, absoluteEnd, isPlatinumPlus] ); const upsell = ( @@ -323,13 +352,13 @@ export const PrevalenceDetails: React.FC = () => { ), diff --git a/x-pack/plugins/security_solution/public/flyout/left/components/test_ids.ts b/x-pack/plugins/security_solution/public/flyout/left/components/test_ids.ts index 855f8379e3438..b3ab7dc341c7d 100644 --- a/x-pack/plugins/security_solution/public/flyout/left/components/test_ids.ts +++ b/x-pack/plugins/security_solution/public/flyout/left/components/test_ids.ts @@ -34,6 +34,8 @@ export const PREVALENCE_DETAILS_TABLE_HOST_PREVALENCE_CELL_TEST_ID = `${PREVALENCE_DETAILS_TABLE_TEST_ID}HostPrevalenceCell` as const; export const PREVALENCE_DETAILS_TABLE_USER_PREVALENCE_CELL_TEST_ID = `${PREVALENCE_DETAILS_TABLE_TEST_ID}UserPrevalenceCell` as const; +export const PREVALENCE_DETAILS_TABLE_UPSELL_CELL_TEST_ID = + `${PREVALENCE_DETAILS_TABLE_TEST_ID}UpsellCell` as const; /* Entities */ From fbccec8fddda1d7ab0175e697572ff6902baad18 Mon Sep 17 00:00:00 2001 From: Jatin Kathuria Date: Thu, 28 Sep 2023 20:20:47 +0200 Subject: [PATCH 43/61] [Security Solution] Discover-Timeline Integration saved search (#165596) This PR is next step completing discover timeline integration. All previous/nest steps have been defined here: https://github.com/elastic/security-team/issues/6677 ## Summary This PR implements the integration between timeline State v/s Discover State. The purpose of this PR is to add functionality related to the persistence of saved search which will always be linked to the timeline user is working in. Below diagram shows briefly how saved search is working with timeline. ```mermaid graph TD; DS(Discover State) -. user updates .-> SS(Saved Search); SS(Saved Search) -. updates savedSearchId .-> TS(Timeline State) ; TS(Timeline State) -. restores Saved Search to App state .->DS(Discover State); ``` Primarily, this PR implements below technical components: 1. `DiscoverInTimleineContext` : provides the ability across security solution to manipulate discover state. 2. `useDiscoverInTimelineActions`: acts as a helper to provide short-hand actions to manipulate discover state. For eg. `resetDiscoverAppState` or `restoreAppStateFromSavedSearch`. Here is the small demo video: https://github.com/elastic/kibana/assets/7485038/006465ba-19ce-4209-ac46-21dbb746508d --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Michael Olorunnisola --- .../current_mappings.json | 3 + .../group2/check_registered_types.test.ts | 2 +- .../discover_app_state_container.test.ts | 109 +++++++ .../services/discover_app_state_container.ts | 14 + .../main/services/discover_state.ts | 11 +- src/plugins/discover/public/mocks.tsx | 2 + .../common/api/timeline/model/api.ts | 2 + .../common/search_strategy/timeline/index.ts | 1 + .../common/types/timeline/saved_object.ts | 1 + .../common/types/timeline/store.ts | 2 + x-pack/plugins/security_solution/kibana.jsonc | 4 +- .../security_solution/public/app/app.tsx | 17 +- .../components/callouts/callout.test.tsx | 2 +- .../configurations/default/index.test.tsx | 2 +- .../use_discover_in_timeline_actions.tsx | 28 ++ .../discover_in_timeline/context.tsx | 19 ++ .../mocks/discover_in_timeline_provider.tsx | 39 +++ .../discover_in_timeline/provider.tsx | 38 +++ .../discover_in_timeline/translations.ts | 22 ++ .../use_discover_in_timeline_actions.test.tsx | 265 ++++++++++++++++ .../use_discover_in_timeline_actions.tsx | 235 ++++++++++++++ .../use_discover_in_timeline_context.tsx | 19 ++ ...elated_alerts_by_process_ancestry.test.tsx | 2 +- .../add_note_icon_item.test.tsx | 2 +- .../header_actions/pin_event_action.test.tsx | 2 +- .../components/local_storage/index.test.tsx | 2 +- .../components/search_bar/index.test.tsx | 2 +- .../timeline/use_init_timeline_url_param.ts | 1 + .../timeline/use_sync_timeline_url_param.ts | 5 +- .../hooks/use_resolve_conflict.test.tsx | 2 +- .../common/hooks/use_resolve_redirect.test.ts | 2 +- .../common/lib/kibana/kibana_react.mock.ts | 2 + .../public/common/mock/global_state.ts | 2 + .../public/common/mock/test_providers.tsx | 74 +++-- .../public/common/mock/timeline_results.ts | 3 + .../add_to_lists_table/index.test.tsx | 2 +- .../components/alerts_table/actions.test.tsx | 3 +- .../index.test.tsx | 2 +- .../rules/eql_query_bar/footer.test.tsx | 2 +- .../components/rules/query_bar/index.test.tsx | 2 +- .../rule_actions_overflow/index.test.tsx | 2 +- .../alerts/use_alerts_privileges.test.tsx | 2 +- .../alerts/use_cases_from_alerts.test.tsx | 2 +- .../alerts/use_signal_index.test.tsx | 2 +- .../chart_context_menu/index.test.tsx | 2 +- .../chart_panels/chart_select/helpers.test.ts | 2 +- .../exceptions_list_card/index.test.tsx | 2 +- .../network/pages/details/index.test.tsx | 2 +- .../components/analyzer_preview.test.tsx | 2 +- .../analyzer_preview_container.test.tsx | 2 +- .../right/components/session_preview.test.tsx | 2 +- .../session_preview_container.test.tsx | 2 +- .../plugins/security_solution/public/index.ts | 1 - .../overview/pages/data_quality.test.tsx | 2 +- .../components/open_timeline/helpers.ts | 4 + .../components/open_timeline/index.test.tsx | 4 +- .../timelines_table/common_columns.test.tsx | 24 +- .../timelines_table/common_columns.tsx | 2 +- .../renderers/reason_column_renderer.test.tsx | 2 +- .../discover_tab_content/__mocks__/index.tsx | 13 + .../discover_tab_content/index.test.tsx | 12 +- .../timeline/discover_tab_content/index.tsx | 196 +++++++++++- .../discover_tab_content/translations.ts | 14 + .../discover_tab_content/utils/index.test.ts | 89 ++++++ .../discover_tab_content/utils/index.ts | 43 +++ .../properties/new_template_timeline.test.tsx | 10 +- .../properties/use_create_timeline.tsx | 6 +- .../timeline/tabs_content/index.tsx | 2 +- .../public/timelines/containers/api.test.ts | 1 + .../timelines/store/timeline/actions.ts | 10 + .../timelines/store/timeline/defaults.ts | 2 + .../timelines/store/timeline/epic.test.ts | 2 + .../public/timelines/store/timeline/epic.ts | 4 + .../public/timelines/store/timeline/model.ts | 6 + .../timelines/store/timeline/reducer.test.ts | 4 + .../timelines/store/timeline/reducer.ts | 22 ++ .../plugins/security_solution/public/types.ts | 2 + .../convert_saved_object_to_savedtimeline.ts | 1 + .../saved_object_mappings/timelines.ts | 3 + .../plugins/security_solution/tsconfig.json | 1 + .../timelines/discover/discover_state.cy.ts | 4 +- .../discover_timeline_state_integration.cy.ts | 293 ++++++++++++++++++ .../screens/common/stack_management.ts | 21 ++ .../cypress/screens/discover.ts | 1 + .../cypress/screens/kibana_navigation.ts | 3 + .../cypress/screens/timeline.ts | 12 +- .../cypress/screens/timelines.ts | 4 +- .../cypress/tasks/discover.ts | 10 +- .../cypress/tasks/stack_management.ts | 14 + .../cypress/tasks/timeline.ts | 22 +- .../apps/endpoint/responder.ts | 1 + .../page_objects/timeline/index.ts | 2 +- .../services/timeline/index.ts | 2 + 93 files changed, 1730 insertions(+), 114 deletions(-) create mode 100644 x-pack/plugins/security_solution/public/common/components/discover_in_timeline/__mocks__/use_discover_in_timeline_actions.tsx create mode 100644 x-pack/plugins/security_solution/public/common/components/discover_in_timeline/context.tsx create mode 100644 x-pack/plugins/security_solution/public/common/components/discover_in_timeline/mocks/discover_in_timeline_provider.tsx create mode 100644 x-pack/plugins/security_solution/public/common/components/discover_in_timeline/provider.tsx create mode 100644 x-pack/plugins/security_solution/public/common/components/discover_in_timeline/translations.ts create mode 100644 x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_actions.test.tsx create mode 100644 x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_actions.tsx create mode 100644 x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_context.tsx create mode 100644 x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/__mocks__/index.tsx create mode 100644 x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/translations.ts create mode 100644 x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/utils/index.test.ts create mode 100644 x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/utils/index.ts create mode 100644 x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/discover/discover_timeline_state_integration.cy.ts create mode 100644 x-pack/test/security_solution_cypress/cypress/screens/common/stack_management.ts create mode 100644 x-pack/test/security_solution_cypress/cypress/tasks/stack_management.ts diff --git a/packages/kbn-check-mappings-update-cli/current_mappings.json b/packages/kbn-check-mappings-update-cli/current_mappings.json index 83168a1815859..d23a717c01e49 100644 --- a/packages/kbn-check-mappings-update-cli/current_mappings.json +++ b/packages/kbn-check-mappings-update-cli/current_mappings.json @@ -2933,6 +2933,9 @@ }, "updatedBy": { "type": "text" + }, + "savedSearchId": { + "type": "text" } } }, diff --git a/src/core/server/integration_tests/saved_objects/migrations/group2/check_registered_types.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group2/check_registered_types.test.ts index ac24ad4dc05fe..b624d4871a1b6 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group2/check_registered_types.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group2/check_registered_types.test.ts @@ -137,7 +137,7 @@ describe('checking migration metadata changes on all registered SO types', () => "security-rule": "07abb4d7e707d91675ec0495c73816394c7b521f", "security-solution-signals-migration": "9d99715fe5246f19de2273ba77debd2446c36bb1", "siem-detection-engine-rule-actions": "54f08e23887b20da7c805fab7c60bc67c428aff9", - "siem-ui-timeline": "820b5a7c478cd4d5ae9cd92ce0d05ac988fee69c", + "siem-ui-timeline": "2d9925f7286a9e947a008eff8e61118dadd8229b", "siem-ui-timeline-note": "0a32fb776907f596bedca292b8c646496ae9c57b", "siem-ui-timeline-pinned-event": "082daa3ce647b33873f6abccf340bdfa32057c8d", "slo": "2048ab6791df2e1ae0936f29c20765cb8d2fcfaa", diff --git a/src/plugins/discover/public/application/main/services/discover_app_state_container.test.ts b/src/plugins/discover/public/application/main/services/discover_app_state_container.test.ts index 80fb6c241b2f5..f93a9fd759da9 100644 --- a/src/plugins/discover/public/application/main/services/discover_app_state_container.test.ts +++ b/src/plugins/discover/public/application/main/services/discover_app_state_container.test.ts @@ -6,7 +6,10 @@ * Side Public License, v 1. */ +import { createSearchSourceMock } from '@kbn/data-plugin/public/mocks'; +import { dataViewMock } from '@kbn/discover-utils/src/__mocks__'; import { createKbnUrlStateStorage, withNotifyOnErrors } from '@kbn/kibana-utils-plugin/public'; +import type { Filter } from '@kbn/es-query'; import { History } from 'history'; import { savedSearchMock } from '../../../__mocks__/saved_search'; @@ -15,6 +18,7 @@ import { DiscoverAppStateContainer, getDiscoverAppStateContainer, } from './discover_app_state_container'; +import { SavedSearch } from '@kbn/saved-search-plugin/common'; let history: History; let state: DiscoverAppStateContainer; @@ -48,4 +52,109 @@ describe('Test discover app state container', () => { state.set({ index: 'second' }); expect(state.getPrevious()).toEqual(stateA); }); + + describe('getAppStateFromSavedSearch', () => { + const customQuery = { + language: 'kuery', + query: '_id: *', + }; + + const defaultQuery = { + query: '*', + language: 'kuery', + }; + + const customFilter = { + $state: { + store: 'appState', + }, + meta: { + alias: null, + disabled: false, + field: 'ecs.version', + index: 'kibana-event-log-data-view', + key: 'ecs.version', + negate: false, + params: { + query: '1.8.0', + }, + type: 'phrase', + }, + query: { + match_phrase: { + 'ecs.version': '1.8.0', + }, + }, + } as Filter; + + const localSavedSearchMock = { + id: 'the-saved-search-id', + title: 'A saved search', + breakdownField: 'customBreakDownField', + searchSource: createSearchSourceMock({ + index: dataViewMock, + filter: [customFilter], + query: customQuery, + }), + hideChart: true, + rowsPerPage: 250, + hideAggregatedPreview: true, + } as SavedSearch; + + test('should return correct output', () => { + const appState = state.getAppStateFromSavedSearch(localSavedSearchMock); + expect(appState).toMatchObject( + expect.objectContaining({ + breakdownField: 'customBreakDownField', + columns: ['default_column'], + filters: [customFilter], + grid: undefined, + hideChart: true, + index: 'the-data-view-id', + interval: 'auto', + query: customQuery, + rowHeight: undefined, + rowsPerPage: 250, + hideAggregatedPreview: true, + savedQuery: undefined, + sort: [], + viewMode: undefined, + }) + ); + }); + + test('should return default query if query is undefined', () => { + discoverServiceMock.data.query.queryString.getDefaultQuery = jest + .fn() + .mockReturnValue(defaultQuery); + const newSavedSearchMock = { + id: 'new-saved-search-id', + title: 'A saved search', + searchSource: createSearchSourceMock({ + index: dataViewMock, + filter: [customFilter], + query: undefined, + }), + }; + const appState = state.getAppStateFromSavedSearch(newSavedSearchMock); + expect(appState).toMatchObject( + expect.objectContaining({ + breakdownField: undefined, + columns: ['default_column'], + filters: [customFilter], + grid: undefined, + hideChart: undefined, + index: 'the-data-view-id', + interval: 'auto', + query: defaultQuery, + rowHeight: undefined, + rowsPerPage: undefined, + hideAggregatedPreview: undefined, + savedQuery: undefined, + sort: [], + viewMode: undefined, + }) + ); + }); + }); }); diff --git a/src/plugins/discover/public/application/main/services/discover_app_state_container.ts b/src/plugins/discover/public/application/main/services/discover_app_state_container.ts index 47cd216b1547e..046e8fd6393f1 100644 --- a/src/plugins/discover/public/application/main/services/discover_app_state_container.ts +++ b/src/plugins/discover/public/application/main/services/discover_app_state_container.ts @@ -73,6 +73,12 @@ export interface DiscoverAppStateContainer extends ReduxLikeStateContainer void; + + /* + * Get updated AppState when given a saved search + * + * */ + getAppStateFromSavedSearch: (newSavedSearch: SavedSearch) => DiscoverAppState; } export interface DiscoverAppState { @@ -170,6 +176,13 @@ export const getDiscoverAppStateContainer = ({ return !isEqualState(initialState, appStateContainer.getState()); }; + const getAppStateFromSavedSearch = (newSavedSearch: SavedSearch) => { + return getStateDefaults({ + savedSearch: newSavedSearch, + services, + }); + }; + const resetToState = (state: DiscoverAppState) => { addLog('[appState] reset state to', state); previousState = state; @@ -260,6 +273,7 @@ export const getDiscoverAppStateContainer = ({ replaceUrlState, syncState: startAppStateUrlSync, update, + getAppStateFromSavedSearch, }; }; diff --git a/src/plugins/discover/public/application/main/services/discover_state.ts b/src/plugins/discover/public/application/main/services/discover_state.ts index d6e2809c14bd6..bb0fbed792d64 100644 --- a/src/plugins/discover/public/application/main/services/discover_state.ts +++ b/src/plugins/discover/public/application/main/services/discover_state.ts @@ -50,7 +50,10 @@ import { DiscoverSavedSearchContainer, } from './discover_saved_search_container'; import { updateFiltersReferences } from '../utils/update_filter_references'; -import { getDiscoverGlobalStateContainer } from './discover_global_state_container'; +import { + getDiscoverGlobalStateContainer, + DiscoverGlobalStateContainer, +} from './discover_global_state_container'; interface DiscoverStateContainerParams { /** * Browser history @@ -87,6 +90,11 @@ export interface LoadParams { } export interface DiscoverStateContainer { + /** + * Global State, the _g part of the URL + */ + globalState: DiscoverGlobalStateContainer; + /** * App state, the _a part of the URL */ @@ -460,6 +468,7 @@ export function getDiscoverStateContainer({ }; return { + globalState: globalStateContainer, appState: appStateContainer, internalState: internalStateContainer, dataState: dataStateContainer, diff --git a/src/plugins/discover/public/mocks.tsx b/src/plugins/discover/public/mocks.tsx index ae2bc4fa547fd..e97c8f5a841a2 100644 --- a/src/plugins/discover/public/mocks.tsx +++ b/src/plugins/discover/public/mocks.tsx @@ -9,6 +9,7 @@ import React from 'react'; import { sharePluginMock } from '@kbn/share-plugin/public/mocks'; import { DiscoverSetup, DiscoverStart } from '.'; +import { getDiscoverStateMock } from './__mocks__/discover_state.mock'; export type Setup = jest.Mocked; export type Start = jest.Mocked; @@ -32,4 +33,5 @@ const createStartContract = (): Start => { export const discoverPluginMock = { createSetupContract, createStartContract, + getDiscoverStateMock, }; diff --git a/x-pack/plugins/security_solution/common/api/timeline/model/api.ts b/x-pack/plugins/security_solution/common/api/timeline/model/api.ts index 230cf122dcbf6..24a9a24f8fd8e 100644 --- a/x-pack/plugins/security_solution/common/api/timeline/model/api.ts +++ b/x-pack/plugins/security_solution/common/api/timeline/model/api.ts @@ -336,6 +336,7 @@ export const SavedTimelineRuntimeType = runtimeTypes.partial({ createdBy: unionWithNullType(runtimeTypes.string), updated: unionWithNullType(runtimeTypes.number), updatedBy: unionWithNullType(runtimeTypes.string), + savedSearchId: unionWithNullType(runtimeTypes.string), }); export type SavedTimeline = runtimeTypes.TypeOf; @@ -666,6 +667,7 @@ export interface TimelineResult { updated?: Maybe; updatedBy?: Maybe; version: string; + savedSearchId?: Maybe; } export interface ResponseTimeline { diff --git a/x-pack/plugins/security_solution/common/search_strategy/timeline/index.ts b/x-pack/plugins/security_solution/common/search_strategy/timeline/index.ts index b71b48e425258..49aea54bd74e6 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/timeline/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/timeline/index.ts @@ -133,6 +133,7 @@ export interface TimelineInput { savedQueryId?: Maybe; sort?: Maybe; status?: Maybe; + savedSearchId: Maybe; } export enum FlowDirection { diff --git a/x-pack/plugins/security_solution/common/types/timeline/saved_object.ts b/x-pack/plugins/security_solution/common/types/timeline/saved_object.ts index 782b1e8e529b8..767e7266ffed0 100644 --- a/x-pack/plugins/security_solution/common/types/timeline/saved_object.ts +++ b/x-pack/plugins/security_solution/common/types/timeline/saved_object.ts @@ -246,6 +246,7 @@ export const SavedObjectTimelineRuntimeType = runtimeTypes.partial({ createdBy: unionWithNullType(runtimeTypes.string), updated: unionWithNullType(runtimeTypes.number), updatedBy: unionWithNullType(runtimeTypes.string), + savedSearchId: unionWithNullType(runtimeTypes.string), }); type SavedObjectTimeline = runtimeTypes.TypeOf; diff --git a/x-pack/plugins/security_solution/common/types/timeline/store.ts b/x-pack/plugins/security_solution/common/types/timeline/store.ts index ceed44c45e03c..96be2a6e0a064 100644 --- a/x-pack/plugins/security_solution/common/types/timeline/store.ts +++ b/x-pack/plugins/security_solution/common/types/timeline/store.ts @@ -58,6 +58,8 @@ export interface TimelinePersistInput { templateTimelineId?: string | null; templateTimelineVersion?: number | null; title?: string; + /* used to saved discover Saved search Id */ + savedSearchId?: string | null; } /** Invoked when a column is sorted */ diff --git a/x-pack/plugins/security_solution/kibana.jsonc b/x-pack/plugins/security_solution/kibana.jsonc index a2e7af427da08..bf7997fa64e6a 100644 --- a/x-pack/plugins/security_solution/kibana.jsonc +++ b/x-pack/plugins/security_solution/kibana.jsonc @@ -49,7 +49,9 @@ "dataViewEditor", "stackConnectors", "discover", - "notifications" + "notifications", + "savedObjects", + "savedSearch" ], "optionalPlugins": [ "cloudExperiments", diff --git a/x-pack/plugins/security_solution/public/app/app.tsx b/x-pack/plugins/security_solution/public/app/app.tsx index 88ced06445c07..4b9941b1cbe5d 100644 --- a/x-pack/plugins/security_solution/public/app/app.tsx +++ b/x-pack/plugins/security_solution/public/app/app.tsx @@ -31,6 +31,7 @@ import type { StartServices } from '../types'; import { PageRouter } from './routes'; import { UserPrivilegesProvider } from '../common/components/user_privileges/user_privileges_context'; import { ReactQueryClientProvider } from '../common/containers/query_client/query_client_provider'; +import { DiscoverInTimelineContextProvider } from '../common/components/discover_in_timeline/provider'; import { AssistantProvider } from '../assistant/provider'; interface StartAppComponent { @@ -77,13 +78,15 @@ const StartAppComponent: FC = ({ getTriggerCompatibleActions={uiActions.getTriggerCompatibleActions} > - - {children} - + + + {children} + + diff --git a/x-pack/plugins/security_solution/public/common/components/callouts/callout.test.tsx b/x-pack/plugins/security_solution/public/common/components/callouts/callout.test.tsx index 4ba576519287a..dd728ad6ba745 100644 --- a/x-pack/plugins/security_solution/public/common/components/callouts/callout.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/callouts/callout.test.tsx @@ -29,7 +29,7 @@ describe('callout', () => { }); afterEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); test('renders the callout data-test-subj from the given id', () => { diff --git a/x-pack/plugins/security_solution/public/common/components/chart_settings_popover/configurations/default/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/chart_settings_popover/configurations/default/index.test.tsx index 915cac434f57b..ed262ee04d9db 100644 --- a/x-pack/plugins/security_solution/public/common/components/chart_settings_popover/configurations/default/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/chart_settings_popover/configurations/default/index.test.tsx @@ -37,7 +37,7 @@ describe('useChartSettingsPopoverConfiguration', () => { {children} ); - beforeEach(() => jest.resetAllMocks()); + beforeEach(() => jest.clearAllMocks()); test('it returns the expected defaultInitialPanelId', () => { const { result } = renderHook( diff --git a/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/__mocks__/use_discover_in_timeline_actions.tsx b/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/__mocks__/use_discover_in_timeline_actions.tsx new file mode 100644 index 0000000000000..cd192a528e36f --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/__mocks__/use_discover_in_timeline_actions.tsx @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const useDiscoverInTimelineActions = () => { + return { + resetDiscoverAppState: jest.fn(), + restoreDiscoverAppStateFromSavedSearch: jest.fn(), + updateSavedSearch: jest.fn(), + getAppStateFromSavedSearch: jest.fn(), + defaultDiscoverAppState: { + query: { + query: '', + language: 'kuery', + }, + sort: [['@timestamp', 'desc']], + columns: [], + index: 'security-solution-default', + interval: 'auto', + filters: [], + hideChart: true, + grid: {}, + }, + }; +}; diff --git a/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/context.tsx b/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/context.tsx new file mode 100644 index 0000000000000..307293b0cfa36 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/context.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { DiscoverStateContainer } from '@kbn/discover-plugin/public'; +import type { RefObject } from 'react'; +import { createContext } from 'react'; +import type { useDiscoverInTimelineActions } from './use_discover_in_timeline_actions'; + +export interface DiscoverInTimelineContextType + extends ReturnType { + discoverStateContainer: RefObject; + setDiscoverStateContainer: (stateContainer: DiscoverStateContainer) => void; +} + +export const DiscoverInTimelineContext = createContext(null); diff --git a/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/mocks/discover_in_timeline_provider.tsx b/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/mocks/discover_in_timeline_provider.tsx new file mode 100644 index 0000000000000..e77e3ecd13dbd --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/mocks/discover_in_timeline_provider.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { DiscoverStateContainer } from '@kbn/discover-plugin/public'; +import { discoverPluginMock } from '@kbn/discover-plugin/public/mocks'; +import React, { useRef, useCallback } from 'react'; +import type { FC, PropsWithChildren } from 'react'; +import { DiscoverInTimelineContext } from '../context'; +import { useDiscoverInTimelineActions } from '../use_discover_in_timeline_actions'; + +type Props = PropsWithChildren<{}>; + +jest.mock('../use_discover_in_timeline_actions'); + +export const MockDiscoverInTimelineContext: FC = ({ children }) => { + const discoverStateContainer = useRef(discoverPluginMock.getDiscoverStateMock({})); + + const setDiscoverStateContainer = useCallback((stateContainer: DiscoverStateContainer) => { + discoverStateContainer.current = stateContainer; + }, []); + + const actions = useDiscoverInTimelineActions(discoverStateContainer); + + return ( + + {children} + + ); +}; diff --git a/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/provider.tsx b/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/provider.tsx new file mode 100644 index 0000000000000..abf03e6b4f466 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/provider.tsx @@ -0,0 +1,38 @@ +/* + * 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 { DiscoverStateContainer } from '@kbn/discover-plugin/public'; +import type { PropsWithChildren, FC } from 'react'; +import React, { useCallback, useRef } from 'react'; +import { DiscoverInTimelineContext } from './context'; +import { useDiscoverInTimelineActions } from './use_discover_in_timeline_actions'; + +type DiscoverInTimelineContextProviderProps = PropsWithChildren<{}>; + +export const DiscoverInTimelineContextProvider: FC = ( + props +) => { + const discoverStateContainer = useRef(); + + const actions = useDiscoverInTimelineActions(discoverStateContainer); + + const setDiscoverStateContainer = useCallback((stateContainer: DiscoverStateContainer) => { + discoverStateContainer.current = stateContainer; + }, []); + + return ( + + {props.children} + + ); +}; diff --git a/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/translations.ts b/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/translations.ts new file mode 100644 index 0000000000000..06f5c01aad5dc --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/translations.ts @@ -0,0 +1,22 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const DISCOVER_SEARCH_SAVE_ERROR_TITLE = i18n.translate( + 'xpack.securitySolution.timelines.discoverInTimeline.save_saved_search_error', + { + defaultMessage: 'Error while saving the Discover search', + } +); + +export const DISCOVER_SEARCH_SAVE_ERROR_UNKNOWN = i18n.translate( + 'xpack.securitySolution.timelines.discoverInTimeline.save_saved_search_unknown_error', + { + defaultMessage: 'Unknown error occurred while saving Discover search', + } +); diff --git a/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_actions.test.tsx b/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_actions.test.tsx new file mode 100644 index 0000000000000..79e138347c79c --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_actions.test.tsx @@ -0,0 +1,265 @@ +/* + * 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 { createSearchSourceMock } from '@kbn/data-plugin/public/mocks'; +import { discoverPluginMock } from '@kbn/discover-plugin/public/mocks'; +import { dataViewMock } from '@kbn/discover-utils/src/__mocks__'; +import type { SavedSearch } from '@kbn/saved-search-plugin/common'; +import { renderHook } from '@testing-library/react-hooks'; +import { + createSecuritySolutionStorageMock, + kibanaObservable, + mockGlobalState, + SUB_PLUGINS_REDUCER, + TestProviders, +} from '../../mock'; +import { useDiscoverInTimelineActions } from './use_discover_in_timeline_actions'; +import type { Filter } from '@kbn/es-query'; +import { createStartServicesMock } from '../../lib/kibana/kibana_react.mock'; +import { useKibana } from '../../lib/kibana'; +import type { State } from '../../store'; +import { createStore } from '../../store'; +import { TimelineId } from '../../../../common/types'; +import type { ComponentType, FC, PropsWithChildren } from 'react'; +import React from 'react'; + +const mockDiscoverStateContainerRef = { + current: discoverPluginMock.getDiscoverStateMock({}), +}; + +jest.mock('../../lib/kibana'); +const mockState: State = { + ...mockGlobalState, + timeline: { + ...mockGlobalState.timeline, + timelineById: { + ...mockGlobalState.timeline.timelineById, + [TimelineId.active]: { + ...mockGlobalState.timeline.timelineById[TimelineId.active], + title: 'Active Timeline', + description: 'Active Timeline Description', + }, + }, + }, +}; + +jest.mock('./use_discover_in_timeline_actions', () => { + const actual = jest.requireActual('./use_discover_in_timeline_actions'); + return actual; +}); + +const { storage } = createSecuritySolutionStorageMock(); + +const getTestProviderWithCustomState = (state: State = mockState) => { + const store = createStore(state, SUB_PLUGINS_REDUCER, kibanaObservable, storage); + + const MockTestProvider: FC> = ({ children }) => ( + {children} + ); + + return MockTestProvider; +}; + +const renderTestHook = (customWrapper: ComponentType = getTestProviderWithCustomState()) => { + return renderHook(() => useDiscoverInTimelineActions(mockDiscoverStateContainerRef), { + wrapper: customWrapper, + }); +}; + +const customQuery = { + language: 'kuery', + query: '_id: *', +}; + +const customFilter = { + $state: { + store: 'appState', + }, + meta: { + alias: null, + disabled: false, + field: 'ecs.version', + index: 'kibana-event-log-data-view', + key: 'ecs.version', + negate: false, + params: { + query: '1.8.0', + }, + type: 'phrase', + }, + query: { + match_phrase: { + 'ecs.version': '1.8.0', + }, + }, +} as Filter; + +const originalSavedSearchMock = { + id: 'the-saved-search-id', + title: 'A saved search', + breakdownField: 'customBreakDownField', + searchSource: createSearchSourceMock({ + index: dataViewMock, + filter: [customFilter], + query: customQuery, + }), +}; + +export const savedSearchMock = { + ...originalSavedSearchMock, + hideChart: true, + sort: ['@timestamp', 'desc'], + timeRange: { + from: 'now-20d', + to: 'now', + }, +} as unknown as SavedSearch; + +const startServicesMock = createStartServicesMock(); + +describe('useDiscoverInTimelineActions', () => { + beforeEach(() => { + (useKibana as jest.Mock).mockImplementation(() => ({ + services: startServicesMock, + })); + }); + afterEach(() => { + jest.clearAllMocks(); + }); + describe('getAppStateFromSavedSearch', () => { + it('should reach out to discover to convert app state from saved search', async () => { + const { result, waitFor } = renderTestHook(); + const { appState } = result.current.getAppStateFromSavedSearch(savedSearchMock); + await waitFor(() => { + expect(appState).toMatchObject( + expect.objectContaining({ + breakdownField: 'customBreakDownField', + columns: ['default_column'], + filters: [customFilter], + grid: undefined, + hideAggregatedPreview: undefined, + hideChart: true, + index: 'the-data-view-id', + interval: 'auto', + query: customQuery, + rowHeight: undefined, + rowsPerPage: undefined, + savedQuery: undefined, + sort: [['@timestamp', 'desc']], + viewMode: undefined, + }) + ); + }); + }); + }); + + describe('restoreDiscoverAppStateFromSavedSearch', () => { + it('should restore basic discover app state and timeRange from a given saved Search', async () => { + const { result, waitFor } = renderTestHook(); + result.current.restoreDiscoverAppStateFromSavedSearch(savedSearchMock); + + await waitFor(() => { + const appState = mockDiscoverStateContainerRef.current.appState.getState(); + const globalState = mockDiscoverStateContainerRef.current.globalState.get(); + expect(appState).toMatchObject({ + breakdownField: 'customBreakDownField', + columns: ['default_column'], + filters: [customFilter], + grid: undefined, + hideAggregatedPreview: undefined, + hideChart: true, + index: 'the-data-view-id', + interval: 'auto', + query: customQuery, + rowHeight: undefined, + rowsPerPage: undefined, + savedQuery: undefined, + sort: [['@timestamp', 'desc']], + viewMode: undefined, + }); + + expect(globalState).toMatchObject({ time: { from: 'now-20d', to: 'now' } }); + }); + }); + }); + describe('resetDiscoverAppState', () => { + it('should reset Discover AppState to a default state', async () => { + const { result, waitFor } = renderTestHook(); + result.current.resetDiscoverAppState(); + await waitFor(() => { + const appState = mockDiscoverStateContainerRef.current.appState.getState(); + expect(appState).toMatchObject(result.current.defaultDiscoverAppState); + }); + }); + it('should reset Discover time to a default state', async () => { + const { result, waitFor } = renderTestHook(); + result.current.resetDiscoverAppState(); + await waitFor(() => { + const globalState = mockDiscoverStateContainerRef.current.globalState.get(); + expect(globalState).toMatchObject({ time: { from: 'now-15m', to: 'now' } }); + }); + }); + }); + describe('updateSavedSearch', () => { + it('should add defaults to the savedSearch before updating saved search', async () => { + const { result } = renderTestHook(); + await result.current.updateSavedSearch(savedSearchMock, TimelineId.active); + + expect(startServicesMock.savedSearch.save).toHaveBeenNthCalledWith( + 1, + expect.objectContaining({ + timeRestore: true, + timeRange: { + from: 'now-20d', + to: 'now', + }, + tags: ['security-solution-default'], + }), + expect.objectContaining({ + copyOnSave: true, + }) + ); + }); + it('should send update request when savedSearchId is already available', async () => { + const localMockState: State = { + ...mockGlobalState, + timeline: { + ...mockGlobalState.timeline, + timelineById: { + ...mockGlobalState.timeline.timelineById, + [TimelineId.active]: { + ...mockGlobalState.timeline.timelineById[TimelineId.active], + title: 'Active Timeline', + description: 'Active Timeline Description', + savedSearchId: 'saved_search_id', + }, + }, + }, + }; + + const LocalTestProvider = getTestProviderWithCustomState(localMockState); + const { result } = renderTestHook(LocalTestProvider); + await result.current.updateSavedSearch(savedSearchMock, TimelineId.active); + + expect(startServicesMock.savedSearch.save).toHaveBeenNthCalledWith( + 1, + expect.objectContaining({ + timeRestore: true, + timeRange: { + from: 'now-20d', + to: 'now', + }, + tags: ['security-solution-default'], + id: 'saved_search_id', + }), + expect.objectContaining({ + copyOnSave: false, + }) + ); + }); + it('should raise appropriate notification in case of any error in saving discover saved search', () => {}); + }); +}); diff --git a/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_actions.tsx b/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_actions.tsx new file mode 100644 index 0000000000000..8361612231a24 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_actions.tsx @@ -0,0 +1,235 @@ +/* + * 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 { DiscoverStateContainer } from '@kbn/discover-plugin/public'; +import type { SaveSavedSearchOptions } from '@kbn/saved-search-plugin/public'; +import type { RefObject } from 'react'; +import { useMemo, useCallback } from 'react'; +import { useDispatch } from 'react-redux'; +import type { SavedSearch } from '@kbn/saved-search-plugin/common'; +import type { DiscoverAppState } from '@kbn/discover-plugin/public/application/main/services/discover_app_state_container'; +import type { TimeRange } from '@kbn/es-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { endTimelineSaving, startTimelineSaving } from '../../../timelines/store/timeline/actions'; +import { timelineDefaults } from '../../../timelines/store/timeline/defaults'; +import { TimelineId } from '../../../../common/types'; +import { timelineActions, timelineSelectors } from '../../../timelines/store/timeline'; +import { useAppToasts } from '../../hooks/use_app_toasts'; +import { useShallowEqualSelector } from '../../hooks/use_selector'; +import { useKibana } from '../../lib/kibana'; +import { useSourcererDataView } from '../../containers/sourcerer'; +import { SourcererScopeName } from '../../store/sourcerer/model'; +import { + DISCOVER_SEARCH_SAVE_ERROR_TITLE, + DISCOVER_SEARCH_SAVE_ERROR_UNKNOWN, +} from './translations'; + +export const defaultDiscoverTimeRange: TimeRange = { + from: 'now-15m', + to: 'now', + mode: 'relative', +}; + +export const useDiscoverInTimelineActions = ( + discoverStateContainer: RefObject +) => { + const { addError } = useAppToasts(); + + const { + services: { customDataService: discoverDataService, savedSearch: savedSearchService }, + } = useKibana(); + + const dispatch = useDispatch(); + + const { dataViewId } = useSourcererDataView(SourcererScopeName.detections); + + const getTimeline = useMemo(() => timelineSelectors.getTimelineByIdSelector(), []); + const timeline = useShallowEqualSelector( + (state) => getTimeline(state, TimelineId.active) ?? timelineDefaults + ); + const { savedSearchId } = timeline; + + const queryClient = useQueryClient(); + + const { mutateAsync: saveSavedSearch } = useMutation({ + mutationFn: ({ + savedSearch, + savedSearchOptions, + }: { + savedSearch: SavedSearch; + savedSearchOptions: SaveSavedSearchOptions; + }) => savedSearchService.save(savedSearch, savedSearchOptions), + onSuccess: () => { + // Invalidate and refetch + queryClient.invalidateQueries({ queryKey: ['savedSearchById', savedSearchId] }); + }, + }); + + const defaultDiscoverAppState: DiscoverAppState = useMemo(() => { + return { + query: discoverDataService.query.queryString.getDefaultQuery(), + sort: [['@timestamp', 'desc']], + columns: [], + index: dataViewId ?? 'security-solution-default', + interval: 'auto', + filters: [], + hideChart: true, + grid: {}, + }; + }, [discoverDataService, dataViewId]); + + /* + * generates Appstate from a given saved Search object + * + * @param savedSearch + * + * */ + const getAppStateFromSavedSearch = useCallback( + (savedSearch: SavedSearch) => { + const appState = + discoverStateContainer.current?.appState.getAppStateFromSavedSearch(savedSearch); + return { + savedSearch, + appState, + }; + }, + [discoverStateContainer] + ); + + /* + * restores the url state of discover in timeline + * + * @param savedSearch + * */ + const restoreDiscoverAppStateFromSavedSearch = useCallback( + (savedSearch: SavedSearch) => { + const { appState } = getAppStateFromSavedSearch(savedSearch); + if (!appState) return; + discoverStateContainer.current?.appState.set(appState); + const timeRangeFromSavedSearch = savedSearch.timeRange; + discoverStateContainer.current?.globalState.set({ + ...discoverStateContainer.current?.globalState.get(), + time: timeRangeFromSavedSearch ?? defaultDiscoverTimeRange, + }); + }, + [getAppStateFromSavedSearch, discoverStateContainer] + ); + + /* + * resets discover state to a default value + * + * */ + const resetDiscoverAppState = useCallback(() => { + discoverStateContainer.current?.appState.set(defaultDiscoverAppState); + discoverStateContainer.current?.globalState.set({ + ...discoverStateContainer.current?.globalState.get(), + time: defaultDiscoverTimeRange, + }); + }, [defaultDiscoverAppState, discoverStateContainer]); + + const persistSavedSearch = useCallback( + async (savedSearch: SavedSearch, savedSearchOption: SaveSavedSearchOptions) => { + if (!discoverStateContainer) { + // eslint-disable-next-line no-console + console.log(`Saved search is not open since state container is null`); + return; + } + if (!savedSearch) return; + + function onError(error: Error) { + addError(error, { title: DISCOVER_SEARCH_SAVE_ERROR_TITLE }); + } + + try { + const id = await saveSavedSearch({ + savedSearch, + savedSearchOptions: savedSearchOption, + }); + if (id) { + return { id }; + } else { + addError(DISCOVER_SEARCH_SAVE_ERROR_UNKNOWN, { title: DISCOVER_SEARCH_SAVE_ERROR_TITLE }); + } + } catch (err) { + onError(err); + } + }, + [addError, discoverStateContainer, saveSavedSearch] + ); + + /* + * persists the given savedSearch + * + * */ + const updateSavedSearch = useCallback( + async (savedSearch: SavedSearch, timelineId: string) => { + dispatch( + startTimelineSaving({ + id: timelineId, + }) + ); + savedSearch.timeRestore = true; + savedSearch.timeRange = + savedSearch.timeRange ?? discoverDataService.query.timefilter.timefilter.getTime(); + savedSearch.tags = ['security-solution-default']; + + if (savedSearchId) { + savedSearch.id = savedSearchId; + } + try { + const response = await persistSavedSearch(savedSearch, { + onTitleDuplicate: () => {}, + copyOnSave: !savedSearchId, + }); + + if (!response || !response.id) { + throw new Error('Unknown Error occured'); + } + + if (!savedSearchId) { + dispatch( + timelineActions.updateSavedSearchId({ + id: TimelineId.active, + savedSearchId: response.id, + }) + ); + } + } catch (err) { + addError(DISCOVER_SEARCH_SAVE_ERROR_TITLE, { + title: DISCOVER_SEARCH_SAVE_ERROR_TITLE, + toastMessage: String(err), + }); + } finally { + dispatch( + endTimelineSaving({ + id: timelineId, + }) + ); + } + }, + [persistSavedSearch, savedSearchId, addError, dispatch, discoverDataService] + ); + + const actions = useMemo( + () => ({ + resetDiscoverAppState, + restoreDiscoverAppStateFromSavedSearch, + updateSavedSearch, + getAppStateFromSavedSearch, + defaultDiscoverAppState, + }), + [ + resetDiscoverAppState, + restoreDiscoverAppStateFromSavedSearch, + updateSavedSearch, + getAppStateFromSavedSearch, + defaultDiscoverAppState, + ] + ); + + return actions; +}; diff --git a/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_context.tsx b/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_context.tsx new file mode 100644 index 0000000000000..0d54b9e58df87 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_context.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useContext } from 'react'; +import { DiscoverInTimelineContext } from './context'; + +export const useDiscoverInTimelineContext = () => { + const discoverContext = useContext(DiscoverInTimelineContext); + if (!discoverContext) { + const errMessage = `useDiscoverInTimelineContext should only used within a tree with parent as DiscoverInTimelineContextProvider`; + throw new Error(errMessage); + } + + return discoverContext; +}; diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/insights/related_alerts_by_process_ancestry.test.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/insights/related_alerts_by_process_ancestry.test.tsx index 88685262ecc17..c74640c9cdc77 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/insights/related_alerts_by_process_ancestry.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/insights/related_alerts_by_process_ancestry.test.tsx @@ -49,7 +49,7 @@ const props = { }; describe('RelatedAlertsByProcessAncestry', () => { beforeEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); it('shows an accordion and does not fetch data right away', () => { diff --git a/x-pack/plugins/security_solution/public/common/components/header_actions/add_note_icon_item.test.tsx b/x-pack/plugins/security_solution/public/common/components/header_actions/add_note_icon_item.test.tsx index 4c95fd0f939ff..9c3b793197c9c 100644 --- a/x-pack/plugins/security_solution/public/common/components/header_actions/add_note_icon_item.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/header_actions/add_note_icon_item.test.tsx @@ -19,7 +19,7 @@ const useUserPrivilegesMock = useUserPrivileges as jest.Mock; describe('AddEventNoteAction', () => { beforeEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); describe('isDisabled', () => { diff --git a/x-pack/plugins/security_solution/public/common/components/header_actions/pin_event_action.test.tsx b/x-pack/plugins/security_solution/public/common/components/header_actions/pin_event_action.test.tsx index d803535b73dd4..1e30fdc8868bd 100644 --- a/x-pack/plugins/security_solution/public/common/components/header_actions/pin_event_action.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/header_actions/pin_event_action.test.tsx @@ -19,7 +19,7 @@ const useUserPrivilegesMock = useUserPrivileges as jest.Mock; describe('PinEventAction', () => { beforeEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); describe('isDisabled', () => { diff --git a/x-pack/plugins/security_solution/public/common/components/local_storage/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/local_storage/index.test.tsx index d7dbfdeb5d026..e13d48354cc3e 100644 --- a/x-pack/plugins/security_solution/public/common/components/local_storage/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/local_storage/index.test.tsx @@ -39,7 +39,7 @@ jest.mock('../../lib/kibana', () => { describe('useLocalStorage', () => { beforeEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); test('it returns the expected value from local storage', async () => { diff --git a/x-pack/plugins/security_solution/public/common/components/search_bar/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/search_bar/index.test.tsx index adc097617e386..71c57edd9191c 100644 --- a/x-pack/plugins/security_solution/public/common/components/search_bar/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/search_bar/index.test.tsx @@ -86,7 +86,7 @@ describe('SearchBarComponent', () => { const pollForSignalIndex = jest.fn(); beforeEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); it('calls pollForSignalIndex on Refresh button click', () => { diff --git a/x-pack/plugins/security_solution/public/common/hooks/timeline/use_init_timeline_url_param.ts b/x-pack/plugins/security_solution/public/common/hooks/timeline/use_init_timeline_url_param.ts index cb4bd92d205d7..c16f5ebb4bae5 100644 --- a/x-pack/plugins/security_solution/public/common/hooks/timeline/use_init_timeline_url_param.ts +++ b/x-pack/plugins/security_solution/public/common/hooks/timeline/use_init_timeline_url_param.ts @@ -33,6 +33,7 @@ export const useInitTimelineFromUrlParam = () => { updateIsLoading: (status: { id: string; isLoading: boolean }) => dispatch(timelineActions.updateIsLoading(status)), updateTimeline: dispatchUpdateTimeline(dispatch), + savedSearchId: initialState.savedSearchId, }); } }, diff --git a/x-pack/plugins/security_solution/public/common/hooks/timeline/use_sync_timeline_url_param.ts b/x-pack/plugins/security_solution/public/common/hooks/timeline/use_sync_timeline_url_param.ts index fc2e9b620c314..f016cbfd57cc8 100644 --- a/x-pack/plugins/security_solution/public/common/hooks/timeline/use_sync_timeline_url_param.ts +++ b/x-pack/plugins/security_solution/public/common/hooks/timeline/use_sync_timeline_url_param.ts @@ -17,7 +17,7 @@ import { URL_PARAM_KEY } from '../use_url_state'; export const useSyncTimelineUrlParam = () => { const updateUrlParam = useUpdateUrlParam(URL_PARAM_KEY.timeline); const getTimeline = useMemo(() => timelineSelectors.getTimelineByIdSelector(), []); - const { activeTab, graphEventId, show, savedObjectId } = useShallowEqualSelector( + const { activeTab, graphEventId, show, savedObjectId, savedSearchId } = useShallowEqualSelector( (state) => getTimeline(state, TimelineId.active) ?? {} ); @@ -27,7 +27,8 @@ export const useSyncTimelineUrlParam = () => { isOpen: show, activeTab, graphEventId: graphEventId ?? '', + savedSearchId: savedSearchId ? savedSearchId : undefined, }; updateUrlParam(params); - }, [activeTab, graphEventId, savedObjectId, show, updateUrlParam]); + }, [activeTab, graphEventId, savedObjectId, show, updateUrlParam, savedSearchId]); }; diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_resolve_conflict.test.tsx b/x-pack/plugins/security_solution/public/common/hooks/use_resolve_conflict.test.tsx index d17b9c16f9d2a..e69f70234153e 100644 --- a/x-pack/plugins/security_solution/public/common/hooks/use_resolve_conflict.test.tsx +++ b/x-pack/plugins/security_solution/public/common/hooks/use_resolve_conflict.test.tsx @@ -29,7 +29,7 @@ jest.mock('../../timelines/store/timeline', () => ({ describe('useResolveConflict', () => { const mockGetLegacyUrlConflict = jest.fn().mockReturnValue('Test!'); beforeEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); // Mock rison format in actual url (useLocation as jest.Mock).mockReturnValue({ pathname: 'my/cool/path', diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_resolve_redirect.test.ts b/x-pack/plugins/security_solution/public/common/hooks/use_resolve_redirect.test.ts index c54259649448b..6aeb2a8b42d83 100644 --- a/x-pack/plugins/security_solution/public/common/hooks/use_resolve_redirect.test.ts +++ b/x-pack/plugins/security_solution/public/common/hooks/use_resolve_redirect.test.ts @@ -30,7 +30,7 @@ jest.mock('../../timelines/store/timeline', () => ({ describe('useResolveRedirect', () => { const mockRedirectLegacyUrl = jest.fn(); beforeEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); // Mock rison format in actual url (useLocation as jest.Mock).mockReturnValue({ pathname: 'my/cool/path', diff --git a/x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts b/x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts index 92db48980fdda..22965044c0838 100644 --- a/x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts +++ b/x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts @@ -52,6 +52,7 @@ import { UpsellingService } from '@kbn/security-solution-upselling/service'; import { cloudMock } from '@kbn/cloud-plugin/public/mocks'; import { NavigationProvider } from '@kbn/security-solution-navigation'; import { uiActionsPluginMock } from '@kbn/ui-actions-plugin/public/mocks'; +import { savedSearchPluginMock } from '@kbn/saved-search-plugin/public/mocks'; const mockUiSettings: Record = { [DEFAULT_TIME_RANGE]: { from: 'now-15m', to: 'now', mode: 'quick' }, @@ -220,6 +221,7 @@ export const createStartServicesMock = ( upselling: new UpsellingService(), customDataService, uiActions: uiActionsPluginMock.createStartContract(), + savedSearch: savedSearchPluginMock.createStartContract(), } as unknown as StartServices; }; diff --git a/x-pack/plugins/security_solution/public/common/mock/global_state.ts b/x-pack/plugins/security_solution/public/common/mock/global_state.ts index 2d8e49ad096e8..3306f3224a432 100644 --- a/x-pack/plugins/security_solution/public/common/mock/global_state.ts +++ b/x-pack/plugins/security_solution/public/common/mock/global_state.ts @@ -374,6 +374,8 @@ export const mockGlobalState: State = { filters: [], isSaving: false, itemsPerPageOptions: [10, 25, 50, 100], + savedSearchId: null, + isDiscoverSavedSearchLoaded: false, }, }, insertTimeline: null, diff --git a/x-pack/plugins/security_solution/public/common/mock/test_providers.tsx b/x-pack/plugins/security_solution/public/common/mock/test_providers.tsx index 88aebe587a8d9..a6779272da763 100644 --- a/x-pack/plugins/security_solution/public/common/mock/test_providers.tsx +++ b/x-pack/plugins/security_solution/public/common/mock/test_providers.tsx @@ -38,6 +38,7 @@ import { SUB_PLUGINS_REDUCER } from './utils'; import { createSecuritySolutionStorageMock, localStorageMock } from './mock_local_storage'; import { ASSISTANT_FEATURE_ID, CASES_FEATURE_ID } from '../../../common/constants'; import { UserPrivilegesProvider } from '../components/user_privileges/user_privileges_context'; +import { MockDiscoverInTimelineContext } from '../components/discover_in_timeline/mocks/discover_in_timeline_provider'; const state: State = mockGlobalState; @@ -79,19 +80,21 @@ export const TestProvidersComponent: React.FC = ({ ({ eui: euiDarkVars, darkMode: true })}> - - - - - Promise.resolve(cellActions)} - > - {children} - - - - - + + + + + + Promise.resolve(cellActions)} + > + {children} + + + + + + @@ -117,29 +120,40 @@ const TestProvidersWithPrivilegesComponent: React.FC = ({ onDragEnd = jest.fn(), cellActions = [], }) => { + const queryClient = new QueryClient({ + defaultOptions: { + queries: { + retry: false, + }, + }, + }); return ( ({ eui: euiDarkVars, darkMode: true })}> - - - Promise.resolve(cellActions)} - > - {children} - - - + + + + + Promise.resolve(cellActions)} + > + {children} + + + + + diff --git a/x-pack/plugins/security_solution/public/common/mock/timeline_results.ts b/x-pack/plugins/security_solution/public/common/mock/timeline_results.ts index 0f861e5624d04..ef6b4d265a5a7 100644 --- a/x-pack/plugins/security_solution/public/common/mock/timeline_results.ts +++ b/x-pack/plugins/security_solution/public/common/mock/timeline_results.ts @@ -2026,6 +2026,7 @@ export const mockTimelineModel: TimelineModel = { templateTimelineId: null, templateTimelineVersion: null, version: '1', + savedSearchId: null, }; export const mockDataTableModel: DataTableModel = { @@ -2205,6 +2206,8 @@ export const defaultTimelineProps: CreateTimelineProps = { templateTimelineVersion: null, templateTimelineId: null, version: null, + savedSearchId: null, + isDiscoverSavedSearchLoaded: false, }, to: '2018-11-05T19:03:25.937Z', notes: null, diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/index.test.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/index.test.tsx index 6c9e08f87adc2..af35e111034c8 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/index.test.tsx @@ -54,7 +54,7 @@ describe.skip('ExceptionsAddToListsTable', () => { }); afterEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); it('it displays loading state while fetching data', () => { diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/actions.test.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_table/actions.test.tsx index 62b1d8e857703..23b8fe50be532 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_table/actions.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_table/actions.test.tsx @@ -265,7 +265,6 @@ describe('alert actions', () => { // jest carries state between mocked implementations when using // spyOn. So now we're doing all three of these. // https://github.com/facebook/jest/issues/7136#issuecomment-565976599 - jest.resetAllMocks(); jest.clearAllMocks(); mockGetExceptionFilter = jest.fn().mockResolvedValue(undefined); @@ -452,6 +451,8 @@ describe('alert actions', () => { templateTimelineId: null, templateTimelineVersion: null, version: null, + savedSearchId: null, + isDiscoverSavedSearchLoaded: false, }, to: '2018-11-05T19:03:25.937Z', resolveTimelineConfig: undefined, diff --git a/x-pack/plugins/security_solution/public/detections/components/callouts/need_admin_for_update_callout/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/callouts/need_admin_for_update_callout/index.test.tsx index 1ca40a32195f8..1f31ec6def5a2 100644 --- a/x-pack/plugins/security_solution/public/detections/components/callouts/need_admin_for_update_callout/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/callouts/need_admin_for_update_callout/index.test.tsx @@ -13,7 +13,7 @@ import * as userInfo from '../../user_info'; describe('need_admin_for_update_callout', () => { afterEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); describe('hasIndexManage is "null"', () => { diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/eql_query_bar/footer.test.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/eql_query_bar/footer.test.tsx index 4de87ed33a87b..cb15e5002ca4c 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/eql_query_bar/footer.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/eql_query_bar/footer.test.tsx @@ -26,7 +26,7 @@ jest.mock('../../../../common/lib/kibana', () => { describe('EQL footer', () => { describe('EQL Settings', () => { beforeEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); it('EQL settings button is enable when popover is NOT open', () => { diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/query_bar/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/query_bar/index.test.tsx index 88073254bfbbe..05fa86a1fa1df 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/query_bar/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/query_bar/index.test.tsx @@ -138,7 +138,7 @@ describe('QueryBarDefineRule', () => { getByTestId('open-timeline-modal').click(); await act(async () => { - fireEvent.click(getByTestId('title-10849df0-7b44-11e9-a608-ab3d811609')); + fireEvent.click(getByTestId('timeline-title-10849df0-7b44-11e9-a608-ab3d811609')); }); expect(onOpenTimeline).toHaveBeenCalled(); }); diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/index.test.tsx index 02f5520af329d..1221d855d5aa9 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/index.test.tsx @@ -45,7 +45,7 @@ describe('RuleActionsOverflow', () => { jest.clearAllMocks(); }); afterAll(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); describe('rules details menu panel', () => { diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_alerts_privileges.test.tsx b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_alerts_privileges.test.tsx index ac2917e580e44..ce92e38dab1d0 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_alerts_privileges.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_alerts_privileges.test.tsx @@ -100,7 +100,7 @@ describe('useAlertsPrivileges', () => { let appToastsMock: jest.Mocked>; beforeEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); appToastsMock = useAppToastsMock.create(); (useAppToasts as jest.Mock).mockReturnValue(appToastsMock); useUserPrivilegesMock.mockReturnValue(userPrivilegesInitial); diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_cases_from_alerts.test.tsx b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_cases_from_alerts.test.tsx index 2430a605a2185..01bbe8c807ec2 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_cases_from_alerts.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_cases_from_alerts.test.tsx @@ -18,7 +18,7 @@ jest.mock('../../../../common/hooks/use_app_toasts'); describe('useCasesFromAlerts hook', () => { let appToastsMock: jest.Mocked>; beforeEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); appToastsMock = useAppToastsMock.create(); (useAppToasts as jest.Mock).mockReturnValue(appToastsMock); }); diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_signal_index.test.tsx b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_signal_index.test.tsx index 4e2110c1b0013..8966232ef2b53 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_signal_index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_signal_index.test.tsx @@ -15,13 +15,13 @@ import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; jest.mock('./api'); jest.mock('../../../../common/hooks/use_app_toasts'); jest.mock('../../../../common/components/user_privileges/endpoint/use_endpoint_privileges'); +jest.mock('../../../../timelines/components/timeline/discover_tab_content'); describe('useSignalIndex', () => { let appToastsMock: jest.Mocked>; beforeEach(() => { jest.clearAllMocks(); - jest.resetAllMocks(); appToastsMock = useAppToastsMock.create(); (useAppToasts as jest.Mock).mockReturnValue(appToastsMock); }); diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/chart_context_menu/index.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/chart_context_menu/index.test.tsx index 4c5bb720d400c..b36ab4a99b371 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/chart_context_menu/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/chart_context_menu/index.test.tsx @@ -21,7 +21,7 @@ import { ChartContextMenu } from '.'; describe('ChartContextMenu', () => { const queryId = 'abcd'; - beforeEach(() => jest.resetAllMocks()); + beforeEach(() => jest.clearAllMocks()); test('it renders the chart context menu button', () => { render( diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/chart_select/helpers.test.ts b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/chart_select/helpers.test.ts index b201674a2494f..e842f998bd5c1 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/chart_select/helpers.test.ts +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/chart_select/helpers.test.ts @@ -18,7 +18,7 @@ import { import * as i18n from './translations'; describe('helpers', () => { - beforeEach(() => jest.resetAllMocks()); + beforeEach(() => jest.clearAllMocks()); describe('getButtonProperties', () => { test('it returns the expected properties when alertViewSelection is Trend', () => { diff --git a/x-pack/plugins/security_solution/public/exceptions/components/exceptions_list_card/index.test.tsx b/x-pack/plugins/security_solution/public/exceptions/components/exceptions_list_card/index.test.tsx index 08061169a74a6..d59168d31afad 100644 --- a/x-pack/plugins/security_solution/public/exceptions/components/exceptions_list_card/index.test.tsx +++ b/x-pack/plugins/security_solution/public/exceptions/components/exceptions_list_card/index.test.tsx @@ -83,7 +83,7 @@ describe('ExceptionsListCard', () => { (useListDetailsView as jest.Mock).mockReturnValue(getMockUseListDetailsView()); }); afterEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); it('should display expired exception confirmation modal when "showIncludeExpiredExceptionsModal" is "true"', () => { diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/details/index.test.tsx b/x-pack/plugins/security_solution/public/explore/network/pages/details/index.test.tsx index 60f3bc086a263..5ab0674807efc 100644 --- a/x-pack/plugins/security_solution/public/explore/network/pages/details/index.test.tsx +++ b/x-pack/plugins/security_solution/public/explore/network/pages/details/index.test.tsx @@ -148,7 +148,7 @@ describe('Network Details', () => { }); afterAll(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); const state: State = mockGlobalState; diff --git a/x-pack/plugins/security_solution/public/flyout/right/components/analyzer_preview.test.tsx b/x-pack/plugins/security_solution/public/flyout/right/components/analyzer_preview.test.tsx index dabc988aa2807..22afc55bbd6cf 100644 --- a/x-pack/plugins/security_solution/public/flyout/right/components/analyzer_preview.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/right/components/analyzer_preview.test.tsx @@ -34,7 +34,7 @@ const NO_DATA_MESSAGE = 'An error is preventing this alert from being analyzed.' describe('', () => { beforeEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); it('shows analyzer preview correctly when documentId and index are present', () => { diff --git a/x-pack/plugins/security_solution/public/flyout/right/components/analyzer_preview_container.test.tsx b/x-pack/plugins/security_solution/public/flyout/right/components/analyzer_preview_container.test.tsx index 2adbf4e01d705..14b475f95c3c7 100644 --- a/x-pack/plugins/security_solution/public/flyout/right/components/analyzer_preview_container.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/right/components/analyzer_preview_container.test.tsx @@ -62,7 +62,7 @@ const renderAnalyzerPreview = () => describe('AnalyzerPreviewContainer', () => { afterEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); it('should render component and link in header', () => { diff --git a/x-pack/plugins/security_solution/public/flyout/right/components/session_preview.test.tsx b/x-pack/plugins/security_solution/public/flyout/right/components/session_preview.test.tsx index 279954cd8d996..3f93b24e4b018 100644 --- a/x-pack/plugins/security_solution/public/flyout/right/components/session_preview.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/right/components/session_preview.test.tsx @@ -39,7 +39,7 @@ const renderSessionPreview = () => describe('SessionPreview', () => { afterEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); it('renders session preview with all data', () => { diff --git a/x-pack/plugins/security_solution/public/flyout/right/components/session_preview_container.test.tsx b/x-pack/plugins/security_solution/public/flyout/right/components/session_preview_container.test.tsx index ef0d52cead5fb..e47673721e5b7 100644 --- a/x-pack/plugins/security_solution/public/flyout/right/components/session_preview_container.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/right/components/session_preview_container.test.tsx @@ -51,7 +51,7 @@ const renderSessionPreview = () => describe('SessionPreviewContainer', () => { afterEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); it('should render component and link in header', () => { diff --git a/x-pack/plugins/security_solution/public/index.ts b/x-pack/plugins/security_solution/public/index.ts index 28b99af129b1d..32378330e27dd 100644 --- a/x-pack/plugins/security_solution/public/index.ts +++ b/x-pack/plugins/security_solution/public/index.ts @@ -4,7 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - import type { PluginInitializerContext } from '@kbn/core/public'; import { Plugin } from './plugin'; diff --git a/x-pack/plugins/security_solution/public/overview/pages/data_quality.test.tsx b/x-pack/plugins/security_solution/public/overview/pages/data_quality.test.tsx index ffb3b616f2389..4f97250752202 100644 --- a/x-pack/plugins/security_solution/public/overview/pages/data_quality.test.tsx +++ b/x-pack/plugins/security_solution/public/overview/pages/data_quality.test.tsx @@ -82,7 +82,7 @@ describe('DataQuality', () => { const defaultIlmPhases = `${HOT}${WARM}${UNMANAGED}`; beforeEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); mockUseSourcererDataView.mockReturnValue(defaultUseSourcererReturn); mockUseSignalIndex.mockReturnValue(defaultUseSignalIndexReturn); diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts index ca43ba15dbf31..b2f113ecbbbad 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts @@ -327,6 +327,7 @@ export interface QueryTimelineById { isLoading: boolean; }) => Action<{ id: string; isLoading: boolean }>; updateTimeline: DispatchUpdateTimeline; + savedSearchId?: string; } export const queryTimelineById = ({ @@ -340,6 +341,7 @@ export const queryTimelineById = ({ openTimeline = true, updateIsLoading, updateTimeline, + savedSearchId, }: QueryTimelineById) => { updateIsLoading({ id: TimelineId.active, isLoading: true }); if (timelineId == null) { @@ -355,6 +357,7 @@ export const queryTimelineById = ({ activeTab: activeTimelineTab, show: openTimeline, initialized: true, + savedSearchId: savedSearchId ?? null, }, })(); updateIsLoading({ id: TimelineId.active, isLoading: false }); @@ -395,6 +398,7 @@ export const queryTimelineById = ({ graphEventId, show: openTimeline, dateRange: { start: from, end: to }, + savedSearchId: timeline.savedSearchId, }, to, })(); diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/index.test.tsx index 471561d6eeb0e..91d865960c813 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/index.test.tsx @@ -642,7 +642,9 @@ describe('StatefulOpenTimeline', () => { await waitFor(() => { wrapper - .find(`[data-test-subj="title-${mockOpenTimelineQueryResults.timeline[0].savedObjectId}"]`) + .find( + `[data-test-subj="timeline-title-${mockOpenTimelineQueryResults.timeline[0].savedObjectId}"]` + ) .last() .simulate('click'); diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.test.tsx index 6b5bfcd1f10c3..fa7f290abb20a 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.test.tsx @@ -271,7 +271,10 @@ describe('#getCommonColumns', () => { ); expect( - wrapper.find(`[data-test-subj="title-${mockResults[0].savedObjectId}"]`).first().text() + wrapper + .find(`[data-test-subj="timeline-title-${mockResults[0].savedObjectId}"]`) + .first() + .text() ).toEqual(mockResults[0].title); }); @@ -314,7 +317,10 @@ describe('#getCommonColumns', () => { ); expect( - wrapper.find(`[data-test-subj="title-${missingTitle[0].savedObjectId}"]`).first().text() + wrapper + .find(`[data-test-subj="timeline-title-${missingTitle[0].savedObjectId}"]`) + .first() + .text() ).toEqual(i18n.UNTITLED_TIMELINE); }); @@ -357,7 +363,7 @@ describe('#getCommonColumns', () => { expect( wrapper - .find(`[data-test-subj="title-${withJustWhitespaceTitle[0].savedObjectId}"]`) + .find(`[data-test-subj="timeline-title-${withJustWhitespaceTitle[0].savedObjectId}"]`) .first() .text() ).toEqual(i18n.UNTITLED_TIMELINE); @@ -397,7 +403,10 @@ describe('#getCommonColumns', () => { ); expect( - wrapper.find(`[data-test-subj="title-${mockResults[0].savedObjectId}"]`).first().exists() + wrapper + .find(`[data-test-subj="timeline-title-${mockResults[0].savedObjectId}"]`) + .first() + .exists() ).toBe(true); }); @@ -418,7 +427,10 @@ describe('#getCommonColumns', () => { ); expect( - wrapper.find(`[data-test-subj="title-${mockResults[0].savedObjectId}"]`).first().exists() + wrapper + .find(`[data-test-subj="timeline-title-${mockResults[0].savedObjectId}"]`) + .first() + .exists() ).toBe(false); }); @@ -438,7 +450,7 @@ describe('#getCommonColumns', () => { ); wrapper - .find(`[data-test-subj="title-${mockResults[0].savedObjectId}"]`) + .find(`[data-test-subj="timeline-title-${mockResults[0].savedObjectId}"]`) .last() .simulate('click'); diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.tsx index d3c5357f9e45e..649dde8664f79 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.tsx @@ -69,7 +69,7 @@ export const getCommonColumns = ({ render: (title: string, timelineResult: OpenTimelineResult) => timelineResult.savedObjectId != null ? ( onOpenTimeline({ duplicate: false, diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.test.tsx index 7b47acfff0586..d9c30f312a859 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.test.tsx @@ -58,7 +58,7 @@ const defaultProps = { describe('reasonColumnRenderer', () => { beforeEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); describe('isIntance', () => { diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/__mocks__/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/__mocks__/index.tsx new file mode 100644 index 0000000000000..728f24b11015e --- /dev/null +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/__mocks__/index.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { MockDiscoverTabContent } from '../mocks/discover_tab_content'; + +export const DiscoverTabContent = MockDiscoverTabContent; + +// eslint-disable-next-line import/no-default-export +export default DiscoverTabContent; diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/index.test.tsx index db874f9a81245..770f9281234ee 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/index.test.tsx @@ -9,21 +9,29 @@ import React from 'react'; import { TestProviders } from '../../../../common/mock'; import DiscoverTabContent from '.'; import { render, screen, waitFor } from '@testing-library/react'; +import { TimelineId } from '../../../../../common/types'; const TestComponent = () => { return ( - + ); }; describe('Discover Tab Content', () => { - it('renders', async () => { + it('should render', async () => { render(); await waitFor(() => { expect(screen.getByTestId('timeline-embedded-discover')).toBeInTheDocument(); }); }); + + // issue for enabling below tests: https://github.com/elastic/kibana/issues/165913 + it.skip('should load saved search when a saved timeline is restored', () => {}); + it.skip('should reset the discover state when new timeline is created', () => {}); + it.skip('should update saved search if timeline title and description are updated', () => {}); + it.skip('should should not update saved search if the fetched saved search is same as discover updated saved search', () => {}); + it.skip('should update saved search if discover time is update', () => {}); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/index.tsx index deb52a77a5012..abce4c9efa9a4 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/index.tsx @@ -5,20 +5,32 @@ * 2.0. */ +import type { FC } from 'react'; import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { useHistory } from 'react-router-dom'; import type { CustomizationCallback } from '@kbn/discover-plugin/public/customizations/types'; import { createGlobalStyle } from 'styled-components'; import type { ScopedHistory } from '@kbn/core/public'; -import type { DiscoverStateContainer } from '@kbn/discover-plugin/public'; import type { Subscription } from 'rxjs'; import type { DataView } from '@kbn/data-views-plugin/common'; +import { useQuery } from '@tanstack/react-query'; +import { debounce, isEqualWith } from 'lodash'; +import type { SavedSearch } from '@kbn/saved-search-plugin/common'; +import type { TimeRange } from '@kbn/es-query'; +import { useDispatch } from 'react-redux'; +import { useDiscoverInTimelineContext } from '../../../../common/components/discover_in_timeline/use_discover_in_timeline_context'; import { useSourcererDataView } from '../../../../common/containers/sourcerer'; import { useKibana } from '../../../../common/lib/kibana'; import { useDiscoverState } from './use_discover_state'; import { SourcererScopeName } from '../../../../common/store/sourcerer/model'; import { useSetDiscoverCustomizationCallbacks } from './customizations/use_set_discover_customizations'; import { EmbeddedDiscoverContainer } from './styles'; +import { timelineSelectors } from '../../../store/timeline'; +import { useShallowEqualSelector } from '../../../../common/hooks/use_selector'; +import { timelineDefaults } from '../../../store/timeline/defaults'; +import { savedSearchComparator } from './utils'; +import { setIsDiscoverSavedSearchLoaded } from '../../../store/timeline/actions'; +import { GET_TIMELINE_DISCOVER_SAVED_SEARCH_TITLE } from './translations'; const HideSearchSessionIndicatorBreadcrumbIcon = createGlobalStyle` [data-test-subj='searchSessionIndicator'] { @@ -26,33 +38,166 @@ const HideSearchSessionIndicatorBreadcrumbIcon = createGlobalStyle` } `; -export const DiscoverTabContent = () => { +interface DiscoverTabContentProps { + timelineId: string; +} + +export const DiscoverTabContent: FC = ({ timelineId }) => { const history = useHistory(); const { - services: { customDataService: discoverDataService, discover, dataViews: dataViewService }, + services: { + customDataService: discoverDataService, + discover, + dataViews: dataViewService, + savedSearch: savedSearchService, + }, } = useKibana(); + const dispatch = useDispatch(); + const { dataViewId } = useSourcererDataView(SourcererScopeName.detections); const [dataView, setDataView] = useState(); - - const stateContainerRef = useRef(); + const [discoverTimerange, setDiscoverTimerange] = useState(); const discoverAppStateSubscription = useRef(); const discoverInternalStateSubscription = useRef(); const discoverSavedSearchStateSubscription = useRef(); + const discoverTimerangeSubscription = useRef(); - const discoverCustomizationCallbacks = useSetDiscoverCustomizationCallbacks(); + const { + discoverStateContainer, + setDiscoverStateContainer, + getAppStateFromSavedSearch, + updateSavedSearch, + restoreDiscoverAppStateFromSavedSearch, + resetDiscoverAppState, + } = useDiscoverInTimelineContext(); const { discoverAppState, - discoverInternalState, discoverSavedSearchState, setDiscoverSavedSearchState, setDiscoverInternalState, setDiscoverAppState, } = useDiscoverState(); + const discoverCustomizationCallbacks = useSetDiscoverCustomizationCallbacks(); + + const getTimeline = useMemo(() => timelineSelectors.getTimelineByIdSelector(), []); + const timeline = useShallowEqualSelector( + (state) => getTimeline(state, timelineId) ?? timelineDefaults + ); + const { + status, + savedSearchId, + activeTab, + savedObjectId, + title, + description, + isDiscoverSavedSearchLoaded = false, + } = timeline; + + const setSavedSearchLoaded = useCallback( + (value: boolean) => { + dispatch( + setIsDiscoverSavedSearchLoaded({ + id: timelineId, + isDiscoverSavedSearchLoaded: value, + }) + ); + }, + [dispatch, timelineId] + ); + + const { data: savedSearchById, isFetching } = useQuery({ + queryKey: ['savedSearchById', savedSearchId ?? ''], + queryFn: () => (savedSearchId ? savedSearchService.get(savedSearchId) : Promise.resolve(null)), + }); + + useEffect(() => { + if (!savedObjectId) return; + setSavedSearchLoaded(false); + }, [savedObjectId, setSavedSearchLoaded]); + + useEffect(() => { + if (isFetching) return; // no-op is fetch is in progress + if (isDiscoverSavedSearchLoaded) return; // no-op if saved search has been already loaded + if (!savedSearchById) { + // nothing to restore if savedSearchById is null + if (status === 'draft') { + resetDiscoverAppState(); + } + setSavedSearchLoaded(true); + return; + } + restoreDiscoverAppStateFromSavedSearch(savedSearchById); + setSavedSearchLoaded(true); + }, [ + discoverStateContainer, + savedSearchId, + isDiscoverSavedSearchLoaded, + status, + activeTab, + resetDiscoverAppState, + savedSearchById, + getAppStateFromSavedSearch, + restoreDiscoverAppStateFromSavedSearch, + isFetching, + setSavedSearchLoaded, + ]); + + const getCombinedDiscoverSavedSearchState: () => SavedSearch | undefined = useCallback(() => { + if (!discoverSavedSearchState) return; + return { + ...(discoverStateContainer.current?.savedSearchState.getState() ?? discoverSavedSearchState), + timeRange: discoverDataService.query.timefilter.timefilter.getTime(), + refreshInterval: discoverStateContainer.current?.globalState.get()?.refreshInterval, + breakdownField: discoverStateContainer.current?.appState.getState().breakdownField, + rowsPerPage: discoverStateContainer.current?.appState.getState().rowsPerPage, + title: GET_TIMELINE_DISCOVER_SAVED_SEARCH_TITLE(title), + description, + }; + }, [ + discoverSavedSearchState, + discoverStateContainer, + discoverDataService.query.timefilter.timefilter, + title, + description, + ]); + + const combinedDiscoverSavedSearchStateRef = useRef(); + + const debouncedUpdateSavedSearch = useMemo( + () => debounce(updateSavedSearch, 300), + [updateSavedSearch] + ); + + useEffect(() => { + if (isFetching) return; + if (!isDiscoverSavedSearchLoaded) return; + if (!savedObjectId) return; + if (!status || status === 'draft') return; + const latestState = getCombinedDiscoverSavedSearchState(); + if (!latestState || combinedDiscoverSavedSearchStateRef.current === latestState) return; + if (isEqualWith(latestState, savedSearchById, savedSearchComparator)) return; + debouncedUpdateSavedSearch(latestState, timelineId); + combinedDiscoverSavedSearchStateRef.current = latestState; + }, [ + getCombinedDiscoverSavedSearchState, + debouncedUpdateSavedSearch, + savedSearchById, + updateSavedSearch, + isDiscoverSavedSearchLoaded, + activeTab, + status, + discoverTimerange, + savedObjectId, + isFetching, + timelineId, + dispatch, + ]); + useEffect(() => { if (!dataViewId) return; dataViewService.get(dataViewId).then(setDataView); @@ -64,21 +209,29 @@ export const DiscoverTabContent = () => { discoverAppStateSubscription.current, discoverInternalStateSubscription.current, discoverSavedSearchStateSubscription.current, + discoverTimerangeSubscription.current, ].forEach((sub) => { if (sub) sub.unsubscribe(); }); }; return unSubscribeAll; - }, []); + }, [discoverStateContainer]); const initialDiscoverCustomizationCallback: CustomizationCallback = useCallback( async ({ stateContainer }) => { - stateContainerRef.current = stateContainer; + setDiscoverStateContainer(stateContainer); + let savedSearchAppState; + if (savedSearchId) { + const localSavedSearch = await savedSearchService.get(savedSearchId); + savedSearchAppState = getAppStateFromSavedSearch(localSavedSearch); + } + + const finalAppState = savedSearchAppState?.appState ?? discoverAppState; - if (discoverAppState && discoverInternalState && discoverSavedSearchState) { - stateContainer.appState.set(discoverAppState); - await stateContainer.appState.replaceUrlState(discoverAppState); + if (finalAppState) { + stateContainer.appState.set(finalAppState); + await stateContainer.appState.replaceUrlState(finalAppState); } else { // set initial dataView Id if (dataView) stateContainer.actions.setDataView(dataView); @@ -101,18 +254,30 @@ export const DiscoverTabContent = () => { }, }); + const timeRangeSub = discoverDataService.query.timefilter.timefilter + .getTimeUpdate$() + .subscribe({ + next: () => { + setDiscoverTimerange(discoverDataService.query.timefilter.timefilter.getTime()); + }, + }); + discoverAppStateSubscription.current = unsubscribeState; discoverInternalStateSubscription.current = internalStateSubscription; discoverSavedSearchStateSubscription.current = savedSearchStateSub; + discoverTimerangeSubscription.current = timeRangeSub; }, [ discoverAppState, - discoverInternalState, - discoverSavedSearchState, setDiscoverSavedSearchState, setDiscoverInternalState, setDiscoverAppState, dataView, + setDiscoverStateContainer, + getAppStateFromSavedSearch, + discoverDataService.query.timefilter.timefilter, + savedSearchId, + savedSearchService, ] ); @@ -125,13 +290,14 @@ export const DiscoverTabContent = () => { () => ({ data: discoverDataService, filterManager: discoverDataService.query.filterManager, + timefilter: discoverDataService.query.timefilter.timefilter, }), [discoverDataService] ); const DiscoverContainer = discover.DiscoverContainer; - const isLoading = !dataView; + const isLoading = Boolean(!dataView) || !isDiscoverSavedSearchLoaded; return ( diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/translations.ts b/x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/translations.ts new file mode 100644 index 0000000000000..e97da8b29c65e --- /dev/null +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/translations.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const GET_TIMELINE_DISCOVER_SAVED_SEARCH_TITLE = (title: string) => + i18n.translate('xpack.securitySolution.timelines.discoverInTimeline.savedSearchTitle', { + defaultMessage: 'Saved search for timeline - {title}', + values: { title }, + }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/utils/index.test.ts b/x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/utils/index.test.ts new file mode 100644 index 0000000000000..3b25737b25278 --- /dev/null +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/utils/index.test.ts @@ -0,0 +1,89 @@ +/* + * 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 { createSearchSourceMock } from '@kbn/data-plugin/public/mocks'; +import { buildDataViewMock, shallowMockedFields } from '@kbn/discover-utils/src/__mocks__'; +import { savedSearchComparator } from '.'; + +const customQuery = { + language: 'kuery', + query: '_id: *', +}; + +const firstDataViewMock = buildDataViewMock({ + name: 'first-data-view', + fields: shallowMockedFields, +}); + +const secondDataViewMock = buildDataViewMock({ + name: 'second-data-view', + fields: shallowMockedFields, +}); + +describe('savedSearchComparator', () => { + const firstMockSavedSearch = { + id: 'first', + title: 'first title', + breakdownField: 'firstBreakdown Field', + searchSource: createSearchSourceMock({ + index: firstDataViewMock, + query: customQuery, + }), + }; + + const secondMockSavedSearch = { + id: 'second', + title: 'second title', + breakdownField: 'second Breakdown Field', + searchSource: createSearchSourceMock({ + index: secondDataViewMock, + query: customQuery, + }), + }; + it('should result true when saved search is same', () => { + const result = savedSearchComparator(firstMockSavedSearch, { ...firstMockSavedSearch }); + expect(result).toBe(true); + }); + + it('should return false index is different', () => { + const newMockedSavedSearch = { + ...firstMockSavedSearch, + searchSource: secondMockSavedSearch.searchSource, + }; + + const result = savedSearchComparator(firstMockSavedSearch, newMockedSavedSearch); + + expect(result).toBe(false); + }); + + it('should return false when query is different', () => { + const newMockedSavedSearch = { + ...firstMockSavedSearch, + searchSource: createSearchSourceMock({ + index: firstDataViewMock, + query: { + ...customQuery, + query: '*', + }, + }), + }; + + const result = savedSearchComparator(firstMockSavedSearch, newMockedSavedSearch); + + expect(result).toBe(false); + }); + + it('should result false when title is different', () => { + const newMockedSavedSearch = { + ...firstMockSavedSearch, + title: 'new-title', + }; + const result = savedSearchComparator(firstMockSavedSearch, newMockedSavedSearch); + + expect(result).toBe(false); + }); +}); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/utils/index.ts b/x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/utils/index.ts new file mode 100644 index 0000000000000..26340c12add52 --- /dev/null +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/discover_tab_content/utils/index.ts @@ -0,0 +1,43 @@ +/* + * 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 { SavedSearch } from '@kbn/saved-search-plugin/common'; +import { isEqual, pick } from 'lodash'; + +export const savedSearchComparator = ( + inputSavedSearch: SavedSearch | null, + existingSavedSearch: SavedSearch | null +) => { + const inputSavedSearchWithFields = { + ...inputSavedSearch, + fields: inputSavedSearch?.searchSource?.getFields(), + }; + + const existingSavedSearchWithFields = { + ...existingSavedSearch, + fields: existingSavedSearch?.searchSource?.getFields(), + }; + + const keysToSelect = [ + 'columns', + 'grid', + 'hideChart', + 'sort', + 'timeRange', + 'fields.filter', + 'fields.index.id', + 'fields.query', + 'title', + 'description', + ]; + + const modifiedInputSavedSearch = pick(inputSavedSearchWithFields, keysToSelect); + const modifiedExistingSavedSearch = pick(existingSavedSearchWithFields, keysToSelect); + + const result = isEqual(modifiedInputSavedSearch, modifiedExistingSavedSearch); + return result; +}; diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/new_template_timeline.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/new_template_timeline.test.tsx index fcecef0d4c212..ac69b86ec5803 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/new_template_timeline.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/new_template_timeline.test.tsx @@ -8,13 +8,13 @@ import type { ReactWrapper } from 'enzyme'; import { mount } from 'enzyme'; import React from 'react'; -import { Provider as ReduxStoreProvider } from 'react-redux'; import { mockGlobalState, SUB_PLUGINS_REDUCER, kibanaObservable, createSecuritySolutionStorageMock, + TestProviders, } from '../../../../common/mock'; import type { State } from '../../../../common/store'; import { createStore } from '../../../../common/store'; @@ -54,9 +54,9 @@ describe('NewTemplateTimeline', () => { }); wrapper = mount( - + - + ); }); @@ -91,9 +91,9 @@ describe('NewTemplateTimeline', () => { }); wrapper = mount( - + - + ); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/use_create_timeline.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/use_create_timeline.tsx index ad0a8b871bbe5..4742bb995fba3 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/use_create_timeline.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/use_create_timeline.tsx @@ -22,6 +22,7 @@ import { sourcererActions, sourcererSelectors } from '../../../../common/store/s import { SourcererScopeName } from '../../../../common/store/sourcerer/model'; import { appActions } from '../../../../common/store/app'; import type { TimeRange } from '../../../../common/store/inputs/model'; +import { useDiscoverInTimelineContext } from '../../../../common/components/discover_in_timeline/use_discover_in_timeline_context'; interface Props { timelineId?: string; @@ -39,6 +40,8 @@ export const useCreateTimeline = ({ timelineId, timelineType, closeGearMenu }: P const { timelineFullScreen, setTimelineFullScreen } = useTimelineFullScreen(); const globalTimeRange = useDeepEqualSelector(inputsSelectors.globalTimeRangeSelector); + const { resetDiscoverAppState } = useDiscoverInTimelineContext(); + const createTimeline = useCallback( ({ id, show, timeRange: timeRangeParam }) => { const timerange = timeRangeParam ?? globalTimeRange; @@ -110,8 +113,9 @@ export const useCreateTimeline = ({ timelineId, timelineType, closeGearMenu }: P if (typeof closeGearMenu === 'function') { closeGearMenu(); } + resetDiscoverAppState(); }, - [createTimeline, timelineId, timelineType, closeGearMenu] + [createTimeline, timelineId, timelineType, closeGearMenu, resetDiscoverAppState] ); return handleCreateNewTimeline; diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs_content/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs_content/index.tsx index 2707bf7b04ebc..b7b4e92afcb6f 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs_content/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs_content/index.tsx @@ -234,7 +234,7 @@ const ActiveTimelineTab = memo( $isVisible={TimelineTabs.discover === activeTimelineTab} data-test-subj={`timeline-tab-content-${TimelineTabs.discover}`} > - + )} diff --git a/x-pack/plugins/security_solution/public/timelines/containers/api.test.ts b/x-pack/plugins/security_solution/public/timelines/containers/api.test.ts index 09bdaeae29b76..cfac0b1d4b243 100644 --- a/x-pack/plugins/security_solution/public/timelines/containers/api.test.ts +++ b/x-pack/plugins/security_solution/public/timelines/containers/api.test.ts @@ -82,6 +82,7 @@ const timelineData = { }, ], status: TimelineStatus.active, + savedSearchId: null, }; const mockPatchTimelineResponse = { data: { diff --git a/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts b/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts index 2b9dbb45d526f..dee16b6088c49 100644 --- a/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts +++ b/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts @@ -271,3 +271,13 @@ export const clearEventsDeleted = actionCreator<{ export const updateTotalCount = actionCreator<{ id: string; totalCount: number }>( 'UPDATE_TOTAL_COUNT' ); + +export const updateSavedSearchId = actionCreator<{ + id: string; + savedSearchId: string; +}>('UPDATE_DISCOVER_SAVED_SEARCH_ID'); + +export const setIsDiscoverSavedSearchLoaded = actionCreator<{ + id: string; + isDiscoverSavedSearchLoaded: boolean; +}>('SET_IS_DISCOVER_SAVED_SEARCH_LOADED'); diff --git a/x-pack/plugins/security_solution/public/timelines/store/timeline/defaults.ts b/x-pack/plugins/security_solution/public/timelines/store/timeline/defaults.ts index 23e8033a111f9..449a2aa2b13f4 100644 --- a/x-pack/plugins/security_solution/public/timelines/store/timeline/defaults.ts +++ b/x-pack/plugins/security_solution/public/timelines/store/timeline/defaults.ts @@ -78,6 +78,8 @@ export const timelineDefaults: SubsetTimelineModel & selectedEventIds: {}, isSelectAllChecked: false, filters: [], + savedSearchId: null, + isDiscoverSavedSearchLoaded: false, }; export const getTimelineManageDefaults = (id: string) => ({ diff --git a/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.test.ts b/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.test.ts index 527ea01903279..21551dacebc66 100644 --- a/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.test.ts +++ b/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.test.ts @@ -175,6 +175,7 @@ describe('Epic Timeline', () => { version: 'WzM4LDFd', id: '11169110-fc22-11e9-8ca9-072f15ce2685', savedQueryId: 'my endgame timeline query', + savedSearchId: null, }; expect( @@ -309,6 +310,7 @@ describe('Epic Timeline', () => { }, }, savedQueryId: 'my endgame timeline query', + savedSearchId: null, sort: [ { columnId: '@timestamp', diff --git a/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts b/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts index 1cc2b9be725c2..1f71ecd67582e 100644 --- a/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts +++ b/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts @@ -83,6 +83,7 @@ import { addTimeline, showCallOutUnauthorizedMsg, saveTimeline, + updateSavedSearchId, } from './actions'; import type { TimelineModel } from './model'; import { epicPersistNote, timelineNoteActionsType } from './epic_note'; @@ -118,6 +119,8 @@ const timelineActionsType = [ updateSort.type, updateRange.type, upsertColumn.type, + + updateSavedSearchId.type, ]; const isItAtimelineAction = (timelineId: string | undefined) => @@ -346,6 +349,7 @@ const timelineInput: TimelineInput = { savedQueryId: null, sort: null, status: null, + savedSearchId: null, }; export const convertTimelineAsInput = ( diff --git a/x-pack/plugins/security_solution/public/timelines/store/timeline/model.ts b/x-pack/plugins/security_solution/public/timelines/store/timeline/model.ts index 34cf8b6dcaadf..98e50a11aa734 100644 --- a/x-pack/plugins/security_solution/public/timelines/store/timeline/model.ts +++ b/x-pack/plugins/security_solution/public/timelines/store/timeline/model.ts @@ -133,6 +133,9 @@ export interface TimelineModel { isSelectAllChecked: boolean; isLoading: boolean; selectAll: boolean; + /* discover saved search Id */ + savedSearchId: string | null; + isDiscoverSavedSearchLoaded?: boolean; } export type SubsetTimelineModel = Readonly< @@ -186,6 +189,8 @@ export type SubsetTimelineModel = Readonly< | 'status' | 'filters' | 'filterManager' + | 'savedSearchId' + | 'isDiscoverSavedSearchLoaded' > >; @@ -194,4 +199,5 @@ export interface TimelineUrl { id?: string; isOpen: boolean; graphEventId?: string; + savedSearchId?: string; } diff --git a/x-pack/plugins/security_solution/public/timelines/store/timeline/reducer.test.ts b/x-pack/plugins/security_solution/public/timelines/store/timeline/reducer.test.ts index 753b2cf4e0b16..980573f0c73c3 100644 --- a/x-pack/plugins/security_solution/public/timelines/store/timeline/reducer.test.ts +++ b/x-pack/plugins/security_solution/public/timelines/store/timeline/reducer.test.ts @@ -137,6 +137,7 @@ const basicTimeline: TimelineModel = { timelineType: TimelineType.default, title: '', version: null, + savedSearchId: null, }; const timelineByIdMock: TimelineById = { foo: { ...basicTimeline }, @@ -223,6 +224,7 @@ describe('Timeline', () => { indexNames: [], timelineById: timelineByIdMock, timelineType: TimelineType.default, + savedSearchId: null, }); expect(update).not.toBe(timelineByIdMock); }); @@ -235,6 +237,7 @@ describe('Timeline', () => { indexNames: [], timelineById: timelineByIdMock, timelineType: TimelineType.default, + savedSearchId: null, }); expect(update).toEqual({ foo: basicTimeline, @@ -253,6 +256,7 @@ describe('Timeline', () => { indexNames: [], timelineById: timelineByIdMock, timelineType: TimelineType.default, + savedSearchId: null, }); expect(update).toEqual({ foo: basicTimeline, diff --git a/x-pack/plugins/security_solution/public/timelines/store/timeline/reducer.ts b/x-pack/plugins/security_solution/public/timelines/store/timeline/reducer.ts index e661fadf428d2..704017a10a7ca 100644 --- a/x-pack/plugins/security_solution/public/timelines/store/timeline/reducer.ts +++ b/x-pack/plugins/security_solution/public/timelines/store/timeline/reducer.ts @@ -59,6 +59,8 @@ import { applyDeltaToColumnWidth, clearEventsDeleted, clearEventsLoading, + updateSavedSearchId, + setIsDiscoverSavedSearchLoaded, } from './actions'; import { @@ -530,4 +532,24 @@ export const timelineReducer = reducerWithInitialState(initialTimelineState) }, }, })) + .case(updateSavedSearchId, (state, { id, savedSearchId }) => ({ + ...state, + timelineById: { + ...state.timelineById, + [id]: { + ...state.timelineById[id], + savedSearchId, + }, + }, + })) + .case(setIsDiscoverSavedSearchLoaded, (state, { id, isDiscoverSavedSearchLoaded }) => ({ + ...state, + timelineById: { + ...state.timelineById, + [id]: { + ...state.timelineById[id], + isDiscoverSavedSearchLoaded, + }, + }, + })) .build(); diff --git a/x-pack/plugins/security_solution/public/types.ts b/x-pack/plugins/security_solution/public/types.ts index 6b16958f65808..f13fcc6e2877a 100644 --- a/x-pack/plugins/security_solution/public/types.ts +++ b/x-pack/plugins/security_solution/public/types.ts @@ -55,6 +55,7 @@ import type { DiscoverStart } from '@kbn/discover-plugin/public'; import type { NavigationPublicPluginStart } from '@kbn/navigation-plugin/public'; import type { DataViewEditorStart } from '@kbn/data-view-editor-plugin/public'; import type { UpsellingService } from '@kbn/security-solution-upselling/service'; +import type { SavedSearchPublicPluginStart } from '@kbn/saved-search-plugin/public'; import type { ResolverPluginSetup } from './resolver/types'; import type { Inspect } from '../common/search_strategy'; import type { Detections } from './detections'; @@ -130,6 +131,7 @@ export interface StartPlugins { discover: DiscoverStart; navigation: NavigationPublicPluginStart; dataViewEditor: DataViewEditorStart; + savedSearch: SavedSearchPublicPluginStart; } export interface StartPluginsDependencies extends StartPlugins { diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/convert_saved_object_to_savedtimeline.ts b/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/convert_saved_object_to_savedtimeline.ts index f93d8a5fef73c..60d2e1cdca502 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/convert_saved_object_to_savedtimeline.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/convert_saved_object_to_savedtimeline.ts @@ -81,6 +81,7 @@ export const convertSavedObjectToSavedTimeline = (savedObject: unknown): Timelin ? savedTimeline.attributes.sort : [savedTimeline.attributes.sort] : [], + savedSearchId: savedTimeline.attributes.savedSearchId, }; return { diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts b/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts index d133e9b114f8b..bc4fdfb1f79bf 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts @@ -316,6 +316,9 @@ export const timelineSavedObjectMappings: SavedObjectsType['mappings'] = { updatedBy: { type: 'text', }, + savedSearchId: { + type: 'text', + }, }, }; diff --git a/x-pack/plugins/security_solution/tsconfig.json b/x-pack/plugins/security_solution/tsconfig.json index 3dbc778394ecb..0eea99624d611 100644 --- a/x-pack/plugins/security_solution/tsconfig.json +++ b/x-pack/plugins/security_solution/tsconfig.json @@ -171,6 +171,7 @@ "@kbn/core-lifecycle-browser", "@kbn/security-solution-features", "@kbn/content-management-plugin", + "@kbn/discover-utils", "@kbn/subscription-tracking", "@kbn/openapi-generator" ] diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/discover/discover_state.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/discover/discover_state.cy.ts index 1a11e677e74d0..ad73a9b33524f 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/discover/discover_state.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/discover/discover_state.cy.ts @@ -89,8 +89,8 @@ describe( navigateFromHeaderTo(ALERTS); openActiveTimeline(); gotToDiscoverTab(); - cy.get(GET_DISCOVER_DATA_GRID_CELL_HEADER('host.name')).should('be.visible'); - cy.get(GET_DISCOVER_DATA_GRID_CELL_HEADER('user.name')).should('be.visible'); + cy.get(GET_DISCOVER_DATA_GRID_CELL_HEADER('host.name')).should('exist'); + cy.get(GET_DISCOVER_DATA_GRID_CELL_HEADER('user.name')).should('exist'); }); } ); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/discover/discover_timeline_state_integration.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/discover/discover_timeline_state_integration.cy.ts new file mode 100644 index 0000000000000..9f8612551c51c --- /dev/null +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/discover/discover_timeline_state_integration.cy.ts @@ -0,0 +1,293 @@ +/* + * 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 { visitWithTimeRange } from '../../../../tasks/navigation'; +import { TIMELINE_TITLE } from '../../../../screens/timeline'; +import { BASIC_TABLE_LOADING } from '../../../../screens/common'; +import { goToSavedObjectSettings } from '../../../../tasks/stack_management'; +import { + navigateFromKibanaCollapsibleTo, + openKibanaNavigation, +} from '../../../../tasks/kibana_navigation'; +import { fillAddFilterForm } from '../../../../tasks/search_bar'; +import { + addDiscoverKqlQuery, + addFieldToTable, + openAddDiscoverFilterPopover, + switchDataViewTo, + switchDataViewToESQL, +} from '../../../../tasks/discover'; +import { + GET_LOCAL_DATE_PICKER_START_DATE_POPOVER_BUTTON, + GET_LOCAL_SHOW_DATES_BUTTON, +} from '../../../../screens/date_picker'; +import { ALERTS_URL } from '../../../../urls/navigation'; +import { + DISCOVER_CONTAINER, + DISCOVER_DATA_VIEW_SWITCHER, + DISCOVER_FILTER_BADGES, + DISCOVER_QUERY_INPUT, + GET_DISCOVER_DATA_GRID_CELL_HEADER, +} from '../../../../screens/discover'; +import { updateDateRangeInLocalDatePickers } from '../../../../tasks/date_picker'; +import { login } from '../../../../tasks/login'; +import { + addDescriptionToTimeline, + addNameToTimeline, + createNewTimeline, + gotToDiscoverTab, + openTimelineById, + openTimelineFromSettings, + waitForTimelineChanges, +} from '../../../../tasks/timeline'; +import { LOADING_INDICATOR } from '../../../../screens/security_header'; +import { STACK_MANAGEMENT_PAGE } from '../../../../screens/kibana_navigation'; +import { + GET_SAVED_OBJECTS_TAGS_OPTION, + SAVED_OBJECTS_ROW_TITLES, + SAVED_OBJECTS_TAGS_FILTER, +} from '../../../../screens/common/stack_management'; + +const INITIAL_START_DATE = 'Jan 18, 2021 @ 20:33:29.186'; +const INITIAL_END_DATE = 'Jan 19, 2024 @ 20:33:29.186'; +const SAVED_SEARCH_UPDATE_REQ = 'SAVED_SEARCH_UPDATE_REQ'; +const SAVED_SEARCH_UPDATE_WITH_DESCRIPTION = 'SAVED_SEARCH_UPDATE_WITH_DESCRIPTION'; +const SAVED_SEARCH_CREATE_REQ = 'SAVED_SEARCH_CREATE_REQ'; +const SAVED_SEARCH_GET_REQ = 'SAVED_SEARCH_GET_REQ'; +const TIMELINE_REQ_WITH_SAVED_SEARCH = 'TIMELINE_REQ_WITH_SAVED_SEARCH'; +const TIMELINE_PATCH_REQ = 'TIMELINE_PATCH_REQ'; + +const TIMELINE_RESPONSE_SAVED_OBJECT_ID_PATH = + 'response.body.data.persistTimeline.timeline.savedObjectId'; + +describe( + 'Discover Timeline State Integration', + { + env: { ftrConfig: { enableExperimental: ['discoverInTimeline'] } }, + tags: ['@ess', '@brokenInServerless'], + // ESQL and test involving STACK_MANAGEMENT_PAGE are broken in serverless + }, + + () => { + beforeEach(() => { + cy.intercept('PATCH', '/api/timeline', (req) => { + if (req.body.hasOwnProperty('timeline') && req.body.timeline.savedSearchId === null) { + req.alias = TIMELINE_PATCH_REQ; + } + }); + cy.intercept('PATCH', '/api/timeline', (req) => { + if (req.body.hasOwnProperty('timeline') && req.body.timeline.savedSearchId !== null) { + req.alias = TIMELINE_REQ_WITH_SAVED_SEARCH; + } + }); + cy.intercept('POST', '/api/content_management/rpc/get', (req) => { + if (req.body.hasOwnProperty('contentTypeId') && req.body.contentTypeId === 'search') { + req.alias = SAVED_SEARCH_GET_REQ; + } + }); + cy.intercept('POST', '/api/content_management/rpc/create', (req) => { + if (req.body.hasOwnProperty('contentTypeId') && req.body.contentTypeId === 'search') { + req.alias = SAVED_SEARCH_CREATE_REQ; + } + }); + + cy.intercept('POST', '/api/content_management/rpc/update', (req) => { + if (req.body.hasOwnProperty('contentTypeId') && req.body.contentTypeId === 'search') { + req.alias = SAVED_SEARCH_UPDATE_REQ; + } + }); + cy.intercept('POST', '/api/content_management/rpc/update', (req) => { + if ( + req.body.hasOwnProperty('data') && + req.body.data.hasOwnProperty('description') && + req.body.data.description.length > 0 + ) { + req.alias = SAVED_SEARCH_UPDATE_WITH_DESCRIPTION; + } + }); + login(); + visitWithTimeRange(ALERTS_URL); + createNewTimeline(); + gotToDiscoverTab(); + updateDateRangeInLocalDatePickers(DISCOVER_CONTAINER, INITIAL_START_DATE, INITIAL_END_DATE); + }); + context('save/restore', () => { + it('should be able create an empty timeline with default discover state', () => { + addNameToTimeline('Timerange timeline'); + createNewTimeline(); + gotToDiscoverTab(); + cy.get(GET_LOCAL_SHOW_DATES_BUTTON(DISCOVER_CONTAINER)).should( + 'contain.text', + `Last 15 minutes` + ); + }); + it('should save/restore discover dataview/timerange/filter/query/columns when saving/resoring timeline', () => { + const dataviewName = '.kibana-event-log'; + const timelineSuffix = Date.now(); + const timelineName = `DataView timeline-${timelineSuffix}`; + const kqlQuery = '_id:*'; + const column1 = 'event.category'; + const column2 = 'ecs.version'; + switchDataViewTo(dataviewName); + addDiscoverKqlQuery(kqlQuery); + openAddDiscoverFilterPopover(); + fillAddFilterForm({ + key: 'ecs.version', + value: '1.8.0', + }); + addFieldToTable(column1); + addFieldToTable(column2); + + // create a custom timeline + addNameToTimeline(timelineName); + cy.wait(`@${TIMELINE_PATCH_REQ}`) + .its(TIMELINE_RESPONSE_SAVED_OBJECT_ID_PATH) + .then((timelineId) => { + cy.wait(`@${TIMELINE_REQ_WITH_SAVED_SEARCH}`); + // create an empty timeline + createNewTimeline(); + // switch to old timeline + openTimelineFromSettings(); + openTimelineById(timelineId); + cy.get(LOADING_INDICATOR).should('not.exist'); + gotToDiscoverTab(); + cy.get(DISCOVER_DATA_VIEW_SWITCHER.BTN).should('contain.text', dataviewName); + cy.get(DISCOVER_QUERY_INPUT).should('have.text', kqlQuery); + cy.get(DISCOVER_FILTER_BADGES).should('have.length', 1); + cy.get(DISCOVER_FILTER_BADGES).should('contain.text', 'ecs.version: 1.8.0'); + cy.get(GET_DISCOVER_DATA_GRID_CELL_HEADER(column1)).should('exist'); + cy.get(GET_DISCOVER_DATA_GRID_CELL_HEADER(column2)).should('exist'); + cy.get(GET_LOCAL_DATE_PICKER_START_DATE_POPOVER_BUTTON(DISCOVER_CONTAINER)).should( + 'have.text', + INITIAL_START_DATE + ); + }); + }); + it('should save/restore discover dataview/timerange/filter/query/columns when timeline is opened via url', () => { + const dataviewName = '.kibana-event-log'; + const timelineSuffix = Date.now(); + const timelineName = `DataView timeline-${timelineSuffix}`; + const kqlQuery = '_id:*'; + const column1 = 'event.category'; + const column2 = 'ecs.version'; + switchDataViewTo(dataviewName); + addDiscoverKqlQuery(kqlQuery); + openAddDiscoverFilterPopover(); + fillAddFilterForm({ + key: 'ecs.version', + value: '1.8.0', + }); + addFieldToTable(column1); + addFieldToTable(column2); + + // create a custom timeline + addNameToTimeline(timelineName); + cy.wait(`@${TIMELINE_PATCH_REQ}`) + .its(TIMELINE_RESPONSE_SAVED_OBJECT_ID_PATH) + .then((timelineId) => { + cy.wait(`@${TIMELINE_REQ_WITH_SAVED_SEARCH}`); + // reload the page with the exact url + cy.reload(); + cy.get(DISCOVER_DATA_VIEW_SWITCHER.BTN).should('contain.text', dataviewName); + cy.get(DISCOVER_QUERY_INPUT).should('have.text', kqlQuery); + cy.get(DISCOVER_FILTER_BADGES).should('have.length', 1); + cy.get(DISCOVER_FILTER_BADGES).should('contain.text', 'ecs.version: 1.8.0'); + cy.get(GET_DISCOVER_DATA_GRID_CELL_HEADER(column1)).should('exist'); + cy.get(GET_DISCOVER_DATA_GRID_CELL_HEADER(column2)).should('exist'); + cy.get(GET_LOCAL_DATE_PICKER_START_DATE_POPOVER_BUTTON(DISCOVER_CONTAINER)).should( + 'have.text', + INITIAL_START_DATE + ); + }); + }); + it('should save/restore discover ES|QL when saving timeline', () => { + const timelineSuffix = Date.now(); + const timelineName = `ES|QL timeline-${timelineSuffix}`; + switchDataViewToESQL(); + addNameToTimeline(timelineName); + cy.wait(`@${TIMELINE_PATCH_REQ}`) + .its(TIMELINE_RESPONSE_SAVED_OBJECT_ID_PATH) + .then((timelineId) => { + cy.wait(`@${TIMELINE_REQ_WITH_SAVED_SEARCH}`); + // create an empty timeline + createNewTimeline(); + // switch to old timeline + openTimelineFromSettings(); + openTimelineById(timelineId); + cy.get(LOADING_INDICATOR).should('not.exist'); + gotToDiscoverTab(); + cy.get(DISCOVER_DATA_VIEW_SWITCHER.BTN).should('contain.text', 'ES|QL'); + }); + }); + }); + /* + * skipping because it is @brokenInServerless and this cypress tag was somehow not working + * so skipping this test both in ess and serverless. + * + * Raised issue: https://github.com/elastic/kibana/issues/165913 + * + * */ + context.skip('saved search tags', () => { + it('should save discover saved search with `Security Solution` tag', () => { + const timelineSuffix = Date.now(); + const timelineName = `SavedObject timeline-${timelineSuffix}`; + const kqlQuery = '_id: *'; + addDiscoverKqlQuery(kqlQuery); + addNameToTimeline(timelineName); + cy.wait(`@${TIMELINE_REQ_WITH_SAVED_SEARCH}`); + openKibanaNavigation(); + navigateFromKibanaCollapsibleTo(STACK_MANAGEMENT_PAGE); + cy.get(LOADING_INDICATOR).should('not.exist'); + goToSavedObjectSettings(); + cy.get(LOADING_INDICATOR).should('not.exist'); + cy.get(SAVED_OBJECTS_TAGS_FILTER).trigger('click'); + cy.get(GET_SAVED_OBJECTS_TAGS_OPTION('Security_Solution')).trigger('click'); + cy.get(BASIC_TABLE_LOADING).should('not.exist'); + cy.get(SAVED_OBJECTS_ROW_TITLES).should( + 'contain.text', + `Saved Search for timeline - ${timelineName}` + ); + }); + }); + context('saved search', () => { + it('should rename the saved search on timeline rename', () => { + const timelineSuffix = Date.now(); + const timelineName = `Rename timeline-${timelineSuffix}`; + const kqlQuery = '_id: *'; + addDiscoverKqlQuery(kqlQuery); + + addNameToTimeline(timelineName); + cy.wait(`@${TIMELINE_PATCH_REQ}`) + .its(TIMELINE_RESPONSE_SAVED_OBJECT_ID_PATH) + .then((timelineId) => { + cy.wait(`@${SAVED_SEARCH_UPDATE_REQ}`); + cy.wait(`@${TIMELINE_REQ_WITH_SAVED_SEARCH}`); + // create an empty timeline + createNewTimeline(); + // switch to old timeline + openTimelineFromSettings(); + openTimelineById(timelineId); + cy.get(TIMELINE_TITLE).should('have.text', timelineName); + const timelineDesc = 'Timeline Description with Saved Seach'; + waitForTimelineChanges(); + addDescriptionToTimeline(timelineDesc); + cy.wait(`@${SAVED_SEARCH_UPDATE_WITH_DESCRIPTION}`, { + timeout: 30000, + }).then((interception) => { + expect(interception.request.body.data.description).eq(timelineDesc); + }); + }); + }); + }); + + // Issue for enabling below tests: https://github.com/elastic/kibana/issues/165913 + context.skip('Advanced Settings', () => { + it('rows per page in saved search should be according to the user selected number of pages', () => {}); + it('rows per page in new search should be according to the value selected in advanced settings', () => {}); + }); + } +); diff --git a/x-pack/test/security_solution_cypress/cypress/screens/common/stack_management.ts b/x-pack/test/security_solution_cypress/cypress/screens/common/stack_management.ts new file mode 100644 index 0000000000000..acb9ac4f324a8 --- /dev/null +++ b/x-pack/test/security_solution_cypress/cypress/screens/common/stack_management.ts @@ -0,0 +1,21 @@ +/* + * 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 { getDataTestSubjectSelector } from '../../helpers/common'; + +export const STACK_MANAGEMENT_HOME = getDataTestSubjectSelector('managementHome'); + +export const SAVED_OBJECTS_SETTINGS = `${getDataTestSubjectSelector('objects')}`; + +export const SAVED_OBJECTS_TAGS_FILTER = '[data-text="Tags"][title="Tags"]'; + +export const GET_SAVED_OBJECTS_TAGS_OPTION = (optionId: string) => + getDataTestSubjectSelector(`tag-searchbar-option-${optionId}`); + +export const SAVED_OBJECTS_SEARCH_BAR = getDataTestSubjectSelector('savedObjectSearchBar'); + +export const SAVED_OBJECTS_ROW_TITLES = getDataTestSubjectSelector('savedObjectsTableRowTitle'); diff --git a/x-pack/test/security_solution_cypress/cypress/screens/discover.ts b/x-pack/test/security_solution_cypress/cypress/screens/discover.ts index 72f0801fde778..a728c1f4c82bd 100644 --- a/x-pack/test/security_solution_cypress/cypress/screens/discover.ts +++ b/x-pack/test/security_solution_cypress/cypress/screens/discover.ts @@ -15,6 +15,7 @@ export const DISCOVER_DATA_VIEW_SWITCHER = { INPUT: getDataTestSubjectSelector('indexPattern-switcher--input'), GET_DATA_VIEW: (title: string) => `.euiSelectableListItem[role=option][title^="${title}"]`, CREATE_NEW: getDataTestSubjectSelector('dataview-create-new'), + TEXT_BASE_LANG_SWICTHER: getDataTestSubjectSelector('select-text-based-language-panel'), }; export const DISCOVER_DATA_VIEW_EDITOR_FLYOUT = { diff --git a/x-pack/test/security_solution_cypress/cypress/screens/kibana_navigation.ts b/x-pack/test/security_solution_cypress/cypress/screens/kibana_navigation.ts index d9b3f23f13873..739e33a14f254 100644 --- a/x-pack/test/security_solution_cypress/cypress/screens/kibana_navigation.ts +++ b/x-pack/test/security_solution_cypress/cypress/screens/kibana_navigation.ts @@ -38,3 +38,6 @@ export const SPACES_BUTTON = '[data-test-subj="spacesNavSelector"]'; export const APP_LEAVE_CONFIRM_MODAL = '[data-test-subj="appLeaveConfirmModal"]'; export const getGoToSpaceMenuItem = (space: string) => `[data-test-subj="space-avatar-${space}"]`; + +export const STACK_MANAGEMENT_PAGE = + '[data-test-subj="collapsibleNavAppLink"] [title="Stack Management"]'; diff --git a/x-pack/test/security_solution_cypress/cypress/screens/timeline.ts b/x-pack/test/security_solution_cypress/cypress/screens/timeline.ts index 7df6b0408c19e..78b25d890c9c7 100644 --- a/x-pack/test/security_solution_cypress/cypress/screens/timeline.ts +++ b/x-pack/test/security_solution_cypress/cypress/screens/timeline.ts @@ -6,7 +6,7 @@ */ import type { TimelineFilter } from '../objects/timeline'; -import { getDataTestSubjectSelector } from '../helpers/common'; +import { getDataTestSubjectSelector, getDataTestSubjectSelectorStartWith } from '../helpers/common'; export const ADD_NOTE_BUTTON = '[data-test-subj="add-note"]'; @@ -209,7 +209,7 @@ export const TIMELINE_FILTER = (filter: TimelineFilter) => export const TIMELINE_FILTER_FIELD = '[data-test-subj="filterFieldSuggestionList"]'; -export const TIMELINE_TITLE_BY_ID = (id: string) => `[data-test-subj="title-${id}"]`; +export const TIMELINE_TITLE_BY_ID = (id: string) => `[data-test-subj="timeline-title-${id}"]`; export const TIMELINE_FILTER_OPERATOR = '[data-test-subj="filterOperatorList"]'; @@ -346,3 +346,11 @@ export const DISCOVER_TAB = getDataTestSubjectSelector('timelineTabs-discover'); export const TIMELINE_DATE_PICKER_CONTAINER = getDataTestSubjectSelector( 'timeline-date-picker-container' ); + +export const OPEN_TIMELINE_MODAL_SEARCH_BAR = `${OPEN_TIMELINE_MODAL} ${getDataTestSubjectSelector( + 'search-bar' +)}`; + +export const OPEN_TIMELINE_MODAL_TIMELINE_NAMES = `${OPEN_TIMELINE_MODAL} ${getDataTestSubjectSelectorStartWith( + 'timeline-title-' +)}`; diff --git a/x-pack/test/security_solution_cypress/cypress/screens/timelines.ts b/x-pack/test/security_solution_cypress/cypress/screens/timelines.ts index d38ccfb0ea49e..b7d12bca8b744 100644 --- a/x-pack/test/security_solution_cypress/cypress/screens/timelines.ts +++ b/x-pack/test/security_solution_cypress/cypress/screens/timelines.ts @@ -23,7 +23,7 @@ export const TIMELINE = (id: string | undefined) => { if (id == null) { throw new TypeError('id should never be null or undefined'); } - return `[data-test-subj="title-${id}"]`; + return `[data-test-subj="timeline-title-${id}"]`; }; export const TIMELINE_CHECKBOX = (id: string) => { @@ -36,7 +36,7 @@ export const TIMELINE_ITEM_ACTION_BTN = (id: string) => { export const EXPORT_TIMELINE = '[data-test-subj="export-timeline"]'; -export const TIMELINE_NAME = '[data-test-subj^=title]'; +export const TIMELINE_NAME = '[data-test-subj^=timeline-title-]'; export const TIMELINES_FAVORITE = '[data-test-subj="favorite-starFilled-star"]'; diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/discover.ts b/x-pack/test/security_solution_cypress/cypress/tasks/discover.ts index 3da381e1b0af5..90623f239c326 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/discover.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/discover.ts @@ -21,10 +21,16 @@ import { GET_LOCAL_SEARCH_BAR_SUBMIT_BUTTON } from '../screens/search_bar'; export const switchDataViewTo = (dataviewName: string) => { openDataViewSwitcher(); cy.get(DISCOVER_DATA_VIEW_SWITCHER.GET_DATA_VIEW(dataviewName)).trigger('click'); - cy.get(DISCOVER_DATA_VIEW_SWITCHER.INPUT).should('not.be.visible'); + cy.get(DISCOVER_DATA_VIEW_SWITCHER.INPUT).should('not.exist'); cy.get(DISCOVER_DATA_VIEW_SWITCHER.BTN).should('contain.text', dataviewName); }; +export const switchDataViewToESQL = () => { + openDataViewSwitcher(); + cy.get(DISCOVER_DATA_VIEW_SWITCHER.TEXT_BASE_LANG_SWICTHER).trigger('click'); + cy.get(DISCOVER_DATA_VIEW_SWITCHER.BTN).should('contain.text', 'ES|QL'); +}; + export const openDataViewSwitcher = () => { cy.get(DISCOVER_DATA_VIEW_SWITCHER.BTN).click(); cy.get(DISCOVER_DATA_VIEW_SWITCHER.INPUT).should('be.visible'); @@ -38,7 +44,7 @@ export const waitForDiscoverGridToLoad = () => { }; export const addDiscoverKqlQuery = (kqlQuery: string) => { - cy.get(DISCOVER_QUERY_INPUT).type(kqlQuery); + cy.get(DISCOVER_QUERY_INPUT).type(`${kqlQuery}{enter}`); }; export const submitDiscoverSearchBar = () => { diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/stack_management.ts b/x-pack/test/security_solution_cypress/cypress/tasks/stack_management.ts new file mode 100644 index 0000000000000..4c53443c13ae1 --- /dev/null +++ b/x-pack/test/security_solution_cypress/cypress/tasks/stack_management.ts @@ -0,0 +1,14 @@ +/* + * 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 { SAVED_OBJECTS_SETTINGS } from '../screens/common/stack_management'; + +export const goToSavedObjectSettings = () => { + cy.get(SAVED_OBJECTS_SETTINGS).scrollIntoView(); + cy.get(SAVED_OBJECTS_SETTINGS).should('be.visible').focus(); + cy.get(SAVED_OBJECTS_SETTINGS).should('be.visible').click(); +}; diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/timeline.ts b/x-pack/test/security_solution_cypress/cypress/tasks/timeline.ts index ced47a6700e7c..6c985c6d93cc1 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/timeline.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/timeline.ts @@ -9,6 +9,7 @@ import { recurse } from 'cypress-recurse'; import type { Timeline, TimelineFilter } from '../objects/timeline'; import { ALL_CASES_CREATE_NEW_CASE_TABLE_BTN } from '../screens/all_cases'; +import { BASIC_TABLE_LOADING } from '../screens/common'; import { FIELDS_BROWSER_CHECKBOX } from '../screens/fields_browser'; import { LOADING_INDICATOR } from '../screens/security_header'; @@ -83,6 +84,9 @@ import { PROVIDER_BADGE, PROVIDER_BADGE_DELETE, DISCOVER_TAB, + OPEN_TIMELINE_MODAL_TIMELINE_NAMES, + OPEN_TIMELINE_MODAL_SEARCH_BAR, + OPEN_TIMELINE_MODAL, } from '../screens/timeline'; import { REFRESH_BUTTON, TIMELINE } from '../screens/timelines'; import { drag, drop } from './common'; @@ -137,8 +141,13 @@ export const goToNotesTab = (): Cypress.Chainable> => { }; export const gotToDiscoverTab = () => { - cy.get(DISCOVER_TAB).click(); - cy.get(DISCOVER_TAB).should('have.class', 'euiTab-isSelected'); + recurse( + () => cy.get(DISCOVER_TAB).click(), + ($el) => expect($el).to.have.class('euiTab-isSelected'), + { + delay: 500, + } + ); }; export const goToCorrelationTab = () => { @@ -487,3 +496,12 @@ export const setKibanaTimezoneToUTC = () => .then(() => { cy.reload(); }); + +export const openTimelineFromOpenTimelineModal = (timelineName: string) => { + cy.get(OPEN_TIMELINE_MODAL_TIMELINE_NAMES).should('have.lengthOf.gt', 0); + cy.get(BASIC_TABLE_LOADING).should('not.exist'); + cy.get(OPEN_TIMELINE_MODAL_SEARCH_BAR).type(`${timelineName}{enter}`); + cy.get(OPEN_TIMELINE_MODAL_TIMELINE_NAMES).should('have.lengthOf', 1); + cy.get(OPEN_TIMELINE_MODAL).should('contain.text', timelineName); + cy.get(OPEN_TIMELINE_MODAL_TIMELINE_NAMES).first().click(); +}; diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/responder.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/responder.ts index 5a0f0fdf93ec1..6a220d35ffffd 100644 --- a/x-pack/test/security_solution_endpoint/apps/endpoint/responder.ts +++ b/x-pack/test/security_solution_endpoint/apps/endpoint/responder.ts @@ -142,6 +142,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { serializedQuery: getEndpointAlertsQueryForAgentId(endpointAgentId).$stringify(), }, }, + savedSearchId: null, }, timeline.data.persistTimeline.timeline.version ); diff --git a/x-pack/test/security_solution_ftr/page_objects/timeline/index.ts b/x-pack/test/security_solution_ftr/page_objects/timeline/index.ts index ce37e487749b7..b6c41a813b07e 100644 --- a/x-pack/test/security_solution_ftr/page_objects/timeline/index.ts +++ b/x-pack/test/security_solution_ftr/page_objects/timeline/index.ts @@ -57,7 +57,7 @@ export class TimelinePageObject extends FtrService { await this.showOpenTimelinePopupFromBottomBar(); await this.testSubjects.click('open-timeline-button'); await this.testSubjects.findService.clickByCssSelector( - `${testSubjSelector('open-timeline-modal')} ${testSubjSelector(`title-${id}`)}` + `${testSubjSelector('open-timeline-modal')} ${testSubjSelector(`timeline-title-${id}`)}` ); await this.ensureTimelineIsOpen(); diff --git a/x-pack/test/security_solution_ftr/services/timeline/index.ts b/x-pack/test/security_solution_ftr/services/timeline/index.ts index 8c87c92d7f6d6..b9acf21a9384e 100644 --- a/x-pack/test/security_solution_ftr/services/timeline/index.ts +++ b/x-pack/test/security_solution_ftr/services/timeline/index.ts @@ -90,6 +90,7 @@ export class TimelineTestService extends FtrService { eventCategoryField: 'event.category', timestampField: '@timestamp', }, + savedSearchId: null, }; // Update the timeline @@ -187,6 +188,7 @@ export class TimelineTestService extends FtrService { serializedQuery: JSON.stringify(esQuery), }, }, + savedSearchId: null, }, newTimeline.data.persistTimeline.timeline.version ); From 6804232663b330843966210511a35cf0396a7e3a Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 28 Sep 2023 14:26:09 -0400 Subject: [PATCH 44/61] skip failing test suite (#167552) --- x-pack/test/functional/apps/lens/group6/annotations.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/functional/apps/lens/group6/annotations.ts b/x-pack/test/functional/apps/lens/group6/annotations.ts index aa3b409d21fb0..cac637ca64ff6 100644 --- a/x-pack/test/functional/apps/lens/group6/annotations.ts +++ b/x-pack/test/functional/apps/lens/group6/annotations.ts @@ -26,7 +26,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const from = 'Sep 19, 2015 @ 06:31:44.000'; const to = 'Sep 23, 2015 @ 18:31:44.000'; - describe('lens annotations tests', () => { + // Failing: See https://github.com/elastic/kibana/issues/167552 + describe.skip('lens annotations tests', () => { before(async () => { await PageObjects.common.setTime({ from, to }); }); From 5a785e8a4197e415f7c680e8623882be30c7d3b8 Mon Sep 17 00:00:00 2001 From: Alex Szabo Date: Thu, 28 Sep 2023 20:35:32 +0200 Subject: [PATCH 45/61] [Ops] ES Serverless image verification fixes (#167223) ## Summary ### Error 1: Strict mode throws an error on non-filled variables. I forgot to add this when creating the script ``` .buildkite/scripts/steps/es_serverless/promote_es_serverless_image.sh: line 40: UPLOAD_MANIFEST: unbound variable ``` ### Error 2: Uploading multi-arch images https://elastic.slack.com/archives/C5UDAFZQU/p1695725623585409 We've noticed that the downloaded `latest-verified` images are slower to start up than normal. After inspecting the manifests, it seems we were getting `linux/amd64` on our arm devices as well. The solution is to grab and upload both platform variants. (using this blog: https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/) --- .../promote_es_serverless_image.sh | 40 ++++++++++++++++--- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/.buildkite/scripts/steps/es_serverless/promote_es_serverless_image.sh b/.buildkite/scripts/steps/es_serverless/promote_es_serverless_image.sh index c6bf1738fe144..c0a5a0d4e8407 100755 --- a/.buildkite/scripts/steps/es_serverless/promote_es_serverless_image.sh +++ b/.buildkite/scripts/steps/es_serverless/promote_es_serverless_image.sh @@ -24,11 +24,37 @@ echo "--- Promoting ${SOURCE_IMAGE_OR_TAG} to ':latest-verified'" echo "Re-tagging $SOURCE_IMAGE -> $TARGET_IMAGE" echo "$KIBANA_DOCKER_PASSWORD" | docker login -u "$KIBANA_DOCKER_USERNAME" --password-stdin docker.elastic.co -docker pull "$SOURCE_IMAGE" -docker tag "$SOURCE_IMAGE" "$TARGET_IMAGE" -docker push "$TARGET_IMAGE" -ORIG_IMG_DATA=$(docker inspect "$SOURCE_IMAGE") +docker manifest inspect "$SOURCE_IMAGE" | tee manifests.json + +ARM_64_DIGEST=$(jq -r '.manifests[] | select(.platform.architecture == "arm64") | .digest' manifests.json) +AMD_64_DIGEST=$(jq -r '.manifests[] | select(.platform.architecture == "amd64") | .digest' manifests.json) + +echo docker pull --platform linux/arm64 "$SOURCE_IMAGE@$ARM_64_DIGEST" +docker pull --platform linux/arm64 "$SOURCE_IMAGE@$ARM_64_DIGEST" +echo linux/arm64 image pulled, with digest: $ARM_64_DIGEST + +echo docker pull --platform linux/amd64 "$SOURCE_IMAGE@$AMD_64_DIGEST" +docker pull --platform linux/amd64 "$SOURCE_IMAGE@$AMD_64_DIGEST" +echo linux/amd64 image pulled, with digest: $AMD_64_DIGEST + +docker tag "$SOURCE_IMAGE@$ARM_64_DIGEST" "$TARGET_IMAGE-arm64" +docker tag "$SOURCE_IMAGE@$AMD_64_DIGEST" "$TARGET_IMAGE-amd64" + +docker push "$TARGET_IMAGE-arm64" +docker push "$TARGET_IMAGE-amd64" + +docker manifest rm "$TARGET_IMAGE" || echo "Nothing to delete" + +docker manifest create "$TARGET_IMAGE" \ +--amend "$TARGET_IMAGE-arm64" \ +--amend "$TARGET_IMAGE-amd64" + +docker manifest push "$TARGET_IMAGE" + +docker manifest inspect "$TARGET_IMAGE" + +ORIG_IMG_DATA=$(docker inspect "$SOURCE_IMAGE@$ARM_64_DIGEST") ELASTIC_COMMIT_HASH=$(echo $ORIG_IMG_DATA | jq -r '.[].Config.Labels["org.opencontainers.image.revision"]') docker logout docker.elastic.co @@ -37,7 +63,7 @@ echo "Image push to $TARGET_IMAGE successful." echo "Promotion successful! Henceforth, thou shall be named Sir $TARGET_IMAGE" MANIFEST_UPLOAD_PATH="Skipped" -if [[ "$UPLOAD_MANIFEST" =~ ^(1|true)$ && "$SOURCE_IMAGE_OR_TAG" =~ ^git-[0-9a-fA-F]{12}$ ]]; then +if [[ "${UPLOAD_MANIFEST:-}" =~ ^(1|true)$ && "$SOURCE_IMAGE_OR_TAG" =~ ^git-[0-9a-fA-F]{12}$ ]]; then echo "--- Uploading latest-verified manifest to GCS" cat << EOT >> $MANIFEST_FILE_NAME { @@ -58,10 +84,12 @@ EOT gsutil acl ch -u AllUsers:R "gs://$ES_SERVERLESS_BUCKET/$MANIFEST_FILE_NAME" MANIFEST_UPLOAD_PATH="$MANIFEST_FILE_NAME" -elif [[ "$UPLOAD_MANIFEST" =~ ^(1|true)$ ]]; then +elif [[ "${UPLOAD_MANIFEST:-}" =~ ^(1|true)$ ]]; then echo "--- Skipping upload of latest-verified manifest to GCS, ES Serverless build tag is not pointing to a hash" elif [[ "$SOURCE_IMAGE_OR_TAG" =~ ^git-[0-9a-fA-F]{12}$ ]]; then echo "--- Skipping upload of latest-verified manifest to GCS, flag was not provided" +else + echo "--- Skipping upload of latest-verified manifest to GCS, no flag and hash provided" fi echo "--- Annotating build with info" From 4c3fe718210d5fac8b87faf4872a991dc44a8439 Mon Sep 17 00:00:00 2001 From: Panagiota Mitsopoulou Date: Thu, 28 Sep 2023 20:39:37 +0200 Subject: [PATCH 46/61] [SLO] create SLO embeddable widget (#165949) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves https://github.com/elastic/kibana/issues/165947 Resolves https://github.com/elastic/actionable-observability/issues/124 ### Summary This PR adds an Embeddable SLO Overview Widget to the Dashboard app. It uses a [Metric chart](https://elastic.github.io/elastic-charts/?path=/story/metric-alpha--basic) component and displays an overview of the SLO health: - name - current sli value - target - status (background color) ### ✔️ Acceptance criteria - The SLO widget should display the basic information listed above - The SLO widget should be clickable and lead to the slo detail page - The user should be able to select the SLO and filter to instanceId - The tag "url.domain:mail.co" is the partition field and instanceId value Screenshot 2023-09-21 at 21 07 23 For more information regarding the key concepts and the usage of an embeddable you can have a look at the Embeddable plugin [README](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- x-pack/plugins/observability/kibana.jsonc | 3 +- .../slo/overview/handle_explicit_input.tsx | 55 ++++++ .../public/embeddable/slo/overview/index.ts | 8 + .../slo/overview/slo_configuration.tsx | 85 ++++++++++ .../slo/overview/slo_embeddable.tsx | 96 +++++++++++ .../slo/overview/slo_embeddable_factory.ts | 73 ++++++++ .../embeddable/slo/overview/slo_overview.tsx | 157 ++++++++++++++++++ .../embeddable/slo/overview/slo_selector.tsx | 101 +++++++++++ .../public/embeddable/slo/overview/types.ts | 15 ++ x-pack/plugins/observability/public/plugin.ts | 10 ++ x-pack/plugins/observability/tsconfig.json | 2 + 11 files changed, 604 insertions(+), 1 deletion(-) create mode 100644 x-pack/plugins/observability/public/embeddable/slo/overview/handle_explicit_input.tsx create mode 100644 x-pack/plugins/observability/public/embeddable/slo/overview/index.ts create mode 100644 x-pack/plugins/observability/public/embeddable/slo/overview/slo_configuration.tsx create mode 100644 x-pack/plugins/observability/public/embeddable/slo/overview/slo_embeddable.tsx create mode 100644 x-pack/plugins/observability/public/embeddable/slo/overview/slo_embeddable_factory.ts create mode 100644 x-pack/plugins/observability/public/embeddable/slo/overview/slo_overview.tsx create mode 100644 x-pack/plugins/observability/public/embeddable/slo/overview/slo_selector.tsx create mode 100644 x-pack/plugins/observability/public/embeddable/slo/overview/types.ts diff --git a/x-pack/plugins/observability/kibana.jsonc b/x-pack/plugins/observability/kibana.jsonc index 5064e06b156e0..5410d58ae7c92 100644 --- a/x-pack/plugins/observability/kibana.jsonc +++ b/x-pack/plugins/observability/kibana.jsonc @@ -30,7 +30,8 @@ "security", "share", "unifiedSearch", - "visualizations" + "visualizations", + "dashboard", ], "optionalPlugins": ["discover", "home", "licensing", "usageCollection", "cloud", "spaces"], "requiredBundles": ["data", "kibanaReact", "kibanaUtils", "unifiedSearch", "cloudChat", "stackAlerts", "spaces"], diff --git a/x-pack/plugins/observability/public/embeddable/slo/overview/handle_explicit_input.tsx b/x-pack/plugins/observability/public/embeddable/slo/overview/handle_explicit_input.tsx new file mode 100644 index 0000000000000..0c36b4e915c6c --- /dev/null +++ b/x-pack/plugins/observability/public/embeddable/slo/overview/handle_explicit_input.tsx @@ -0,0 +1,55 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { toMountPoint } from '@kbn/react-kibana-mount'; + +import type { CoreStart } from '@kbn/core/public'; +import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import type { EmbeddableSloProps, SloEmbeddableInput } from './types'; + +import { ObservabilityPublicPluginsStart } from '../../..'; +import { SloConfiguration } from './slo_configuration'; +export async function resolveEmbeddableSloUserInput( + coreStart: CoreStart, + pluginStart: ObservabilityPublicPluginsStart, + input?: SloEmbeddableInput +): Promise { + const { overlays } = coreStart; + const queryClient = new QueryClient(); + return new Promise(async (resolve, reject) => { + try { + const modalSession = overlays.openModal( + toMountPoint( + + + { + modalSession.close(); + resolve(update); + }} + onCancel={() => { + modalSession.close(); + reject(); + }} + /> + + , + { i18n: coreStart.i18n, theme: coreStart.theme } + ) + ); + } catch (error) { + reject(error); + } + }); +} diff --git a/x-pack/plugins/observability/public/embeddable/slo/overview/index.ts b/x-pack/plugins/observability/public/embeddable/slo/overview/index.ts new file mode 100644 index 0000000000000..9cc48e8c635f2 --- /dev/null +++ b/x-pack/plugins/observability/public/embeddable/slo/overview/index.ts @@ -0,0 +1,8 @@ +/* + * 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 { SloOverviewEmbeddableFactoryDefinition } from './slo_embeddable_factory'; diff --git a/x-pack/plugins/observability/public/embeddable/slo/overview/slo_configuration.tsx b/x-pack/plugins/observability/public/embeddable/slo/overview/slo_configuration.tsx new file mode 100644 index 0000000000000..cf83690800318 --- /dev/null +++ b/x-pack/plugins/observability/public/embeddable/slo/overview/slo_configuration.tsx @@ -0,0 +1,85 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useState } from 'react'; +import { + EuiModal, + EuiModalHeader, + EuiModalHeaderTitle, + EuiModalBody, + EuiModalFooter, + EuiButton, + EuiButtonEmpty, + EuiFlexGroup, + EuiFlexItem, +} from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { i18n } from '@kbn/i18n'; +import { SloSelector } from './slo_selector'; + +import type { EmbeddableSloProps } from './types'; + +interface SloConfigurationProps { + onCreate: (props: EmbeddableSloProps) => void; + onCancel: () => void; +} + +export function SloConfiguration({ onCreate, onCancel }: SloConfigurationProps) { + const [selectedSlo, setSelectedSlo] = useState(); + const onConfirmClick = () => + onCreate({ sloId: selectedSlo?.sloId, sloInstanceId: selectedSlo?.sloInstanceId }); + const [hasError, setHasError] = useState(false); + + return ( + + + + {i18n.translate('xpack.observability.sloEmbeddable.config.sloSelector.headerTitle', { + defaultMessage: 'SLO configuration', + })} + + + + + + { + if (slo === undefined) { + setHasError(true); + } else { + setHasError(false); + } + setSelectedSlo({ sloId: slo?.id, sloInstanceId: slo?.instanceId }); + }} + /> + + + + + + + + + + + + + + ); +} diff --git a/x-pack/plugins/observability/public/embeddable/slo/overview/slo_embeddable.tsx b/x-pack/plugins/observability/public/embeddable/slo/overview/slo_embeddable.tsx new file mode 100644 index 0000000000000..faadbcb637646 --- /dev/null +++ b/x-pack/plugins/observability/public/embeddable/slo/overview/slo_embeddable.tsx @@ -0,0 +1,96 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React from 'react'; +import ReactDOM from 'react-dom'; +import { Subscription } from 'rxjs'; +import { i18n } from '@kbn/i18n'; + +import { + Embeddable as AbstractEmbeddable, + EmbeddableOutput, + IContainer, +} from '@kbn/embeddable-plugin/public'; +import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; + +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { type CoreStart, IUiSettingsClient, ApplicationStart } from '@kbn/core/public'; +import { SloOverview } from './slo_overview'; +import type { SloEmbeddableInput } from './types'; + +export const SLO_EMBEDDABLE = 'SLO_EMBEDDABLE'; + +interface SloEmbeddableDeps { + uiSettings: IUiSettingsClient; + http: CoreStart['http']; + i18n: CoreStart['i18n']; + application: ApplicationStart; +} + +export class SLOEmbeddable extends AbstractEmbeddable { + public readonly type = SLO_EMBEDDABLE; + private subscription: Subscription; + private node?: HTMLElement; + + constructor( + private readonly deps: SloEmbeddableDeps, + initialInput: SloEmbeddableInput, + parent?: IContainer + ) { + super(initialInput, {}, parent); + + this.subscription = new Subscription(); + this.subscription.add(this.getInput$().subscribe(() => this.reload())); + } + + setTitle(title: string) { + this.updateInput({ title }); + } + + public render(node: HTMLElement) { + this.node = node; + this.setTitle( + this.input.title || + i18n.translate('xpack.observability.sloEmbeddable.displayTitle', { + defaultMessage: 'SLO Overview', + }) + ); + this.input.lastReloadRequestTime = Date.now(); + + const { sloId, sloInstanceId } = this.getInput(); + const queryClient = new QueryClient(); + + const I18nContext = this.deps.i18n.Context; + ReactDOM.render( + + + + + + + , + node + ); + } + + public reload() { + if (this.node) { + this.render(this.node); + } + } + + public destroy() { + super.destroy(); + this.subscription.unsubscribe(); + if (this.node) { + ReactDOM.unmountComponentAtNode(this.node); + } + } +} diff --git a/x-pack/plugins/observability/public/embeddable/slo/overview/slo_embeddable_factory.ts b/x-pack/plugins/observability/public/embeddable/slo/overview/slo_embeddable_factory.ts new file mode 100644 index 0000000000000..7adb76eb9acfe --- /dev/null +++ b/x-pack/plugins/observability/public/embeddable/slo/overview/slo_embeddable_factory.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import type { CoreSetup } from '@kbn/core/public'; +import { + IContainer, + EmbeddableFactoryDefinition, + EmbeddableFactory, + ErrorEmbeddable, +} from '@kbn/embeddable-plugin/public'; +import { SLOEmbeddable, SLO_EMBEDDABLE } from './slo_embeddable'; +import { ObservabilityPublicPluginsStart, ObservabilityPublicStart } from '../../..'; +import type { SloEmbeddableInput } from './types'; + +export type SloOverviewEmbeddableFactory = EmbeddableFactory; +export class SloOverviewEmbeddableFactoryDefinition implements EmbeddableFactoryDefinition { + public readonly type = SLO_EMBEDDABLE; + + constructor( + private getStartServices: CoreSetup< + ObservabilityPublicPluginsStart, + ObservabilityPublicStart + >['getStartServices'] + ) {} + + public async isEditable() { + return true; + } + + public async getExplicitInput(): Promise> { + const [coreStart, pluginStart] = await this.getStartServices(); + try { + const { resolveEmbeddableSloUserInput } = await import('./handle_explicit_input'); + return await resolveEmbeddableSloUserInput(coreStart, pluginStart); + } catch (e) { + return Promise.reject(); + } + } + + public async create(initialInput: SloEmbeddableInput, parent?: IContainer) { + try { + const [{ uiSettings, application, http, i18n: i18nService }] = await this.getStartServices(); + return new SLOEmbeddable( + { uiSettings, application, http, i18n: i18nService }, + initialInput, + parent + ); + } catch (e) { + return new ErrorEmbeddable(e, initialInput, parent); + } + } + + public getDescription() { + return i18n.translate('xpack.observability.sloEmbeddable.description', { + defaultMessage: 'Get an overview of your SLO health', + }); + } + + public getDisplayName() { + return i18n.translate('xpack.observability.sloEmbeddable.displayName', { + defaultMessage: 'SLO Overview', + }); + } + + public getIconType() { + return 'visGauge'; + } +} diff --git a/x-pack/plugins/observability/public/embeddable/slo/overview/slo_overview.tsx b/x-pack/plugins/observability/public/embeddable/slo/overview/slo_overview.tsx new file mode 100644 index 0000000000000..5e8947a6c5ba9 --- /dev/null +++ b/x-pack/plugins/observability/public/embeddable/slo/overview/slo_overview.tsx @@ -0,0 +1,157 @@ +/* + * 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, { useCallback, useEffect } from 'react'; +import { i18n } from '@kbn/i18n'; +import { EuiIcon, useEuiBackgroundColor } from '@elastic/eui'; +import { Chart, Metric, MetricTrendShape, Settings } from '@elastic/charts'; +import numeral from '@elastic/numeral'; +import { ALL_VALUE } from '@kbn/slo-schema'; +import { EuiLoadingChart } from '@elastic/eui'; +import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import { NOT_AVAILABLE_LABEL } from '../../../../common/i18n'; +import { useKibana } from '../../../utils/kibana_react'; +import { useFetchSloDetails } from '../../../hooks/slo/use_fetch_slo_details'; +import { paths } from '../../../../common/locators/paths'; + +import { EmbeddableSloProps } from './types'; + +export function SloOverview({ sloId, sloInstanceId, lastReloadRequestTime }: EmbeddableSloProps) { + const { + uiSettings, + application: { navigateToUrl }, + http: { basePath }, + } = useKibana().services; + const { isLoading, slo, refetch, isRefetching } = useFetchSloDetails({ + sloId, + instanceId: sloInstanceId, + }); + + useEffect(() => { + refetch(); + }, [lastReloadRequestTime, refetch]); + + const percentFormat = uiSettings.get('format:percent:defaultPattern'); + const isSloNotFound = !isLoading && slo === undefined; + + const getIcon = useCallback( + (type: string) => + ({ width = 20, height = 20, color }: { width: number; height: number; color: string }) => { + return ; + }, + [] + ); + + const sloSummary = slo?.summary; + const sloStatus = sloSummary?.status; + const healthyColor = useEuiBackgroundColor('success'); + const noDataColor = useEuiBackgroundColor('subdued'); + const degradingColor = useEuiBackgroundColor('warning'); + const violatedColor = useEuiBackgroundColor('danger'); + let color; + switch (sloStatus) { + case 'HEALTHY': + color = healthyColor; + break; + case 'NO_DATA': + color = noDataColor; + break; + case 'DEGRADING': + color = degradingColor; + break; + case 'VIOLATED': + color = violatedColor; + break; + default: + color = noDataColor; + } + + if (isRefetching || isLoading) { + return ( + + + + + + ); + } + + if (isSloNotFound) { + return ( + + + {i18n.translate('xpack.observability.sloEmbeddable.overview.sloNotFoundText', { + defaultMessage: + 'The SLO has been deleted. You can safely delete the widget from the dashboard.', + })} + + + ); + } + const TargetCopy = i18n.translate('xpack.observability.sloEmbeddable.overview.sloTargetLabel', { + defaultMessage: 'Target', + }); + const extraContent = `${TargetCopy} ${numeral(slo?.objective.target).format( + percentFormat + )}`; + // eslint-disable-next-line react/no-danger + const extra = ; + const metricData = + slo !== undefined + ? [ + { + color, + title: slo.name, + subtitle: slo.groupBy !== ALL_VALUE ? `${slo.groupBy}:${slo.instanceId}` : '', + icon: getIcon('visGauge'), + value: + sloStatus === 'NO_DATA' + ? NOT_AVAILABLE_LABEL + : numeral(slo.summary.sliValue).format(percentFormat), + valueFormatter: (value: number) => `${value}%`, + extra, + trend: [], + trendShape: MetricTrendShape.Area, + }, + ] + : []; + return ( + <> + + { + navigateToUrl( + basePath.prepend( + paths.observability.sloDetails( + slo!.id, + slo?.groupBy !== ALL_VALUE && slo?.instanceId ? slo.instanceId : undefined + ) + ) + ); + }} + /> + + + + ); +} + +export const LoadingContainer = euiStyled.div` + position: relative; + overflow: hidden; + display: flex; + flex-direction: column; + justify-content: center; + width: 100%; + height: 100%; +`; + +export const LoadingContent = euiStyled.div` + flex: 0 0 auto; + align-self: center; + text-align: center; +`; diff --git a/x-pack/plugins/observability/public/embeddable/slo/overview/slo_selector.tsx b/x-pack/plugins/observability/public/embeddable/slo/overview/slo_selector.tsx new file mode 100644 index 0000000000000..468358127bd18 --- /dev/null +++ b/x-pack/plugins/observability/public/embeddable/slo/overview/slo_selector.tsx @@ -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 React, { useEffect, useMemo, useState } from 'react'; +import { EuiComboBox, EuiComboBoxOptionOption, EuiFormRow } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { debounce } from 'lodash'; +import { ALL_VALUE, SLOWithSummaryResponse } from '@kbn/slo-schema'; +import { useFetchSloList } from '../../../hooks/slo/use_fetch_slo_list'; + +interface Props { + initialSlo?: SLOWithSummaryResponse; + onSelected: (slo: SLOWithSummaryResponse | undefined) => void; + hasError?: boolean; +} + +const SLO_REQUIRED = i18n.translate('xpack.observability.sloEmbeddable.config.errors.sloRequired', { + defaultMessage: 'SLO is required.', +}); + +export function SloSelector({ initialSlo, onSelected, hasError }: Props) { + const [options, setOptions] = useState>>([]); + const [selectedOptions, setSelectedOptions] = useState>>(); + const [searchValue, setSearchValue] = useState(''); + const { isInitialLoading, isLoading, sloList } = useFetchSloList({ + kqlQuery: `slo.name: ${searchValue.replaceAll(' ', '*')}*`, + }); + + useEffect(() => { + const isLoadedWithData = !isLoading && sloList!.results !== undefined; + const opts: Array> = isLoadedWithData + ? sloList!.results!.map((slo) => { + const label = + slo.instanceId !== ALL_VALUE + ? `${slo.name} (${slo.groupBy}: ${slo.instanceId})` + : slo.name; + return { + value: `${slo.id}-${slo.instanceId}`, + label, + instanceId: slo.instanceId, + }; + }) + : []; + setOptions(opts); + }, [isLoading, sloList]); + + const onChange = (opts: Array>) => { + setSelectedOptions(opts); + const selectedSlo = + opts.length === 1 + ? sloList!.results?.find((slo) => opts[0].value === `${slo.id}-${slo.instanceId}`) + : undefined; + + onSelected(selectedSlo); + }; + + const onSearchChange = useMemo( + () => + debounce((value: string) => { + setSearchValue(value); + }, 300), + [] + ); + + if (isInitialLoading) { + return null; + } + + return ( + + + + ); +} diff --git a/x-pack/plugins/observability/public/embeddable/slo/overview/types.ts b/x-pack/plugins/observability/public/embeddable/slo/overview/types.ts new file mode 100644 index 0000000000000..ea125ffa8a9d5 --- /dev/null +++ b/x-pack/plugins/observability/public/embeddable/slo/overview/types.ts @@ -0,0 +1,15 @@ +/* + * 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 { EmbeddableInput } from '@kbn/embeddable-plugin/public'; + +export interface EmbeddableSloProps { + sloId: string | undefined; + sloInstanceId: string | undefined; + lastReloadRequestTime?: number | undefined; +} + +export type SloEmbeddableInput = EmbeddableInput & EmbeddableSloProps; diff --git a/x-pack/plugins/observability/public/plugin.ts b/x-pack/plugins/observability/public/plugin.ts index c40662219ddb7..d864a09fe6fdc 100644 --- a/x-pack/plugins/observability/public/plugin.ts +++ b/x-pack/plugins/observability/public/plugin.ts @@ -56,6 +56,7 @@ import { ObservabilityAIAssistantPluginSetup, ObservabilityAIAssistantPluginStart, } from '@kbn/observability-ai-assistant-plugin/public'; +import type { EmbeddableSetup } from '@kbn/embeddable-plugin/public'; import { AiopsPluginStart } from '@kbn/aiops-plugin/public/types'; import { RulesLocatorDefinition } from './locators/rules'; import { RuleDetailsLocatorDefinition } from './locators/rule_details'; @@ -111,6 +112,7 @@ export interface ObservabilityPublicPluginsSetup { triggersActionsUi: TriggersAndActionsUIPublicPluginSetup; home?: HomePublicPluginSetup; usageCollection: UsageCollectionSetup; + embeddable: EmbeddableSetup; } export interface ObservabilityPublicPluginsStart { @@ -286,6 +288,14 @@ export class Plugin coreSetup.application.register(app); registerObservabilityRuleTypes(config, this.observabilityRuleTypeRegistry); + const registerSloEmbeddableFactory = async () => { + const { SloOverviewEmbeddableFactoryDefinition } = await import( + './embeddable/slo/overview/slo_embeddable_factory' + ); + const factory = new SloOverviewEmbeddableFactoryDefinition(coreSetup.getStartServices); + pluginsSetup.embeddable.registerEmbeddableFactory(factory.type, factory); + }; + registerSloEmbeddableFactory(); if (pluginsSetup.home) { pluginsSetup.home.featureCatalogue.registerSolution({ diff --git a/x-pack/plugins/observability/tsconfig.json b/x-pack/plugins/observability/tsconfig.json index 2b7a9e0749650..cfb16fea9a839 100644 --- a/x-pack/plugins/observability/tsconfig.json +++ b/x-pack/plugins/observability/tsconfig.json @@ -84,6 +84,8 @@ "@kbn/core-capabilities-common", "@kbn/observability-ai-assistant-plugin", "@kbn/osquery-plugin", + "@kbn/content-management-plugin", + "@kbn/embeddable-plugin", "@kbn/aiops-plugin", "@kbn/content-management-plugin", "@kbn/deeplinks-observability", From 460a84e4f9a2aba70921e8a07a3df8b276445f14 Mon Sep 17 00:00:00 2001 From: Gabriel Landau <42078554+gabriellandau@users.noreply.github.com> Date: Thu, 28 Sep 2023 14:53:44 -0400 Subject: [PATCH 47/61] [8.11.0] Promote Defend API events to Production (#167549) ## Summary This PR supercedes https://github.com/elastic/kibana/pull/167107 Elastic Defend for Windows now collects ETW Threat Intelligence (ETW-TI) events. Defend calls these API events. API events currently include the existing Credential Access and ETW-TI. We will add more events under the API umbrella in the future. The Windows Events Policy `Credential Access` category has been renamed to `API` in the UI and documentation - but it remains as `credential_access` in the yaml for backwards compatibility. This new category definition is a superset of the previous category. Two new advanced options are added - * `windows.advanced.events.api_disabled` - comma separated list * `windows.advanced.events.api_verbose` - boolean ### Checklist Delete any items that are not applicable to this PR. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --- .../policy/models/advanced_policy_schema.ts | 23 ++++++++++++++++++- .../windows_event_collection_card.test.tsx | 4 ++-- .../cards/windows_event_collection_card.tsx | 2 +- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/models/advanced_policy_schema.ts b/x-pack/plugins/security_solution/public/management/pages/policy/models/advanced_policy_schema.ts index f9818447c2e0d..056577f7944ef 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/models/advanced_policy_schema.ts +++ b/x-pack/plugins/security_solution/public/management/pages/policy/models/advanced_policy_schema.ts @@ -1271,7 +1271,28 @@ export const AdvancedPolicySchema: AdvancedPolicySchemaType[] = [ 'xpack.securitySolution.endpoint.policy.advanced.windows.advanced.events.api', { defaultMessage: - 'Controls whether API events are enabled. Set to false to disable API event collection. Default: true', + 'Controls whether ETW API events are enabled. Set to false to disable ETW event collection. Default: true', + } + ), + }, + { + key: 'windows.advanced.events.api_disabled', + first_supported_version: '8.11', + documentation: i18n.translate( + 'xpack.securitySolution.endpoint.policy.advanced.windows.advanced.events.api_disabled', + { + defaultMessage: 'A comma separated list of API names to selectively disable.', + } + ), + }, + { + key: 'windows.advanced.events.api_verbose', + first_supported_version: '8.11', + documentation: i18n.translate( + 'xpack.securitySolution.endpoint.policy.advanced.windows.advanced.events.api_verbose', + { + defaultMessage: + 'Controls whether high volume API events are forwarded. Event filtering is recommended if enabled. Default: false', } ), }, diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/windows_event_collection_card.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/windows_event_collection_card.test.tsx index 16c84436684f1..64c0473a55393 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/windows_event_collection_card.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/windows_event_collection_card.test.tsx @@ -70,7 +70,7 @@ describe('Policy Windows Event Collection Card', () => { 'Operating system' + 'Windows 8 / 8 event collections enabled' + 'Events' + - 'Credential Access' + + 'API' + 'DLL and Driver Load' + 'DNS' + 'File' + @@ -98,7 +98,7 @@ describe('Policy Windows Event Collection Card', () => { 'Windows ' + '6 / 8 event collections enabled' + 'Events' + - 'Credential Access' + + 'API' + 'DLL and Driver Load' + 'Network' + 'Process' + diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/windows_event_collection_card.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/windows_event_collection_card.tsx index 3fadf3665d9fd..fd20184113468 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/windows_event_collection_card.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/windows_event_collection_card.tsx @@ -17,7 +17,7 @@ const OPTIONS: ReadonlyArray> = [ name: i18n.translate( 'xpack.securitySolution.endpoint.policyDetailsConfig.windows.events.credentialAccess', { - defaultMessage: 'Credential Access', + defaultMessage: 'API', } ), protectionField: 'credential_access', From 05a7d30072c0f66df1d00b56efbcd96659b1065d Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 28 Sep 2023 15:40:51 -0400 Subject: [PATCH 48/61] skip failing test suite (#167561) --- x-pack/test/functional/apps/lens/group6/lens_tagging.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/functional/apps/lens/group6/lens_tagging.ts b/x-pack/test/functional/apps/lens/group6/lens_tagging.ts index c3b279f591cdb..b8d9c332f64f5 100644 --- a/x-pack/test/functional/apps/lens/group6/lens_tagging.ts +++ b/x-pack/test/functional/apps/lens/group6/lens_tagging.ts @@ -29,7 +29,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const lensTag = 'extreme-lens-tag'; const lensTitle = 'lens tag test'; - describe('lens tagging', () => { + // Failing: See https://github.com/elastic/kibana/issues/167561 + describe.skip('lens tagging', () => { before(async () => { await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional'); await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); From 424dec613f72fe52ccee300d34e6dc1db54af873 Mon Sep 17 00:00:00 2001 From: Rachel Shen Date: Thu, 28 Sep 2023 13:54:56 -0600 Subject: [PATCH 49/61] [Accessibility] Loading indicator aria labels (#166391) ## Summary Closes https://github.com/elastic/kibana/issues/153597 In full screen, the loading indicator fails a11y tests. By removing the aria-label and aria-hidden attributes, this allows the validation to pass. https://github.com/elastic/kibana/issues/153597#issuecomment-1482805134 This PR also introduces optional props for max and value props on the `EuiProgress` component to provide consumers of the component greater ability to define how the component is being used. [Information](https://eui.elastic.co/#/display/progress#progress-with-values) on the max and value props can be found in the [EUI docs](https://eui.elastic.co/#/display/progress#progress-with-values). --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../src/ui/loading_indicator.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/chrome/core-chrome-browser-internal/src/ui/loading_indicator.tsx b/packages/core/chrome/core-chrome-browser-internal/src/ui/loading_indicator.tsx index 8e3cae33ceb84..22e9b5dd9276d 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/ui/loading_indicator.tsx +++ b/packages/core/chrome/core-chrome-browser-internal/src/ui/loading_indicator.tsx @@ -19,6 +19,8 @@ export interface LoadingIndicatorProps { loadingCount$: ReturnType; showAsBar?: boolean; customLogo?: string; + maxAmount?: number; + valueAmount?: string | number; } export class LoadingIndicator extends React.Component { @@ -62,8 +64,6 @@ export class LoadingIndicator extends React.Component Date: Thu, 28 Sep 2023 16:26:24 -0400 Subject: [PATCH 50/61] [Asset Manager] Creates baseline public asset client for use in public plugins (#167191) Closes #167075 ## Summary Adds a public asset client available in the `setup` lifecycle hook for plugins that depend on this one. `getHosts` is the only method available on this client for now. TODO, before merge: - [x] Add docs for the server client - [x] Add docs for the public client - [x] Remove REST docs from plugin docs, not needed - [x] Add unit tests for public client ### Testing this PR One way of testing this new client is to apply the attached test-assets.patch file locally, adjust the date range in the getHosts query that is added in the infra plugin, and then start Kibana and navigate to the infra app. You should see print out in the browser console. [test-assets.patch](https://github.com/elastic/kibana/files/12718693/test-assets.patch) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- docs/developer/plugin-list.asciidoc | 3 +- packages/kbn-optimizer/limits.yml | 1 + .../test_suites/core_plugins/rendering.ts | 1 + x-pack/plugins/asset_manager/README.md | 36 +--- x-pack/plugins/asset_manager/common/config.ts | 56 ++++++ .../asset_manager/common/constants_routes.ts | 18 ++ .../plugins/asset_manager/common/types_api.ts | 181 +++++++++++------ .../asset_manager/common/types_client.ts | 17 ++ x-pack/plugins/asset_manager/docs/api.md | 187 ++++++++++++++++++ .../plugins/asset_manager/docs/development.md | 34 ++++ .../docs/{index.md => rest_deprecated.md} | 70 +++---- x-pack/plugins/asset_manager/kibana.jsonc | 2 +- x-pack/plugins/asset_manager/public/index.ts | 20 ++ .../public/lib/public_assets_client.test.ts | 48 +++++ .../public/lib/public_assets_client.ts | 26 +++ x-pack/plugins/asset_manager/public/plugin.ts | 51 +++++ x-pack/plugins/asset_manager/public/types.ts | 25 +++ .../plugins/asset_manager/server/constants.ts | 1 - x-pack/plugins/asset_manager/server/index.ts | 16 +- .../accessors/hosts/get_hosts_by_assets.ts | 2 +- .../accessors/hosts/get_hosts_by_signals.ts | 4 +- .../server/lib/accessors/hosts/index.ts | 9 +- .../server/lib/accessors/index.ts | 8 +- .../services/get_services_by_assets.ts | 4 +- .../services/get_services_by_signals.ts | 4 +- .../server/lib/accessors/services/index.ts | 10 +- .../{asset_accessor.ts => asset_client.ts} | 18 +- .../server/lib/get_all_related_assets.ts | 16 +- .../asset_manager/server/lib/get_assets.ts | 4 +- .../lib/get_indirectly_related_assets.ts | 4 +- .../asset_manager/server/lib/write_assets.ts | 4 +- x-pack/plugins/asset_manager/server/plugin.ts | 15 +- .../server/routes/assets/hosts.ts | 41 ++-- .../server/routes/assets/index.ts | 24 +-- .../server/routes/assets/services.ts | 16 +- .../asset_manager/server/routes/index.ts | 12 +- .../asset_manager/server/routes/ping.ts | 2 +- .../server/routes/sample_assets.ts | 14 +- .../asset_manager/server/routes/types.ts | 4 +- .../asset_manager/server/routes/utils.ts | 10 +- x-pack/plugins/asset_manager/server/types.ts | 38 +--- x-pack/plugins/asset_manager/tsconfig.json | 4 +- 42 files changed, 758 insertions(+), 302 deletions(-) create mode 100644 x-pack/plugins/asset_manager/common/config.ts create mode 100644 x-pack/plugins/asset_manager/common/constants_routes.ts create mode 100644 x-pack/plugins/asset_manager/common/types_client.ts create mode 100644 x-pack/plugins/asset_manager/docs/api.md create mode 100644 x-pack/plugins/asset_manager/docs/development.md rename x-pack/plugins/asset_manager/docs/{index.md => rest_deprecated.md} (93%) create mode 100644 x-pack/plugins/asset_manager/public/index.ts create mode 100644 x-pack/plugins/asset_manager/public/lib/public_assets_client.test.ts create mode 100644 x-pack/plugins/asset_manager/public/lib/public_assets_client.ts create mode 100644 x-pack/plugins/asset_manager/public/plugin.ts create mode 100644 x-pack/plugins/asset_manager/public/types.ts rename x-pack/plugins/asset_manager/server/lib/{asset_accessor.ts => asset_client.ts} (81%) diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index 71190c26c4894..ccea77d906970 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -451,8 +451,7 @@ The plugin exposes the static DefaultEditorController class to consume. |{kib-repo}blob/{branch}/x-pack/plugins/asset_manager/README.md[assetManager] -|This plugin provides access to the asset data stored in assets-* indices, primarily -for inventory and topology purposes. +|This plugin provides access to observed asset data, such as information about hosts, pods, containers, services, and more. |{kib-repo}blob/{branch}/x-pack/plugins/banners/README.md[banners] diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index ec34d257eadc2..9b12708a506fc 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -4,6 +4,7 @@ pageLoadAssetSize: aiops: 10000 alerting: 106936 apm: 64385 + assetManager: 25000 banners: 17946 bfetch: 22837 canvas: 1066647 diff --git a/test/plugin_functional/test_suites/core_plugins/rendering.ts b/test/plugin_functional/test_suites/core_plugins/rendering.ts index 94af20ff4f86b..ca639ed3272fd 100644 --- a/test/plugin_functional/test_suites/core_plugins/rendering.ts +++ b/test/plugin_functional/test_suites/core_plugins/rendering.ts @@ -197,6 +197,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) { 'xpack.apm.featureFlags.sourcemapApiAvailable (any)', 'xpack.apm.featureFlags.storageExplorerAvailable (any)', 'xpack.apm.serverless.enabled (any)', // It's a boolean (any because schema.conditional) + 'xpack.assetManager.alphaEnabled (boolean)', 'xpack.observability_onboarding.serverless.enabled (any)', // It's a boolean (any because schema.conditional) 'xpack.cases.files.allowedMimeTypes (array)', 'xpack.cases.files.maxSize (number)', diff --git a/x-pack/plugins/asset_manager/README.md b/x-pack/plugins/asset_manager/README.md index f82f174af471c..d73bfbb53b087 100644 --- a/x-pack/plugins/asset_manager/README.md +++ b/x-pack/plugins/asset_manager/README.md @@ -1,39 +1,13 @@ # Asset Manager Plugin -This plugin provides access to the asset data stored in assets-\* indices, primarily -for inventory and topology purposes. +This plugin provides access to observed asset data, such as information about hosts, pods, containers, services, and more. ## Documentation -See [docs for the provided APIs in the docs folder](./docs/index.md). +### User Docs -## Running Tests +For those interested in making use of the APIs provided by this plugin, see [our API docs](./docs/api.md). -There are integration tests for the endpoints implemented thus far as well as for -the sample data tests. There is also a small set of tests meant to ensure that the -plugin is not doing anything without the proper config value in place to enable -the plugin fully. For more on enabling the plugin, see [the docs page](./docs/index.md). +### Developer Docs -The "not enabled" tests are run by default in CI. To run them manually, do the following: - -```shell -$ node scripts/functional_tests_server --config x-pack/test/api_integration/apis/asset_manager/config_when_disabled.ts -$ node scripts/functional_test_runner --config=x-pack/test/api_integration/apis/asset_manager/config_when_disabled.ts -``` - -The "enabled" tests are NOT run by CI yet, to prevent blocking Kibana development for a -test failure in this alpha, tech preview plugin. They will be moved into the right place -to make them run for CI before the plugin is enabled by default. To run them manually: - -```shell -$ node scripts/functional_tests_server --config x-pack/test/api_integration/apis/asset_manager/config.ts -$ node scripts/functional_test_runner --config=x-pack/test/api_integration/apis/asset_manager/config.ts -``` - -## Using Sample Data - -This plugin comes with a full "working set" of sample asset documents, meant -to provide enough data in the correct schema format so that all of the API -endpoints return expected values. - -To create the sample data, follow [the instructions in the REST API docs](./docs/index.md#sample-data). +For those working on this plugin directly and developing it, please see [our development docs](./docs/development.md). diff --git a/x-pack/plugins/asset_manager/common/config.ts b/x-pack/plugins/asset_manager/common/config.ts new file mode 100644 index 0000000000000..0a57e37d497bb --- /dev/null +++ b/x-pack/plugins/asset_manager/common/config.ts @@ -0,0 +1,56 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { schema, TypeOf } from '@kbn/config-schema'; + +export const INDEX_DEFAULTS = { + logs: 'filebeat-*,logs-*', +}; + +export const configSchema = schema.object({ + alphaEnabled: schema.maybe(schema.boolean()), + // Designate where various types of data live. + // NOTE: this should be handled in a centralized way for observability, so + // that when a user configures these differently from the known defaults, + // that value is propagated everywhere. For now, we duplicate the value here. + sourceIndices: schema.object( + { + logs: schema.string({ defaultValue: INDEX_DEFAULTS.logs }), + }, + { defaultValue: INDEX_DEFAULTS } + ), + // Choose an explicit source for asset queries. + // NOTE: This will eventually need to be able to cleverly switch + // between these values based on the availability of data in the + // indices, and possibly for each asset kind/type value. + // For now, we set this explicitly. + lockedSource: schema.oneOf([schema.literal('assets'), schema.literal('signals')], { + defaultValue: 'signals', + }), +}); + +export type AssetManagerConfig = TypeOf; + +/** + * The following map is passed to the server plugin setup under the + * exposeToBrowser: option, and controls which of the above config + * keys are allow-listed to be available in the browser config. + * + * NOTE: anything exposed here will be visible in the UI dev tools, + * and therefore MUST NOT be anything that is sensitive information! + */ +export const exposeToBrowserConfig = { + alphaEnabled: true, +} as const; + +type ValidKeys = keyof { + [K in keyof typeof exposeToBrowserConfig as typeof exposeToBrowserConfig[K] extends true + ? K + : never]: true; +}; + +export type AssetManagerPublicConfig = Pick; diff --git a/x-pack/plugins/asset_manager/common/constants_routes.ts b/x-pack/plugins/asset_manager/common/constants_routes.ts new file mode 100644 index 0000000000000..1aef43f7383bd --- /dev/null +++ b/x-pack/plugins/asset_manager/common/constants_routes.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const ASSET_MANAGER_API_BASE = '/api/asset-manager'; + +function base(path: string) { + return `${ASSET_MANAGER_API_BASE}${path}`; +} + +export const GET_ASSETS = base('/assets'); +export const GET_RELATED_ASSETS = base('/assets/related'); +export const GET_ASSETS_DIFF = base('/assets/diff'); + +export const GET_HOSTS = base('/assets/hosts'); diff --git a/x-pack/plugins/asset_manager/common/types_api.ts b/x-pack/plugins/asset_manager/common/types_api.ts index 8e9e9181a29e4..11b5ea4bda3a4 100644 --- a/x-pack/plugins/asset_manager/common/types_api.ts +++ b/x-pack/plugins/asset_manager/common/types_api.ts @@ -6,77 +6,111 @@ */ import * as rt from 'io-ts'; - -export const assetTypeRT = rt.union([ - rt.literal('k8s.pod'), - rt.literal('k8s.cluster'), - rt.literal('k8s.node'), -]); +import { + dateRt, + inRangeFromStringRt, + datemathStringRt, + createLiteralValueFromUndefinedRT, +} from '@kbn/io-ts-utils'; + +export const assetTypeRT = rt.keyof({ + 'k8s.pod': null, + 'k8s.cluster': null, + 'k8s.node': null, +}); export type AssetType = rt.TypeOf; -export const assetKindRT = rt.union([ - rt.literal('cluster'), - rt.literal('host'), - rt.literal('pod'), - rt.literal('container'), - rt.literal('service'), - rt.literal('alert'), -]); +export const assetKindRT = rt.keyof({ + cluster: null, + host: null, + pod: null, + container: null, + service: null, + alert: null, +}); export type AssetKind = rt.TypeOf; -export type AssetStatus = - | 'CREATING' - | 'ACTIVE' - | 'DELETING' - | 'FAILED' - | 'UPDATING' - | 'PENDING' - | 'UNKNOWN'; -export type CloudProviderName = 'aws' | 'gcp' | 'azure' | 'other' | 'unknown' | 'none'; - -interface WithTimestamp { - '@timestamp': string; -} -export interface ECSDocument extends WithTimestamp { - 'kubernetes.namespace'?: string; - 'kubernetes.pod.name'?: string; - 'kubernetes.pod.uid'?: string; - 'kubernetes.pod.start_time'?: Date; - 'kubernetes.node.name'?: string; - 'kubernetes.node.start_time'?: Date; - - 'orchestrator.api_version'?: string; - 'orchestrator.namespace'?: string; - 'orchestrator.organization'?: string; - 'orchestrator.type'?: string; - 'orchestrator.cluster.id'?: string; - 'orchestrator.cluster.name'?: string; - 'orchestrator.cluster.url'?: string; - 'orchestrator.cluster.version'?: string; - - 'cloud.provider'?: CloudProviderName; - 'cloud.instance.id'?: string; - 'cloud.region'?: string; - 'cloud.service.name'?: string; - - 'service.environment'?: string; -} +export const assetStatusRT = rt.keyof({ + CREATING: null, + ACTIVE: null, + DELETING: null, + FAILED: null, + UPDATING: null, + PENDING: null, + UNKNOWN: null, +}); + +export type AssetStatus = rt.TypeOf; + +// https://github.com/gcanti/io-ts/blob/master/index.md#union-of-string-literals +export const cloudProviderNameRT = rt.keyof({ + aws: null, + gcp: null, + azure: null, + other: null, + unknown: null, + none: null, +}); + +export type CloudProviderName = rt.TypeOf; + +const withTimestampRT = rt.type({ + '@timestamp': rt.string, +}); + +export type WithTimestamp = rt.TypeOf; + +export const ECSDocumentRT = rt.intersection([ + withTimestampRT, + rt.partial({ + 'kubernetes.namespace': rt.string, + 'kubernetes.pod.name': rt.string, + 'kubernetes.pod.uid': rt.string, + 'kubernetes.pod.start_time': rt.string, + 'kubernetes.node.name': rt.string, + 'kubernetes.node.start_time': rt.string, + 'orchestrator.api_version': rt.string, + 'orchestrator.namespace': rt.string, + 'orchestrator.organization': rt.string, + 'orchestrator.type': rt.string, + 'orchestrator.cluster.id': rt.string, + 'orchestrator.cluster.name': rt.string, + 'orchestrator.cluster.url': rt.string, + 'orchestrator.cluster.version': rt.string, + 'cloud.provider': cloudProviderNameRT, + 'cloud.instance.id': rt.string, + 'cloud.region': rt.string, + 'cloud.service.name': rt.string, + 'service.environment': rt.string, + }), +]); -export interface Asset extends ECSDocument { - 'asset.collection_version'?: string; - 'asset.ean': string; - 'asset.id': string; - 'asset.kind': AssetKind; - 'asset.name'?: string; - 'asset.type'?: AssetType; - 'asset.status'?: AssetStatus; - 'asset.parents'?: string | string[]; - 'asset.children'?: string | string[]; - 'asset.references'?: string | string[]; - 'asset.namespace'?: string; -} +export type ECSDocument = rt.TypeOf; + +export const assetRT = rt.intersection([ + ECSDocumentRT, + rt.type({ + 'asset.ean': rt.string, + 'asset.id': rt.string, + 'asset.kind': assetKindRT, + }), + // mixed required and optional require separate hashes combined via intersection + // https://github.com/gcanti/io-ts/blob/master/index.md#mixing-required-and-optional-props + rt.partial({ + 'asset.collection_version': rt.string, + 'asset.name': rt.string, + 'asset.type': assetTypeRT, + 'asset.status': assetStatusRT, + 'asset.parents': rt.union([rt.string, rt.array(rt.string)]), + 'asset.children': rt.union([rt.string, rt.array(rt.string)]), + 'asset.references': rt.union([rt.string, rt.array(rt.string)]), + 'asset.namespace': rt.string, + }), +]); + +export type Asset = rt.TypeOf; export type AssetWithoutTimestamp = Omit; @@ -156,3 +190,22 @@ export type RelationField = keyof Pick< Asset, 'asset.children' | 'asset.parents' | 'asset.references' >; + +export const sizeRT = rt.union([ + inRangeFromStringRt(1, 100), + createLiteralValueFromUndefinedRT(10), +]); +export const assetDateRT = rt.union([dateRt, datemathStringRt]); +export const getHostAssetsQueryOptionsRT = rt.exact( + rt.partial({ + from: assetDateRT, + to: assetDateRT, + size: sizeRT, + }) +); +export type GetHostAssetsQueryOptions = rt.TypeOf; + +export const getHostAssetsResponseRT = rt.type({ + hosts: rt.array(assetRT), +}); +export type GetHostAssetsResponse = rt.TypeOf; diff --git a/x-pack/plugins/asset_manager/common/types_client.ts b/x-pack/plugins/asset_manager/common/types_client.ts new file mode 100644 index 0000000000000..350a168da8965 --- /dev/null +++ b/x-pack/plugins/asset_manager/common/types_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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export interface GetHostsOptionsPublic { + from: string; + to: string; +} + +export interface GetServicesOptionsPublic { + from: string; + to: string; + parent?: string; +} diff --git a/x-pack/plugins/asset_manager/docs/api.md b/x-pack/plugins/asset_manager/docs/api.md new file mode 100644 index 0000000000000..755abfe4be373 --- /dev/null +++ b/x-pack/plugins/asset_manager/docs/api.md @@ -0,0 +1,187 @@ +# Asset Manager API Documentation + +## Plugin configuration + +This plugin is NOT fully enabled by default, even though it's always enabled +by Kibana's definition of "enabled". However, without the following configuration, +it will bail before it sets up any routes or returns anything from its +start, setup, or stop hooks. + +To fully enable the plugin, set the following config values in your kibana.yml file: + +```yaml +xpack.assetManager: + alphaEnabled: true +``` + +## Depending on an asset client in your packages + +If you're creating a shared UI component or tool that needs to access asset data, you +can create that code in a stateless Kibana package that can itself be imported into +any Kibana plugin without any dependency restrictions. To gain access to the asset data, +this component or tool can require the appropriate asset client to be passed in. + +TODO: need to move main client types to a package so that they can be depended on by +other packages that require an injected asset client. Then we can list that package name +here and explain how to use those types in a package. + +## Client APIs + +This plugin provides asset clients for Kibana server and public usage. The differences between these +two clients are described below in their sections, while the methods for both APIs are described +in the Client Methods section. + +These clients are set up in the following way. For a given "methodA": + +``` +publicMethodA(...options: MethodAPublicOptions) + -> browser client calls corresponding REST API method with MethodAPublicOptions + -> REST API handler calls corresponding serverMethodA + -> serverMethodA requires MethodAPublicOptions & AssetClientDependencies, and it also + injects some internal dependencies from the plugin's config on your behalf +``` + +The public and server clientss are both accessible to plugin dependants, but the REST API is NOT. + +### Required dependency setup + +To use either client, you must first add "assetManager" to your `"requiredDependencies"` array +in your plugin's kibana.jsonc file. + +TECH PREVIEW NOTE: While this plugin is in "tech preview", in both the server and public clients, +the provided plugin dependencies can be undefined for this plugin if the proper configuration +has not been set (see above). For that reason, the types will force you to guard against this +undefined scenario. Once the tech preview gating is removed, this will no longer be the case. + +### Server client usage + +In your plugin's `setup` method, you can gain access to the client from the injected `plugins` map. +Make sure you import the `AssetManagerServerPluginSetup` type from the plugin's server +directory and add it to your own SetupPlugins type, as seen below. + +```ts +import { AssetManagerServerPluginSetup } from '@kbn/assetManager-plugin/server'; + +interface MyPluginSetupDeps { + assetManager: AssetManagerServerPluginSetup; +} + +class MyPlugin { + setup(core: CoreSetup, plugins: MyPluginSetupDeps) { + // assetClient is found on plugins.assetManager.assetClient + setupRoutes(router, plugins); + } +} +``` + +To use the server client in your server routes, you can use something like this: + +```ts +export function setupRoutes(router: IRouter, plugins: MyPluginDeps) { + router.get( + { + path: '/my/path', + validate: {}, + }, + async (context, req, res) => { + // handle route + // optionally, use asset client + // NOTE: see below for important info on required server client args + const hosts = await plugins.assetManager.assetClient.getHosts(); + } + ); +} +``` + +#### Required parameters for server client methods + +All methods called via the server client require some core Kibana clients to be passed in, +so that they are pulled from the request context and properly scoped. If the asset manager +plugin provided these clients internally, they would not be scoped to the user that made +the API request, so they are required arguments for every server client method. + +_Note: These required arguments are referred to as `AssetClientDependencies`, which can be +seen in the [the server types file](../server/types.ts)._ + +For example: + +```ts +router.get( + { + path: '/my/path', + validate: {}, + }, + async (context, req, res) => { + // to use server asset client, you must get the following clients + // from the request context and pass them to the client method + // alongside whatever "public" arguments that method defines + const coreContext = await context.core; + const hostsOptions: PublicGetHostsOptions = {}; // these will be different for each method + + const hosts = await plugins.assetManager.assetClient.getHosts({ + ...hostsOptions, + elasticsearchClient: coreContext.elasticsearch.client.asCurrentUser, + savedObjectsClient: coreContext.savedObjects.client, + }); + } +); +``` + +### Public client usage + +You should grab the public client in the same way as the server one, via the plugin dependencies +in your `setup` lifecycle. + +```ts +import { AssetManagerPublicPluginStart } from '@kbn/assetManager-plugin/public'; + +interface MyPluginStartDeps { + assetManager: AssetManagerPublicPluginStart; +} + +class MyPlugin { + setup(core: CoreSetup) { + core.application.register({ + id: 'my-other-plugin', + title: '', + appRoute: '/app/my-other-plugin', + mount: async (params: AppMountParameters) => { + // mount callback should not use setup dependencies, get start dependencies instead + // so the pluginStart map passed to your renderApp method will be the start deps, + // not the setup deps -- the same asset client is provided to both setup and start in public + const [coreStart, , pluginStart] = await core.getStartServices(); + // assetClient is found on pluginStart.assetManager.assetClient + return renderApp(coreStart, pluginStart, params); + }, + }); + } +} +``` + +All methods in the public client only require their public options (seen below), and don't require +the "AssetClientDependencies" that are required for the server client versions of the same methods. +This is because the public client will use the asset manager's internal REST API under the hood, where +it will be able to pull the properly-scoped client dependencies off of that request context for you. + +### Client methods + +#### getHosts + +Get a group of host assets found within a specified time range. + +| Parameter | Type | Required? | Description | +| :-------- | :-------------- | :-------- | :--------------------------------------------------------------------- | +| from | datetime string | yes | ISO date string representing the START of the time range being queried | +| to | datetime string | yes | ISO date string representing the END of the time range being queried | + +**Response** + +```json +{ + "hosts": [ + ...found host assets + ] +} +``` + +TODO: Link to a centralized asset document example that each response can reference? diff --git a/x-pack/plugins/asset_manager/docs/development.md b/x-pack/plugins/asset_manager/docs/development.md new file mode 100644 index 0000000000000..a98e8e46a8ce4 --- /dev/null +++ b/x-pack/plugins/asset_manager/docs/development.md @@ -0,0 +1,34 @@ +# Asset Manager Plugin Development + +These docs contain information you might need if you are developing this plugin in Kibana. If you are interested in the APIs this plugin exposes, please see [./api.md](our API docs) instead. + +## Running Tests + +There are integration tests for the endpoints implemented thus far as well as for +the sample data tests. There is also a small set of tests meant to ensure that the +plugin is not doing anything without the proper config value in place to enable +the plugin fully. For more on enabling the plugin, see [the docs page](./docs/index.md). + +The "not enabled" tests are run by default in CI. To run them manually, do the following: + +```shell +$ node scripts/functional_tests_server --config x-pack/test/api_integration/apis/asset_manager/config_when_disabled.ts +$ node scripts/functional_test_runner --config=x-pack/test/api_integration/apis/asset_manager/config_when_disabled.ts +``` + +The "enabled" tests are NOT run by CI yet, to prevent blocking Kibana development for a +test failure in this alpha, tech preview plugin. They will be moved into the right place +to make them run for CI before the plugin is enabled by default. To run them manually: + +```shell +$ node scripts/functional_tests_server --config x-pack/test/api_integration/apis/asset_manager/config.ts +$ node scripts/functional_test_runner --config=x-pack/test/api_integration/apis/asset_manager/config.ts +``` + +## Using Sample Data + +This plugin comes with a full "working set" of sample asset documents, meant +to provide enough data in the correct schema format so that all of the API +endpoints return expected values. + +To create the sample data, follow [the instructions in the REST API docs](./docs/index.md#sample-data). diff --git a/x-pack/plugins/asset_manager/docs/index.md b/x-pack/plugins/asset_manager/docs/rest_deprecated.md similarity index 93% rename from x-pack/plugins/asset_manager/docs/index.md rename to x-pack/plugins/asset_manager/docs/rest_deprecated.md index 790beb87b4f7e..43a5f74a0d058 100644 --- a/x-pack/plugins/asset_manager/docs/index.md +++ b/x-pack/plugins/asset_manager/docs/rest_deprecated.md @@ -1,24 +1,6 @@ -# Asset Manager Documentation +## Deprecated REST API docs -_Note:_ To read about development guidance around testing, sample data, etc., see the -[plugin's main README file](../README.md) - -## Alpha Configuration - -This plugin is NOT fully enabled by default, even though it's always enabled -by Kibana's definition of "enabled". However, without the following configuration, -it will bail before it sets up any routes or returns anything from its -start, setup, or stop hooks. - -To fully enable the plugin, set the following config value in your kibana.yml file: - -```yaml -xpack.assetManager.alphaEnabled: true -``` - -## APIs - -This plugin provides the following APIs. +These docs are not being currently maintained because they pertain to an internal REST API. Please see [our docs for our API clients](./api.md) instead. ### Shared Types @@ -58,16 +40,16 @@ Returns a list of assets present within a given time range. Can be limited by as ##### Request -| Option | Type | Required? | Default | Description | -| :------ | :------------ | :-------- | :------ | :--------------------------------------------------------------------------------- | -| from | RangeDate | No | "now-24h" | Starting point for date range to search for assets within | -| to | RangeDate | No | "now" | End point for date range to search for assets | -| type | AssetType[] | No | all | Specify one or more types to restrict the query | -| ean | AssetEan[] | No | all | Specify one or more EANs (specific assets) to restrict the query | -| size | number | No | all | Limit the amount of assets returned | - +| Option | Type | Required? | Default | Description | +| :----- | :---------- | :-------- | :-------- | :--------------------------------------------------------------- | +| from | RangeDate | No | "now-24h" | Starting point for date range to search for assets within | +| to | RangeDate | No | "now" | End point for date range to search for assets | +| type | AssetType[] | No | all | Specify one or more types to restrict the query | +| ean | AssetEan[] | No | all | Specify one or more EANs (specific assets) to restrict the query | +| size | number | No | all | Limit the amount of assets returned | _Notes:_ + - User cannot specify both type and ean at the same time. - For array types such as `type` and `ean`, user should specify the query parameter multiple times, e.g. `type=k8s.pod&type=k8s.node` @@ -410,15 +392,15 @@ GET kbn:/api/asset-manager/assets?from=2023-03-25T17:44:44.000Z&to=2023-03-25T18 Returns assets found in the two time ranges, split by what occurs in only either or in both. -#### Request +#### Request -| Option | Type | Required? | Default | Description | -| :--- | :--- | :--- | :--- | :--- | -| aFrom | RangeDate | Yes | N/A | Starting point for baseline date range to search for assets within | -| aTo | RangeDate | Yes | N/A | End point for baseline date range to search for assets within | -| bFrom | RangeDate | Yes | N/A | Starting point for comparison date range | -| bTo | RangeDate | Yes | N/A | End point for comparison date range | -| type | AssetType[] | No | all | Restrict results to one or more asset.type value | +| Option | Type | Required? | Default | Description | +| :----- | :---------- | :-------- | :------ | :----------------------------------------------------------------- | +| aFrom | RangeDate | Yes | N/A | Starting point for baseline date range to search for assets within | +| aTo | RangeDate | Yes | N/A | End point for baseline date range to search for assets within | +| bFrom | RangeDate | Yes | N/A | Starting point for comparison date range | +| bTo | RangeDate | Yes | N/A | End point for comparison date range | +| type | AssetType[] | No | all | Restrict results to one or more asset.type value | #### Responses @@ -1044,14 +1026,14 @@ Returns assets related to the provided ean. The relation can be one of ancestors #### Request -| Option | Type | Required? | Default | Description | -| :--- | :--- | :--- | :--- | :--- | -| relation | string | Yes | N/A | The type of related assets we're looking for. One of (ancestors|descendants|references) | -| from | RangeDate | Yes | N/A | Starting point for date range to search for assets within | -| to | RangeDate | No | "now" | End point for date range to search for assets | -| ean | AssetEan | Yes | N/A | Single Elastic Asset Name representing the asset for which the related assets are being requested | -| type | AssetType[] | No | all | Restrict results to one or more asset.type value | -| maxDistance | number (1-5) | No | 1 | Maximum number of "hops" to search away from specified asset | +| Option | Type | Required? | Default | Description | +| :---------- | :----------- | :-------- | :------ | :------------------------------------------------------------------------------------------------ | ----------- | ----------- | +| relation | string | Yes | N/A | The type of related assets we're looking for. One of (ancestors | descendants | references) | +| from | RangeDate | Yes | N/A | Starting point for date range to search for assets within | +| to | RangeDate | No | "now" | End point for date range to search for assets | +| ean | AssetEan | Yes | N/A | Single Elastic Asset Name representing the asset for which the related assets are being requested | +| type | AssetType[] | No | all | Restrict results to one or more asset.type value | +| maxDistance | number (1-5) | No | 1 | Maximum number of "hops" to search away from specified asset | #### Responses diff --git a/x-pack/plugins/asset_manager/kibana.jsonc b/x-pack/plugins/asset_manager/kibana.jsonc index 49b1b59838d9c..b3fcd1b3a4fa1 100644 --- a/x-pack/plugins/asset_manager/kibana.jsonc +++ b/x-pack/plugins/asset_manager/kibana.jsonc @@ -15,7 +15,7 @@ "apmDataAccess", "metricsDataAccess" ], - "browser": false, + "browser": true, "server": true, "requiredBundles": [ ] diff --git a/x-pack/plugins/asset_manager/public/index.ts b/x-pack/plugins/asset_manager/public/index.ts new file mode 100644 index 0000000000000..7837c00909430 --- /dev/null +++ b/x-pack/plugins/asset_manager/public/index.ts @@ -0,0 +1,20 @@ +/* + * 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 { PluginInitializer, PluginInitializerContext } from '@kbn/core/public'; +import { Plugin } from './plugin'; +import { AssetManagerPublicPluginSetup, AssetManagerPublicPluginStart } from './types'; + +export const plugin: PluginInitializer< + AssetManagerPublicPluginSetup | undefined, + AssetManagerPublicPluginStart | undefined +> = (context: PluginInitializerContext) => { + return new Plugin(context); +}; + +export type { AssetManagerPublicPluginSetup, AssetManagerPublicPluginStart }; +export type AssetManagerAppId = 'assetManager'; diff --git a/x-pack/plugins/asset_manager/public/lib/public_assets_client.test.ts b/x-pack/plugins/asset_manager/public/lib/public_assets_client.test.ts new file mode 100644 index 0000000000000..93cc541a34af4 --- /dev/null +++ b/x-pack/plugins/asset_manager/public/lib/public_assets_client.test.ts @@ -0,0 +1,48 @@ +/* + * 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 { HttpSetupMock } from '@kbn/core-http-browser-mocks'; +import { coreMock } from '@kbn/core/public/mocks'; +import { PublicAssetsClient } from './public_assets_client'; +import * as routePaths from '../../common/constants_routes'; + +describe('Public assets client', () => { + let http: HttpSetupMock = coreMock.createSetup().http; + + beforeEach(() => { + http = coreMock.createSetup().http; + }); + + describe('class instantiation', () => { + it('should successfully instantiate', () => { + new PublicAssetsClient(http); + }); + }); + + describe('getHosts', () => { + it('should call the REST API', async () => { + const client = new PublicAssetsClient(http); + await client.getHosts({ from: 'x', to: 'y' }); + expect(http.get).toBeCalledTimes(1); + }); + + it('should include specified "from" and "to" parameters in http.get query', async () => { + const client = new PublicAssetsClient(http); + await client.getHosts({ from: 'x', to: 'y' }); + expect(http.get).toBeCalledWith(routePaths.GET_HOSTS, { + query: { from: 'x', to: 'y' }, + }); + }); + + it('should return the direct results of http.get', async () => { + const client = new PublicAssetsClient(http); + http.get.mockResolvedValueOnce('my result'); + const result = await client.getHosts({ from: 'x', to: 'y' }); + expect(result).toBe('my result'); + }); + }); +}); diff --git a/x-pack/plugins/asset_manager/public/lib/public_assets_client.ts b/x-pack/plugins/asset_manager/public/lib/public_assets_client.ts new file mode 100644 index 0000000000000..dd18386868f94 --- /dev/null +++ b/x-pack/plugins/asset_manager/public/lib/public_assets_client.ts @@ -0,0 +1,26 @@ +/* + * 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 { HttpStart } from '@kbn/core/public'; +import { GetHostsOptionsPublic } from '../../common/types_client'; +import { GetHostAssetsResponse } from '../../common/types_api'; +import { GET_HOSTS } from '../../common/constants_routes'; +import { IPublicAssetsClient } from '../types'; + +export class PublicAssetsClient implements IPublicAssetsClient { + constructor(private readonly http: HttpStart) {} + + async getHosts(options: GetHostsOptionsPublic) { + const results = await this.http.get(GET_HOSTS, { + query: { + ...options, + }, + }); + + return results; + } +} diff --git a/x-pack/plugins/asset_manager/public/plugin.ts b/x-pack/plugins/asset_manager/public/plugin.ts new file mode 100644 index 0000000000000..4b2d91f3a60f1 --- /dev/null +++ b/x-pack/plugins/asset_manager/public/plugin.ts @@ -0,0 +1,51 @@ +/* + * 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 { CoreSetup, CoreStart, PluginInitializerContext } from '@kbn/core/public'; +import { Logger } from '@kbn/logging'; +import { AssetManagerPluginClass } from './types'; +import { PublicAssetsClient } from './lib/public_assets_client'; +import type { AssetManagerPublicConfig } from '../common/config'; + +export class Plugin implements AssetManagerPluginClass { + public config: AssetManagerPublicConfig; + public logger: Logger; + + constructor(context: PluginInitializerContext<{}>) { + this.config = context.config.get(); + this.logger = context.logger.get(); + } + + setup(core: CoreSetup) { + // Check for config value and bail out if not "alpha-enabled" + if (!this.config.alphaEnabled) { + this.logger.debug('Public is NOT enabled'); + return; + } + + this.logger.debug('Public is enabled'); + + const publicAssetsClient = new PublicAssetsClient(core.http); + return { + publicAssetsClient, + }; + } + + start(core: CoreStart) { + // Check for config value and bail out if not "alpha-enabled" + if (!this.config.alphaEnabled) { + return; + } + + const publicAssetsClient = new PublicAssetsClient(core.http); + return { + publicAssetsClient, + }; + } + + stop() {} +} diff --git a/x-pack/plugins/asset_manager/public/types.ts b/x-pack/plugins/asset_manager/public/types.ts new file mode 100644 index 0000000000000..67f0053cfdd56 --- /dev/null +++ b/x-pack/plugins/asset_manager/public/types.ts @@ -0,0 +1,25 @@ +/* + * 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 { Plugin as PluginClass } from '@kbn/core/public'; +import { GetHostsOptionsPublic } from '../common/types_client'; +import { GetHostAssetsResponse } from '../common/types_api'; +export interface AssetManagerPublicPluginSetup { + publicAssetsClient: IPublicAssetsClient; +} + +export interface AssetManagerPublicPluginStart { + publicAssetsClient: IPublicAssetsClient; +} + +export type AssetManagerPluginClass = PluginClass< + AssetManagerPublicPluginSetup | undefined, + AssetManagerPublicPluginStart | undefined +>; + +export interface IPublicAssetsClient { + getHosts: (options: GetHostsOptionsPublic) => Promise; +} diff --git a/x-pack/plugins/asset_manager/server/constants.ts b/x-pack/plugins/asset_manager/server/constants.ts index 0aa1cb467df48..4630365e47875 100644 --- a/x-pack/plugins/asset_manager/server/constants.ts +++ b/x-pack/plugins/asset_manager/server/constants.ts @@ -6,4 +6,3 @@ */ export const ASSETS_INDEX_PREFIX = 'assets'; -export const ASSET_MANAGER_API_BASE = '/api/asset-manager'; diff --git a/x-pack/plugins/asset_manager/server/index.ts b/x-pack/plugins/asset_manager/server/index.ts index d6eafa380b857..5dbecbee5f9da 100644 --- a/x-pack/plugins/asset_manager/server/index.ts +++ b/x-pack/plugins/asset_manager/server/index.ts @@ -6,11 +6,21 @@ */ import { PluginInitializerContext } from '@kbn/core-plugins-server'; -import { AssetManagerServerPlugin, config } from './plugin'; +import { AssetManagerConfig } from '../common/config'; +import { + AssetManagerServerPlugin, + AssetManagerServerPluginSetup, + AssetManagerServerPluginStart, + config, +} from './plugin'; import type { WriteSamplesPostBody } from './routes/sample_assets'; -import { AssetManagerConfig } from './types'; -export type { AssetManagerConfig, WriteSamplesPostBody }; +export type { + AssetManagerConfig, + WriteSamplesPostBody, + AssetManagerServerPluginSetup, + AssetManagerServerPluginStart, +}; export { config }; export const plugin = (context: PluginInitializerContext) => diff --git a/x-pack/plugins/asset_manager/server/lib/accessors/hosts/get_hosts_by_assets.ts b/x-pack/plugins/asset_manager/server/lib/accessors/hosts/get_hosts_by_assets.ts index 13e2d00a82083..f975df1cd82f4 100644 --- a/x-pack/plugins/asset_manager/server/lib/accessors/hosts/get_hosts_by_assets.ts +++ b/x-pack/plugins/asset_manager/server/lib/accessors/hosts/get_hosts_by_assets.ts @@ -13,7 +13,7 @@ export async function getHostsByAssets( options: GetHostsOptionsInjected ): Promise<{ hosts: Asset[] }> { const hosts = await getAssets({ - esClient: options.esClient, + elasticsearchClient: options.elasticsearchClient, filters: { kind: 'host', from: options.from, diff --git a/x-pack/plugins/asset_manager/server/lib/accessors/hosts/get_hosts_by_signals.ts b/x-pack/plugins/asset_manager/server/lib/accessors/hosts/get_hosts_by_signals.ts index 4fad9e301a89d..93e601ae00f9c 100644 --- a/x-pack/plugins/asset_manager/server/lib/accessors/hosts/get_hosts_by_signals.ts +++ b/x-pack/plugins/asset_manager/server/lib/accessors/hosts/get_hosts_by_signals.ts @@ -13,11 +13,11 @@ export async function getHostsBySignals( options: GetHostsOptionsInjected ): Promise<{ hosts: Asset[] }> { const metricsIndices = await options.metricsClient.getMetricIndices({ - savedObjectsClient: options.soClient, + savedObjectsClient: options.savedObjectsClient, }); const { assets } = await collectHosts({ - client: options.esClient, + client: options.elasticsearchClient, from: options.from, to: options.to, sourceIndices: { diff --git a/x-pack/plugins/asset_manager/server/lib/accessors/hosts/index.ts b/x-pack/plugins/asset_manager/server/lib/accessors/hosts/index.ts index 9becb15ebdc0a..1b60268d85389 100644 --- a/x-pack/plugins/asset_manager/server/lib/accessors/hosts/index.ts +++ b/x-pack/plugins/asset_manager/server/lib/accessors/hosts/index.ts @@ -5,12 +5,11 @@ * 2.0. */ -import { AccessorOptions, OptionsWithInjectedValues } from '..'; +import type { AssetClientDependencies } from '../../../types'; +import type { GetHostsOptionsPublic } from '../../../../common/types_client'; +import type { OptionsWithInjectedValues } from '..'; -export interface GetHostsOptions extends AccessorOptions { - from: string; - to: string; -} +export type GetHostsOptions = GetHostsOptionsPublic & AssetClientDependencies; export type GetHostsOptionsInjected = OptionsWithInjectedValues; export interface HostIdentifier { diff --git a/x-pack/plugins/asset_manager/server/lib/accessors/index.ts b/x-pack/plugins/asset_manager/server/lib/accessors/index.ts index f5cf4d38fadc8..6fd9254a2182e 100644 --- a/x-pack/plugins/asset_manager/server/lib/accessors/index.ts +++ b/x-pack/plugins/asset_manager/server/lib/accessors/index.ts @@ -5,11 +5,10 @@ * 2.0. */ -import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { APMDataAccessConfig } from '@kbn/apm-data-access-plugin/server'; import { MetricsDataClient } from '@kbn/metrics-data-access-plugin/server'; import { SavedObjectsClientContract } from '@kbn/core/server'; -import { AssetManagerConfig } from '../../types'; +import { AssetManagerConfig } from '../../../common/config'; export interface InjectedValues { sourceIndices: AssetManagerConfig['sourceIndices']; @@ -18,8 +17,3 @@ export interface InjectedValues { } export type OptionsWithInjectedValues = T & InjectedValues; - -export interface AccessorOptions { - esClient: ElasticsearchClient; - soClient: SavedObjectsClientContract; -} diff --git a/x-pack/plugins/asset_manager/server/lib/accessors/services/get_services_by_assets.ts b/x-pack/plugins/asset_manager/server/lib/accessors/services/get_services_by_assets.ts index 8bdd6283d6559..8e69bcbff4625 100644 --- a/x-pack/plugins/asset_manager/server/lib/accessors/services/get_services_by_assets.ts +++ b/x-pack/plugins/asset_manager/server/lib/accessors/services/get_services_by_assets.ts @@ -18,7 +18,7 @@ export async function getServicesByAssets( } const services = await getAssets({ - esClient: options.esClient, + elasticsearchClient: options.elasticsearchClient, filters: { kind: 'service', from: options.from, @@ -32,7 +32,7 @@ export async function getServicesByAssets( async function getServicesByParent( options: GetServicesOptionsInjected ): Promise<{ services: Asset[] }> { - const { descendants } = await getAllRelatedAssets(options.esClient, { + const { descendants } = await getAllRelatedAssets(options.elasticsearchClient, { from: options.from, to: options.to, maxDistance: 5, diff --git a/x-pack/plugins/asset_manager/server/lib/accessors/services/get_services_by_signals.ts b/x-pack/plugins/asset_manager/server/lib/accessors/services/get_services_by_signals.ts index ab8de39adb301..720d6b3e30531 100644 --- a/x-pack/plugins/asset_manager/server/lib/accessors/services/get_services_by_signals.ts +++ b/x-pack/plugins/asset_manager/server/lib/accessors/services/get_services_by_signals.ts @@ -26,9 +26,9 @@ export async function getServicesBySignals( }); } - const apmIndices = await options.getApmIndices(options.soClient); + const apmIndices = await options.getApmIndices(options.savedObjectsClient); const { assets } = await collectServices({ - client: options.esClient, + client: options.elasticsearchClient, from: options.from, to: options.to, sourceIndices: { diff --git a/x-pack/plugins/asset_manager/server/lib/accessors/services/index.ts b/x-pack/plugins/asset_manager/server/lib/accessors/services/index.ts index 3fed1047eacba..e8b52e4924c4d 100644 --- a/x-pack/plugins/asset_manager/server/lib/accessors/services/index.ts +++ b/x-pack/plugins/asset_manager/server/lib/accessors/services/index.ts @@ -5,13 +5,11 @@ * 2.0. */ -import { AccessorOptions, OptionsWithInjectedValues } from '..'; +import { AssetClientDependencies } from '../../../types'; +import { GetServicesOptionsPublic } from '../../../../common/types_client'; +import { OptionsWithInjectedValues } from '..'; -export interface GetServicesOptions extends AccessorOptions { - from: string; - to: string; - parent?: string; -} +export type GetServicesOptions = GetServicesOptionsPublic & AssetClientDependencies; export type GetServicesOptionsInjected = OptionsWithInjectedValues; export interface ServiceIdentifier { diff --git a/x-pack/plugins/asset_manager/server/lib/asset_accessor.ts b/x-pack/plugins/asset_manager/server/lib/asset_client.ts similarity index 81% rename from x-pack/plugins/asset_manager/server/lib/asset_accessor.ts rename to x-pack/plugins/asset_manager/server/lib/asset_client.ts index 73c2064e48311..8bf23313c663e 100644 --- a/x-pack/plugins/asset_manager/server/lib/asset_accessor.ts +++ b/x-pack/plugins/asset_manager/server/lib/asset_client.ts @@ -8,8 +8,8 @@ import { APMDataAccessConfig } from '@kbn/apm-data-access-plugin/server'; import { MetricsDataClient } from '@kbn/metrics-data-access-plugin/server'; import { SavedObjectsClientContract } from '@kbn/core/server'; +import { AssetManagerConfig } from '../../common/config'; import { Asset } from '../../common/types_api'; -import { AssetManagerConfig } from '../types'; import { OptionsWithInjectedValues } from './accessors'; import { GetHostsOptions } from './accessors/hosts'; import { GetServicesOptions } from './accessors/services'; @@ -18,28 +18,28 @@ import { getHostsBySignals } from './accessors/hosts/get_hosts_by_signals'; import { getServicesByAssets } from './accessors/services/get_services_by_assets'; import { getServicesBySignals } from './accessors/services/get_services_by_signals'; -interface AssetAccessorClassOptions { +interface AssetClientClassOptions { sourceIndices: AssetManagerConfig['sourceIndices']; source: AssetManagerConfig['lockedSource']; getApmIndices: (soClient: SavedObjectsClientContract) => Promise; metricsClient: MetricsDataClient; } -export class AssetAccessor { - constructor(private options: AssetAccessorClassOptions) {} +export class AssetClient { + constructor(private baseOptions: AssetClientClassOptions) {} injectOptions(options: T): OptionsWithInjectedValues { return { ...options, - sourceIndices: this.options.sourceIndices, - getApmIndices: this.options.getApmIndices, - metricsClient: this.options.metricsClient, + sourceIndices: this.baseOptions.sourceIndices, + getApmIndices: this.baseOptions.getApmIndices, + metricsClient: this.baseOptions.metricsClient, }; } async getHosts(options: GetHostsOptions): Promise<{ hosts: Asset[] }> { const withInjected = this.injectOptions(options); - if (this.options.source === 'assets') { + if (this.baseOptions.source === 'assets') { return await getHostsByAssets(withInjected); } else { return await getHostsBySignals(withInjected); @@ -48,7 +48,7 @@ export class AssetAccessor { async getServices(options: GetServicesOptions): Promise<{ services: Asset[] }> { const withInjected = this.injectOptions(options); - if (this.options.source === 'assets') { + if (this.baseOptions.source === 'assets') { return await getServicesByAssets(withInjected); } else { return await getServicesBySignals(withInjected); diff --git a/x-pack/plugins/asset_manager/server/lib/get_all_related_assets.ts b/x-pack/plugins/asset_manager/server/lib/get_all_related_assets.ts index ad8aff78cbb18..dddbb792b0979 100644 --- a/x-pack/plugins/asset_manager/server/lib/get_all_related_assets.ts +++ b/x-pack/plugins/asset_manager/server/lib/get_all_related_assets.ts @@ -26,13 +26,13 @@ interface GetAllRelatedAssetsOptions { } export async function getAllRelatedAssets( - esClient: ElasticsearchClient, + elasticsearchClient: ElasticsearchClient, options: GetAllRelatedAssetsOptions ) { // How to put size into this? const { ean, from, to, relation, maxDistance, kind = [] } = options; - const primary = await findPrimary(esClient, { ean, from, to }); + const primary = await findPrimary(elasticsearchClient, { ean, from, to }); let assetsToFetch = [primary]; let currentDistance = 1; @@ -52,7 +52,7 @@ export async function getAllRelatedAssets( const results = flatten( await Promise.all( - assetsToFetch.map((asset) => findRelatedAssets(esClient, asset, queryOptions)) + assetsToFetch.map((asset) => findRelatedAssets(elasticsearchClient, asset, queryOptions)) ) ); @@ -75,11 +75,11 @@ export async function getAllRelatedAssets( } async function findPrimary( - esClient: ElasticsearchClient, + elasticsearchClient: ElasticsearchClient, { ean, from, to }: Pick ): Promise { const primaryResults = await getAssets({ - esClient, + elasticsearchClient, size: 1, filters: { ean, from, to }, }); @@ -101,7 +101,7 @@ type FindRelatedAssetsOptions = Pick< > & { visitedEans: string[] }; async function findRelatedAssets( - esClient: ElasticsearchClient, + elasticsearchClient: ElasticsearchClient, primary: Asset, { relation, from, to, kind, visitedEans }: FindRelatedAssetsOptions ): Promise { @@ -116,7 +116,7 @@ async function findRelatedAssets( const remainingEansToFind = without(directlyRelatedEans, ...visitedEans); if (remainingEansToFind.length > 0) { directlyRelatedAssets = await getAssets({ - esClient, + elasticsearchClient, filters: { ean: remainingEansToFind, from, to, kind }, }); } @@ -124,7 +124,7 @@ async function findRelatedAssets( debug('Directly related assets found:', JSON.stringify(directlyRelatedAssets)); const indirectlyRelatedAssets = await getIndirectlyRelatedAssets({ - esClient, + elasticsearchClient, ean: primary['asset.ean'], excludeEans: visitedEans.concat(directlyRelatedEans), relation, diff --git a/x-pack/plugins/asset_manager/server/lib/get_assets.ts b/x-pack/plugins/asset_manager/server/lib/get_assets.ts index 12f87e4b398fc..e3630f92f26e9 100644 --- a/x-pack/plugins/asset_manager/server/lib/get_assets.ts +++ b/x-pack/plugins/asset_manager/server/lib/get_assets.ts @@ -19,7 +19,7 @@ interface GetAssetsOptions extends ElasticsearchAccessorOptions { } export async function getAssets({ - esClient, + elasticsearchClient, size = 100, filters = {}, }: GetAssetsOptions): Promise { @@ -125,6 +125,6 @@ export async function getAssets({ debug('Performing Get Assets Query', '\n\n', JSON.stringify(dsl, null, 2)); - const response = await esClient.search(dsl); + const response = await elasticsearchClient.search(dsl); return response.hits.hits.map((hit) => hit._source).filter((asset): asset is Asset => !!asset); } diff --git a/x-pack/plugins/asset_manager/server/lib/get_indirectly_related_assets.ts b/x-pack/plugins/asset_manager/server/lib/get_indirectly_related_assets.ts index fa9f3279ec497..b91242f4aba1b 100644 --- a/x-pack/plugins/asset_manager/server/lib/get_indirectly_related_assets.ts +++ b/x-pack/plugins/asset_manager/server/lib/get_indirectly_related_assets.ts @@ -23,7 +23,7 @@ interface GetRelatedAssetsOptions extends ElasticsearchAccessorOptions { } export async function getIndirectlyRelatedAssets({ - esClient, + elasticsearchClient, size = 100, from = 'now-24h', to = 'now', @@ -91,7 +91,7 @@ export async function getIndirectlyRelatedAssets({ debug('Performing Indirectly Related Asset Query', '\n\n', JSON.stringify(dsl, null, 2)); - const response = await esClient.search(dsl); + const response = await elasticsearchClient.search(dsl); return response.hits.hits.map((hit) => hit._source).filter((asset): asset is Asset => !!asset); } diff --git a/x-pack/plugins/asset_manager/server/lib/write_assets.ts b/x-pack/plugins/asset_manager/server/lib/write_assets.ts index 55c5397645725..72b79bc366b6d 100644 --- a/x-pack/plugins/asset_manager/server/lib/write_assets.ts +++ b/x-pack/plugins/asset_manager/server/lib/write_assets.ts @@ -18,7 +18,7 @@ interface WriteAssetsOptions extends ElasticsearchAccessorOptions { } export async function writeAssets({ - esClient, + elasticsearchClient, assetDocs, namespace = 'default', refresh = false, @@ -33,5 +33,5 @@ export async function writeAssets({ debug('Performing Write Asset Query', '\n\n', JSON.stringify(dsl, null, 2)); - return await esClient.bulk<{}>(dsl); + return await elasticsearchClient.bulk<{}>(dsl); } diff --git a/x-pack/plugins/asset_manager/server/plugin.ts b/x-pack/plugins/asset_manager/server/plugin.ts index 6693e6037a836..24563b5e0fbc1 100644 --- a/x-pack/plugins/asset_manager/server/plugin.ts +++ b/x-pack/plugins/asset_manager/server/plugin.ts @@ -18,15 +18,16 @@ import { import { upsertTemplate } from './lib/manage_index_templates'; import { setupRoutes } from './routes'; import { assetsIndexTemplateConfig } from './templates/assets_template'; -import { AssetManagerConfig, configSchema } from './types'; -import { AssetAccessor } from './lib/asset_accessor'; +import { AssetClient } from './lib/asset_client'; import { AssetManagerPluginSetupDependencies, AssetManagerPluginStartDependencies } from './types'; +import { AssetManagerConfig, configSchema, exposeToBrowserConfig } from '../common/config'; export type AssetManagerServerPluginSetup = ReturnType; export type AssetManagerServerPluginStart = ReturnType; export const config: PluginConfigDescriptor = { schema: configSchema, + exposeToBrowser: exposeToBrowserConfig, }; export class AssetManagerServerPlugin @@ -49,13 +50,13 @@ export class AssetManagerServerPlugin public setup(core: CoreSetup, plugins: AssetManagerPluginSetupDependencies) { // Check for config value and bail out if not "alpha-enabled" if (!this.config.alphaEnabled) { - this.logger.info('Asset manager plugin [tech preview] is NOT enabled'); + this.logger.info('Server is NOT enabled'); return; } - this.logger.info('Asset manager plugin [tech preview] is enabled'); + this.logger.info('Server is enabled'); - const assetAccessor = new AssetAccessor({ + const assetClient = new AssetClient({ source: this.config.lockedSource, sourceIndices: this.config.sourceIndices, getApmIndices: plugins.apmDataAccess.getApmIndices, @@ -63,10 +64,10 @@ export class AssetManagerServerPlugin }); const router = core.http.createRouter(); - setupRoutes({ router, assetAccessor }); + setupRoutes({ router, assetClient }); return { - assetAccessor, + assetClient, }; } diff --git a/x-pack/plugins/asset_manager/server/routes/assets/hosts.ts b/x-pack/plugins/asset_manager/server/routes/assets/hosts.ts index e17ad95f81a24..f7780f2ef4a6c 100644 --- a/x-pack/plugins/asset_manager/server/routes/assets/hosts.ts +++ b/x-pack/plugins/asset_manager/server/routes/assets/hosts.ts @@ -5,56 +5,37 @@ * 2.0. */ -import * as rt from 'io-ts'; import datemath from '@kbn/datemath'; -import { - dateRt, - inRangeFromStringRt, - datemathStringRt, - createRouteValidationFunction, - createLiteralValueFromUndefinedRT, -} from '@kbn/io-ts-utils'; +import { createRouteValidationFunction } from '@kbn/io-ts-utils'; import { RequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; +import { GetHostAssetsQueryOptions, getHostAssetsQueryOptionsRT } from '../../../common/types_api'; import { debug } from '../../../common/debug_log'; import { SetupRouteOptions } from '../types'; -import { ASSET_MANAGER_API_BASE } from '../../constants'; -import { getEsClientFromContext } from '../utils'; - -const sizeRT = rt.union([inRangeFromStringRt(1, 100), createLiteralValueFromUndefinedRT(10)]); -const assetDateRT = rt.union([dateRt, datemathStringRt]); -const getHostAssetsQueryOptionsRT = rt.exact( - rt.partial({ - from: assetDateRT, - to: assetDateRT, - size: sizeRT, - }) -); - -export type GetHostAssetsQueryOptions = rt.TypeOf; +import * as routePaths from '../../../common/constants_routes'; +import { getClientsFromContext } from '../utils'; export function hostsRoutes({ router, - assetAccessor, + assetClient, }: SetupRouteOptions) { router.get( { - path: `${ASSET_MANAGER_API_BASE}/assets/hosts`, + path: routePaths.GET_HOSTS, validate: { query: createRouteValidationFunction(getHostAssetsQueryOptionsRT), }, }, async (context, req, res) => { const { from = 'now-24h', to = 'now' } = req.query || {}; - const esClient = await getEsClientFromContext(context); - const coreContext = await context.core; - const soClient = coreContext.savedObjects.client; + + const { elasticsearchClient, savedObjectsClient } = await getClientsFromContext(context); try { - const response = await assetAccessor.getHosts({ + const response = await assetClient.getHosts({ from: datemath.parse(from)!.toISOString(), to: datemath.parse(to)!.toISOString(), - esClient, - soClient, + elasticsearchClient, + savedObjectsClient, }); return res.ok({ body: response }); diff --git a/x-pack/plugins/asset_manager/server/routes/assets/index.ts b/x-pack/plugins/asset_manager/server/routes/assets/index.ts index b8b6d7ab0fa3a..8d9eaff170d30 100644 --- a/x-pack/plugins/asset_manager/server/routes/assets/index.ts +++ b/x-pack/plugins/asset_manager/server/routes/assets/index.ts @@ -17,11 +17,11 @@ import { } from '@kbn/io-ts-utils'; import { debug } from '../../../common/debug_log'; import { assetTypeRT, assetKindRT, relationRT } from '../../../common/types_api'; -import { ASSET_MANAGER_API_BASE } from '../../constants'; +import { GET_ASSETS, GET_RELATED_ASSETS, GET_ASSETS_DIFF } from '../../../common/constants_routes'; import { getAssets } from '../../lib/get_assets'; import { getAllRelatedAssets } from '../../lib/get_all_related_assets'; import { SetupRouteOptions } from '../types'; -import { getEsClientFromContext } from '../utils'; +import { getClientsFromContext } from '../utils'; import { AssetNotFoundError } from '../../lib/errors'; import { isValidRange } from '../../lib/utils'; @@ -82,7 +82,7 @@ export function assetsRoutes({ router }: SetupR // GET /assets router.get( { - path: `${ASSET_MANAGER_API_BASE}/assets`, + path: GET_ASSETS, validate: { query: createRouteValidationFunction(getAssetsQueryOptionsRT), }, @@ -102,10 +102,10 @@ export function assetsRoutes({ router }: SetupR }); } - const esClient = await getEsClientFromContext(context); + const { elasticsearchClient } = await getClientsFromContext(context); try { - const results = await getAssets({ esClient, size, filters }); + const results = await getAssets({ elasticsearchClient, size, filters }); return res.ok({ body: { results } }); } catch (error: unknown) { debug('error looking up asset records', error); @@ -120,7 +120,7 @@ export function assetsRoutes({ router }: SetupR // GET assets/related router.get( { - path: `${ASSET_MANAGER_API_BASE}/assets/related`, + path: GET_RELATED_ASSETS, validate: { query: createRouteValidationFunction(getRelatedAssetsQueryOptionsRT), }, @@ -129,7 +129,7 @@ export function assetsRoutes({ router }: SetupR // Add references into sample data and write integration tests const { from, to, ean, relation, maxDistance, size, type, kind } = req.query || {}; - const esClient = await getEsClientFromContext(context); + const { elasticsearchClient } = await getClientsFromContext(context); if (to && !isValidRange(from, to)) { return res.badRequest({ @@ -140,7 +140,7 @@ export function assetsRoutes({ router }: SetupR try { return res.ok({ body: { - results: await getAllRelatedAssets(esClient, { + results: await getAllRelatedAssets(elasticsearchClient, { ean, from, to, @@ -165,7 +165,7 @@ export function assetsRoutes({ router }: SetupR // GET /assets/diff router.get( { - path: `${ASSET_MANAGER_API_BASE}/assets/diff`, + path: GET_ASSETS_DIFF, validate: { query: createRouteValidationFunction(getAssetsDiffQueryOptionsRT), }, @@ -187,11 +187,11 @@ export function assetsRoutes({ router }: SetupR }); } - const esClient = await getEsClientFromContext(context); + const { elasticsearchClient } = await getClientsFromContext(context); try { const resultsForA = await getAssets({ - esClient, + elasticsearchClient, filters: { from: aFrom, to: aTo, @@ -201,7 +201,7 @@ export function assetsRoutes({ router }: SetupR }); const resultsForB = await getAssets({ - esClient, + elasticsearchClient, filters: { from: bFrom, to: bTo, diff --git a/x-pack/plugins/asset_manager/server/routes/assets/services.ts b/x-pack/plugins/asset_manager/server/routes/assets/services.ts index d7edf3b6f7f3c..3852a0bb60d11 100644 --- a/x-pack/plugins/asset_manager/server/routes/assets/services.ts +++ b/x-pack/plugins/asset_manager/server/routes/assets/services.ts @@ -17,8 +17,8 @@ import { import { RequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; import { debug } from '../../../common/debug_log'; import { SetupRouteOptions } from '../types'; -import { ASSET_MANAGER_API_BASE } from '../../constants'; -import { getEsClientFromContext } from '../utils'; +import { ASSET_MANAGER_API_BASE } from '../../../common/constants_routes'; +import { getClientsFromContext } from '../utils'; const sizeRT = rt.union([inRangeFromStringRt(1, 100), createLiteralValueFromUndefinedRT(10)]); const assetDateRT = rt.union([dateRt, datemathStringRt]); @@ -35,7 +35,7 @@ export type GetServiceAssetsQueryOptions = rt.TypeOf({ router, - assetAccessor, + assetClient, }: SetupRouteOptions) { // GET /assets/services router.get( @@ -47,16 +47,14 @@ export function servicesRoutes({ }, async (context, req, res) => { const { from = 'now-24h', to = 'now', parent } = req.query || {}; - const esClient = await getEsClientFromContext(context); - const coreContext = await context.core; - const soClient = coreContext.savedObjects.client; + const { elasticsearchClient, savedObjectsClient } = await getClientsFromContext(context); try { - const response = await assetAccessor.getServices({ + const response = await assetClient.getServices({ from: datemath.parse(from)!.toISOString(), to: datemath.parse(to)!.toISOString(), parent, - esClient, - soClient, + elasticsearchClient, + savedObjectsClient, }); return res.ok({ body: response }); diff --git a/x-pack/plugins/asset_manager/server/routes/index.ts b/x-pack/plugins/asset_manager/server/routes/index.ts index cab0b1558fa00..30064a8562b6f 100644 --- a/x-pack/plugins/asset_manager/server/routes/index.ts +++ b/x-pack/plugins/asset_manager/server/routes/index.ts @@ -15,11 +15,11 @@ import { servicesRoutes } from './assets/services'; export function setupRoutes({ router, - assetAccessor, + assetClient, }: SetupRouteOptions) { - pingRoute({ router, assetAccessor }); - assetsRoutes({ router, assetAccessor }); - sampleAssetsRoutes({ router, assetAccessor }); - hostsRoutes({ router, assetAccessor }); - servicesRoutes({ router, assetAccessor }); + pingRoute({ router, assetClient }); + assetsRoutes({ router, assetClient }); + sampleAssetsRoutes({ router, assetClient }); + hostsRoutes({ router, assetClient }); + servicesRoutes({ router, assetClient }); } diff --git a/x-pack/plugins/asset_manager/server/routes/ping.ts b/x-pack/plugins/asset_manager/server/routes/ping.ts index 3f7b1bb679b98..3d7a20b5fd476 100644 --- a/x-pack/plugins/asset_manager/server/routes/ping.ts +++ b/x-pack/plugins/asset_manager/server/routes/ping.ts @@ -6,7 +6,7 @@ */ import { RequestHandlerContextBase } from '@kbn/core-http-server'; -import { ASSET_MANAGER_API_BASE } from '../constants'; +import { ASSET_MANAGER_API_BASE } from '../../common/constants_routes'; import { SetupRouteOptions } from './types'; export function pingRoute({ router }: SetupRouteOptions) { diff --git a/x-pack/plugins/asset_manager/server/routes/sample_assets.ts b/x-pack/plugins/asset_manager/server/routes/sample_assets.ts index 98f7f32051f3f..447051bbb2730 100644 --- a/x-pack/plugins/asset_manager/server/routes/sample_assets.ts +++ b/x-pack/plugins/asset_manager/server/routes/sample_assets.ts @@ -7,11 +7,11 @@ import { schema } from '@kbn/config-schema'; import { RequestHandlerContext } from '@kbn/core/server'; -import { ASSET_MANAGER_API_BASE } from '../constants'; +import { ASSET_MANAGER_API_BASE } from '../../common/constants_routes'; import { getSampleAssetDocs, sampleAssets } from '../lib/sample_assets'; import { writeAssets } from '../lib/write_assets'; import { SetupRouteOptions } from './types'; -import { getEsClientFromContext } from './utils'; +import { getClientsFromContext } from './utils'; export type WriteSamplesPostBody = { baseDateTime?: string | number; @@ -62,12 +62,12 @@ export function sampleAssetsRoutes({ }, }); } - const esClient = await getEsClientFromContext(context); + const { elasticsearchClient } = await getClientsFromContext(context); const assetDocs = getSampleAssetDocs({ baseDateTime: parsed, excludeEans }); try { const response = await writeAssets({ - esClient, + elasticsearchClient, assetDocs, namespace: 'sample_data', refresh, @@ -101,9 +101,9 @@ export function sampleAssetsRoutes({ validate: {}, }, async (context, req, res) => { - const esClient = await getEsClientFromContext(context); + const { elasticsearchClient } = await getClientsFromContext(context); - const sampleDataStreams = await esClient.indices.getDataStream({ + const sampleDataStreams = await elasticsearchClient.indices.getDataStream({ name: 'assets-*-sample_data', expand_wildcards: 'all', }); @@ -115,7 +115,7 @@ export function sampleAssetsRoutes({ for (let i = 0; i < dataStreamsToDelete.length; i++) { const dsName = dataStreamsToDelete[i]; try { - await esClient.indices.deleteDataStream({ name: dsName }); + await elasticsearchClient.indices.deleteDataStream({ name: dsName }); deletedDataStreams.push(dsName); } catch (error: any) { errorWhileDeleting = diff --git a/x-pack/plugins/asset_manager/server/routes/types.ts b/x-pack/plugins/asset_manager/server/routes/types.ts index 2a0cf91f47df7..ae1b967a5b596 100644 --- a/x-pack/plugins/asset_manager/server/routes/types.ts +++ b/x-pack/plugins/asset_manager/server/routes/types.ts @@ -6,9 +6,9 @@ */ import { IRouter, RequestHandlerContextBase } from '@kbn/core-http-server'; -import { AssetAccessor } from '../lib/asset_accessor'; +import { AssetClient } from '../lib/asset_client'; export interface SetupRouteOptions { router: IRouter; - assetAccessor: AssetAccessor; + assetClient: AssetClient; } diff --git a/x-pack/plugins/asset_manager/server/routes/utils.ts b/x-pack/plugins/asset_manager/server/routes/utils.ts index 378ed0b48fc87..665adc0917fa0 100644 --- a/x-pack/plugins/asset_manager/server/routes/utils.ts +++ b/x-pack/plugins/asset_manager/server/routes/utils.ts @@ -7,6 +7,12 @@ import { RequestHandlerContext } from '@kbn/core/server'; -export async function getEsClientFromContext(context: T) { - return (await context.core).elasticsearch.client.asCurrentUser; +export async function getClientsFromContext(context: T) { + const coreContext = await context.core; + + return { + coreContext, + elasticsearchClient: coreContext.elasticsearch.client.asCurrentUser, + savedObjectsClient: coreContext.savedObjects.client, + }; } diff --git a/x-pack/plugins/asset_manager/server/types.ts b/x-pack/plugins/asset_manager/server/types.ts index 380d48aa0c7fe..431378c7c9a9f 100644 --- a/x-pack/plugins/asset_manager/server/types.ts +++ b/x-pack/plugins/asset_manager/server/types.ts @@ -5,8 +5,7 @@ * 2.0. */ -import { schema, TypeOf } from '@kbn/config-schema'; -import { ElasticsearchClient } from '@kbn/core/server'; +import { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/server'; import { ApmDataAccessPluginSetup, ApmDataAccessPluginStart, @@ -14,37 +13,9 @@ import { import { MetricsDataPluginSetup } from '@kbn/metrics-data-access-plugin/server'; export interface ElasticsearchAccessorOptions { - esClient: ElasticsearchClient; + elasticsearchClient: ElasticsearchClient; } -export const INDEX_DEFAULTS = { - logs: 'filebeat-*,logs-*', -}; - -export const configSchema = schema.object({ - alphaEnabled: schema.maybe(schema.boolean()), - // Designate where various types of data live. - // NOTE: this should be handled in a centralized way for observability, so - // that when a user configures these differently from the known defaults, - // that value is propagated everywhere. For now, we duplicate the value here. - sourceIndices: schema.object( - { - logs: schema.string({ defaultValue: INDEX_DEFAULTS.logs }), - }, - { defaultValue: INDEX_DEFAULTS } - ), - // Choose an explicit source for asset queries. - // NOTE: This will eventually need to be able to cleverly switch - // between these values based on the availability of data in the - // indices, and possibly for each asset kind/type value. - // For now, we set this explicitly. - lockedSource: schema.oneOf([schema.literal('assets'), schema.literal('signals')], { - defaultValue: 'signals', - }), -}); - -export type AssetManagerConfig = TypeOf; - export interface AssetManagerPluginSetupDependencies { apmDataAccess: ApmDataAccessPluginSetup; metricsDataAccess: MetricsDataPluginSetup; @@ -52,3 +23,8 @@ export interface AssetManagerPluginSetupDependencies { export interface AssetManagerPluginStartDependencies { apmDataAccess: ApmDataAccessPluginStart; } + +export interface AssetClientDependencies { + elasticsearchClient: ElasticsearchClient; + savedObjectsClient: SavedObjectsClientContract; +} diff --git a/x-pack/plugins/asset_manager/tsconfig.json b/x-pack/plugins/asset_manager/tsconfig.json index d7663856f0513..35972189e5287 100644 --- a/x-pack/plugins/asset_manager/tsconfig.json +++ b/x-pack/plugins/asset_manager/tsconfig.json @@ -7,6 +7,7 @@ "../../../typings/**/*", "common/**/*", "server/**/*", + "public/**/*", "types/**/*" ], "exclude": ["target/**/*"], @@ -17,10 +18,11 @@ "@kbn/core-http-server", "@kbn/core-elasticsearch-client-server-mocks", "@kbn/io-ts-utils", - "@kbn/core-elasticsearch-server", "@kbn/core-http-request-handler-context-server", "@kbn/datemath", "@kbn/apm-data-access-plugin", + "@kbn/core-http-browser-mocks", + "@kbn/logging", "@kbn/metrics-data-access-plugin" ] } From 8759b03474d1b18f8493f00752b417f09361a791 Mon Sep 17 00:00:00 2001 From: Rickyanto Ang Date: Thu, 28 Sep 2023 14:02:23 -0700 Subject: [PATCH 51/61] [Cloud Security] [CIS GCP] GCP Organization option (#166983) ## Summary This PR is for adding the GCP Organization option as well as updating the Single option to include Project ID field. Still rough Changes: - Added GCP Organization Option - Project ID field now exist on Google Cloud Shell Single option as well as Organization Option - Organization ID field added to the form when user chose account_type : GCP Organization - Project ID are now optional (previously users aren't able to save the integration without filling in the Project ID) - Removed Beta tag for CIS GCP TODO: - Make sure previous installation using previous wont break because of the new fields and requirement (migration) - More tests - Clean up --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../public/common/constants.ts | 1 - .../fleet_extensions/gcp_credential_form.tsx | 166 ++++++++++++++---- .../components/fleet_extensions/mocks.ts | 2 + .../policy_template_form.test.tsx | 119 ++++++++++--- .../fleet_extensions/policy_template_form.tsx | 153 ++++++++++++---- .../post_install_google_cloud_shell_modal.tsx | 11 +- .../google_cloud_shell_instructions.tsx | 4 +- .../steps/compute_steps.tsx | 14 +- ..._google_cloud_shell_managed_agent_step.tsx | 3 + .../enrollment_instructions/manual/index.tsx | 10 +- .../components/google_cloud_shell_guide.tsx | 17 +- ...egration_details_from_agent_policy.test.ts | 101 +++++++++++ ..._integration_details_from_agent_policy.tsx | 71 ++++++++ ...ration_details_from_package_policy.test.ts | 80 +++++++++ ...ntegration_details_from_package_policy.tsx | 53 ++++++ x-pack/plugins/fleet/public/services/index.ts | 2 + 16 files changed, 702 insertions(+), 105 deletions(-) create mode 100644 x-pack/plugins/fleet/public/services/get_gcp_integration_details_from_agent_policy.test.ts create mode 100644 x-pack/plugins/fleet/public/services/get_gcp_integration_details_from_agent_policy.tsx create mode 100644 x-pack/plugins/fleet/public/services/get_gcp_integration_details_from_package_policy.test.ts create mode 100644 x-pack/plugins/fleet/public/services/get_gcp_integration_details_from_package_policy.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/common/constants.ts b/x-pack/plugins/cloud_security_posture/public/common/constants.ts index eb6318e7c6727..bec25a70dbd1e 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/constants.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/constants.ts @@ -93,7 +93,6 @@ export const cloudPostureIntegrations: CloudPostureIntegrations = { defaultMessage: 'CIS GCP', }), icon: googleCloudLogo, - isBeta: true, }, // needs to be a function that disables/enabled based on integration version { diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credential_form.tsx b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credential_form.tsx index 18ac1247d4b1a..411d5298580a5 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credential_form.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credential_form.tsx @@ -25,6 +25,7 @@ import type { NewPackagePolicy } from '@kbn/fleet-plugin/public'; import { NewPackagePolicyInput, PackageInfo } from '@kbn/fleet-plugin/common'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; +import { GcpCredentialsType } from '../../../common/types'; import { CLOUDBEAT_GCP, SETUP_ACCESS_CLOUD_SHELL, @@ -39,10 +40,12 @@ import { import { MIN_VERSION_GCP_CIS } from '../../common/constants'; import { cspIntegrationDocsNavigation } from '../../common/navigation/constants'; import { ReadDocumentation } from './aws_credentials_form/aws_credentials_form'; +import { GCP_ORGANIZATION_ACCOUNT } from './policy_template_form'; export const CIS_GCP_INPUT_FIELDS_TEST_SUBJECTS = { GOOGLE_CLOUD_SHELL_SETUP: 'google_cloud_shell_setup_test_id', PROJECT_ID: 'project_id_test_id', + ORGANIZATION_ID: 'organization_id_test_id', CREDENTIALS_TYPE: 'credentials_type_test_id', CREDENTIALS_FILE: 'credentials_file_test_id', CREDENTIALS_JSON: 'credentials_json_test_id', @@ -71,7 +74,21 @@ const GCPSetupInfoContent = () => ( ); -const GoogleCloudShellSetup = () => { +const GoogleCloudShellSetup = ({ + fields, + onChange, + input, +}: { + fields: Array; + onChange: (key: string, value: string) => void; + input: NewPackagePolicyInput; +}) => { + const accountType = input.streams?.[0]?.vars?.['gcp.account_type']?.value; + const getFieldById = (id: keyof GcpInputFields['fields']) => { + return fields.find((element) => element.id === id); + }; + const projectIdFields = getFieldById('gcp.project_id'); + const organizationIdFields = getFieldById('gcp.organization_id'); return ( <> { defaultMessage="Log into your Google Cloud Console" /> -
  • - -
  • + {accountType === GCP_ORGANIZATION_ACCOUNT ? ( +
  • + +
  • + ) : ( +
  • + +
  • + )} +
  • { + + {organizationIdFields && accountType === GCP_ORGANIZATION_ACCOUNT && ( + + onChange(organizationIdFields.id, event.target.value)} + /> + + )} + {projectIdFields && ( + + onChange(projectIdFields.id, event.target.value)} + /> + + )} + + ); }; @@ -137,6 +189,12 @@ interface GcpInputFields { export const gcpField: GcpInputFields = { fields: { + 'gcp.organization_id': { + label: i18n.translate('xpack.csp.gcpIntegration.organizationIdFieldLabel', { + defaultMessage: 'Organization ID', + }), + type: 'text', + }, 'gcp.project_id': { label: i18n.translate('xpack.csp.gcpIntegration.projectidFieldLabel', { defaultMessage: 'Project ID', @@ -190,17 +248,14 @@ const getSetupFormatOptions = (): Array<{ interface GcpFormProps { newPolicy: NewPackagePolicy; - input: Extract< - NewPackagePolicyPostureInput, - { type: 'cloudbeat/cis_aws' | 'cloudbeat/cis_eks' | 'cloudbeat/cis_gcp' } - >; + input: Extract; updatePolicy(updatedPolicy: NewPackagePolicy): void; packageInfo: PackageInfo; setIsValid: (isValid: boolean) => void; onChange: any; } -const getInputVarsFields = (input: NewPackagePolicyInput, fields: GcpFields) => +export const getInputVarsFields = (input: NewPackagePolicyInput, fields: GcpFields) => Object.entries(input.streams[0].vars || {}) .filter(([id]) => id in fields) .map(([id, inputVar]) => { @@ -290,6 +345,10 @@ const useCloudShellUrl = ({ }, [newPolicy?.vars?.cloud_shell_url, newPolicy, packageInfo, setupFormat]); }; +export const getGcpCredentialsType = ( + input: Extract +): GcpCredentialsType | undefined => input.streams[0].vars?.setup_access.value; + export const GcpCredentialsForm = ({ input, newPolicy, @@ -298,6 +357,12 @@ export const GcpCredentialsForm = ({ setIsValid, onChange, }: GcpFormProps) => { + /* Create a subset of properties from GcpField to use for hiding value of credentials json and credentials file when user switch from Manual to Cloud Shell, we wanna keep Project and Organization ID */ + const subsetOfGcpField = (({ ['gcp.credentials.file']: a, ['gcp.credentials.json']: b }) => ({ + 'gcp.credentials.file': a, + ['gcp.credentials.json']: b, + }))(gcpField.fields); + const fieldsToHide = getInputVarsFields(input, subsetOfGcpField); const fields = getInputVarsFields(input, gcpField.fields); const validSemantic = semverValid(packageInfo.version); const integrationVersionNumberOnly = semverCoerce(validSemantic) || ''; @@ -305,9 +370,20 @@ export const GcpCredentialsForm = ({ const fieldsSnapshot = useRef({}); const lastSetupAccessType = useRef(undefined); const setupFormat = getSetupFormatFromInput(input); - const getFieldById = (id: keyof GcpInputFields['fields']) => { - return fields.find((element) => element.id === id); - }; + const accountType = input.streams?.[0]?.vars?.['gcp.account_type']?.value; + const isOrganization = accountType === 'organization-account'; + // Integration is Invalid IF Version is not at least 1.5.0 OR Setup Access is manual but Project ID is empty + useEffect(() => { + const isInvalidPolicy = isInvalid; + + setIsValid(!isInvalidPolicy); + + onChange({ + isValid: !isInvalidPolicy, + updatedPolicy: newPolicy, + }); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [setupFormat, input.type]); useCloudShellUrl({ packageInfo, @@ -316,23 +392,23 @@ export const GcpCredentialsForm = ({ setupFormat, }); const onSetupFormatChange = (newSetupFormat: SetupFormatGCP) => { - if (newSetupFormat === SETUP_ACCESS_CLOUD_SHELL) { + if (newSetupFormat === 'google_cloud_shell') { // We need to store the current manual fields to restore them later fieldsSnapshot.current = Object.fromEntries( - fields.map((field) => [field.id, { value: field.value }]) + fieldsToHide.map((field) => [field.id, { value: field.value }]) ); // We need to store the last manual credentials type to restore it later - lastSetupAccessType.current = input.streams[0].vars?.setup_access?.value; + lastSetupAccessType.current = getGcpCredentialsType(input); updatePolicy( getPosturePolicy(newPolicy, input.type, { setup_access: { - value: SETUP_ACCESS_CLOUD_SHELL, + value: 'google_cloud_shell', type: 'text', }, // Clearing fields from previous setup format to prevent exposing credentials // when switching from manual to cloud formation - ...Object.fromEntries(fields.map((field) => [field.id, { value: undefined }])), + ...Object.fromEntries(fieldsToHide.map((field) => [field.id, { value: undefined }])), }) ); } else { @@ -340,7 +416,7 @@ export const GcpCredentialsForm = ({ getPosturePolicy(newPolicy, input.type, { setup_access: { // Restoring last manual credentials type - value: SETUP_ACCESS_MANUAL, + value: lastSetupAccessType.current || SETUP_ACCESS_MANUAL, type: 'text', }, // Restoring fields from manual setup format if any @@ -349,20 +425,6 @@ export const GcpCredentialsForm = ({ ); } }; - // Integration is Invalid IF Version is not at least 1.5.0 OR Setup Access is manual but Project ID is empty - useEffect(() => { - const isProjectIdEmpty = - setupFormat === SETUP_ACCESS_MANUAL && !getFieldById('gcp.project_id')?.value; - const isInvalidPolicy = isInvalid || isProjectIdEmpty; - - setIsValid(!isInvalidPolicy); - - onChange({ - isValid: !isInvalidPolicy, - updatedPolicy: newPolicy, - }); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [input, packageInfo, setupFormat]); if (isInvalid) { return ( @@ -385,19 +447,29 @@ export const GcpCredentialsForm = ({ size="s" options={getSetupFormatOptions()} idSelected={setupFormat} - onChange={onSetupFormatChange} + onChange={(idSelected: SetupFormatGCP) => + idSelected !== setupFormat && onSetupFormatChange(idSelected) + } /> - {setupFormat === SETUP_ACCESS_MANUAL ? ( - updatePolicy(getPosturePolicy(newPolicy, input.type, { [key]: { value } })) } + input={input} /> ) : ( - + + updatePolicy(getPosturePolicy(newPolicy, input.type, { [key]: { value } })) + } + isOrganization={isOrganization} + /> )} + @@ -408,13 +480,18 @@ export const GcpCredentialsForm = ({ const GcpInputVarFields = ({ fields, onChange, + isOrganization, }: { fields: Array; onChange: (key: string, value: string) => void; + isOrganization: boolean; }) => { const getFieldById = (id: keyof GcpInputFields['fields']) => { return fields.find((element) => element.id === id); }; + + const organizationIdFields = getFieldById('gcp.organization_id'); + const projectIdFields = getFieldById('gcp.project_id'); const credentialsTypeFields = getFieldById('gcp.credentials.type'); const credentialFilesFields = getFieldById('gcp.credentials.file'); @@ -428,6 +505,17 @@ const GcpInputVarFields = ({ return (
    + {organizationIdFields && isOrganization && ( + + onChange(organizationIdFields.id, event.target.value)} + /> + + )} {projectIdFields && ( ', () => { it(`renders Google Cloud Shell forms when Setup Access is set to Google Cloud Shell`, () => { let policy = getMockPolicyGCP(); policy = getPosturePolicy(policy, CLOUDBEAT_GCP, { - credentials_type: { value: 'credentials-file' }, + 'gcp.account_type': { value: GCP_ORGANIZATION_ACCOUNT }, setup_access: { value: 'google_cloud_shell' }, }); @@ -1028,31 +1030,6 @@ describe('', () => { ).toBeInTheDocument(); }); - it(`project ID is required for Manual users`, () => { - let policy = getMockPolicyGCP(); - policy = getPosturePolicy(policy, CLOUDBEAT_GCP, { - 'gcp.project_id': { value: undefined }, - setup_access: { value: 'manual' }, - }); - - const { rerender } = render( - - ); - expect(onChange).toHaveBeenCalledWith({ - isValid: false, - updatedPolicy: policy, - }); - policy = getPosturePolicy(policy, CLOUDBEAT_GCP, { - 'gcp.project_id': { value: '' }, - setup_access: { value: 'manual' }, - }); - rerender(); - expect(onChange).toHaveBeenCalledWith({ - isValid: false, - updatedPolicy: policy, - }); - }); - it(`renders ${CLOUDBEAT_GCP} Credentials File fields`, () => { let policy = getMockPolicyGCP(); policy = getPosturePolicy(policy, CLOUDBEAT_GCP, { @@ -1136,6 +1113,96 @@ describe('', () => { updatedPolicy: policy, }); }); + + it(`${CLOUDBEAT_GCP} form do not displays upgrade message for supported versions and gcp organization option is enabled`, () => { + let policy = getMockPolicyGCP(); + policy = getPosturePolicy(policy, CLOUDBEAT_GCP, { + 'gcp.credentials.type': { value: 'manual' }, + 'gcp.account_type': { value: GCP_ORGANIZATION_ACCOUNT }, + }); + + const { queryByText, getByLabelText } = render( + + ); + + expect( + queryByText( + 'GCP Organization not supported in current integration version. Please upgrade to the latest version to enable GCP Organizations integration.' + ) + ).not.toBeInTheDocument(); + expect(getByLabelText('GCP Organization')).toBeEnabled(); + }); + + it(`renders ${CLOUDBEAT_GCP} Organization fields when account type is Organization and Setup Access is Google Cloud Shell`, () => { + let policy = getMockPolicyGCP(); + policy = getPosturePolicy(policy, CLOUDBEAT_GCP, { + 'gcp.account_type': { value: GCP_ORGANIZATION_ACCOUNT }, + setup_access: { value: 'google_cloud_shell' }, + }); + + const { getByLabelText, getByTestId } = render( + + ); + + expect(getByTestId(CIS_GCP_INPUT_FIELDS_TEST_SUBJECTS.ORGANIZATION_ID)).toBeInTheDocument(); + + expect(getByLabelText('Organization ID')).toBeInTheDocument(); + }); + + it(`renders ${CLOUDBEAT_GCP} Organization fields when account type is Organization and Setup Access is manual`, () => { + let policy = getMockPolicyGCP(); + policy = getPosturePolicy(policy, CLOUDBEAT_GCP, { + 'gcp.account_type': { value: GCP_ORGANIZATION_ACCOUNT }, + setup_access: { value: 'manual' }, + }); + + const { getByLabelText, getByTestId } = render( + + ); + + expect(getByTestId(CIS_GCP_INPUT_FIELDS_TEST_SUBJECTS.ORGANIZATION_ID)).toBeInTheDocument(); + + expect(getByLabelText('Organization ID')).toBeInTheDocument(); + }); + + it(`Should not render ${CLOUDBEAT_GCP} Organization fields when account type is Single`, () => { + let policy = getMockPolicyGCP(); + policy = getPosturePolicy(policy, CLOUDBEAT_GCP, { + 'gcp.account_type': { value: GCP_SINGLE_ACCOUNT }, + setup_access: { value: 'google_cloud_shell' }, + }); + + const { queryByLabelText, queryByTestId } = render( + + ); + + expect(queryByTestId(CIS_GCP_INPUT_FIELDS_TEST_SUBJECTS.ORGANIZATION_ID)).toBeNull(); + + expect(queryByLabelText('Organization ID')).toBeNull(); + }); + + it(`updates ${CLOUDBEAT_GCP} organization id`, () => { + let policy = getMockPolicyGCP(); + policy = getPosturePolicy(policy, CLOUDBEAT_GCP, { + 'gcp.account_type': { value: GCP_ORGANIZATION_ACCOUNT }, + setup_access: { value: 'manual' }, + }); + + const { getByTestId } = render( + + ); + + userEvent.type(getByTestId(CIS_GCP_INPUT_FIELDS_TEST_SUBJECTS.ORGANIZATION_ID), 'c'); + + policy = getPosturePolicy(policy, CLOUDBEAT_GCP, { + 'gcp.organization_id': { value: 'c' }, + }); + + expect(onChange).toHaveBeenCalledWith({ + isValid: true, + updatedPolicy: policy, + }); + }); }); describe('Azure Credentials input fields', () => { diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.tsx b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.tsx index 67a617decac76..306cc6da445fd 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.tsx @@ -4,9 +4,11 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import React, { memo, useCallback, useEffect, useMemo, useState } from 'react'; +import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; import semverCompare from 'semver/functions/compare'; import semverValid from 'semver/functions/valid'; +import semverCoerce from 'semver/functions/coerce'; +import semverLt from 'semver/functions/lt'; import { EuiCallOut, EuiFieldText, @@ -54,6 +56,7 @@ import { PolicyTemplateVarsForm, } from './policy_template_selectors'; import { usePackagePolicyList } from '../../common/api/use_package_policy_list'; +import { gcpField, getInputVarsFields } from './gcp_credential_form'; const DEFAULT_INPUT_TYPE = { kspm: CLOUDBEAT_VANILLA, @@ -82,13 +85,14 @@ interface IntegrationInfoFieldsProps { export const AWS_SINGLE_ACCOUNT = 'single-account'; export const AWS_ORGANIZATION_ACCOUNT = 'organization-account'; -export const GCP_SINGLE_ACCOUNT = 'single-account-gcp'; -export const GCP_ORGANIZATION_ACCOUNT = 'organization-account-gcp'; +export const GCP_SINGLE_ACCOUNT = 'single-account'; +export const GCP_ORGANIZATION_ACCOUNT = 'organization-account'; export const AZURE_SINGLE_ACCOUNT = 'single-account-azure'; export const AZURE_ORGANIZATION_ACCOUNT = 'organization-account-azure'; type AwsAccountType = typeof AWS_SINGLE_ACCOUNT | typeof AWS_ORGANIZATION_ACCOUNT; type AzureAccountType = typeof AZURE_SINGLE_ACCOUNT | typeof AZURE_ORGANIZATION_ACCOUNT; +type GcpAccountType = typeof GCP_SINGLE_ACCOUNT | typeof GCP_ORGANIZATION_ACCOUNT; const getAwsAccountTypeOptions = (isAwsOrgDisabled: boolean): CspRadioGroupProps['options'] => [ { @@ -111,19 +115,18 @@ const getAwsAccountTypeOptions = (isAwsOrgDisabled: boolean): CspRadioGroupProps }, ]; -const getGcpAccountTypeOptions = (): CspRadioGroupProps['options'] => [ +const getGcpAccountTypeOptions = (isGcpOrgDisabled: boolean): CspRadioGroupProps['options'] => [ { id: GCP_ORGANIZATION_ACCOUNT, label: i18n.translate('xpack.csp.fleetIntegration.gcpAccountType.gcpOrganizationLabel', { defaultMessage: 'GCP Organization', }), - disabled: true, - tooltip: i18n.translate( - 'xpack.csp.fleetIntegration.gcpAccountType.gcpOrganizationDisabledTooltip', - { - defaultMessage: 'Coming Soon', - } - ), + disabled: isGcpOrgDisabled, + tooltip: isGcpOrgDisabled + ? i18n.translate('xpack.csp.fleetIntegration.gcpAccountType.gcpOrganizationDisabledTooltip', { + defaultMessage: 'Supported from integration version 1.6.0 and above', + }) + : undefined, }, { id: GCP_SINGLE_ACCOUNT, @@ -258,6 +261,12 @@ const AwsAccountTypeSelect = ({ ); }; +const getGcpAccountType = ( + input: Extract +): GcpAccountType | undefined => input.streams[0].vars?.['gcp.account_type']?.value; + +const GCP_ORG_MINIMUM_PACKAGE_VERSION = '1.6.0'; + const GcpAccountTypeSelect = ({ input, newPolicy, @@ -269,6 +278,71 @@ const GcpAccountTypeSelect = ({ updatePolicy: (updatedPolicy: NewPackagePolicy) => void; packageInfo: PackageInfo; }) => { + // This will disable the gcp org option for any version below 1.6.0 which introduced support for account_type. https://github.com/elastic/integrations/pull/6682 + const validSemantic = semverValid(packageInfo.version); + const integrationVersionNumberOnly = semverCoerce(validSemantic) || ''; + const isGcpOrgDisabled = semverLt(integrationVersionNumberOnly, GCP_ORG_MINIMUM_PACKAGE_VERSION); + + const gcpAccountTypeOptions = useMemo( + () => getGcpAccountTypeOptions(isGcpOrgDisabled), + [isGcpOrgDisabled] + ); + /* Create a subset of properties from GcpField to use for hiding value of Organization ID when switching account type from Organization to Single */ + const subsetOfGcpField = (({ ['gcp.organization_id']: a }) => ({ 'gcp.organization_id': a }))( + gcpField.fields + ); + const fieldsToHide = getInputVarsFields(input, subsetOfGcpField); + const fieldsSnapshot = useRef({}); + const lastSetupAccessType = useRef(undefined); + const onSetupFormatChange = (newSetupFormat: string) => { + if (newSetupFormat === 'single-account') { + // We need to store the current manual fields to restore them later + fieldsSnapshot.current = Object.fromEntries( + fieldsToHide.map((field) => [field.id, { value: field.value }]) + ); + // We need to store the last manual credentials type to restore it later + lastSetupAccessType.current = input.streams[0].vars?.['gcp.account_type'].value; + + updatePolicy( + getPosturePolicy(newPolicy, input.type, { + 'gcp.account_type': { + value: 'single-account', + type: 'text', + }, + // Clearing fields from previous setup format to prevent exposing credentials + // when switching from manual to cloud formation + ...Object.fromEntries(fieldsToHide.map((field) => [field.id, { value: undefined }])), + }) + ); + } else { + updatePolicy( + getPosturePolicy(newPolicy, input.type, { + 'gcp.account_type': { + // Restoring last manual credentials type + value: lastSetupAccessType.current || 'organization-account', + type: 'text', + }, + // Restoring fields from manual setup format if any + ...fieldsSnapshot.current, + }) + ); + } + }; + + useEffect(() => { + if (!getGcpAccountType(input)) { + updatePolicy( + getPosturePolicy(newPolicy, input.type, { + 'gcp.account_type': { + value: isGcpOrgDisabled ? GCP_SINGLE_ACCOUNT : GCP_ORGANIZATION_ACCOUNT, + type: 'text', + }, + }) + ); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [input]); + return ( <> @@ -278,28 +352,47 @@ const GcpAccountTypeSelect = ({ /> + {isGcpOrgDisabled && ( + <> + + + + + + )} { - updatePolicy( - getPosturePolicy(newPolicy, input.type, { - gcp_account_type: { - value: accountType, - type: 'text', - }, - }) - ); - }} + idSelected={getGcpAccountType(input) || ''} + options={gcpAccountTypeOptions} + onChange={(accountType) => + accountType !== getGcpAccountType(input) && onSetupFormatChange(accountType) + } size="m" /> - - - - + {getGcpAccountType(input) === GCP_ORGANIZATION_ACCOUNT && ( + <> + + + + + + )} + {getGcpAccountType(input) === GCP_SINGLE_ACCOUNT && ( + <> + + + + + + )} ); }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/components/post_install_google_cloud_shell_modal.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/components/post_install_google_cloud_shell_modal.tsx index a9185d3efa743..ce43298d8a97d 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/components/post_install_google_cloud_shell_modal.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/components/post_install_google_cloud_shell_modal.tsx @@ -30,6 +30,7 @@ import { } from '../../../../../hooks'; import { GoogleCloudShellGuide } from '../../../../../components'; import { ManualInstructions } from '../../../../../../../components/enrollment_instructions'; +import { getGcpIntegrationDetailsFromPackagePolicy } from '../../../../../../../services'; export const PostInstallGoogleCloudShellModal: React.FunctionComponent<{ onConfirm: () => void; @@ -46,6 +47,8 @@ export const PostInstallGoogleCloudShellModal: React.FunctionComponent<{ ); const { fleetServerHosts, fleetProxy } = useFleetServerHostsForPolicy(agentPolicy); const agentVersion = useAgentVersion(); + const { gcpProjectId, gcpOrganizationId, gcpAccountType } = + getGcpIntegrationDetailsFromPackagePolicy(packagePolicy); const { cloudShellUrl, error, isError, isLoading } = useCreateCloudShellUrl({ enrollmentAPIKey: apyKeysData?.data?.items[0]?.api_key, @@ -61,6 +64,9 @@ export const PostInstallGoogleCloudShellModal: React.FunctionComponent<{ fleetServerHosts, fleetProxy, agentVersion, + gcpProjectId, + gcpOrganizationId, + gcpAccountType, }); return ( @@ -75,7 +81,10 @@ export const PostInstallGoogleCloudShellModal: React.FunctionComponent<{ - + {error && isError && ( <> diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/google_cloud_shell_instructions.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/google_cloud_shell_instructions.tsx index 89b6f67fe0dcf..a7090370680e4 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/google_cloud_shell_instructions.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/google_cloud_shell_instructions.tsx @@ -14,15 +14,17 @@ import { GoogleCloudShellGuide } from '../google_cloud_shell_guide'; interface Props { cloudShellUrl: string; cloudShellCommand: string; + projectId?: string; } export const GoogleCloudShellInstructions: React.FunctionComponent = ({ cloudShellUrl, cloudShellCommand, + projectId, }) => { return ( <> - + = ({ const agentVersion = useAgentVersion(); + const { gcpProjectId, gcpOrganizationId, gcpAccountType } = + getGcpIntegrationDetailsFromAgentPolicy(selectedPolicy); + const fleetServerHost = fleetServerHosts?.[0]; const installManagedCommands = ManualInstructions({ @@ -228,6 +235,9 @@ export const ManagedSteps: React.FunctionComponent = ({ fleetServerHosts, fleetProxy, agentVersion: agentVersion || '', + gcpProjectId, + gcpOrganizationId, + gcpAccountType, }); const instructionsSteps = useMemo(() => { @@ -273,6 +283,7 @@ export const ManagedSteps: React.FunctionComponent = ({ selectedApiKeyId, cloudShellUrl: cloudSecurityIntegration.cloudShellUrl, cloudShellCommand: installManagedCommands.googleCloudShell, + projectId: gcpProjectId, }) ); } else if (cloudSecurityIntegration?.isAzureArmTemplate) { @@ -343,6 +354,7 @@ export const ManagedSteps: React.FunctionComponent = ({ enrolledAgentIds, agentDataConfirmed, installedPackagePolicy, + gcpProjectId, ]); if (!agentVersion) { diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps/install_google_cloud_shell_managed_agent_step.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps/install_google_cloud_shell_managed_agent_step.tsx index ff367be9125fd..4e5b15c626735 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps/install_google_cloud_shell_managed_agent_step.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps/install_google_cloud_shell_managed_agent_step.tsx @@ -21,12 +21,14 @@ export const InstallGoogleCloudShellManagedAgentStep = ({ isComplete, cloudShellUrl, cloudShellCommand, + projectId, }: { selectedApiKeyId?: string; apiKeyData?: GetOneEnrollmentAPIKeyResponse | null; isComplete?: boolean; cloudShellUrl?: string | undefined; cloudShellCommand?: string; + projectId?: string; }): EuiContainedStepProps => { const nonCompleteStatus = selectedApiKeyId ? undefined : 'disabled'; const status = isComplete ? 'complete' : nonCompleteStatus; @@ -41,6 +43,7 @@ export const InstallGoogleCloudShellManagedAgentStep = ({ ) : ( diff --git a/x-pack/plugins/fleet/public/components/enrollment_instructions/manual/index.tsx b/x-pack/plugins/fleet/public/components/enrollment_instructions/manual/index.tsx index b7a4fed713cad..21c8ec6172cc7 100644 --- a/x-pack/plugins/fleet/public/components/enrollment_instructions/manual/index.tsx +++ b/x-pack/plugins/fleet/public/components/enrollment_instructions/manual/index.tsx @@ -28,11 +28,17 @@ export const ManualInstructions = ({ fleetServerHosts, fleetProxy, agentVersion: agentVersion, + gcpProjectId = '', + gcpOrganizationId = '', + gcpAccountType, }: { apiKey: string; fleetServerHosts: string[]; fleetProxy?: FleetProxy; agentVersion: string; + gcpProjectId?: string; + gcpOrganizationId?: string; + gcpAccountType?: string; }) => { const enrollArgs = getfleetServerHostsEnrollArgs(apiKey, fleetServerHosts, fleetProxy); const fleetServerUrl = enrollArgs?.split('--url=')?.pop()?.split('--enrollment')[0]; @@ -64,7 +70,9 @@ sudo elastic-agent enroll ${enrollArgs} \nsudo systemctl enable elastic-agent \n sudo rpm -vi elastic-agent-${agentVersion}-x86_64.rpm sudo elastic-agent enroll ${enrollArgs} \nsudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent`; - const googleCloudShellCommand = `gcloud config set project && \nFLEET_URL=${fleetServerUrl} ENROLLMENT_TOKEN=${enrollmentToken} STACK_VERSION=${agentVersion} ./deploy.sh`; + const googleCloudShellCommand = `gcloud config set project ${gcpProjectId} && ${ + gcpAccountType === 'organization-account' ? `\nORG_ID=${gcpOrganizationId}` : `` + } \nFLEET_URL=${fleetServerUrl} ENROLLMENT_TOKEN=${enrollmentToken} \nSTACK_VERSION=${agentVersion} ./deploy.sh`; return { linux: linuxCommand, diff --git a/x-pack/plugins/fleet/public/components/google_cloud_shell_guide.tsx b/x-pack/plugins/fleet/public/components/google_cloud_shell_guide.tsx index d494fc1075f41..1d5c804ef157a 100644 --- a/x-pack/plugins/fleet/public/components/google_cloud_shell_guide.tsx +++ b/x-pack/plugins/fleet/public/components/google_cloud_shell_guide.tsx @@ -23,7 +23,7 @@ const Link = ({ children, url }: { children: React.ReactNode; url: string }) => ); -export const GoogleCloudShellGuide = (props: { commandText: string }) => { +export const GoogleCloudShellGuide = (props: { commandText: string; hasProjectId?: boolean }) => { return ( <> @@ -48,10 +48,17 @@ export const GoogleCloudShellGuide = (props: { commandText: string }) => {
    1. <> - + {props?.hasProjectId ? ( + + ) : ( + + )} {props.commandText} diff --git a/x-pack/plugins/fleet/public/services/get_gcp_integration_details_from_agent_policy.test.ts b/x-pack/plugins/fleet/public/services/get_gcp_integration_details_from_agent_policy.test.ts new file mode 100644 index 0000000000000..e53e2dc36df07 --- /dev/null +++ b/x-pack/plugins/fleet/public/services/get_gcp_integration_details_from_agent_policy.test.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 { getGcpIntegrationDetailsFromAgentPolicy } from './get_gcp_integration_details_from_agent_policy'; + +const undefinedAllValue = { + gcpAccountType: undefined, + gcpOrganizationId: undefined, + gcpProjectId: undefined, +}; + +describe('getGcpIntegrationDetailsFromAgentPolicy', () => { + test('returns undefined when agentPolicy is undefined', () => { + const result = getGcpIntegrationDetailsFromAgentPolicy(undefined); + expect(result).toEqual(undefinedAllValue); + }); + + test('returns undefined when agentPolicy is defined but inputs are empty', () => { + const selectedPolicy = { inputs: [] }; + // @ts-expect-error + const result = getGcpIntegrationDetailsFromAgentPolicy(selectedPolicy); + expect(result).toEqual(undefinedAllValue); + }); + + it('should return undefined when no input has enabled and gcp integration details', () => { + const selectedPolicy = { + package_policies: [ + { + inputs: [ + { enabled: false, streams: [{}] }, + { enabled: true, streams: [{ vars: { other_property: 'false' } }] }, + { enabled: true, streams: [{ other_property: 'False' }] }, + ], + }, + { + inputs: [ + { enabled: false, streams: [{}] }, + { enabled: false, streams: [{}] }, + ], + }, + ], + }; + // @ts-expect-error + const result = getGcpIntegrationDetailsFromAgentPolicy(selectedPolicy); + expect(result).toEqual(undefinedAllValue); + }); + + it('should return the first gcp integration details when available', () => { + const selectedPolicy = { + package_policies: [ + { + inputs: [ + { enabled: false, streams: [{}] }, + { enabled: true, streams: [{ vars: { other_property: 'false' } }] }, + { enabled: true, streams: [{ other_property: 'False' }] }, + ], + }, + { + inputs: [ + { enabled: false, streams: [{}] }, + { + enabled: true, + streams: [ + { + vars: { + 'gcp.account_type': { value: 'account_type_test_1' }, + 'gcp.project_id': { value: 'project_id_1' }, + 'gcp.organization_id': { value: 'organization_id_1' }, + }, + }, + ], + }, + { + enabled: true, + streams: [ + { + vars: { + 'gcp.account_type': { value: 'account_type_test_2' }, + 'gcp.project_id': { value: 'project_id_2' }, + 'gcp.organization_id': { value: 'organization_id_2' }, + }, + }, + ], + }, + ], + }, + ], + }; + // @ts-expect-error + const result = getGcpIntegrationDetailsFromAgentPolicy(selectedPolicy); + expect(result).toEqual({ + gcpAccountType: 'account_type_test_1', + gcpOrganizationId: 'organization_id_1', + gcpProjectId: 'project_id_1', + }); + }); + // Add more test cases as needed +}); diff --git a/x-pack/plugins/fleet/public/services/get_gcp_integration_details_from_agent_policy.tsx b/x-pack/plugins/fleet/public/services/get_gcp_integration_details_from_agent_policy.tsx new file mode 100644 index 0000000000000..a1112683b4f1a --- /dev/null +++ b/x-pack/plugins/fleet/public/services/get_gcp_integration_details_from_agent_policy.tsx @@ -0,0 +1,71 @@ +/* + * 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 { AgentPolicy } from '../types'; + +/** + * Get the project id, organization id and account type of gcp integration from an agent policy + */ +export const getGcpIntegrationDetailsFromAgentPolicy = (selectedPolicy?: AgentPolicy) => { + let gcpProjectId = selectedPolicy?.package_policies?.reduce((acc, packagePolicy) => { + const findGcpProjectId = packagePolicy.inputs?.reduce((accInput, input) => { + if (accInput !== '') { + return accInput; + } + if (input?.enabled && input?.streams[0]?.vars?.['gcp.project_id']?.value) { + return input?.streams[0]?.vars?.['gcp.project_id']?.value; + } + return accInput; + }, ''); + if (findGcpProjectId) { + return findGcpProjectId; + } + return acc; + }, ''); + + let gcpOrganizationId = selectedPolicy?.package_policies?.reduce((acc, packagePolicy) => { + const findGcpProjectId = packagePolicy.inputs?.reduce((accInput, input) => { + if (accInput !== '') { + return accInput; + } + if (input?.enabled && input?.streams[0]?.vars?.['gcp.organization_id']?.value) { + return input?.streams[0]?.vars?.['gcp.organization_id']?.value; + } + return accInput; + }, ''); + if (findGcpProjectId) { + return findGcpProjectId; + } + return acc; + }, ''); + + let gcpAccountType = selectedPolicy?.package_policies?.reduce((acc, packagePolicy) => { + const findGcpProjectId = packagePolicy.inputs?.reduce((accInput, input) => { + if (accInput !== '') { + return accInput; + } + if (input?.enabled && input?.streams[0]?.vars?.['gcp.account_type']?.value) { + return input?.streams[0]?.vars?.['gcp.account_type']?.value; + } + return accInput; + }, ''); + if (findGcpProjectId) { + return findGcpProjectId; + } + return acc; + }, ''); + + gcpProjectId = gcpProjectId !== '' ? gcpProjectId : undefined; + gcpOrganizationId = gcpOrganizationId !== '' ? gcpOrganizationId : undefined; + gcpAccountType = gcpAccountType !== '' ? gcpAccountType : undefined; + + return { + gcpProjectId, + gcpOrganizationId, + gcpAccountType, + }; +}; diff --git a/x-pack/plugins/fleet/public/services/get_gcp_integration_details_from_package_policy.test.ts b/x-pack/plugins/fleet/public/services/get_gcp_integration_details_from_package_policy.test.ts new file mode 100644 index 0000000000000..44da2fb65383a --- /dev/null +++ b/x-pack/plugins/fleet/public/services/get_gcp_integration_details_from_package_policy.test.ts @@ -0,0 +1,80 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { getGcpIntegrationDetailsFromPackagePolicy } from './get_gcp_integration_details_from_package_policy'; + +const undefinedAllValue = { + gcpAccountType: undefined, + gcpOrganizationId: undefined, + gcpProjectId: undefined, +}; + +describe('getGcpIntegrationDetailsFromPackagePolicy', () => { + test('returns undefined when packagePolicy is undefined', () => { + const result = getGcpIntegrationDetailsFromPackagePolicy(undefined); + expect(result).toEqual(undefinedAllValue); + }); + + test('returns undefined when packagePolicy is defined but inputs are empty', () => { + const packagePolicy = { inputs: [] }; + // @ts-expect-error + const result = getGcpIntegrationDetailsFromPackagePolicy(packagePolicy); + expect(result).toEqual(undefinedAllValue); + }); + + it('should return undefined when no input has enabled and gcp integration details', () => { + const packagePolicy = { + inputs: [ + { enabled: false, streams: [{}] }, + { enabled: true, streams: [{ vars: { other_property: 'false' } }] }, + { enabled: true, streams: [{ other_property: 'False' }] }, + ], + }; + // @ts-expect-error + const result = getGcpIntegrationDetailsFromPackagePolicy(packagePolicy); + expect(result).toEqual(undefinedAllValue); + }); + + it('should return the first gcp integration details when available', () => { + const packagePolicy = { + inputs: [ + { enabled: false, streams: [{}] }, + { + enabled: true, + streams: [ + { + vars: { + 'gcp.account_type': { value: 'account_type_test_1' }, + 'gcp.project_id': { value: 'project_id_1' }, + 'gcp.organization_id': { value: 'organization_id_1' }, + }, + }, + ], + }, + { + enabled: true, + streams: [ + { + vars: { + 'gcp.account_type': { value: 'account_type_test_2' }, + 'gcp.project_id': { value: 'project_id_2' }, + 'gcp.organization_id': { value: 'organization_id_2' }, + }, + }, + ], + }, + ], + }; + // @ts-expect-error + const result = getGcpIntegrationDetailsFromPackagePolicy(packagePolicy); + expect(result).toEqual({ + gcpAccountType: 'account_type_test_1', + gcpOrganizationId: 'organization_id_1', + gcpProjectId: 'project_id_1', + }); + }); + // Add more test cases as needed +}); diff --git a/x-pack/plugins/fleet/public/services/get_gcp_integration_details_from_package_policy.tsx b/x-pack/plugins/fleet/public/services/get_gcp_integration_details_from_package_policy.tsx new file mode 100644 index 0000000000000..ae82352d51e0a --- /dev/null +++ b/x-pack/plugins/fleet/public/services/get_gcp_integration_details_from_package_policy.tsx @@ -0,0 +1,53 @@ +/* + * 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 { PackagePolicy } from '../types'; + +/** + * Get the project id, organization id and account type of gcp integration from a package policy + */ +export const getGcpIntegrationDetailsFromPackagePolicy = (packagePolicy?: PackagePolicy) => { + let gcpProjectId = packagePolicy?.inputs?.reduce((accInput, input) => { + if (accInput !== '') { + return accInput; + } + if (input?.enabled && input?.streams[0]?.vars?.['gcp.project_id']?.value) { + return input?.streams[0]?.vars?.['gcp.project_id']?.value; + } + return accInput; + }, ''); + + let gcpOrganizationId = packagePolicy?.inputs?.reduce((accInput, input) => { + if (accInput !== '') { + return accInput; + } + if (input?.enabled && input?.streams[0]?.vars?.['gcp.organization_id']?.value) { + return input?.streams[0]?.vars?.['gcp.organization_id']?.value; + } + return accInput; + }, ''); + + let gcpAccountType = packagePolicy?.inputs?.reduce((accInput, input) => { + if (accInput !== '') { + return accInput; + } + if (input?.enabled && input?.streams[0]?.vars?.['gcp.account_type']?.value) { + return input?.streams[0]?.vars?.['gcp.account_type']?.value; + } + return accInput; + }, ''); + + gcpProjectId = gcpProjectId !== '' ? gcpProjectId : undefined; + gcpOrganizationId = gcpOrganizationId !== '' ? gcpOrganizationId : undefined; + gcpAccountType = gcpAccountType !== '' ? gcpAccountType : undefined; + + return { + gcpProjectId, + gcpOrganizationId, + gcpAccountType, + }; +}; diff --git a/x-pack/plugins/fleet/public/services/index.ts b/x-pack/plugins/fleet/public/services/index.ts index 64009e4a11061..71f5fde90d93a 100644 --- a/x-pack/plugins/fleet/public/services/index.ts +++ b/x-pack/plugins/fleet/public/services/index.ts @@ -53,3 +53,5 @@ export { getTemplateUrlFromAgentPolicy } from './get_template_url_from_agent_pol export { getTemplateUrlFromPackageInfo } from './get_template_url_from_package_info'; export { getCloudShellUrlFromPackagePolicy } from './get_cloud_shell_url_from_package_policy'; export { getCloudShellUrlFromAgentPolicy } from './get_cloud_shell_url_from_agent_policy'; +export { getGcpIntegrationDetailsFromPackagePolicy } from './get_gcp_integration_details_from_package_policy'; +export { getGcpIntegrationDetailsFromAgentPolicy } from './get_gcp_integration_details_from_agent_policy'; From e84742dfc66dbb2adced21ac0cf8b5786a5be081 Mon Sep 17 00:00:00 2001 From: Alex Szabo Date: Fri, 29 Sep 2023 00:16:22 +0200 Subject: [PATCH 52/61] [Osquery][Ops] Move Osquery/cypress configurations close to cypress (#167428) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary The osquery-cypress package was referring to configurations from a parent folder. This caused difficulties with having to exclude/include the same files in the `tsconfig.json`s, leading to hard-to-resolve typescript issues. This PR moves the configs in, and cleans up redundancies and type errors. chore(osquery): move osquery/cypress configs to cypress folder, fix type errors --------- Co-authored-by: Patryk Kopyciński Co-authored-by: Brad White Co-authored-by: Brad White --- x-pack/plugins/osquery/{ => cypress}/cypress.config.ts | 7 +++---- .../osquery/cypress/e2e/all/add_integration.cy.ts | 1 - .../osquery/cypress/e2e/all/packs_create_edit.cy.ts | 2 -- x-pack/plugins/osquery/cypress/e2e/roles/reader.cy.ts | 4 ---- .../osquery/cypress/e2e/roles/t1_and_t2_analyst.cy.ts | 4 ---- .../osquery/{ => cypress}/serverless_cypress.config.ts | 3 +-- x-pack/plugins/osquery/cypress/support/e2e.ts | 10 +++++----- x-pack/plugins/osquery/cypress/tasks/navigation.ts | 6 +++++- x-pack/plugins/osquery/cypress/tsconfig.json | 7 ++++--- x-pack/plugins/osquery/package.json | 4 ++-- x-pack/plugins/osquery/tsconfig.json | 10 +++------- .../test_suites/security/cypress/tasks/login.ts | 2 +- 12 files changed, 24 insertions(+), 36 deletions(-) rename x-pack/plugins/osquery/{ => cypress}/cypress.config.ts (83%) rename x-pack/plugins/osquery/{ => cypress}/serverless_cypress.config.ts (85%) diff --git a/x-pack/plugins/osquery/cypress.config.ts b/x-pack/plugins/osquery/cypress/cypress.config.ts similarity index 83% rename from x-pack/plugins/osquery/cypress.config.ts rename to x-pack/plugins/osquery/cypress/cypress.config.ts index 4efb4ce8c5429..26b1d9b67850d 100644 --- a/x-pack/plugins/osquery/cypress.config.ts +++ b/x-pack/plugins/osquery/cypress/cypress.config.ts @@ -11,11 +11,10 @@ import path from 'path'; import { safeLoad as loadYaml } from 'js-yaml'; import { readFileSync } from 'fs'; -import type { YamlRoleDefinitions } from '../../test_serverless/shared/lib'; -// eslint-disable-next-line @kbn/imports/no_boundary_crossing -import { setupUserDataLoader } from '../../test_serverless/functional/test_suites/security/cypress/support/setup_data_loader_tasks'; +import type { YamlRoleDefinitions } from '../../../test_serverless/shared/lib'; +import { setupUserDataLoader } from '../../../test_serverless/functional/test_suites/security/cypress/support/setup_data_loader_tasks'; const ROLES_YAML_FILE_PATH = path.join( - `${__dirname}/cypress/support`, + `${__dirname}/support`, 'project_controller_osquery_roles.yml' ); const roleDefinitions = loadYaml(readFileSync(ROLES_YAML_FILE_PATH, 'utf8')) as YamlRoleDefinitions; diff --git a/x-pack/plugins/osquery/cypress/e2e/all/add_integration.cy.ts b/x-pack/plugins/osquery/cypress/e2e/all/add_integration.cy.ts index a84cdb5013047..ecad2eebf5248 100644 --- a/x-pack/plugins/osquery/cypress/e2e/all/add_integration.cy.ts +++ b/x-pack/plugins/osquery/cypress/e2e/all/add_integration.cy.ts @@ -198,7 +198,6 @@ describe('ALL - Add Integration', { tags: ['@ess', '@brokenInServerless'] }, () // test list of prebuilt queries navigateTo('/app/osquery/saved_queries'); - cy.waitForReact(); cy.react('EuiTableRow').should('have.length.above', 5); }); }); diff --git a/x-pack/plugins/osquery/cypress/e2e/all/packs_create_edit.cy.ts b/x-pack/plugins/osquery/cypress/e2e/all/packs_create_edit.cy.ts index 52d1236c1f12f..770d5afc5ec0f 100644 --- a/x-pack/plugins/osquery/cypress/e2e/all/packs_create_edit.cy.ts +++ b/x-pack/plugins/osquery/cypress/e2e/all/packs_create_edit.cy.ts @@ -544,8 +544,6 @@ describe('Packs - Create and Edit', () => { recurse( () => { - cy.waitForReact(); - cy.getBySel('docsLoading').should('exist'); cy.getBySel('docsLoading').should('not.exist'); diff --git a/x-pack/plugins/osquery/cypress/e2e/roles/reader.cy.ts b/x-pack/plugins/osquery/cypress/e2e/roles/reader.cy.ts index 82b02bdda7289..67f7eff7f3ed4 100644 --- a/x-pack/plugins/osquery/cypress/e2e/roles/reader.cy.ts +++ b/x-pack/plugins/osquery/cypress/e2e/roles/reader.cy.ts @@ -47,7 +47,6 @@ describe('Reader - only READ', { tags: ['@ess'] }, () => { it('should not be able to add nor run saved queries', () => { navigateTo('/app/osquery/saved_queries'); - cy.waitForReact(1000); cy.contains(savedQueryName); cy.contains('Add saved query').should('be.disabled'); cy.react('PlayButtonComponent', { @@ -70,13 +69,11 @@ describe('Reader - only READ', { tags: ['@ess'] }, () => { it('should not be able to enter live queries with just read and no run saved queries', () => { navigateTo('/app/osquery/live_queries/new'); - cy.waitForReact(1000); cy.contains('Permission denied'); }); it('should not be able to play in live queries history', () => { navigateTo('/app/osquery/live_queries'); - cy.waitForReact(1000); cy.contains('New live query').should('be.disabled'); cy.contains(liveQueryQuery); cy.react('EuiIconPlay', { options: { timeout: 3000 } }).should('not.exist'); @@ -85,7 +82,6 @@ describe('Reader - only READ', { tags: ['@ess'] }, () => { it('should not be able to add nor edit packs', () => { navigateTo('/app/osquery/packs'); - cy.waitForReact(1000); cy.contains('Add pack').should('be.disabled'); cy.getBySel('tablePaginationPopoverButton').click(); cy.getBySel('tablePagination-50-rows').click(); diff --git a/x-pack/plugins/osquery/cypress/e2e/roles/t1_and_t2_analyst.cy.ts b/x-pack/plugins/osquery/cypress/e2e/roles/t1_and_t2_analyst.cy.ts index 779df77f2d382..6528c9b911932 100644 --- a/x-pack/plugins/osquery/cypress/e2e/roles/t1_and_t2_analyst.cy.ts +++ b/x-pack/plugins/osquery/cypress/e2e/roles/t1_and_t2_analyst.cy.ts @@ -57,7 +57,6 @@ describe(`T1 and T2 analysts`, { tags: ['@ess', '@serverless'] }, () => { it('should be able to run saved queries but not add new ones', () => { navigateTo('/app/osquery/saved_queries'); - cy.waitForReact(1000); cy.contains(savedQueryName); cy.contains('Add saved query').should('be.disabled'); cy.react('PlayButtonComponent', { @@ -79,7 +78,6 @@ describe(`T1 and T2 analysts`, { tags: ['@ess', '@serverless'] }, () => { it('should be able to play in live queries history', () => { navigateTo('/app/osquery/live_queries'); - cy.waitForReact(1000); cy.contains('New live query').should('not.be.disabled'); cy.contains(liveQueryQuery); cy.wait(1000); @@ -91,7 +89,6 @@ describe(`T1 and T2 analysts`, { tags: ['@ess', '@serverless'] }, () => { it('should be able to use saved query in a new query', () => { navigateTo('/app/osquery/live_queries'); - cy.waitForReact(1000); cy.contains('New live query').should('not.be.disabled').click(); selectAllAgents(); getSavedQueriesDropdown().type(`${savedQueryName}{downArrow} {enter}`); @@ -102,7 +99,6 @@ describe(`T1 and T2 analysts`, { tags: ['@ess', '@serverless'] }, () => { it('should not be able to add nor edit packs', () => { navigateTo('/app/osquery/packs'); - cy.waitForReact(1000); cy.getBySel('tablePaginationPopoverButton').click(); cy.getBySel('tablePagination-50-rows').click(); cy.contains('Add pack').should('be.disabled'); diff --git a/x-pack/plugins/osquery/serverless_cypress.config.ts b/x-pack/plugins/osquery/cypress/serverless_cypress.config.ts similarity index 85% rename from x-pack/plugins/osquery/serverless_cypress.config.ts rename to x-pack/plugins/osquery/cypress/serverless_cypress.config.ts index 6b60dc076631f..fff0d4431df52 100644 --- a/x-pack/plugins/osquery/serverless_cypress.config.ts +++ b/x-pack/plugins/osquery/cypress/serverless_cypress.config.ts @@ -6,8 +6,7 @@ */ import { defineCypressConfig } from '@kbn/cypress-config'; -// eslint-disable-next-line @kbn/imports/no_boundary_crossing -import { setupUserDataLoader } from '../../test_serverless/functional/test_suites/security/cypress/support/setup_data_loader_tasks'; +import { setupUserDataLoader } from '../../../test_serverless/functional/test_suites/security/cypress/support/setup_data_loader_tasks'; // eslint-disable-next-line import/no-default-export export default defineCypressConfig({ diff --git a/x-pack/plugins/osquery/cypress/support/e2e.ts b/x-pack/plugins/osquery/cypress/support/e2e.ts index ed267eaff8ac6..760aeb80d3ee8 100644 --- a/x-pack/plugins/osquery/cypress/support/e2e.ts +++ b/x-pack/plugins/osquery/cypress/support/e2e.ts @@ -23,17 +23,17 @@ // *********************************************************** // force ESM in this module -import type { SecuritySolutionDescribeBlockFtrConfig } from '@kbn/security-solution-plugin/scripts/run_cypress/utils'; - export {}; -import 'cypress-react-selector'; +// @ts-expect-error ts(2306) module has some interesting ways of importing, see https://github.com/cypress-io/cypress/blob/0871b03c5b21711cd23056454da8f23dcaca4950/npm/grep/README.md#support-file import registerCypressGrep from '@cypress/grep'; +registerCypressGrep(); -import { login } from '../../../../test_serverless/functional/test_suites/security/cypress/tasks/login'; +import type { SecuritySolutionDescribeBlockFtrConfig } from '@kbn/security-solution-plugin/scripts/run_cypress/utils'; import type { ServerlessRoleName } from './roles'; -registerCypressGrep(); +import 'cypress-react-selector'; +import { login } from '../../../../test_serverless/functional/test_suites/security/cypress/tasks/login'; declare global { // eslint-disable-next-line @typescript-eslint/no-namespace diff --git a/x-pack/plugins/osquery/cypress/tasks/navigation.ts b/x-pack/plugins/osquery/cypress/tasks/navigation.ts index 72fe34c7bce42..13ab8d4105b3e 100644 --- a/x-pack/plugins/osquery/cypress/tasks/navigation.ts +++ b/x-pack/plugins/osquery/cypress/tasks/navigation.ts @@ -21,7 +21,11 @@ export const navigateTo = (page: string, opts?: Partial) = // There's a security warning toast that seemingly makes ui elements in the bottom right unavailable, so we close it closeToastIfVisible(); - cy.waitForReact(); + cy.waitForReact( + 10000, + Cypress.env('cypress-react-selector')?.root, + '../../../node_modules/resq/dist/index.js' + ); }; export const openNavigationFlyout = () => { diff --git a/x-pack/plugins/osquery/cypress/tsconfig.json b/x-pack/plugins/osquery/cypress/tsconfig.json index cb468e0fb8893..ddd53a1ad7156 100644 --- a/x-pack/plugins/osquery/cypress/tsconfig.json +++ b/x-pack/plugins/osquery/cypress/tsconfig.json @@ -2,12 +2,13 @@ "extends": "../../../../tsconfig.base.json", "include": [ "**/*", - "../cypress.config.ts", - "../serverless_cypress.config.ts", + "./cypress.config.ts", + "./serverless_cypress.config.ts", "../../../test_serverless/shared/lib" ], "exclude": [ - "target/**/*" + "target/**/*", + "../../../test_serverless/shared/lib/security/default_http_headers.ts" ], "compilerOptions": { "outDir": "target/types", diff --git a/x-pack/plugins/osquery/package.json b/x-pack/plugins/osquery/package.json index 32db6010c6573..e9ab128dd45fb 100644 --- a/x-pack/plugins/osquery/package.json +++ b/x-pack/plugins/osquery/package.json @@ -7,10 +7,10 @@ "scripts": { "cypress:burn": "yarn cypress:run --env burn=2 --headed", "cypress:changed-specs-only": "yarn cypress:run --changed-specs-only --env burn=2", - "cypress": "NODE_OPTIONS=--openssl-legacy-provider node ../security_solution/scripts/start_cypress_parallel --config-file ../osquery/cypress.config.ts --ftr-config-file ../../../x-pack/test/osquery_cypress/cli_config", + "cypress": "NODE_OPTIONS=--openssl-legacy-provider node ../security_solution/scripts/start_cypress_parallel --config-file ../osquery/cypress/cypress.config.ts --ftr-config-file ../../../x-pack/test/osquery_cypress/cli_config", "cypress:open": "yarn cypress open", "cypress:run": "yarn cypress run", - "cypress:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ../security_solution/scripts/start_cypress_parallel --config-file ../osquery/serverless_cypress.config.ts --ftr-config-file ../../../x-pack/test/osquery_cypress/serverless_cli_config", + "cypress:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ../security_solution/scripts/start_cypress_parallel --config-file ../osquery/cypress/serverless_cypress.config.ts --ftr-config-file ../../../x-pack/test/osquery_cypress/serverless_cli_config", "cypress:serverless:open": "yarn cypress:serverless open", "cypress:serverless:run": "yarn cypress:serverless run", "nyc": "../../../node_modules/.bin/nyc report --reporter=text-summary", diff --git a/x-pack/plugins/osquery/tsconfig.json b/x-pack/plugins/osquery/tsconfig.json index d2344a2581df8..6516c4241f0df 100644 --- a/x-pack/plugins/osquery/tsconfig.json +++ b/x-pack/plugins/osquery/tsconfig.json @@ -1,12 +1,10 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "target/types", + "outDir": "target/types" }, "exclude": [ - "cypress.config.ts", - "serverless_cypress.config.ts", - "target/**/*", + "target/**/*" ], "include": [ // add all the folders contains files to be compiled @@ -15,8 +13,6 @@ "scripts/**/*", "scripts/**/**.json", "server/**/*", - "cypress.config.ts", - "serverless_cypress.config.ts", "../../../typings/**/*", // ECS and Osquery schema files "public/common/schemas/*/**.json", @@ -77,6 +73,6 @@ "@kbn/core-saved-objects-server", "@kbn/monaco", "@kbn/io-ts-utils", - "@kbn/shared-ux-page-kibana-template", + "@kbn/shared-ux-page-kibana-template" ] } diff --git a/x-pack/test_serverless/functional/test_suites/security/cypress/tasks/login.ts b/x-pack/test_serverless/functional/test_suites/security/cypress/tasks/login.ts index 89ca14ec0c28f..7ff366ea2cd14 100644 --- a/x-pack/test_serverless/functional/test_suites/security/cypress/tasks/login.ts +++ b/x-pack/test_serverless/functional/test_suites/security/cypress/tasks/login.ts @@ -48,7 +48,7 @@ const sendApiLoginRequest = ( }; interface CyLoginTask { - (user?: ServerlessRoleName): ReturnType; + (user?: ServerlessRoleName | 'elastic'): ReturnType; /** * Login using any username/password From 905dcfae51250c67fcbeb7938d8ddbd1115451c6 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 28 Sep 2023 18:46:45 -0400 Subject: [PATCH 53/61] skip failing test suite (#150249) --- .../functional/tests/discover_integration.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/saved_object_tagging/functional/tests/discover_integration.ts b/x-pack/test/saved_object_tagging/functional/tests/discover_integration.ts index 4529bf260fef1..7a82d0aec5d34 100644 --- a/x-pack/test/saved_object_tagging/functional/tests/discover_integration.ts +++ b/x-pack/test/saved_object_tagging/functional/tests/discover_integration.ts @@ -52,7 +52,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); }; - describe('discover integration', () => { + // Failing: See https://github.com/elastic/kibana/issues/150249 + describe.skip('discover integration', () => { before(async () => { await kibanaServer.importExport.load( 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/discover/data.json' From 8a29a5e2ca4ffabce7760e311e41ba2166e0f49e Mon Sep 17 00:00:00 2001 From: Alex Szabo Date: Fri, 29 Sep 2023 01:55:17 +0200 Subject: [PATCH 54/61] [Ops] Fix outstanding typescript issues / re-enable typecheck (#167392) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary This is hopefully the last batch of typescript issues to be fixed, related to https://github.com/elastic/kibana/pull/166813. It's also re-enabling full typecheck, with this, we should be back in a clean, typechecked main branch. Blocked by #167428 --------- Co-authored-by: Brad White Co-authored-by: Brad White Co-authored-by: Thomas Watson Co-authored-by: Patryk Kopyciński Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .buildkite/pipelines/on_merge.yml | 19 +++++++++---------- .buildkite/pipelines/pull_request/base.yml | 19 +++++++++---------- .../pull_request/type_check_selective.yml | 10 ---------- .../pipelines/pull_request/pipeline.ts | 6 ------ .../scripts/steps/check_types_commits.sh | 4 ++++ 5 files changed, 22 insertions(+), 36 deletions(-) delete mode 100644 .buildkite/pipelines/pull_request/type_check_selective.yml diff --git a/.buildkite/pipelines/on_merge.yml b/.buildkite/pipelines/on_merge.yml index 086098cee6790..133004f468948 100644 --- a/.buildkite/pipelines/on_merge.yml +++ b/.buildkite/pipelines/on_merge.yml @@ -154,16 +154,15 @@ steps: - exit_status: '-1' limit: 3 -# TODO: Enable in #166813 after fixing types -# - command: .buildkite/scripts/steps/check_types.sh -# label: 'Check Types' -# agents: -# queue: n2-16-spot -# timeout_in_minutes: 60 -# retry: -# automatic: -# - exit_status: '-1' -# limit: 3 + - command: .buildkite/scripts/steps/check_types.sh + label: 'Check Types' + agents: + queue: n2-16-spot + timeout_in_minutes: 60 + retry: + automatic: + - exit_status: '-1' + limit: 3 - command: .buildkite/scripts/steps/storybooks/build_and_upload.sh label: 'Build Storybooks' diff --git a/.buildkite/pipelines/pull_request/base.yml b/.buildkite/pipelines/pull_request/base.yml index 9c2527fcdd413..158c22c0bb0c5 100644 --- a/.buildkite/pipelines/pull_request/base.yml +++ b/.buildkite/pipelines/pull_request/base.yml @@ -136,13 +136,12 @@ steps: - exit_status: '-1' limit: 3 -# TODO: Enable in #166813 after fixing types -# - command: .buildkite/scripts/steps/check_types.sh -# label: 'Check Types' -# agents: -# queue: n2-16-spot -# timeout_in_minutes: 60 -# retry: -# automatic: -# - exit_status: '-1' -# limit: 3 + - command: .buildkite/scripts/steps/check_types.sh + label: 'Check Types' + agents: + queue: n2-16-spot + timeout_in_minutes: 60 + retry: + automatic: + - exit_status: '-1' + limit: 3 diff --git a/.buildkite/pipelines/pull_request/type_check_selective.yml b/.buildkite/pipelines/pull_request/type_check_selective.yml deleted file mode 100644 index 7d01f128aac3c..0000000000000 --- a/.buildkite/pipelines/pull_request/type_check_selective.yml +++ /dev/null @@ -1,10 +0,0 @@ -steps: - - command: .buildkite/scripts/steps/check_types_commits.sh - label: 'Check Types Commit Diff' - agents: - queue: n2-16-spot - timeout_in_minutes: 60 - retry: - automatic: - - exit_status: '-1' - limit: 3 diff --git a/.buildkite/scripts/pipelines/pull_request/pipeline.ts b/.buildkite/scripts/pipelines/pull_request/pipeline.ts index 37bd89f2a75a7..80d1312af6e64 100644 --- a/.buildkite/scripts/pipelines/pull_request/pipeline.ts +++ b/.buildkite/scripts/pipelines/pull_request/pipeline.ts @@ -59,12 +59,6 @@ const uploadPipeline = (pipelineContent: string | object) => { pipeline.push(getPipeline('.buildkite/pipelines/pull_request/kbn_handlebars.yml')); } - if (GITHUB_PR_LABELS.includes('ci:hard-typecheck')) { - pipeline.push(getPipeline('.buildkite/pipelines/pull_request/type_check.yml')); - } else { - pipeline.push(getPipeline('.buildkite/pipelines/pull_request/type_check_selective.yml')); - } - if ( (await doAnyChangesMatch([ /^src\/plugins\/controls/, diff --git a/.buildkite/scripts/steps/check_types_commits.sh b/.buildkite/scripts/steps/check_types_commits.sh index 2fe1af46825fb..d34c4dae5ffa9 100755 --- a/.buildkite/scripts/steps/check_types_commits.sh +++ b/.buildkite/scripts/steps/check_types_commits.sh @@ -2,6 +2,10 @@ set -euo pipefail +# This script will collect typescript projects and run typecheck on projects between the given 2 parameters +# Could be used for selective typechecking on projects that might be affected for a given PR. +# (The accuracy for finding related projects is not a 100%) + if [[ "${CI-}" == "true" ]]; then .buildkite/scripts/bootstrap.sh From e9d2e782b59c3c8328f8e38b8136afe8c4e086fa Mon Sep 17 00:00:00 2001 From: Yara Tercero Date: Thu, 28 Sep 2023 17:52:39 -0700 Subject: [PATCH 55/61] [DE][Exceptions] Allow numerous match_any values that differ in case (#167208) ## Summary Updates the exceptions flyout UI `match_any` operator to accept numerous duplicate values that differ in case. Prior to this change, a user could not add a field value of `foo` and `FOO` - the UI would display that the value is a duplicate. We now will allow this as exceptions are case sensitive and this is a necessary use case for the current exceptions behavior. Cypress tests and FTR tests are added. --- .../src/field_value_match_any/index.tsx | 1 + .../group3/exceptions_workflows.ts | 55 ++++++++++++ .../tests/create_exception_list_items.ts | 31 +++++++ .../exceptions/entry/flyout_validation.cy.ts | 2 +- .../e2e/exceptions/entry/match_any.cy.ts | 89 +++++++++++++++++++ .../add_edit_exception.cy.ts | 6 +- .../add_edit_exception_data_view.cy.ts | 6 +- .../cypress/tasks/exceptions.ts | 16 ++-- .../es_archives/exceptions/data.json | 54 +++++++++++ 9 files changed, 248 insertions(+), 12 deletions(-) create mode 100644 x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/match_any.cy.ts diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_match_any/index.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_match_any/index.tsx index bccbe24186ab8..aa3cb5dc9a417 100644 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_match_any/index.tsx +++ b/packages/kbn-securitysolution-autocomplete/src/field_value_match_any/index.tsx @@ -184,6 +184,7 @@ export const AutocompleteFieldMatchAnyComponent: React.FC { expect(signalsOpen.hits.hits.length).toEqual(0); }); + it('should be able to execute against an exception list that does include valid case sensitive entries and get back 0 signals', async () => { + const rule: QueryRuleCreateProps = { + name: 'Simple Rule Query', + description: 'Simple Rule Query', + enabled: true, + risk_score: 1, + rule_id: 'rule-1', + severity: 'high', + index: ['auditbeat-*'], + type: 'query', + from: '1900-01-01T00:00:00.000Z', + query: 'host.name: "suricata-sensor-amsterdam"', + }; + const rule2: QueryRuleCreateProps = { + name: 'Simple Rule Query', + description: 'Simple Rule Query', + enabled: true, + risk_score: 1, + rule_id: 'rule-2', + severity: 'high', + index: ['auditbeat-*'], + type: 'query', + from: '1900-01-01T00:00:00.000Z', + query: 'host.name: "suricata-sensor-amsterdam"', + }; + const createdRule = await createRuleWithExceptionEntries(supertest, log, rule, [ + [ + { + field: 'host.os.name', + operator: 'included', + type: 'match_any', + value: ['ubuntu'], + }, + ], + ]); + const createdRule2 = await createRuleWithExceptionEntries(supertest, log, rule2, [ + [ + { + field: 'host.os.name', // This matches the query above which will exclude everything + operator: 'included', + type: 'match_any', + value: ['ubuntu', 'Ubuntu'], + }, + ], + ]); + const signalsOpen = await getOpenSignals(supertest, log, es, createdRule); + const signalsOpen2 = await getOpenSignals(supertest, log, es, createdRule2); + // Expect signals here because all values are "Ubuntu" + // and exception is one of ["ubuntu"] + expect(signalsOpen.hits.hits.length).toEqual(10); + // Expect no signals here because all values are "Ubuntu" + // and exception is one of ["ubuntu", "Ubuntu"] + expect(signalsOpen2.hits.hits.length).toEqual(0); + }); + it('generates no signals when an exception is added for an EQL rule', async () => { const rule: EqlRuleCreateProps = { ...getEqlRuleForSignalTesting(['auditbeat-*']), diff --git a/x-pack/test/lists_api_integration/security_and_spaces/tests/create_exception_list_items.ts b/x-pack/test/lists_api_integration/security_and_spaces/tests/create_exception_list_items.ts index cc916862a6313..ab4eb4d802fc9 100644 --- a/x-pack/test/lists_api_integration/security_and_spaces/tests/create_exception_list_items.ts +++ b/x-pack/test/lists_api_integration/security_and_spaces/tests/create_exception_list_items.ts @@ -67,6 +67,37 @@ export default ({ getService }: FtrProviderContext) => { expect(bodyToCompare).to.eql(getExceptionListItemResponseMockWithoutAutoGeneratedValues()); }); + it('should create a match any exception item with multiple case sensitive values', async () => { + const entries = [ + { + field: 'agent.name', + operator: 'included', + type: 'match_any', + value: ['dll', 'DLL'], + }, + ]; + await supertest + .post(EXCEPTION_LIST_URL) + .set('kbn-xsrf', 'true') + .send(getCreateExceptionListMinimalSchemaMock()) + .expect(200); + + const { body } = await supertest + .post(EXCEPTION_LIST_ITEM_URL) + .set('kbn-xsrf', 'true') + .send({ + ...getCreateExceptionListItemMinimalSchemaMock(), + entries, + }) + .expect(200); + + const bodyToCompare = removeExceptionListItemServerGeneratedProperties(body); + expect(bodyToCompare).to.eql({ + ...getExceptionListItemResponseMockWithoutAutoGeneratedValues(), + entries, + }); + }); + it('should create a simple exception list item without an id', async () => { await supertest .post(EXCEPTION_LIST_URL) diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/flyout_validation.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/flyout_validation.cy.ts index 9d8661edd4415..48d6730db8a81 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/flyout_validation.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/flyout_validation.cy.ts @@ -125,7 +125,7 @@ describe.skip('Exceptions flyout', { tags: ['@ess', '@serverless', '@skipInServe cy.get(CONFIRM_BTN).should('be.disabled'); // add value again and button should be enabled again - addExceptionEntryFieldMatchAnyValue('test', 0); + addExceptionEntryFieldMatchAnyValue(['test'], 0); cy.get(CONFIRM_BTN).should('be.enabled'); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/match_any.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/match_any.cy.ts new file mode 100644 index 0000000000000..f18b056c4e254 --- /dev/null +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/match_any.cy.ts @@ -0,0 +1,89 @@ +/* + * 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 { getNewRule } from '../../../objects/rule'; + +import { RULE_STATUS } from '../../../screens/create_new_rule'; + +import { createRule } from '../../../tasks/api_calls/rules'; +import { login } from '../../../tasks/login'; +import { + openExceptionFlyoutFromEmptyViewerPrompt, + visitRuleDetailsPage, + enablesRule, + waitForTheRuleToBeExecuted, + goToAlertsTab, +} from '../../../tasks/rule_details'; +import { + addExceptionEntryFieldMatchAnyValue, + addExceptionEntryFieldValue, + addExceptionEntryOperatorValue, + addExceptionFlyoutItemName, + submitNewExceptionItem, +} from '../../../tasks/exceptions'; +import { CONFIRM_BTN } from '../../../screens/exceptions'; +import { deleteAlertsAndRules } from '../../../tasks/common'; +import { ALERTS_COUNT } from '../../../screens/alerts'; +import { waitForAlertsToPopulate } from '../../../tasks/create_new_rule'; + +describe('Exceptions match_any', { tags: ['@ess', '@serverless'] }, () => { + before(() => { + // this is a made-up index that has just the necessary + // mappings to conduct tests, avoiding loading large + // amounts of data like in auditbeat_exceptions + cy.task('esArchiverLoad', { archiveName: 'exceptions' }); + }); + + beforeEach(() => { + deleteAlertsAndRules(); + login(); + createRule( + getNewRule({ + index: ['exceptions-*'], + enabled: false, + query: '*', + from: 'now-438300h', + }) + ).then((rule) => visitRuleDetailsPage(rule.body.id, { tab: 'rule_exceptions' })); + cy.get(RULE_STATUS).should('have.text', '—'); + }); + + after(() => { + cy.task('esArchiverUnload', 'exceptions'); + }); + + it('Creates exception item', () => { + cy.log('open add exception modal'); + openExceptionFlyoutFromEmptyViewerPrompt(); + + cy.log('add exception item name'); + addExceptionFlyoutItemName('My item name'); + + cy.log('add match_any entry'); + addExceptionEntryFieldValue('agent.name', 0); + // Asserting double negative because it is easier to check + // that an alert was created than that it was NOT (as if it is not + // it could be for other reasons, like rule failure) + addExceptionEntryOperatorValue('is not one of', 0); + addExceptionEntryFieldMatchAnyValue(['foo', 'FOO'], 0); + cy.get(CONFIRM_BTN).should('be.enabled'); + submitNewExceptionItem(); + + enablesRule(); + + goToAlertsTab(); + + waitForTheRuleToBeExecuted(); + waitForAlertsToPopulate(); + + // Will match document with value "foo" and document with value "FOO" + cy.log('Asserting that alert is generated'); + cy.get(ALERTS_COUNT) + .invoke('text') + .should('match', /^[2].+$/); + }); +}); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_exception.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_exception.cy.ts index 3d5c1dd37bfe4..4801683e9c90e 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_exception.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_exception.cy.ts @@ -63,7 +63,7 @@ describe( 'Add/edit exception from rule details', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { - const NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS = '1 alert'; + const NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS = '3 alerts'; const FIELD_DIFFERENT_FROM_EXISTING_ITEM_FIELD = 'agent.name'; const ITEM_FIELD = 'unique_value.test'; @@ -276,8 +276,8 @@ describe( // add exception item conditions addExceptionConditions({ field: 'agent.name', - operator: 'is', - values: ['foo'], + operator: 'is one of', + values: ['foo', 'FOO', 'bar'], }); // Name is required so want to check that submit is still disabled diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_exception_data_view.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_exception_data_view.cy.ts index 6751b79e2c2e6..d7a829294bce2 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_exception_data_view.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_exception_data_view.cy.ts @@ -45,7 +45,7 @@ describe( 'Add exception using data views from rule details', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { - const NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS = '1 alert'; + const NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS = '3 alerts'; const ITEM_NAME = 'Sample Exception List Item'; before(() => { @@ -87,8 +87,8 @@ describe( addFirstExceptionFromRuleDetails( { field: 'agent.name', - operator: 'is', - values: ['foo'], + operator: 'is one of', + values: ['foo', 'FOO', 'bar'], }, ITEM_NAME ); diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/exceptions.ts b/x-pack/test/security_solution_cypress/cypress/tasks/exceptions.ts index 1a1c730ef053d..909b1bfcf4c5d 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/exceptions.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/exceptions.ts @@ -114,8 +114,10 @@ export const addExceptionEntryFieldValueValue = (value: string, index = 0) => { cy.get(EXCEPTION_FLYOUT_TITLE).click(); }; -export const addExceptionEntryFieldMatchAnyValue = (value: string, index = 0) => { - cy.get(VALUES_MATCH_ANY_INPUT).eq(index).type(`${value}{enter}`); +export const addExceptionEntryFieldMatchAnyValue = (values: string[], index = 0) => { + values.forEach((value) => { + cy.get(VALUES_MATCH_ANY_INPUT).eq(index).type(`${value}{enter}`); + }); cy.get(EXCEPTION_FLYOUT_TITLE).click(); }; export const addExceptionEntryFieldMatchIncludedValue = (value: string, index = 0) => { @@ -164,9 +166,13 @@ export const selectCloseSingleAlerts = () => { export const addExceptionConditions = (exception: Exception) => { cy.get(FIELD_INPUT).type(`${exception.field}{downArrow}{enter}`); cy.get(OPERATOR_INPUT).type(`${exception.operator}{enter}`); - exception.values.forEach((value) => { - cy.get(VALUES_INPUT).type(`${value}{enter}`); - }); + if (exception.operator === 'is one of') { + addExceptionEntryFieldMatchAnyValue(exception.values, 0); + } else { + exception.values.forEach((value) => { + cy.get(VALUES_INPUT).type(`${value}{enter}`); + }); + } }; export const validateExceptionConditionField = (value: string) => { diff --git a/x-pack/test/security_solution_cypress/es_archives/exceptions/data.json b/x-pack/test/security_solution_cypress/es_archives/exceptions/data.json index f8152c27084df..808aeaa22925c 100644 --- a/x-pack/test/security_solution_cypress/es_archives/exceptions/data.json +++ b/x-pack/test/security_solution_cypress/es_archives/exceptions/data.json @@ -24,3 +24,57 @@ } } } + +{ + "type": "doc", + "value": { + "id": "_aZE5nwBOpWiDweSth_A", + "index": "exceptions-0001", + "source": { + "@timestamp": "2019-09-01T00:41:04.527Z", + "agent": { + "name": "bar" + }, + "unique_value": { + "test": "another value" + }, + "user" : [ + { + "name" : "john", + "id" : "c5baec68-e774-46dc-b728-417e71d68444" + }, + { + "name" : "alice", + "id" : "6e831997-deab-4e56-9218-a90ef045556e" + } + ] + } + } +} + +{ + "type": "doc", + "value": { + "id": "_aZE5nwBOpWiDweSth_C", + "index": "exceptions-0001", + "source": { + "@timestamp": "2019-09-01T00:41:09.527Z", + "agent": { + "name": "FOO" + }, + "unique_value": { + "test": "different value" + }, + "user" : [ + { + "name" : "john", + "id" : "c5baec68-e774-46dc-b728-417e71d68444" + }, + { + "name" : "alice", + "id" : "6e831997-deab-4e56-9218-a90ef045556e" + } + ] + } + } +} From 785d640628177f9f997f948eb3756f94c1a1b5c4 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:39:07 -0400 Subject: [PATCH 56/61] [api-docs] 2023-09-29 Daily api_docs build (#167593) Generated by https://buildkite.com/elastic/kibana-api-docs-daily/builds/475 --- api_docs/actions.mdx | 2 +- api_docs/advanced_settings.mdx | 2 +- api_docs/aiops.mdx | 2 +- api_docs/alerting.devdocs.json | 44 +- api_docs/alerting.mdx | 2 +- api_docs/apm.mdx | 2 +- api_docs/apm_data_access.mdx | 2 +- api_docs/asset_manager.devdocs.json | 115 +- api_docs/asset_manager.mdx | 18 +- api_docs/banners.mdx | 2 +- api_docs/bfetch.mdx | 2 +- api_docs/canvas.mdx | 2 +- api_docs/cases.mdx | 2 +- api_docs/charts.mdx | 2 +- api_docs/cloud.mdx | 2 +- api_docs/cloud_chat.mdx | 2 +- api_docs/cloud_chat_provider.mdx | 2 +- api_docs/cloud_data_migration.mdx | 2 +- api_docs/cloud_defend.mdx | 2 +- api_docs/cloud_experiments.mdx | 2 +- api_docs/cloud_security_posture.mdx | 2 +- api_docs/console.mdx | 2 +- api_docs/content_management.mdx | 2 +- api_docs/controls.mdx | 2 +- api_docs/custom_integrations.mdx | 2 +- api_docs/dashboard.mdx | 2 +- api_docs/dashboard_enhanced.mdx | 2 +- api_docs/data.devdocs.json | 441 +-- api_docs/data.mdx | 4 +- api_docs/data_query.mdx | 4 +- api_docs/data_search.devdocs.json | 67 +- api_docs/data_search.mdx | 4 +- api_docs/data_view_editor.mdx | 2 +- api_docs/data_view_field_editor.mdx | 2 +- api_docs/data_view_management.mdx | 2 +- api_docs/data_views.devdocs.json | 472 +-- api_docs/data_views.mdx | 2 +- api_docs/data_visualizer.mdx | 2 +- api_docs/deprecations_by_api.mdx | 70 +- api_docs/deprecations_by_plugin.mdx | 39 +- api_docs/deprecations_by_team.mdx | 2 +- api_docs/dev_tools.mdx | 2 +- api_docs/discover.devdocs.json | 32 +- api_docs/discover.mdx | 4 +- api_docs/discover_enhanced.mdx | 2 +- api_docs/ecs_data_quality_dashboard.mdx | 2 +- api_docs/elastic_assistant.mdx | 2 +- api_docs/embeddable.mdx | 2 +- api_docs/embeddable_enhanced.mdx | 2 +- api_docs/encrypted_saved_objects.mdx | 2 +- api_docs/enterprise_search.mdx | 2 +- api_docs/es_ui_shared.mdx | 2 +- api_docs/event_annotation.mdx | 2 +- api_docs/event_annotation_listing.mdx | 2 +- api_docs/event_log.mdx | 2 +- api_docs/exploratory_view.mdx | 2 +- api_docs/expression_error.mdx | 2 +- api_docs/expression_gauge.mdx | 2 +- api_docs/expression_heatmap.mdx | 2 +- api_docs/expression_image.mdx | 2 +- api_docs/expression_legacy_metric_vis.mdx | 2 +- api_docs/expression_metric.mdx | 2 +- api_docs/expression_metric_vis.mdx | 2 +- api_docs/expression_partition_vis.mdx | 2 +- api_docs/expression_repeat_image.mdx | 2 +- api_docs/expression_reveal_image.mdx | 2 +- api_docs/expression_shape.mdx | 2 +- api_docs/expression_tagcloud.mdx | 2 +- api_docs/expression_x_y.devdocs.json | 14 + api_docs/expression_x_y.mdx | 4 +- api_docs/expressions.mdx | 2 +- api_docs/features.mdx | 2 +- api_docs/field_formats.mdx | 2 +- api_docs/file_upload.mdx | 2 +- api_docs/files.mdx | 2 +- api_docs/files_management.mdx | 2 +- api_docs/fleet.mdx | 2 +- api_docs/global_search.mdx | 2 +- api_docs/guided_onboarding.mdx | 2 +- api_docs/home.mdx | 2 +- api_docs/image_embeddable.mdx | 2 +- api_docs/index_lifecycle_management.mdx | 2 +- api_docs/index_management.mdx | 2 +- api_docs/infra.mdx | 2 +- api_docs/inspector.mdx | 2 +- api_docs/interactive_setup.mdx | 2 +- api_docs/kbn_ace.mdx | 2 +- api_docs/kbn_aiops_components.mdx | 2 +- api_docs/kbn_aiops_utils.mdx | 2 +- ...rting_api_integration_helpers.devdocs.json | 49 + .../kbn_alerting_api_integration_helpers.mdx | 4 +- api_docs/kbn_alerting_state_types.mdx | 2 +- .../kbn_alerts_as_data_utils.devdocs.json | 21 +- api_docs/kbn_alerts_as_data_utils.mdx | 4 +- api_docs/kbn_alerts_ui_shared.mdx | 2 +- api_docs/kbn_analytics.mdx | 2 +- api_docs/kbn_analytics_client.devdocs.json | 208 +- api_docs/kbn_analytics_client.mdx | 2 +- ..._analytics_shippers_elastic_v3_browser.mdx | 2 +- ...n_analytics_shippers_elastic_v3_common.mdx | 2 +- ...n_analytics_shippers_elastic_v3_server.mdx | 2 +- api_docs/kbn_analytics_shippers_fullstory.mdx | 2 +- api_docs/kbn_analytics_shippers_gainsight.mdx | 2 +- api_docs/kbn_apm_config_loader.mdx | 2 +- api_docs/kbn_apm_synthtrace.mdx | 2 +- api_docs/kbn_apm_synthtrace_client.mdx | 2 +- api_docs/kbn_apm_utils.mdx | 2 +- api_docs/kbn_axe_config.mdx | 2 +- api_docs/kbn_cases_components.mdx | 2 +- api_docs/kbn_cell_actions.mdx | 2 +- .../kbn_chart_expressions_common.devdocs.json | 65 + api_docs/kbn_chart_expressions_common.mdx | 4 +- api_docs/kbn_chart_icons.mdx | 2 +- api_docs/kbn_ci_stats_core.mdx | 2 +- api_docs/kbn_ci_stats_performance_metrics.mdx | 2 +- api_docs/kbn_ci_stats_reporter.mdx | 2 +- api_docs/kbn_cli_dev_mode.mdx | 2 +- api_docs/kbn_code_editor.mdx | 2 +- api_docs/kbn_code_editor_mocks.mdx | 2 +- api_docs/kbn_coloring.devdocs.json | 3444 ++++++++++++----- api_docs/kbn_coloring.mdx | 10 +- api_docs/kbn_config.mdx | 2 +- api_docs/kbn_config_mocks.mdx | 2 +- api_docs/kbn_config_schema.mdx | 2 +- .../kbn_content_management_content_editor.mdx | 2 +- ...tent_management_tabbed_table_list_view.mdx | 2 +- ...kbn_content_management_table_list_view.mdx | 2 +- ...ntent_management_table_list_view_table.mdx | 2 +- .../kbn_content_management_utils.devdocs.json | 33 +- api_docs/kbn_content_management_utils.mdx | 4 +- api_docs/kbn_core_analytics_browser.mdx | 2 +- .../kbn_core_analytics_browser_internal.mdx | 2 +- api_docs/kbn_core_analytics_browser_mocks.mdx | 2 +- api_docs/kbn_core_analytics_server.mdx | 2 +- .../kbn_core_analytics_server_internal.mdx | 2 +- api_docs/kbn_core_analytics_server_mocks.mdx | 2 +- .../kbn_core_application_browser.devdocs.json | 8 +- api_docs/kbn_core_application_browser.mdx | 2 +- .../kbn_core_application_browser_internal.mdx | 2 +- .../kbn_core_application_browser_mocks.mdx | 2 +- api_docs/kbn_core_application_common.mdx | 2 +- api_docs/kbn_core_apps_browser_internal.mdx | 2 +- api_docs/kbn_core_apps_browser_mocks.mdx | 2 +- api_docs/kbn_core_apps_server_internal.mdx | 2 +- api_docs/kbn_core_base_browser_mocks.mdx | 2 +- api_docs/kbn_core_base_common.mdx | 2 +- api_docs/kbn_core_base_server_internal.mdx | 2 +- api_docs/kbn_core_base_server_mocks.mdx | 2 +- .../kbn_core_capabilities_browser_mocks.mdx | 2 +- api_docs/kbn_core_capabilities_common.mdx | 2 +- api_docs/kbn_core_capabilities_server.mdx | 2 +- .../kbn_core_capabilities_server_mocks.mdx | 2 +- api_docs/kbn_core_chrome_browser.devdocs.json | 33 + api_docs/kbn_core_chrome_browser.mdx | 4 +- api_docs/kbn_core_chrome_browser_mocks.mdx | 2 +- api_docs/kbn_core_config_server_internal.mdx | 2 +- api_docs/kbn_core_custom_branding_browser.mdx | 2 +- ..._core_custom_branding_browser_internal.mdx | 2 +- ...kbn_core_custom_branding_browser_mocks.mdx | 2 +- api_docs/kbn_core_custom_branding_common.mdx | 2 +- api_docs/kbn_core_custom_branding_server.mdx | 2 +- ...n_core_custom_branding_server_internal.mdx | 2 +- .../kbn_core_custom_branding_server_mocks.mdx | 2 +- api_docs/kbn_core_deprecations_browser.mdx | 2 +- ...kbn_core_deprecations_browser_internal.mdx | 2 +- .../kbn_core_deprecations_browser_mocks.mdx | 2 +- api_docs/kbn_core_deprecations_common.mdx | 2 +- api_docs/kbn_core_deprecations_server.mdx | 2 +- .../kbn_core_deprecations_server_internal.mdx | 2 +- .../kbn_core_deprecations_server_mocks.mdx | 2 +- api_docs/kbn_core_doc_links_browser.mdx | 2 +- api_docs/kbn_core_doc_links_browser_mocks.mdx | 2 +- api_docs/kbn_core_doc_links_server.mdx | 2 +- api_docs/kbn_core_doc_links_server_mocks.mdx | 2 +- ...e_elasticsearch_client_server_internal.mdx | 2 +- ...core_elasticsearch_client_server_mocks.mdx | 2 +- api_docs/kbn_core_elasticsearch_server.mdx | 2 +- ...kbn_core_elasticsearch_server_internal.mdx | 2 +- .../kbn_core_elasticsearch_server_mocks.mdx | 2 +- .../kbn_core_environment_server_internal.mdx | 2 +- .../kbn_core_environment_server_mocks.mdx | 2 +- .../kbn_core_execution_context_browser.mdx | 2 +- ...ore_execution_context_browser_internal.mdx | 2 +- ...n_core_execution_context_browser_mocks.mdx | 2 +- .../kbn_core_execution_context_common.mdx | 2 +- .../kbn_core_execution_context_server.mdx | 2 +- ...core_execution_context_server_internal.mdx | 2 +- ...bn_core_execution_context_server_mocks.mdx | 2 +- api_docs/kbn_core_fatal_errors_browser.mdx | 2 +- .../kbn_core_fatal_errors_browser_mocks.mdx | 2 +- api_docs/kbn_core_http_browser.mdx | 2 +- api_docs/kbn_core_http_browser_internal.mdx | 2 +- api_docs/kbn_core_http_browser_mocks.mdx | 2 +- api_docs/kbn_core_http_common.mdx | 2 +- .../kbn_core_http_context_server_mocks.mdx | 2 +- ...re_http_request_handler_context_server.mdx | 2 +- api_docs/kbn_core_http_resources_server.mdx | 2 +- ...bn_core_http_resources_server_internal.mdx | 2 +- .../kbn_core_http_resources_server_mocks.mdx | 2 +- .../kbn_core_http_router_server_internal.mdx | 2 +- .../kbn_core_http_router_server_mocks.mdx | 2 +- api_docs/kbn_core_http_server.devdocs.json | 1324 +++---- api_docs/kbn_core_http_server.mdx | 2 +- api_docs/kbn_core_http_server_internal.mdx | 2 +- api_docs/kbn_core_http_server_mocks.mdx | 2 +- api_docs/kbn_core_i18n_browser.mdx | 2 +- api_docs/kbn_core_i18n_browser_mocks.mdx | 2 +- api_docs/kbn_core_i18n_server.mdx | 2 +- api_docs/kbn_core_i18n_server_internal.mdx | 2 +- api_docs/kbn_core_i18n_server_mocks.mdx | 2 +- ...n_core_injected_metadata_browser_mocks.mdx | 2 +- ...kbn_core_integrations_browser_internal.mdx | 2 +- .../kbn_core_integrations_browser_mocks.mdx | 2 +- api_docs/kbn_core_lifecycle_browser.mdx | 2 +- api_docs/kbn_core_lifecycle_browser_mocks.mdx | 2 +- api_docs/kbn_core_lifecycle_server.mdx | 2 +- api_docs/kbn_core_lifecycle_server_mocks.mdx | 2 +- api_docs/kbn_core_logging_browser_mocks.mdx | 2 +- api_docs/kbn_core_logging_common_internal.mdx | 2 +- api_docs/kbn_core_logging_server.mdx | 2 +- api_docs/kbn_core_logging_server_internal.mdx | 2 +- api_docs/kbn_core_logging_server_mocks.mdx | 2 +- ...ore_metrics_collectors_server_internal.mdx | 2 +- ...n_core_metrics_collectors_server_mocks.mdx | 2 +- api_docs/kbn_core_metrics_server.mdx | 2 +- api_docs/kbn_core_metrics_server_internal.mdx | 2 +- api_docs/kbn_core_metrics_server_mocks.mdx | 2 +- api_docs/kbn_core_mount_utils_browser.mdx | 2 +- api_docs/kbn_core_node_server.mdx | 2 +- api_docs/kbn_core_node_server_internal.mdx | 2 +- api_docs/kbn_core_node_server_mocks.mdx | 2 +- api_docs/kbn_core_notifications_browser.mdx | 2 +- ...bn_core_notifications_browser_internal.mdx | 2 +- .../kbn_core_notifications_browser_mocks.mdx | 2 +- api_docs/kbn_core_overlays_browser.mdx | 2 +- .../kbn_core_overlays_browser_internal.mdx | 2 +- api_docs/kbn_core_overlays_browser_mocks.mdx | 2 +- api_docs/kbn_core_plugins_browser.mdx | 2 +- api_docs/kbn_core_plugins_browser_mocks.mdx | 2 +- api_docs/kbn_core_plugins_server.mdx | 2 +- api_docs/kbn_core_plugins_server_mocks.mdx | 2 +- api_docs/kbn_core_preboot_server.mdx | 2 +- api_docs/kbn_core_preboot_server_mocks.mdx | 2 +- api_docs/kbn_core_rendering_browser_mocks.mdx | 2 +- .../kbn_core_rendering_server_internal.mdx | 2 +- api_docs/kbn_core_rendering_server_mocks.mdx | 2 +- api_docs/kbn_core_root_server_internal.mdx | 2 +- ...ore_saved_objects_api_browser.devdocs.json | 88 +- .../kbn_core_saved_objects_api_browser.mdx | 2 +- ...core_saved_objects_api_server.devdocs.json | 96 +- .../kbn_core_saved_objects_api_server.mdx | 2 +- ...bn_core_saved_objects_api_server_mocks.mdx | 2 +- ...ore_saved_objects_base_server_internal.mdx | 2 +- ...n_core_saved_objects_base_server_mocks.mdx | 2 +- ...bn_core_saved_objects_browser.devdocs.json | 8 +- api_docs/kbn_core_saved_objects_browser.mdx | 2 +- ...bn_core_saved_objects_browser_internal.mdx | 2 +- .../kbn_core_saved_objects_browser_mocks.mdx | 2 +- ...kbn_core_saved_objects_common.devdocs.json | 1272 +++--- api_docs/kbn_core_saved_objects_common.mdx | 2 +- ..._objects_import_export_server_internal.mdx | 2 +- ...ved_objects_import_export_server_mocks.mdx | 2 +- ...aved_objects_migration_server_internal.mdx | 2 +- ...e_saved_objects_migration_server_mocks.mdx | 2 +- ...kbn_core_saved_objects_server.devdocs.json | 136 +- api_docs/kbn_core_saved_objects_server.mdx | 2 +- ...kbn_core_saved_objects_server_internal.mdx | 2 +- .../kbn_core_saved_objects_server_mocks.mdx | 2 +- .../kbn_core_saved_objects_utils_server.mdx | 2 +- api_docs/kbn_core_status_common.mdx | 2 +- api_docs/kbn_core_status_common_internal.mdx | 2 +- api_docs/kbn_core_status_server.mdx | 2 +- api_docs/kbn_core_status_server_internal.mdx | 2 +- api_docs/kbn_core_status_server_mocks.mdx | 2 +- ...core_test_helpers_deprecations_getters.mdx | 2 +- ...n_core_test_helpers_http_setup_browser.mdx | 2 +- api_docs/kbn_core_test_helpers_kbn_server.mdx | 2 +- ...n_core_test_helpers_so_type_serializer.mdx | 2 +- api_docs/kbn_core_test_helpers_test_utils.mdx | 2 +- api_docs/kbn_core_theme_browser.mdx | 2 +- api_docs/kbn_core_theme_browser_mocks.mdx | 2 +- api_docs/kbn_core_ui_settings_browser.mdx | 2 +- .../kbn_core_ui_settings_browser_internal.mdx | 2 +- .../kbn_core_ui_settings_browser_mocks.mdx | 2 +- api_docs/kbn_core_ui_settings_common.mdx | 2 +- api_docs/kbn_core_ui_settings_server.mdx | 2 +- .../kbn_core_ui_settings_server_internal.mdx | 2 +- .../kbn_core_ui_settings_server_mocks.mdx | 2 +- api_docs/kbn_core_usage_data_server.mdx | 2 +- .../kbn_core_usage_data_server_internal.mdx | 2 +- api_docs/kbn_core_usage_data_server_mocks.mdx | 2 +- api_docs/kbn_core_user_settings_server.mdx | 2 +- ...kbn_core_user_settings_server_internal.mdx | 2 +- .../kbn_core_user_settings_server_mocks.mdx | 2 +- api_docs/kbn_crypto.mdx | 2 +- api_docs/kbn_crypto_browser.mdx | 2 +- api_docs/kbn_custom_integrations.mdx | 2 +- api_docs/kbn_cypress_config.mdx | 2 +- api_docs/kbn_data_service.mdx | 2 +- api_docs/kbn_datemath.mdx | 2 +- api_docs/kbn_deeplinks_analytics.mdx | 2 +- api_docs/kbn_deeplinks_devtools.mdx | 2 +- api_docs/kbn_deeplinks_management.mdx | 2 +- api_docs/kbn_deeplinks_ml.mdx | 2 +- api_docs/kbn_deeplinks_observability.mdx | 2 +- api_docs/kbn_deeplinks_search.mdx | 2 +- api_docs/kbn_default_nav_analytics.mdx | 2 +- api_docs/kbn_default_nav_devtools.mdx | 2 +- api_docs/kbn_default_nav_management.mdx | 2 +- api_docs/kbn_default_nav_ml.mdx | 2 +- api_docs/kbn_dev_cli_errors.mdx | 2 +- api_docs/kbn_dev_cli_runner.mdx | 2 +- api_docs/kbn_dev_proc_runner.mdx | 2 +- api_docs/kbn_dev_utils.mdx | 2 +- api_docs/kbn_discover_utils.mdx | 2 +- api_docs/kbn_doc_links.mdx | 2 +- api_docs/kbn_docs_utils.mdx | 2 +- api_docs/kbn_dom_drag_drop.mdx | 2 +- api_docs/kbn_ebt_tools.mdx | 2 +- api_docs/kbn_ecs.mdx | 2 +- api_docs/kbn_ecs_data_quality_dashboard.mdx | 2 +- api_docs/kbn_elastic_assistant.mdx | 2 +- api_docs/kbn_es.mdx | 2 +- api_docs/kbn_es_archiver.mdx | 2 +- api_docs/kbn_es_errors.mdx | 2 +- api_docs/kbn_es_query.mdx | 2 +- api_docs/kbn_es_types.mdx | 2 +- api_docs/kbn_eslint_plugin_imports.mdx | 2 +- api_docs/kbn_event_annotation_common.mdx | 2 +- api_docs/kbn_event_annotation_components.mdx | 2 +- api_docs/kbn_expandable_flyout.mdx | 2 +- api_docs/kbn_field_types.mdx | 2 +- api_docs/kbn_find_used_node_modules.mdx | 2 +- .../kbn_ftr_common_functional_services.mdx | 2 +- api_docs/kbn_generate.mdx | 2 +- api_docs/kbn_generate_console_definitions.mdx | 2 +- api_docs/kbn_generate_csv.mdx | 2 +- api_docs/kbn_generate_csv_types.mdx | 2 +- api_docs/kbn_guided_onboarding.mdx | 2 +- api_docs/kbn_handlebars.mdx | 2 +- api_docs/kbn_hapi_mocks.mdx | 2 +- api_docs/kbn_health_gateway_server.mdx | 2 +- api_docs/kbn_home_sample_data_card.mdx | 2 +- api_docs/kbn_home_sample_data_tab.mdx | 2 +- api_docs/kbn_i18n.mdx | 2 +- api_docs/kbn_i18n_react.mdx | 2 +- api_docs/kbn_import_resolver.mdx | 2 +- api_docs/kbn_infra_forge.mdx | 2 +- api_docs/kbn_interpreter.mdx | 2 +- api_docs/kbn_io_ts_utils.mdx | 2 +- api_docs/kbn_jest_serializers.mdx | 2 +- api_docs/kbn_journeys.devdocs.json | 16 +- api_docs/kbn_journeys.mdx | 4 +- api_docs/kbn_json_ast.mdx | 2 +- api_docs/kbn_kibana_manifest_schema.mdx | 2 +- .../kbn_language_documentation_popover.mdx | 2 +- api_docs/kbn_lens_embeddable_utils.mdx | 2 +- api_docs/kbn_logging.mdx | 2 +- api_docs/kbn_logging_mocks.mdx | 2 +- api_docs/kbn_managed_vscode_config.mdx | 2 +- api_docs/kbn_management_cards_navigation.mdx | 2 +- ...ngs_components_field_category.devdocs.json | 569 +++ ...ent_settings_components_field_category.mdx | 36 + ...ttings_components_field_input.devdocs.json | 16 +- ...gement_settings_components_field_input.mdx | 2 +- ...settings_components_field_row.devdocs.json | 78 +- ...nagement_settings_components_field_row.mdx | 4 +- ...bn_management_settings_components_form.mdx | 2 +- ...n_management_settings_field_definition.mdx | 2 +- api_docs/kbn_management_settings_ids.mdx | 2 +- ...n_management_settings_section_registry.mdx | 2 +- ...kbn_management_settings_types.devdocs.json | 145 +- api_docs/kbn_management_settings_types.mdx | 4 +- ...management_settings_utilities.devdocs.json | 120 +- .../kbn_management_settings_utilities.mdx | 4 +- api_docs/kbn_management_storybook_config.mdx | 2 +- api_docs/kbn_mapbox_gl.mdx | 2 +- api_docs/kbn_maps_vector_tile_utils.mdx | 2 +- api_docs/kbn_ml_agg_utils.mdx | 2 +- api_docs/kbn_ml_anomaly_utils.mdx | 2 +- api_docs/kbn_ml_category_validator.mdx | 2 +- api_docs/kbn_ml_chi2test.mdx | 2 +- .../kbn_ml_data_frame_analytics_utils.mdx | 2 +- api_docs/kbn_ml_data_grid.mdx | 2 +- api_docs/kbn_ml_date_picker.mdx | 2 +- api_docs/kbn_ml_date_utils.mdx | 2 +- api_docs/kbn_ml_error_utils.mdx | 2 +- api_docs/kbn_ml_in_memory_table.mdx | 2 +- api_docs/kbn_ml_is_defined.mdx | 2 +- api_docs/kbn_ml_is_populated_object.mdx | 2 +- api_docs/kbn_ml_kibana_theme.mdx | 2 +- api_docs/kbn_ml_local_storage.mdx | 2 +- api_docs/kbn_ml_nested_property.mdx | 2 +- api_docs/kbn_ml_number_utils.mdx | 2 +- api_docs/kbn_ml_query_utils.mdx | 2 +- api_docs/kbn_ml_random_sampler_utils.mdx | 2 +- api_docs/kbn_ml_route_utils.mdx | 2 +- api_docs/kbn_ml_runtime_field_utils.mdx | 2 +- api_docs/kbn_ml_string_hash.mdx | 2 +- api_docs/kbn_ml_trained_models_utils.mdx | 2 +- api_docs/kbn_ml_url_state.mdx | 2 +- api_docs/kbn_monaco.mdx | 2 +- api_docs/kbn_object_versioning.mdx | 2 +- api_docs/kbn_observability_alert_details.mdx | 2 +- api_docs/kbn_openapi_generator.mdx | 2 +- api_docs/kbn_optimizer.mdx | 2 +- api_docs/kbn_optimizer_webpack_helpers.mdx | 2 +- api_docs/kbn_osquery_io_ts_types.mdx | 2 +- ..._performance_testing_dataset_extractor.mdx | 2 +- api_docs/kbn_plugin_generator.mdx | 2 +- api_docs/kbn_plugin_helpers.mdx | 2 +- api_docs/kbn_profiling_utils.mdx | 2 +- api_docs/kbn_random_sampling.mdx | 2 +- api_docs/kbn_react_field.mdx | 2 +- api_docs/kbn_react_kibana_context_common.mdx | 2 +- api_docs/kbn_react_kibana_context_render.mdx | 2 +- api_docs/kbn_react_kibana_context_root.mdx | 2 +- api_docs/kbn_react_kibana_context_styled.mdx | 2 +- api_docs/kbn_react_kibana_context_theme.mdx | 2 +- api_docs/kbn_react_kibana_mount.mdx | 2 +- api_docs/kbn_repo_file_maps.mdx | 2 +- api_docs/kbn_repo_linter.mdx | 2 +- api_docs/kbn_repo_path.mdx | 2 +- api_docs/kbn_repo_source_classifier.mdx | 2 +- api_docs/kbn_reporting_common.mdx | 2 +- api_docs/kbn_resizable_layout.mdx | 2 +- api_docs/kbn_rison.mdx | 2 +- api_docs/kbn_rrule.mdx | 2 +- api_docs/kbn_rule_data_utils.mdx | 2 +- api_docs/kbn_saved_objects_settings.mdx | 2 +- api_docs/kbn_search_api_panels.mdx | 2 +- api_docs/kbn_search_connectors.mdx | 2 +- api_docs/kbn_search_response_warnings.mdx | 2 +- api_docs/kbn_security_solution_features.mdx | 2 +- api_docs/kbn_security_solution_navigation.mdx | 2 +- api_docs/kbn_security_solution_side_nav.mdx | 2 +- ...kbn_security_solution_storybook_config.mdx | 2 +- .../kbn_securitysolution_autocomplete.mdx | 2 +- api_docs/kbn_securitysolution_data_table.mdx | 2 +- api_docs/kbn_securitysolution_ecs.mdx | 2 +- api_docs/kbn_securitysolution_es_utils.mdx | 2 +- ...ritysolution_exception_list_components.mdx | 2 +- api_docs/kbn_securitysolution_grouping.mdx | 2 +- api_docs/kbn_securitysolution_hook_utils.mdx | 2 +- ..._securitysolution_io_ts_alerting_types.mdx | 2 +- .../kbn_securitysolution_io_ts_list_types.mdx | 2 +- api_docs/kbn_securitysolution_io_ts_types.mdx | 2 +- api_docs/kbn_securitysolution_io_ts_utils.mdx | 2 +- api_docs/kbn_securitysolution_list_api.mdx | 2 +- ...curitysolution_list_constants.devdocs.json | 16 +- .../kbn_securitysolution_list_constants.mdx | 2 +- api_docs/kbn_securitysolution_list_hooks.mdx | 2 +- api_docs/kbn_securitysolution_list_utils.mdx | 2 +- api_docs/kbn_securitysolution_rules.mdx | 2 +- api_docs/kbn_securitysolution_t_grid.mdx | 2 +- api_docs/kbn_securitysolution_utils.mdx | 2 +- api_docs/kbn_server_http_tools.mdx | 2 +- api_docs/kbn_server_route_repository.mdx | 2 +- api_docs/kbn_serverless_common_settings.mdx | 2 +- .../kbn_serverless_observability_settings.mdx | 2 +- api_docs/kbn_serverless_project_switcher.mdx | 2 +- api_docs/kbn_serverless_search_settings.mdx | 2 +- api_docs/kbn_serverless_security_settings.mdx | 2 +- api_docs/kbn_serverless_storybook_config.mdx | 2 +- api_docs/kbn_shared_svg.mdx | 2 +- api_docs/kbn_shared_ux_avatar_solution.mdx | 2 +- ...ared_ux_avatar_user_profile_components.mdx | 2 +- .../kbn_shared_ux_button_exit_full_screen.mdx | 2 +- ...hared_ux_button_exit_full_screen_mocks.mdx | 2 +- api_docs/kbn_shared_ux_button_toolbar.mdx | 2 +- api_docs/kbn_shared_ux_card_no_data.mdx | 2 +- api_docs/kbn_shared_ux_card_no_data_mocks.mdx | 2 +- api_docs/kbn_shared_ux_chrome_navigation.mdx | 2 +- api_docs/kbn_shared_ux_file_context.mdx | 2 +- api_docs/kbn_shared_ux_file_image.mdx | 2 +- api_docs/kbn_shared_ux_file_image_mocks.mdx | 2 +- api_docs/kbn_shared_ux_file_mocks.mdx | 2 +- api_docs/kbn_shared_ux_file_picker.mdx | 2 +- api_docs/kbn_shared_ux_file_types.mdx | 2 +- api_docs/kbn_shared_ux_file_upload.mdx | 2 +- api_docs/kbn_shared_ux_file_util.mdx | 2 +- api_docs/kbn_shared_ux_link_redirect_app.mdx | 2 +- .../kbn_shared_ux_link_redirect_app_mocks.mdx | 2 +- api_docs/kbn_shared_ux_markdown.mdx | 2 +- api_docs/kbn_shared_ux_markdown_mocks.mdx | 2 +- .../kbn_shared_ux_page_analytics_no_data.mdx | 2 +- ...shared_ux_page_analytics_no_data_mocks.mdx | 2 +- .../kbn_shared_ux_page_kibana_no_data.mdx | 2 +- ...bn_shared_ux_page_kibana_no_data_mocks.mdx | 2 +- .../kbn_shared_ux_page_kibana_template.mdx | 2 +- ...n_shared_ux_page_kibana_template_mocks.mdx | 2 +- api_docs/kbn_shared_ux_page_no_data.mdx | 2 +- .../kbn_shared_ux_page_no_data_config.mdx | 2 +- ...bn_shared_ux_page_no_data_config_mocks.mdx | 2 +- api_docs/kbn_shared_ux_page_no_data_mocks.mdx | 2 +- api_docs/kbn_shared_ux_page_solution_nav.mdx | 2 +- .../kbn_shared_ux_prompt_no_data_views.mdx | 2 +- ...n_shared_ux_prompt_no_data_views_mocks.mdx | 2 +- api_docs/kbn_shared_ux_prompt_not_found.mdx | 2 +- api_docs/kbn_shared_ux_router.mdx | 2 +- api_docs/kbn_shared_ux_router_mocks.mdx | 2 +- api_docs/kbn_shared_ux_storybook_config.mdx | 2 +- api_docs/kbn_shared_ux_storybook_mock.mdx | 2 +- api_docs/kbn_shared_ux_utility.mdx | 2 +- api_docs/kbn_slo_schema.mdx | 2 +- api_docs/kbn_some_dev_log.mdx | 2 +- api_docs/kbn_std.mdx | 2 +- api_docs/kbn_stdio_dev_helpers.mdx | 2 +- api_docs/kbn_storybook.mdx | 2 +- api_docs/kbn_subscription_tracking.mdx | 2 +- api_docs/kbn_telemetry_tools.mdx | 2 +- api_docs/kbn_test.mdx | 2 +- api_docs/kbn_test_jest_helpers.mdx | 2 +- api_docs/kbn_test_subj_selector.mdx | 2 +- api_docs/kbn_text_based_editor.mdx | 2 +- api_docs/kbn_tooling_log.mdx | 2 +- api_docs/kbn_ts_projects.mdx | 2 +- api_docs/kbn_typed_react_router_config.mdx | 2 +- api_docs/kbn_ui_actions_browser.mdx | 2 +- api_docs/kbn_ui_shared_deps_src.mdx | 2 +- api_docs/kbn_ui_theme.mdx | 2 +- api_docs/kbn_unified_data_table.mdx | 2 +- api_docs/kbn_unified_doc_viewer.mdx | 2 +- api_docs/kbn_unified_field_list.mdx | 2 +- api_docs/kbn_url_state.mdx | 2 +- api_docs/kbn_use_tracked_promise.mdx | 2 +- api_docs/kbn_user_profile_components.mdx | 2 +- api_docs/kbn_utility_types.mdx | 2 +- api_docs/kbn_utility_types_jest.mdx | 2 +- api_docs/kbn_utils.mdx | 2 +- api_docs/kbn_visualization_ui_components.mdx | 2 +- api_docs/kbn_xstate_utils.mdx | 2 +- api_docs/kbn_yarn_lock_validator.mdx | 2 +- api_docs/kibana_overview.mdx | 2 +- api_docs/kibana_react.devdocs.json | 456 ++- api_docs/kibana_react.mdx | 2 +- api_docs/kibana_utils.devdocs.json | 31 - api_docs/kibana_utils.mdx | 4 +- api_docs/kubernetes_security.mdx | 2 +- api_docs/lens.devdocs.json | 71 +- api_docs/lens.mdx | 4 +- api_docs/license_api_guard.mdx | 2 +- api_docs/license_management.mdx | 2 +- api_docs/licensing.devdocs.json | 24 +- api_docs/licensing.mdx | 2 +- api_docs/lists.mdx | 2 +- api_docs/log_explorer.mdx | 2 +- api_docs/logs_shared.mdx | 2 +- api_docs/management.mdx | 2 +- api_docs/maps.mdx | 2 +- api_docs/maps_ems.mdx | 2 +- api_docs/metrics_data_access.mdx | 2 +- api_docs/ml.devdocs.json | 8 +- api_docs/ml.mdx | 4 +- api_docs/monitoring.mdx | 2 +- api_docs/monitoring_collection.mdx | 2 +- api_docs/navigation.mdx | 2 +- api_docs/newsfeed.mdx | 2 +- api_docs/no_data_page.mdx | 2 +- api_docs/notifications.mdx | 2 +- api_docs/observability.devdocs.json | 20 + api_docs/observability.mdx | 4 +- api_docs/observability_a_i_assistant.mdx | 2 +- api_docs/observability_log_explorer.mdx | 2 +- api_docs/observability_onboarding.mdx | 2 +- api_docs/observability_shared.mdx | 2 +- api_docs/osquery.mdx | 2 +- api_docs/painless_lab.mdx | 2 +- api_docs/plugin_directory.mdx | 49 +- api_docs/presentation_util.mdx | 2 +- api_docs/profiling.mdx | 2 +- api_docs/profiling_data_access.mdx | 2 +- api_docs/remote_clusters.mdx | 2 +- api_docs/reporting.mdx | 2 +- api_docs/rollup.mdx | 2 +- api_docs/rule_registry.mdx | 2 +- api_docs/runtime_fields.mdx | 2 +- api_docs/saved_objects.mdx | 2 +- api_docs/saved_objects_finder.mdx | 2 +- api_docs/saved_objects_management.mdx | 2 +- api_docs/saved_objects_tagging.devdocs.json | 134 + api_docs/saved_objects_tagging.mdx | 4 +- .../saved_objects_tagging_oss.devdocs.json | 67 + api_docs/saved_objects_tagging_oss.mdx | 4 +- api_docs/saved_search.mdx | 2 +- api_docs/screenshot_mode.mdx | 2 +- api_docs/screenshotting.mdx | 2 +- api_docs/security.devdocs.json | 16 +- api_docs/security.mdx | 2 +- api_docs/security_solution.devdocs.json | 28 + api_docs/security_solution.mdx | 4 +- api_docs/security_solution_ess.mdx | 2 +- api_docs/security_solution_serverless.mdx | 2 +- api_docs/serverless.mdx | 2 +- api_docs/serverless_observability.mdx | 2 +- api_docs/serverless_search.mdx | 2 +- api_docs/session_view.mdx | 2 +- api_docs/share.mdx | 2 +- api_docs/snapshot_restore.mdx | 2 +- api_docs/spaces.mdx | 2 +- api_docs/stack_alerts.mdx | 2 +- api_docs/stack_connectors.mdx | 2 +- api_docs/task_manager.mdx | 2 +- api_docs/telemetry.mdx | 2 +- api_docs/telemetry_collection_manager.mdx | 2 +- api_docs/telemetry_collection_xpack.mdx | 2 +- api_docs/telemetry_management_section.mdx | 2 +- api_docs/text_based_languages.mdx | 2 +- api_docs/threat_intelligence.mdx | 2 +- api_docs/timelines.mdx | 2 +- api_docs/transform.mdx | 2 +- api_docs/triggers_actions_ui.mdx | 2 +- api_docs/ui_actions.mdx | 2 +- api_docs/ui_actions_enhanced.mdx | 2 +- api_docs/unified_doc_viewer.mdx | 2 +- api_docs/unified_histogram.mdx | 2 +- api_docs/unified_search.mdx | 2 +- api_docs/unified_search_autocomplete.mdx | 2 +- api_docs/uptime.mdx | 2 +- api_docs/url_forwarding.mdx | 2 +- api_docs/usage_collection.mdx | 2 +- api_docs/ux.mdx | 2 +- api_docs/vis_default_editor.mdx | 2 +- api_docs/vis_type_gauge.mdx | 2 +- api_docs/vis_type_heatmap.mdx | 2 +- api_docs/vis_type_pie.mdx | 2 +- api_docs/vis_type_table.mdx | 2 +- api_docs/vis_type_timelion.mdx | 2 +- api_docs/vis_type_timeseries.mdx | 2 +- api_docs/vis_type_vega.mdx | 2 +- api_docs/vis_type_vislib.mdx | 2 +- api_docs/vis_type_xy.mdx | 2 +- api_docs/visualizations.mdx | 2 +- 633 files changed, 7039 insertions(+), 4188 deletions(-) create mode 100644 api_docs/kbn_management_settings_components_field_category.devdocs.json create mode 100644 api_docs/kbn_management_settings_components_field_category.mdx diff --git a/api_docs/actions.mdx b/api_docs/actions.mdx index 9a116bd9aa00b..0d89bf3c7f9dd 100644 --- a/api_docs/actions.mdx +++ b/api_docs/actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/actions title: "actions" image: https://source.unsplash.com/400x175/?github description: API docs for the actions plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions'] --- import actionsObj from './actions.devdocs.json'; diff --git a/api_docs/advanced_settings.mdx b/api_docs/advanced_settings.mdx index dbf9c0fc8cec3..68a115e64c789 100644 --- a/api_docs/advanced_settings.mdx +++ b/api_docs/advanced_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/advancedSettings title: "advancedSettings" image: https://source.unsplash.com/400x175/?github description: API docs for the advancedSettings plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings'] --- import advancedSettingsObj from './advanced_settings.devdocs.json'; diff --git a/api_docs/aiops.mdx b/api_docs/aiops.mdx index 3eb68f5e67a56..e629362e8ce00 100644 --- a/api_docs/aiops.mdx +++ b/api_docs/aiops.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/aiops title: "aiops" image: https://source.unsplash.com/400x175/?github description: API docs for the aiops plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiops'] --- import aiopsObj from './aiops.devdocs.json'; diff --git a/api_docs/alerting.devdocs.json b/api_docs/alerting.devdocs.json index 4a97328c5bbd9..6b300ca759ee0 100644 --- a/api_docs/alerting.devdocs.json +++ b/api_docs/alerting.devdocs.json @@ -108,10 +108,6 @@ "deprecated": true, "trackAdoption": false, "references": [ - { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/alerting/register_ml_alerts.ts" - }, { "plugin": "stackAlerts", "path": "x-pack/plugins/stack_alerts/public/rule_types/es_query/index.ts" @@ -127,6 +123,10 @@ { "plugin": "stackAlerts", "path": "x-pack/plugins/stack_alerts/public/rule_types/es_query/index.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/alerting/register_ml_alerts.ts" } ], "children": [ @@ -3360,36 +3360,20 @@ "path": "x-pack/plugins/rule_registry/server/utils/create_persistence_rule_type_wrapper.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/lib/alerts/register_jobs_monitoring_rule_type.ts" + "plugin": "observability", + "path": "x-pack/plugins/observability/server/lib/rules/slo_burn_rate/executor.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/lib/alerts/register_jobs_monitoring_rule_type.ts" + "plugin": "observability", + "path": "x-pack/plugins/observability/server/lib/rules/custom_threshold/custom_threshold_executor.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts" + "path": "x-pack/plugins/ml/server/lib/alerts/register_jobs_monitoring_rule_type.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_rules_notification_alert_type.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts" - }, - { - "plugin": "observability", - "path": "x-pack/plugins/observability/server/lib/rules/slo_burn_rate/executor.ts" - }, - { - "plugin": "observability", - "path": "x-pack/plugins/observability/server/lib/rules/custom_threshold/custom_threshold_executor.ts" + "path": "x-pack/plugins/ml/server/lib/alerts/register_jobs_monitoring_rule_type.ts" }, { "plugin": "infra", @@ -3419,6 +3403,14 @@ "plugin": "monitoring", "path": "x-pack/plugins/monitoring/server/alerts/base_rule.ts" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_rules_notification_alert_type.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts" + }, { "plugin": "stackAlerts", "path": "x-pack/plugins/stack_alerts/server/rule_types/index_threshold/rule_type.ts" diff --git a/api_docs/alerting.mdx b/api_docs/alerting.mdx index a9cfdd9c6283c..d21a7eb0aa50e 100644 --- a/api_docs/alerting.mdx +++ b/api_docs/alerting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/alerting title: "alerting" image: https://source.unsplash.com/400x175/?github description: API docs for the alerting plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting'] --- import alertingObj from './alerting.devdocs.json'; diff --git a/api_docs/apm.mdx b/api_docs/apm.mdx index 4762b1407b25a..3755a26ed8429 100644 --- a/api_docs/apm.mdx +++ b/api_docs/apm.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/apm title: "apm" image: https://source.unsplash.com/400x175/?github description: API docs for the apm plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apm'] --- import apmObj from './apm.devdocs.json'; diff --git a/api_docs/apm_data_access.mdx b/api_docs/apm_data_access.mdx index 1e5c28a1e94d0..23a63a157a3fb 100644 --- a/api_docs/apm_data_access.mdx +++ b/api_docs/apm_data_access.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/apmDataAccess title: "apmDataAccess" image: https://source.unsplash.com/400x175/?github description: API docs for the apmDataAccess plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apmDataAccess'] --- import apmDataAccessObj from './apm_data_access.devdocs.json'; diff --git a/api_docs/asset_manager.devdocs.json b/api_docs/asset_manager.devdocs.json index 5f7f45af9f998..31183ec6acb0b 100644 --- a/api_docs/asset_manager.devdocs.json +++ b/api_docs/asset_manager.devdocs.json @@ -3,9 +3,82 @@ "client": { "classes": [], "functions": [], - "interfaces": [], + "interfaces": [ + { + "parentPluginId": "assetManager", + "id": "def-public.AssetManagerPublicPluginSetup", + "type": "Interface", + "tags": [], + "label": "AssetManagerPublicPluginSetup", + "description": [], + "path": "x-pack/plugins/asset_manager/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "assetManager", + "id": "def-public.AssetManagerPublicPluginSetup.publicAssetsClient", + "type": "Object", + "tags": [], + "label": "publicAssetsClient", + "description": [], + "signature": [ + "IPublicAssetsClient" + ], + "path": "x-pack/plugins/asset_manager/public/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "assetManager", + "id": "def-public.AssetManagerPublicPluginStart", + "type": "Interface", + "tags": [], + "label": "AssetManagerPublicPluginStart", + "description": [], + "path": "x-pack/plugins/asset_manager/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "assetManager", + "id": "def-public.AssetManagerPublicPluginStart.publicAssetsClient", + "type": "Object", + "tags": [], + "label": "publicAssetsClient", + "description": [], + "signature": [ + "IPublicAssetsClient" + ], + "path": "x-pack/plugins/asset_manager/public/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], "enums": [], - "misc": [], + "misc": [ + { + "parentPluginId": "assetManager", + "id": "def-public.AssetManagerAppId", + "type": "Type", + "tags": [], + "label": "AssetManagerAppId", + "description": [], + "signature": [ + "\"assetManager\"" + ], + "path": "x-pack/plugins/asset_manager/public/index.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], "objects": [] }, "server": { @@ -24,7 +97,7 @@ "signature": [ "{ readonly alphaEnabled?: boolean | undefined; readonly sourceIndices: Readonly<{} & { logs: string; }>; readonly lockedSource: \"assets\" | \"signals\"; }" ], - "path": "x-pack/plugins/asset_manager/server/types.ts", + "path": "x-pack/plugins/asset_manager/common/config.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -45,7 +118,41 @@ "initialIsOpen": false } ], - "objects": [] + "objects": [], + "setup": { + "parentPluginId": "assetManager", + "id": "def-server.AssetManagerServerPluginSetup", + "type": "Type", + "tags": [], + "label": "AssetManagerServerPluginSetup", + "description": [], + "signature": [ + "{ assetClient: ", + "AssetClient", + "; } | undefined" + ], + "path": "x-pack/plugins/asset_manager/server/plugin.ts", + "deprecated": false, + "trackAdoption": false, + "lifecycle": "setup", + "initialIsOpen": true + }, + "start": { + "parentPluginId": "assetManager", + "id": "def-server.AssetManagerServerPluginStart", + "type": "Type", + "tags": [], + "label": "AssetManagerServerPluginStart", + "description": [], + "signature": [ + "{} | undefined" + ], + "path": "x-pack/plugins/asset_manager/server/plugin.ts", + "deprecated": false, + "trackAdoption": false, + "lifecycle": "start", + "initialIsOpen": true + } }, "common": { "classes": [], diff --git a/api_docs/asset_manager.mdx b/api_docs/asset_manager.mdx index ddf0cc20472fe..6f7552cd515cc 100644 --- a/api_docs/asset_manager.mdx +++ b/api_docs/asset_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/assetManager title: "assetManager" image: https://source.unsplash.com/400x175/?github description: API docs for the assetManager plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'assetManager'] --- import assetManagerObj from './asset_manager.devdocs.json'; @@ -21,10 +21,24 @@ Contact [@elastic/infra-monitoring-ui](https://github.com/orgs/elastic/teams/inf | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2 | 0 | 2 | 0 | +| 9 | 0 | 9 | 2 | + +## Client + +### Interfaces + + +### Consts, variables and types + ## Server +### Setup + + +### Start + + ### Consts, variables and types diff --git a/api_docs/banners.mdx b/api_docs/banners.mdx index b2669d7582a7b..f6cf2a6900b2e 100644 --- a/api_docs/banners.mdx +++ b/api_docs/banners.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/banners title: "banners" image: https://source.unsplash.com/400x175/?github description: API docs for the banners plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'banners'] --- import bannersObj from './banners.devdocs.json'; diff --git a/api_docs/bfetch.mdx b/api_docs/bfetch.mdx index 1fae708721588..0393811c438ad 100644 --- a/api_docs/bfetch.mdx +++ b/api_docs/bfetch.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/bfetch title: "bfetch" image: https://source.unsplash.com/400x175/?github description: API docs for the bfetch plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'bfetch'] --- import bfetchObj from './bfetch.devdocs.json'; diff --git a/api_docs/canvas.mdx b/api_docs/canvas.mdx index 17162885d6c6f..3af184b4742d2 100644 --- a/api_docs/canvas.mdx +++ b/api_docs/canvas.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/canvas title: "canvas" image: https://source.unsplash.com/400x175/?github description: API docs for the canvas plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'canvas'] --- import canvasObj from './canvas.devdocs.json'; diff --git a/api_docs/cases.mdx b/api_docs/cases.mdx index ee01032ea5bbb..2800c746cc3a8 100644 --- a/api_docs/cases.mdx +++ b/api_docs/cases.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cases title: "cases" image: https://source.unsplash.com/400x175/?github description: API docs for the cases plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cases'] --- import casesObj from './cases.devdocs.json'; diff --git a/api_docs/charts.mdx b/api_docs/charts.mdx index d8f4058a7693c..3db571b23aaf9 100644 --- a/api_docs/charts.mdx +++ b/api_docs/charts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/charts title: "charts" image: https://source.unsplash.com/400x175/?github description: API docs for the charts plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'charts'] --- import chartsObj from './charts.devdocs.json'; diff --git a/api_docs/cloud.mdx b/api_docs/cloud.mdx index b0df4aec4917c..01904c265c80d 100644 --- a/api_docs/cloud.mdx +++ b/api_docs/cloud.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloud title: "cloud" image: https://source.unsplash.com/400x175/?github description: API docs for the cloud plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloud'] --- import cloudObj from './cloud.devdocs.json'; diff --git a/api_docs/cloud_chat.mdx b/api_docs/cloud_chat.mdx index 59f6308448b28..249c224384d96 100644 --- a/api_docs/cloud_chat.mdx +++ b/api_docs/cloud_chat.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudChat title: "cloudChat" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudChat plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudChat'] --- import cloudChatObj from './cloud_chat.devdocs.json'; diff --git a/api_docs/cloud_chat_provider.mdx b/api_docs/cloud_chat_provider.mdx index 1a10061b30cb7..4ac3bf6bd4cce 100644 --- a/api_docs/cloud_chat_provider.mdx +++ b/api_docs/cloud_chat_provider.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudChatProvider title: "cloudChatProvider" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudChatProvider plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudChatProvider'] --- import cloudChatProviderObj from './cloud_chat_provider.devdocs.json'; diff --git a/api_docs/cloud_data_migration.mdx b/api_docs/cloud_data_migration.mdx index 8105ffe2731a9..ae4b4a29d78ce 100644 --- a/api_docs/cloud_data_migration.mdx +++ b/api_docs/cloud_data_migration.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudDataMigration title: "cloudDataMigration" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudDataMigration plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudDataMigration'] --- import cloudDataMigrationObj from './cloud_data_migration.devdocs.json'; diff --git a/api_docs/cloud_defend.mdx b/api_docs/cloud_defend.mdx index ed4603e068a47..ec4be3d360a8b 100644 --- a/api_docs/cloud_defend.mdx +++ b/api_docs/cloud_defend.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudDefend title: "cloudDefend" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudDefend plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudDefend'] --- import cloudDefendObj from './cloud_defend.devdocs.json'; diff --git a/api_docs/cloud_experiments.mdx b/api_docs/cloud_experiments.mdx index 9254d1947b082..99716abd3701c 100644 --- a/api_docs/cloud_experiments.mdx +++ b/api_docs/cloud_experiments.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudExperiments title: "cloudExperiments" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudExperiments plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudExperiments'] --- import cloudExperimentsObj from './cloud_experiments.devdocs.json'; diff --git a/api_docs/cloud_security_posture.mdx b/api_docs/cloud_security_posture.mdx index f566e653ba31b..c20244fc686f9 100644 --- a/api_docs/cloud_security_posture.mdx +++ b/api_docs/cloud_security_posture.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudSecurityPosture title: "cloudSecurityPosture" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudSecurityPosture plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudSecurityPosture'] --- import cloudSecurityPostureObj from './cloud_security_posture.devdocs.json'; diff --git a/api_docs/console.mdx b/api_docs/console.mdx index 81e8162e0c184..5c671fd45f2d5 100644 --- a/api_docs/console.mdx +++ b/api_docs/console.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/console title: "console" image: https://source.unsplash.com/400x175/?github description: API docs for the console plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'console'] --- import consoleObj from './console.devdocs.json'; diff --git a/api_docs/content_management.mdx b/api_docs/content_management.mdx index ed9e7f7c42fff..2d22cc243f482 100644 --- a/api_docs/content_management.mdx +++ b/api_docs/content_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/contentManagement title: "contentManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the contentManagement plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'contentManagement'] --- import contentManagementObj from './content_management.devdocs.json'; diff --git a/api_docs/controls.mdx b/api_docs/controls.mdx index adb1072427e54..2732f9a60e6b6 100644 --- a/api_docs/controls.mdx +++ b/api_docs/controls.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/controls title: "controls" image: https://source.unsplash.com/400x175/?github description: API docs for the controls plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'controls'] --- import controlsObj from './controls.devdocs.json'; diff --git a/api_docs/custom_integrations.mdx b/api_docs/custom_integrations.mdx index 3c92e9bf5fb05..6112df2f0681b 100644 --- a/api_docs/custom_integrations.mdx +++ b/api_docs/custom_integrations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/customIntegrations title: "customIntegrations" image: https://source.unsplash.com/400x175/?github description: API docs for the customIntegrations plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'customIntegrations'] --- import customIntegrationsObj from './custom_integrations.devdocs.json'; diff --git a/api_docs/dashboard.mdx b/api_docs/dashboard.mdx index bc9e62b6ea68f..5ac9914f294d8 100644 --- a/api_docs/dashboard.mdx +++ b/api_docs/dashboard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dashboard title: "dashboard" image: https://source.unsplash.com/400x175/?github description: API docs for the dashboard plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboard'] --- import dashboardObj from './dashboard.devdocs.json'; diff --git a/api_docs/dashboard_enhanced.mdx b/api_docs/dashboard_enhanced.mdx index 85c05d0182f96..d086d1780167e 100644 --- a/api_docs/dashboard_enhanced.mdx +++ b/api_docs/dashboard_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dashboardEnhanced title: "dashboardEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the dashboardEnhanced plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboardEnhanced'] --- import dashboardEnhancedObj from './dashboard_enhanced.devdocs.json'; diff --git a/api_docs/data.devdocs.json b/api_docs/data.devdocs.json index c7c415ce2a07d..5c0335bdc9fe2 100644 --- a/api_docs/data.devdocs.json +++ b/api_docs/data.devdocs.json @@ -8218,23 +8218,6 @@ "path": "src/plugins/data/common/search/types.ts", "deprecated": false, "trackAdoption": false - }, - { - "parentPluginId": "data", - "id": "def-public.IKibanaSearchResponse.requestParams", - "type": "Object", - "tags": [], - "label": "requestParams", - "description": [ - "\nHTTP request parameters from elasticsearch transport client t" - ], - "signature": [ - "ConnectionRequestParams", - " | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false, - "trackAdoption": false } ], "initialIsOpen": false @@ -8833,18 +8816,6 @@ "deprecated": true, "trackAdoption": false, "references": [ - { - "plugin": "@kbn/core-saved-objects-api-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/utils/internal_utils.ts" - }, - { - "plugin": "@kbn/core-saved-objects-import-export-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/lib/collect_saved_objects.ts" - }, - { - "plugin": "@kbn/core-saved-objects-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/import_dashboards.ts" - }, { "plugin": "@kbn/core-saved-objects-api-browser", "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts" @@ -8857,6 +8828,22 @@ "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts" }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" + }, + { + "plugin": "@kbn/core-saved-objects-api-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/utils/internal_utils.ts" + }, + { + "plugin": "@kbn/core-saved-objects-import-export-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/lib/collect_saved_objects.ts" + }, + { + "plugin": "@kbn/core-saved-objects-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/import_dashboards.ts" + }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts" @@ -8869,6 +8856,22 @@ "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts" }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/server/sample_data/logs.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/server/sample_data/ecommerce.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/server/sample_data/flights.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" + }, { "plugin": "osquery", "path": "x-pack/plugins/osquery/server/routes/pack/read_pack_route.ts" @@ -8957,26 +8960,6 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/server/sample_data/logs.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/server/sample_data/ecommerce.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/server/sample_data/flights.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" - }, { "plugin": "alerting", "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" @@ -12796,6 +12779,10 @@ "plugin": "dashboard", "path": "src/plugins/dashboard/public/services/data/data_service.ts" }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/rule_types/threshold/expression.tsx" + }, { "plugin": "dataVisualizer", "path": "x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_row/document_stats.tsx" @@ -12812,10 +12799,6 @@ "plugin": "dataVisualizer", "path": "x-pack/plugins/data_visualizer/public/application/data_drift/charts/default_value_formatter.ts" }, - { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/rule_types/threshold/expression.tsx" - }, { "plugin": "expressionPartitionVis", "path": "src/plugins/chart_expressions/expression_partition_vis/public/utils/layers/get_color.test.ts" @@ -13264,10 +13247,6 @@ "plugin": "@kbn/visualization-ui-components", "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter.ts" - }, { "plugin": "observability", "path": "x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts" @@ -13292,6 +13271,10 @@ "plugin": "observability", "path": "x-pack/plugins/observability/public/components/custom_threshold/components/alert_details_app_section.tsx" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" @@ -13516,18 +13499,6 @@ "plugin": "dataViews", "path": "src/plugins/data_views/common/data_views/data_view.ts" }, - { - "plugin": "logsShared", - "path": "x-pack/plugins/logs_shared/common/log_views/resolved_log_view.ts" - }, - { - "plugin": "dataViews", - "path": "src/plugins/data_views/server/rest_api_routes/public/update_data_view.ts" - }, - { - "plugin": "dataViews", - "path": "src/plugins/data_views/server/rest_api_routes/public/update_data_view.ts" - }, { "plugin": "savedObjectsManagement", "path": "src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx" @@ -13580,145 +13551,153 @@ "plugin": "lens", "path": "x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx" }, + { + "plugin": "dataViews", + "path": "src/plugins/data_views/server/rest_api_routes/public/update_data_view.ts" + }, + { + "plugin": "dataViews", + "path": "src/plugins/data_views/server/rest_api_routes/public/update_data_view.ts" + }, { "plugin": "triggersActionsUi", "path": "x-pack/plugins/triggers_actions_ui/public/common/lib/data_apis.ts" }, { - "plugin": "dataVisualizer", - "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_data_visualizer_grid_data.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx" + "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts" + "path": "x-pack/plugins/ml/server/lib/alerts/alerting_service.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + "plugin": "apm", + "path": "x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/utils/observability_data_views/observability_data_views.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" + "plugin": "logsShared", + "path": "x-pack/plugins/logs_shared/common/log_views/resolved_log_view.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/boundary_form.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/entity_form.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/rule_types/components/data_view_select_popover.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_data_visualizer_grid_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span_estimator/estimate_bucket_span.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx" + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/lib/alerts/alerting_service.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/server/search_strategy/index_fields/index.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx" }, { - "plugin": "apm", - "path": "x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/utils/observability_data_views/observability_data_views.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span_estimator/estimate_bucket_span.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/boundary_form.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/entity_form.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/rule_types/components/data_view_select_popover.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx" }, { "plugin": "infra", @@ -13808,6 +13787,10 @@ "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/server/lib/get_fields.ts" }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/server/search_strategy/index_fields/index.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/common/containers/sourcerer/create_sourcerer_data_view.ts" @@ -21009,10 +20992,6 @@ "plugin": "@kbn/visualization-ui-components", "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter.ts" - }, { "plugin": "observability", "path": "x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts" @@ -21037,6 +21016,10 @@ "plugin": "observability", "path": "x-pack/plugins/observability/public/components/custom_threshold/components/alert_details_app_section.tsx" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" @@ -21261,18 +21244,6 @@ "plugin": "dataViews", "path": "src/plugins/data_views/common/data_views/data_view.ts" }, - { - "plugin": "logsShared", - "path": "x-pack/plugins/logs_shared/common/log_views/resolved_log_view.ts" - }, - { - "plugin": "dataViews", - "path": "src/plugins/data_views/server/rest_api_routes/public/update_data_view.ts" - }, - { - "plugin": "dataViews", - "path": "src/plugins/data_views/server/rest_api_routes/public/update_data_view.ts" - }, { "plugin": "savedObjectsManagement", "path": "src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx" @@ -21325,145 +21296,153 @@ "plugin": "lens", "path": "x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx" }, + { + "plugin": "dataViews", + "path": "src/plugins/data_views/server/rest_api_routes/public/update_data_view.ts" + }, + { + "plugin": "dataViews", + "path": "src/plugins/data_views/server/rest_api_routes/public/update_data_view.ts" + }, { "plugin": "triggersActionsUi", "path": "x-pack/plugins/triggers_actions_ui/public/common/lib/data_apis.ts" }, { - "plugin": "dataVisualizer", - "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_data_visualizer_grid_data.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx" + "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts" + "path": "x-pack/plugins/ml/server/lib/alerts/alerting_service.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + "plugin": "apm", + "path": "x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/utils/observability_data_views/observability_data_views.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" + "plugin": "logsShared", + "path": "x-pack/plugins/logs_shared/common/log_views/resolved_log_view.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/boundary_form.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/entity_form.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/rule_types/components/data_view_select_popover.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_data_visualizer_grid_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span_estimator/estimate_bucket_span.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx" + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/lib/alerts/alerting_service.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/server/search_strategy/index_fields/index.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx" }, { - "plugin": "apm", - "path": "x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/utils/observability_data_views/observability_data_views.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span_estimator/estimate_bucket_span.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/boundary_form.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/entity_form.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/rule_types/components/data_view_select_popover.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx" }, { "plugin": "infra", @@ -21553,6 +21532,10 @@ "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/server/lib/get_fields.ts" }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/server/search_strategy/index_fields/index.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/common/containers/sourcerer/create_sourcerer_data_view.ts" @@ -27718,18 +27701,6 @@ "deprecated": true, "trackAdoption": false, "references": [ - { - "plugin": "@kbn/core-saved-objects-api-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/utils/internal_utils.ts" - }, - { - "plugin": "@kbn/core-saved-objects-import-export-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/lib/collect_saved_objects.ts" - }, - { - "plugin": "@kbn/core-saved-objects-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/import_dashboards.ts" - }, { "plugin": "@kbn/core-saved-objects-api-browser", "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts" @@ -27742,6 +27713,22 @@ "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts" }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" + }, + { + "plugin": "@kbn/core-saved-objects-api-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/utils/internal_utils.ts" + }, + { + "plugin": "@kbn/core-saved-objects-import-export-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/lib/collect_saved_objects.ts" + }, + { + "plugin": "@kbn/core-saved-objects-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/import_dashboards.ts" + }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts" @@ -27754,6 +27741,22 @@ "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts" }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/server/sample_data/logs.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/server/sample_data/ecommerce.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/server/sample_data/flights.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" + }, { "plugin": "osquery", "path": "x-pack/plugins/osquery/server/routes/pack/read_pack_route.ts" @@ -27842,26 +27845,6 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/server/sample_data/logs.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/server/sample_data/ecommerce.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/server/sample_data/flights.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" - }, { "plugin": "alerting", "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" diff --git a/api_docs/data.mdx b/api_docs/data.mdx index 76c97d8b1bf9f..c60ee98bcae8f 100644 --- a/api_docs/data.mdx +++ b/api_docs/data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data title: "data" image: https://source.unsplash.com/400x175/?github description: API docs for the data plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data'] --- import dataObj from './data.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/k | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3310 | 33 | 2575 | 24 | +| 3311 | 33 | 2577 | 24 | ## Client diff --git a/api_docs/data_query.mdx b/api_docs/data_query.mdx index 4a3052e69dacb..8eed5453737fc 100644 --- a/api_docs/data_query.mdx +++ b/api_docs/data_query.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data-query title: "data.query" image: https://source.unsplash.com/400x175/?github description: API docs for the data.query plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.query'] --- import dataQueryObj from './data_query.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/k | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3310 | 33 | 2575 | 24 | +| 3311 | 33 | 2577 | 24 | ## Client diff --git a/api_docs/data_search.devdocs.json b/api_docs/data_search.devdocs.json index f79d7c49a2f89..f0a4baedc0261 100644 --- a/api_docs/data_search.devdocs.json +++ b/api_docs/data_search.devdocs.json @@ -16128,6 +16128,39 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "data", + "id": "def-common.isMultiFieldKey", + "type": "Function", + "tags": [], + "label": "isMultiFieldKey", + "description": [], + "signature": [ + "(field: unknown) => boolean" + ], + "path": "src/plugins/data/common/search/aggs/buckets/multi_field_key.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.isMultiFieldKey.$1", + "type": "Unknown", + "tags": [], + "label": "field", + "description": [], + "signature": [ + "unknown" + ], + "path": "src/plugins/data/common/search/aggs/buckets/multi_field_key.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "data", "id": "def-common.isNumberType", @@ -28023,23 +28056,6 @@ "path": "src/plugins/data/common/search/types.ts", "deprecated": false, "trackAdoption": false - }, - { - "parentPluginId": "data", - "id": "def-common.IKibanaSearchResponse.requestParams", - "type": "Object", - "tags": [], - "label": "requestParams", - "description": [ - "\nHTTP request parameters from elasticsearch transport client t" - ], - "signature": [ - "ConnectionRequestParams", - " | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false, - "trackAdoption": false } ], "initialIsOpen": false @@ -35052,6 +35068,23 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "data", + "id": "def-common.MULTI_FIELD_KEY_SEPARATOR", + "type": "string", + "tags": [], + "label": "MULTI_FIELD_KEY_SEPARATOR", + "description": [ + "\nMulti-field key separator used in Visualizations (Lens, AggBased, TSVB).\nThis differs from the separator used in the toString method of the MultiFieldKey" + ], + "signature": [ + "\" › \"" + ], + "path": "src/plugins/data/common/search/aggs/buckets/multi_field_key.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "data", "id": "def-common.NumericalRangeOutput", diff --git a/api_docs/data_search.mdx b/api_docs/data_search.mdx index 55c7a1cd37548..e7caee8f95917 100644 --- a/api_docs/data_search.mdx +++ b/api_docs/data_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data-search title: "data.search" image: https://source.unsplash.com/400x175/?github description: API docs for the data.search plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.search'] --- import dataSearchObj from './data_search.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/k | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3310 | 33 | 2575 | 24 | +| 3311 | 33 | 2577 | 24 | ## Client diff --git a/api_docs/data_view_editor.mdx b/api_docs/data_view_editor.mdx index 523efeb3c400b..c324604693ced 100644 --- a/api_docs/data_view_editor.mdx +++ b/api_docs/data_view_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewEditor title: "dataViewEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewEditor plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewEditor'] --- import dataViewEditorObj from './data_view_editor.devdocs.json'; diff --git a/api_docs/data_view_field_editor.mdx b/api_docs/data_view_field_editor.mdx index 34b59f7b16539..ac10e1f38cbd2 100644 --- a/api_docs/data_view_field_editor.mdx +++ b/api_docs/data_view_field_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewFieldEditor title: "dataViewFieldEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewFieldEditor plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewFieldEditor'] --- import dataViewFieldEditorObj from './data_view_field_editor.devdocs.json'; diff --git a/api_docs/data_view_management.mdx b/api_docs/data_view_management.mdx index c82cf17f02184..cc9788c023c7a 100644 --- a/api_docs/data_view_management.mdx +++ b/api_docs/data_view_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewManagement title: "dataViewManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewManagement plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewManagement'] --- import dataViewManagementObj from './data_view_management.devdocs.json'; diff --git a/api_docs/data_views.devdocs.json b/api_docs/data_views.devdocs.json index baaf0d95bec9c..aa6f12fb292d7 100644 --- a/api_docs/data_views.devdocs.json +++ b/api_docs/data_views.devdocs.json @@ -71,10 +71,6 @@ "plugin": "@kbn/visualization-ui-components", "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter.ts" - }, { "plugin": "observability", "path": "x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts" @@ -99,6 +95,10 @@ "plugin": "observability", "path": "x-pack/plugins/observability/public/components/custom_threshold/components/alert_details_app_section.tsx" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" @@ -307,10 +307,6 @@ "plugin": "@kbn/es-query", "path": "packages/kbn-es-query/src/kuery/functions/utils/get_full_field_name_node.test.ts" }, - { - "plugin": "data", - "path": "src/plugins/data/public/query/filter_manager/lib/get_display_value.ts" - }, { "plugin": "data", "path": "src/plugins/data/common/search/search_source/inspect/inspector_stats.ts" @@ -321,15 +317,15 @@ }, { "plugin": "data", - "path": "src/plugins/data/public/search/errors/painless_error.tsx" + "path": "src/plugins/data/common/search/aggs/param_types/field.ts" }, { "plugin": "data", - "path": "src/plugins/data/common/search/aggs/param_types/field.ts" + "path": "src/plugins/data/public/query/filter_manager/lib/get_display_value.ts" }, { - "plugin": "logsShared", - "path": "x-pack/plugins/logs_shared/common/log_views/resolved_log_view.ts" + "plugin": "data", + "path": "src/plugins/data/public/search/errors/painless_error.tsx" }, { "plugin": "savedObjectsManagement", @@ -388,140 +384,140 @@ "path": "x-pack/plugins/triggers_actions_ui/public/common/lib/data_apis.ts" }, { - "plugin": "dataVisualizer", - "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_data_visualizer_grid_data.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx" + "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts" + "path": "x-pack/plugins/ml/server/lib/alerts/alerting_service.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + "plugin": "apm", + "path": "x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/utils/observability_data_views/observability_data_views.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" + "plugin": "logsShared", + "path": "x-pack/plugins/logs_shared/common/log_views/resolved_log_view.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/boundary_form.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/entity_form.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/rule_types/components/data_view_select_popover.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_data_visualizer_grid_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span_estimator/estimate_bucket_span.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx" + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/lib/alerts/alerting_service.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/server/search_strategy/index_fields/index.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx" }, { - "plugin": "apm", - "path": "x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/utils/observability_data_views/observability_data_views.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span_estimator/estimate_bucket_span.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/boundary_form.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/entity_form.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/rule_types/components/data_view_select_popover.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx" }, { "plugin": "infra", @@ -611,6 +607,10 @@ "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/server/lib/get_fields.ts" }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/server/search_strategy/index_fields/index.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/common/containers/sourcerer/create_sourcerer_data_view.ts" @@ -8064,10 +8064,6 @@ "plugin": "@kbn/visualization-ui-components", "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter.ts" - }, { "plugin": "observability", "path": "x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts" @@ -8092,6 +8088,10 @@ "plugin": "observability", "path": "x-pack/plugins/observability/public/components/custom_threshold/components/alert_details_app_section.tsx" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" @@ -8300,10 +8300,6 @@ "plugin": "@kbn/es-query", "path": "packages/kbn-es-query/src/kuery/functions/utils/get_full_field_name_node.test.ts" }, - { - "plugin": "data", - "path": "src/plugins/data/public/query/filter_manager/lib/get_display_value.ts" - }, { "plugin": "data", "path": "src/plugins/data/common/search/search_source/inspect/inspector_stats.ts" @@ -8314,15 +8310,15 @@ }, { "plugin": "data", - "path": "src/plugins/data/public/search/errors/painless_error.tsx" + "path": "src/plugins/data/common/search/aggs/param_types/field.ts" }, { "plugin": "data", - "path": "src/plugins/data/common/search/aggs/param_types/field.ts" + "path": "src/plugins/data/public/query/filter_manager/lib/get_display_value.ts" }, { - "plugin": "logsShared", - "path": "x-pack/plugins/logs_shared/common/log_views/resolved_log_view.ts" + "plugin": "data", + "path": "src/plugins/data/public/search/errors/painless_error.tsx" }, { "plugin": "savedObjectsManagement", @@ -8381,140 +8377,140 @@ "path": "x-pack/plugins/triggers_actions_ui/public/common/lib/data_apis.ts" }, { - "plugin": "dataVisualizer", - "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_data_visualizer_grid_data.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx" + "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts" + "path": "x-pack/plugins/ml/server/lib/alerts/alerting_service.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + "plugin": "apm", + "path": "x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/utils/observability_data_views/observability_data_views.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" + "plugin": "logsShared", + "path": "x-pack/plugins/logs_shared/common/log_views/resolved_log_view.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/boundary_form.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/entity_form.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/rule_types/components/data_view_select_popover.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_data_visualizer_grid_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span_estimator/estimate_bucket_span.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx" + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/lib/alerts/alerting_service.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/server/search_strategy/index_fields/index.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx" }, { - "plugin": "apm", - "path": "x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/utils/observability_data_views/observability_data_views.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span_estimator/estimate_bucket_span.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/boundary_form.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/entity_form.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/rule_types/components/data_view_select_popover.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx" }, { "plugin": "infra", @@ -8604,6 +8600,10 @@ "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/server/lib/get_fields.ts" }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/server/search_strategy/index_fields/index.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/common/containers/sourcerer/create_sourcerer_data_view.ts" @@ -15118,10 +15118,6 @@ "plugin": "@kbn/visualization-ui-components", "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter.ts" - }, { "plugin": "observability", "path": "x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts" @@ -15146,6 +15142,10 @@ "plugin": "observability", "path": "x-pack/plugins/observability/public/components/custom_threshold/components/alert_details_app_section.tsx" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" @@ -15354,10 +15354,6 @@ "plugin": "@kbn/es-query", "path": "packages/kbn-es-query/src/kuery/functions/utils/get_full_field_name_node.test.ts" }, - { - "plugin": "data", - "path": "src/plugins/data/public/query/filter_manager/lib/get_display_value.ts" - }, { "plugin": "data", "path": "src/plugins/data/common/search/search_source/inspect/inspector_stats.ts" @@ -15368,15 +15364,15 @@ }, { "plugin": "data", - "path": "src/plugins/data/public/search/errors/painless_error.tsx" + "path": "src/plugins/data/common/search/aggs/param_types/field.ts" }, { "plugin": "data", - "path": "src/plugins/data/common/search/aggs/param_types/field.ts" + "path": "src/plugins/data/public/query/filter_manager/lib/get_display_value.ts" }, { - "plugin": "logsShared", - "path": "x-pack/plugins/logs_shared/common/log_views/resolved_log_view.ts" + "plugin": "data", + "path": "src/plugins/data/public/search/errors/painless_error.tsx" }, { "plugin": "savedObjectsManagement", @@ -15435,140 +15431,140 @@ "path": "x-pack/plugins/triggers_actions_ui/public/common/lib/data_apis.ts" }, { - "plugin": "dataVisualizer", - "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_data_visualizer_grid_data.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx" + "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts" + "path": "x-pack/plugins/ml/server/lib/alerts/alerting_service.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + "plugin": "apm", + "path": "x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/utils/observability_data_views/observability_data_views.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" + "plugin": "logsShared", + "path": "x-pack/plugins/logs_shared/common/log_views/resolved_log_view.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/boundary_form.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/entity_form.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/rule_types/components/data_view_select_popover.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_data_visualizer_grid_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span_estimator/estimate_bucket_span.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx" + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/lib/alerts/alerting_service.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/server/search_strategy/index_fields/index.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx" }, { - "plugin": "apm", - "path": "x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/utils/observability_data_views/observability_data_views.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span_estimator/estimate_bucket_span.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/boundary_form.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/entity_form.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/rule_types/components/data_view_select_popover.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx" }, { "plugin": "infra", @@ -15658,6 +15654,10 @@ "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/server/lib/get_fields.ts" }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/server/search_strategy/index_fields/index.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/common/containers/sourcerer/create_sourcerer_data_view.ts" @@ -24366,18 +24366,6 @@ "deprecated": true, "trackAdoption": false, "references": [ - { - "plugin": "@kbn/core-saved-objects-api-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/utils/internal_utils.ts" - }, - { - "plugin": "@kbn/core-saved-objects-import-export-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/lib/collect_saved_objects.ts" - }, - { - "plugin": "@kbn/core-saved-objects-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/import_dashboards.ts" - }, { "plugin": "@kbn/core-saved-objects-api-browser", "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts" @@ -24390,6 +24378,22 @@ "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts" }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" + }, + { + "plugin": "@kbn/core-saved-objects-api-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/utils/internal_utils.ts" + }, + { + "plugin": "@kbn/core-saved-objects-import-export-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/lib/collect_saved_objects.ts" + }, + { + "plugin": "@kbn/core-saved-objects-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/import_dashboards.ts" + }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts" @@ -24402,6 +24406,22 @@ "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts" }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/server/sample_data/logs.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/server/sample_data/ecommerce.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/server/sample_data/flights.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" + }, { "plugin": "osquery", "path": "x-pack/plugins/osquery/server/routes/pack/read_pack_route.ts" @@ -24490,26 +24510,6 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/server/sample_data/logs.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/server/sample_data/ecommerce.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/server/sample_data/flights.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" - }, { "plugin": "alerting", "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" diff --git a/api_docs/data_views.mdx b/api_docs/data_views.mdx index ae7cee83fdaf7..27437fcd766fb 100644 --- a/api_docs/data_views.mdx +++ b/api_docs/data_views.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViews title: "dataViews" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViews plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViews'] --- import dataViewsObj from './data_views.devdocs.json'; diff --git a/api_docs/data_visualizer.mdx b/api_docs/data_visualizer.mdx index 57fc66f96769e..0e76079c026b7 100644 --- a/api_docs/data_visualizer.mdx +++ b/api_docs/data_visualizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataVisualizer title: "dataVisualizer" image: https://source.unsplash.com/400x175/?github description: API docs for the dataVisualizer plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataVisualizer'] --- import dataVisualizerObj from './data_visualizer.devdocs.json'; diff --git a/api_docs/deprecations_by_api.mdx b/api_docs/deprecations_by_api.mdx index 4bf60fbe5107a..f62330c24105c 100644 --- a/api_docs/deprecations_by_api.mdx +++ b/api_docs/deprecations_by_api.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsByApi slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-api title: Deprecated API usage by API description: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -16,36 +16,37 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Referencing plugin(s) | Remove By | | ---------------|-----------|-----------| -| | ml, stackAlerts | - | -| | ruleRegistry, ml, securitySolution, observability, infra, monitoring, stackAlerts, synthetics, transform, uptime | - | -| | @kbn/es-query, @kbn/visualization-ui-components, securitySolution, observability, timelines, lists, threatIntelligence, savedSearch, dataViews, logsShared, savedObjectsManagement, unifiedSearch, controls, @kbn/unified-field-list, lens, triggersActionsUi, dataVisualizer, ml, apm, exploratoryView, fleet, stackAlerts, infra, canvas, presentationUtil, enterpriseSearch, graph, visTypeTimeseries, transform, upgradeAssistant, uptime, ux, maps, dataViewManagement, eventAnnotationListing, inputControlVis, visDefaultEditor, visTypeTimelion, visTypeVega, data | - | -| | @kbn/es-query, @kbn/visualization-ui-components, securitySolution, observability, timelines, lists, threatIntelligence, savedSearch, dataViews, logsShared, savedObjectsManagement, unifiedSearch, controls, @kbn/unified-field-list, lens, triggersActionsUi, dataVisualizer, ml, apm, exploratoryView, fleet, stackAlerts, infra, canvas, presentationUtil, enterpriseSearch, graph, visTypeTimeseries, transform, upgradeAssistant, uptime, ux, maps, dataViewManagement, eventAnnotationListing, inputControlVis, visDefaultEditor, visTypeTimelion, visTypeVega, data | - | -| | @kbn/es-query, @kbn/visualization-ui-components, securitySolution, observability, timelines, lists, threatIntelligence, savedSearch, data, logsShared, savedObjectsManagement, unifiedSearch, controls, @kbn/unified-field-list, lens, triggersActionsUi, dataVisualizer, ml, apm, exploratoryView, fleet, stackAlerts, infra, canvas, presentationUtil, enterpriseSearch, graph, visTypeTimeseries, transform, upgradeAssistant, uptime, ux, maps, dataViewManagement, eventAnnotationListing, inputControlVis, visDefaultEditor, visTypeTimelion, visTypeVega | - | -| | home, data, esUiShared, savedObjectsManagement, ml, exploratoryView, fleet, observability, apm, indexLifecycleManagement, observabilityOnboarding, synthetics, upgradeAssistant, uptime, ux, kibanaOverview | - | -| | share, uiActions, guidedOnboarding, home, serverless, management, spaces, security, savedObjects, indexManagement, visualizations, controls, dashboard, savedObjectsTagging, expressionXY, lens, expressionMetricVis, expressionGauge, alerting, triggersActionsUi, cases, licenseManagement, advancedSettings, maps, dataVisualizer, aiops, ml, exploratoryView, fleet, infra, profiling, apm, expressionImage, expressionMetric, expressionError, expressionRevealImage, expressionRepeatImage, expressionShape, crossClusterReplication, enterpriseSearch, globalSearchBar, graph, grokdebugger, indexLifecycleManagement, ingestPipelines, logstash, monitoring, observabilityOnboarding, osquery, devTools, painlessLab, remoteClusters, rollup, searchprofiler, newsfeed, securitySolution, snapshotRestore, synthetics, transform, upgradeAssistant, uptime, ux, watcher, cloudDataMigration, console, filesManagement, kibanaOverview, visDefaultEditor, expressionHeatmap, expressionLegacyMetricVis, expressionPartitionVis, expressionTagcloud, visTypeTable, visTypeTimelion, visTypeTimeseries, visTypeVega, visTypeVislib | - | -| | encryptedSavedObjects, actions, data, ml, securitySolution, logstash, cloudChat | - | -| | actions, ml, savedObjectsTagging, enterpriseSearch | - | -| | @kbn/core-saved-objects-browser-internal, @kbn/core, savedObjects, visualizations, dataVisualizer, ml, aiops, dashboardEnhanced, graph, lens, securitySolution, eventAnnotation, @kbn/core-saved-objects-browser-mocks | - | -| | @kbn/core, ml, savedObjects, embeddable, visualizations, canvas, graph, @kbn/core-saved-objects-common, @kbn/core-saved-objects-server, actions, alerting, securitySolution, savedSearch, enterpriseSearch, taskManager, @kbn/core-saved-objects-server-internal, @kbn/core-saved-objects-api-server | - | +| | stackAlerts, ml | - | +| | ruleRegistry, observability, ml, infra, monitoring, securitySolution, stackAlerts, synthetics, transform, uptime | - | | | stackAlerts, alerting, securitySolution, inputControlVis | - | | | stackAlerts, infra, graph, inputControlVis, securitySolution, savedObjects | - | -| | dashboard, dataVisualizer, stackAlerts, expressionPartitionVis | - | +| | dashboard, stackAlerts, dataVisualizer, expressionPartitionVis | - | +| | @kbn/es-query, @kbn/visualization-ui-components, observability, securitySolution, timelines, lists, threatIntelligence, savedSearch, dataViews, savedObjectsManagement, unifiedSearch, controls, @kbn/unified-field-list, lens, triggersActionsUi, ml, apm, exploratoryView, logsShared, fleet, stackAlerts, dataVisualizer, infra, canvas, presentationUtil, enterpriseSearch, graph, visTypeTimeseries, transform, upgradeAssistant, uptime, ux, maps, dataViewManagement, eventAnnotationListing, inputControlVis, visDefaultEditor, visTypeTimelion, visTypeVega, data | - | | | stackAlerts, alerting, securitySolution, inputControlVis | - | +| | @kbn/es-query, @kbn/visualization-ui-components, observability, securitySolution, timelines, lists, threatIntelligence, savedSearch, dataViews, savedObjectsManagement, unifiedSearch, controls, @kbn/unified-field-list, lens, triggersActionsUi, ml, apm, exploratoryView, logsShared, fleet, stackAlerts, dataVisualizer, infra, canvas, presentationUtil, enterpriseSearch, graph, visTypeTimeseries, transform, upgradeAssistant, uptime, ux, maps, dataViewManagement, eventAnnotationListing, inputControlVis, visDefaultEditor, visTypeTimelion, visTypeVega, data | - | +| | @kbn/es-query, @kbn/visualization-ui-components, observability, securitySolution, timelines, lists, threatIntelligence, savedSearch, data, savedObjectsManagement, unifiedSearch, controls, @kbn/unified-field-list, lens, triggersActionsUi, ml, apm, exploratoryView, logsShared, fleet, stackAlerts, dataVisualizer, infra, canvas, presentationUtil, enterpriseSearch, graph, visTypeTimeseries, transform, upgradeAssistant, uptime, ux, maps, dataViewManagement, eventAnnotationListing, inputControlVis, visDefaultEditor, visTypeTimelion, visTypeVega | - | +| | home, data, esUiShared, savedObjectsManagement, exploratoryView, fleet, observability, ml, apm, indexLifecycleManagement, observabilityOnboarding, synthetics, upgradeAssistant, uptime, ux, kibanaOverview | - | +| | share, uiActions, guidedOnboarding, home, serverless, management, spaces, savedObjects, indexManagement, visualizations, controls, dashboard, savedObjectsTagging, expressionXY, lens, expressionMetricVis, expressionGauge, security, alerting, triggersActionsUi, cases, aiops, exploratoryView, fleet, licenseManagement, advancedSettings, maps, dataVisualizer, ml, infra, profiling, apm, expressionImage, expressionMetric, expressionError, expressionRevealImage, expressionRepeatImage, expressionShape, crossClusterReplication, enterpriseSearch, globalSearchBar, graph, grokdebugger, indexLifecycleManagement, ingestPipelines, logstash, monitoring, observabilityOnboarding, osquery, devTools, painlessLab, remoteClusters, rollup, searchprofiler, newsfeed, securitySolution, snapshotRestore, synthetics, transform, upgradeAssistant, uptime, ux, watcher, cloudDataMigration, console, filesManagement, kibanaOverview, visDefaultEditor, expressionHeatmap, expressionLegacyMetricVis, expressionPartitionVis, expressionTagcloud, visTypeTable, visTypeTimelion, visTypeTimeseries, visTypeVega, visTypeVislib | - | +| | encryptedSavedObjects, actions, data, ml, logstash, securitySolution, cloudChat | - | +| | actions, ml, savedObjectsTagging, enterpriseSearch | - | +| | @kbn/core-saved-objects-browser-internal, @kbn/core, savedObjects, visualizations, aiops, ml, dataVisualizer, dashboardEnhanced, graph, lens, securitySolution, eventAnnotation, @kbn/core-saved-objects-browser-mocks | - | +| | @kbn/core, savedObjects, embeddable, visualizations, canvas, graph, ml, @kbn/core-saved-objects-common, @kbn/core-saved-objects-server, actions, alerting, savedSearch, enterpriseSearch, securitySolution, taskManager, @kbn/core-saved-objects-server-internal, @kbn/core-saved-objects-api-server | - | +| | observability, @kbn/securitysolution-data-table, securitySolution | - | +| | monitoring | - | +| | inspector, data, savedObjects, runtimeFields, indexManagement, dataViewEditor, unifiedSearch, embeddable, visualizations, controls, dashboard, licensing, savedObjectsTagging, dataViewFieldEditor, lens, security, triggersActionsUi, cases, observabilityShared, exploratoryView, fleet, telemetry, advancedSettings, maps, banners, reporting, timelines, cloudSecurityPosture, dashboardEnhanced, imageEmbeddable, graph, monitoring, securitySolution, synthetics, uptime, cloudLinks, console, dataViewManagement, eventAnnotationListing, filesManagement, uiActions, visTypeVislib | - | | | alerting, discover, securitySolution | - | -| | @kbn/core-saved-objects-api-server-internal, @kbn/core-saved-objects-import-export-server-internal, @kbn/core-saved-objects-server-internal, @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, fleet, osquery, securitySolution, @kbn/core-saved-objects-browser-mocks, graph, lists, alerting | - | -| | @kbn/core-saved-objects-api-server-internal, @kbn/core-saved-objects-import-export-server-internal, @kbn/core-saved-objects-server-internal, @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, fleet, osquery, securitySolution, @kbn/core-saved-objects-browser-mocks, graph, lists, alerting | - | +| | @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-browser-mocks, @kbn/core-saved-objects-api-server-internal, @kbn/core-saved-objects-import-export-server-internal, @kbn/core-saved-objects-server-internal, fleet, graph, lists, osquery, securitySolution, alerting | - | +| | @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-browser-mocks, @kbn/core-saved-objects-api-server-internal, @kbn/core-saved-objects-import-export-server-internal, @kbn/core-saved-objects-server-internal, fleet, graph, lists, osquery, securitySolution, alerting | - | | | alerting, discover, securitySolution | - | | | securitySolution | - | -| | inspector, data, licensing, security, savedObjects, runtimeFields, indexManagement, dataViewEditor, unifiedSearch, embeddable, visualizations, controls, dashboard, savedObjectsTagging, dataViewFieldEditor, lens, triggersActionsUi, cases, observabilityShared, telemetry, advancedSettings, maps, exploratoryView, fleet, observability, banners, reporting, timelines, cloudSecurityPosture, dashboardEnhanced, imageEmbeddable, graph, monitoring, securitySolution, synthetics, uptime, cloudLinks, console, dataViewManagement, eventAnnotationListing, filesManagement, uiActions, visTypeVislib | - | -| | observability, @kbn/securitysolution-data-table, securitySolution | - | | | @kbn/securitysolution-data-table, securitySolution | - | | | securitySolution | - | | | securitySolution, @kbn/securitysolution-data-table | - | | | securitySolution, @kbn/securitysolution-data-table | - | | | securitySolution | - | | | securitySolution | - | -| | @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, @kbn/core, savedObjectsTaggingOss, savedObjectsTagging, securitySolution, lists, upgradeAssistant, savedObjectsManagement, @kbn/core-saved-objects-api-server, @kbn/core-saved-objects-import-export-server-internal, home, canvas, savedObjects, @kbn/core-saved-objects-browser-mocks, @kbn/core-ui-settings-server-internal | - | -| | @kbn/core-saved-objects-migration-server-internal, actions, dataViews, data, alerting, lens, lists, cases, savedObjectsTagging, securitySolution, savedSearch, canvas, graph, visualizations, maps, dashboard, @kbn/core-test-helpers-so-type-serializer | - | +| | @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-api-server, @kbn/core, home, savedObjectsTagging, canvas, savedObjects, @kbn/core-saved-objects-browser-mocks, @kbn/core-saved-objects-import-export-server-internal, savedObjectsTaggingOss, lists, securitySolution, upgradeAssistant, savedObjectsManagement, @kbn/core-ui-settings-server-internal | - | +| | @kbn/core-saved-objects-migration-server-internal, actions, dataViews, data, alerting, lens, cases, savedObjectsTagging, savedSearch, canvas, graph, visualizations, lists, maps, securitySolution, dashboard, @kbn/core-test-helpers-so-type-serializer | - | | | lists, securitySolution, @kbn/securitysolution-io-ts-list-types | - | | | lists, securitySolution, @kbn/securitysolution-io-ts-list-types | - | | | lists, securitySolution, @kbn/securitysolution-io-ts-list-types | - | @@ -58,26 +59,22 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | securitySolution | - | | | securitySolution | - | | | securitySolution | - | -| | monitoring | - | -| | dataVisualizer, exploratoryView, fleet, cloudSecurityPosture, discoverEnhanced, osquery, synthetics | - | +| | exploratoryView, fleet, dataVisualizer, cloudSecurityPosture, discoverEnhanced, osquery, synthetics | - | | | @kbn/core-plugins-browser-internal, @kbn/core-root-browser-internal, home, savedObjects, unifiedSearch, visualizations, fileUpload, dashboardEnhanced, transform, discover, dataVisualizer | - | -| | @kbn/core, @kbn/core-lifecycle-browser, @kbn/core-saved-objects-browser-internal, visualizations, exploratoryView, transform, @kbn/core-saved-objects-browser-mocks | - | +| | @kbn/core-lifecycle-browser, @kbn/core-saved-objects-browser-internal, @kbn/core, visualizations, exploratoryView, transform, @kbn/core-saved-objects-browser-mocks | - | | | actions, alerting | - | | | discover | - | | | data, discover, imageEmbeddable, embeddable | - | | | @kbn/core-saved-objects-browser-mocks, discover, @kbn/core-saved-objects-browser-internal | - | | | advancedSettings, discover, @kbn/management-settings-field-definition | - | -| | @kbn/core-saved-objects-api-server-internal | - | -| | @kbn/core-saved-objects-api-server-internal | - | -| | @kbn/core-saved-objects-api-server-internal, canvas, @kbn/core-saved-objects-browser-internal | - | -| | @kbn/core, kibanaUtils, expressions, data, savedObjectsTaggingOss, embeddable, visualizations, controls, savedObjectsTagging, uiActionsEnhanced, lens, maps, canvas, dashboardEnhanced, globalSearchProviders, @kbn/core-saved-objects-api-browser, savedObjects, savedObjectsManagement, eventAnnotation, graph, dashboard | - | +| | @kbn/core-saved-objects-api-browser, @kbn/core, savedObjects, savedObjectsManagement, visualizations, savedObjectsTagging, eventAnnotation, lens, graph, dashboard, savedObjectsTaggingOss, kibanaUtils, expressions, data, embeddable, controls, uiActionsEnhanced, maps, canvas, dashboardEnhanced, globalSearchProviders | - | | | @kbn/core-saved-objects-browser, @kbn/core-saved-objects-browser-internal, @kbn/core, home, savedObjects, visualizations, lens, visTypeTimeseries, @kbn/core-saved-objects-browser-mocks | - | -| | @kbn/core-saved-objects-browser-internal, savedObjects, @kbn/core-saved-objects-browser-mocks | - | -| | home, @kbn/core-saved-objects-browser-mocks, @kbn/core-saved-objects-browser-internal | - | -| | @kbn/core-saved-objects-browser-internal, savedObjects, visualizations, @kbn/core-saved-objects-browser-mocks | - | +| | @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-browser-mocks, savedObjects | - | +| | @kbn/core-saved-objects-browser-mocks, home, @kbn/core-saved-objects-browser-internal | - | +| | @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-browser-mocks, savedObjects, visualizations | - | | | @kbn/core-saved-objects-browser-mocks, @kbn/core-saved-objects-browser-internal | - | -| | savedObjects, @kbn/core-saved-objects-browser-mocks, dashboardEnhanced, @kbn/core-saved-objects-browser-internal | - | -| | savedObjects, @kbn/core-saved-objects-browser-mocks, dashboardEnhanced, @kbn/core-saved-objects-browser-internal | - | +| | @kbn/core-saved-objects-browser-mocks, savedObjects, dashboardEnhanced, @kbn/core-saved-objects-browser-internal | - | +| | @kbn/core-saved-objects-browser-mocks, savedObjects, dashboardEnhanced, @kbn/core-saved-objects-browser-internal | - | | | @kbn/core-saved-objects-browser-mocks, savedObjects, @kbn/core-saved-objects-browser-internal | - | | | @kbn/core-saved-objects-browser-mocks, @kbn/core-saved-objects-browser-internal | - | | | @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-browser-mocks, savedObjects | - | @@ -86,17 +83,20 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | @kbn/core-saved-objects-browser-internal | - | | | @kbn/core-saved-objects-browser-internal | - | | | @kbn/core-saved-objects-browser-internal, @kbn/core, savedObjects, visualizations, graph | - | +| | @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-api-server-internal, canvas | - | | | @kbn/core-saved-objects-browser-internal, @kbn/core | - | | | @kbn/core-saved-objects-browser-internal, @kbn/core | - | | | @kbn/core-saved-objects-browser-internal, @kbn/core | - | | | @kbn/core-saved-objects-browser-internal, @kbn/core | - | -| | @kbn/core-saved-objects-browser-internal, @kbn/core, cases, spaces, savedSearch, visualizations, lens, maps, canvas, graph | - | +| | @kbn/core-saved-objects-browser-internal, @kbn/core, spaces, savedSearch, visualizations, lens, cases, maps, canvas, graph | - | | | @kbn/core-saved-objects-browser-internal, @kbn/core | - | | | @kbn/core-saved-objects-browser-internal, @kbn/core | - | | | @kbn/core-saved-objects-browser-internal, @kbn/core | - | | | @kbn/core-saved-objects-browser-internal, @kbn/core | - | | | @kbn/core-saved-objects-browser-internal | - | | | @kbn/core-root-browser-internal, @kbn/core-saved-objects-browser-mocks | - | +| | @kbn/core-saved-objects-api-server-internal | - | +| | @kbn/core-saved-objects-api-server-internal | - | | | graph, visTypeTimeseries, dataViewManagement, dataViews | - | | | graph, visTypeTimeseries, dataViewManagement, dataViews | - | | | graph, visTypeTimeseries, dataViewManagement | - | @@ -139,13 +139,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | @kbn/core-lifecycle-browser-mocks, @kbn/core, @kbn/core-plugins-browser-internal | - | | | @kbn/core | - | | | @kbn/core-plugins-server-internal | - | -| | security, licenseManagement, aiops, ml, profiling, apm, crossClusterReplication, logstash, painlessLab, searchprofiler, watcher | 8.8.0 | -| | spaces, security, actions, alerting, ml, osquery, securitySolution, remoteClusters, graph, indexLifecycleManagement, mapsEms, painlessLab, rollup, searchprofiler, snapshotRestore, transform, upgradeAssistant | 8.8.0 | +| | security, aiops, licenseManagement, ml, profiling, apm, crossClusterReplication, logstash, painlessLab, searchprofiler, watcher | 8.8.0 | +| | spaces, security, actions, alerting, ml, remoteClusters, graph, indexLifecycleManagement, mapsEms, osquery, securitySolution, painlessLab, rollup, searchprofiler, snapshotRestore, transform, upgradeAssistant | 8.8.0 | | | apm, fleet, security, securitySolution | 8.8.0 | | | apm, fleet, security, securitySolution | 8.8.0 | | | spaces, security, alerting | 8.8.0 | | | embeddable, presentationUtil, dashboard, lens, discover, graph | 8.8.0 | -| | @kbn/core-application-browser-internal, management, @kbn/core-application-browser-mocks, fleet, security, kibanaOverview, @kbn/core | 8.8.0 | +| | @kbn/core-application-browser-internal, @kbn/core-application-browser-mocks, management, fleet, security, kibanaOverview, @kbn/core | 8.8.0 | | | apm | 8.8.0 | | | security | 8.8.0 | | | mapsEms | 8.8.0 | diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index 70748cc0ec64b..247aebf5885fb 100644 --- a/api_docs/deprecations_by_plugin.mdx +++ b/api_docs/deprecations_by_plugin.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsByPlugin slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-plugin title: Deprecated API usage by plugin description: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -40,14 +40,14 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [index.ts](https://github.com/elastic/kibana/tree/main/src/core/public/index.ts#:~:text=SavedObjectsBulkUpdateOptions) | - | | | [index.ts](https://github.com/elastic/kibana/tree/main/src/core/public/index.ts#:~:text=SavedObjectsBulkResolveResponse) | - | | | [index.ts](https://github.com/elastic/kibana/tree/main/src/core/public/index.ts#:~:text=SavedObjectsBulkCreateObject) | - | -| | [index.ts](https://github.com/elastic/kibana/tree/main/src/core/server/index.ts#:~:text=SavedObjectAttributes), [index.ts](https://github.com/elastic/kibana/tree/main/src/core/types/index.ts#:~:text=SavedObjectAttributes), [index.ts](https://github.com/elastic/kibana/tree/main/src/core/public/index.ts#:~:text=SavedObjectAttributes), [index.ts](https://github.com/elastic/kibana/tree/main/src/core/server/index.ts#:~:text=SavedObjectAttributes) | - | -| | [index.ts](https://github.com/elastic/kibana/tree/main/src/core/server/index.ts#:~:text=SavedObjectsStart), [index.ts](https://github.com/elastic/kibana/tree/main/src/core/public/index.ts#:~:text=SavedObjectsStart) | - | +| | [index.ts](https://github.com/elastic/kibana/tree/main/src/core/server/index.ts#:~:text=SavedObjectAttributes), [index.ts](https://github.com/elastic/kibana/tree/main/src/core/public/index.ts#:~:text=SavedObjectAttributes), [index.ts](https://github.com/elastic/kibana/tree/main/src/core/types/index.ts#:~:text=SavedObjectAttributes), [index.ts](https://github.com/elastic/kibana/tree/main/src/core/server/index.ts#:~:text=SavedObjectAttributes) | - | +| | [index.ts](https://github.com/elastic/kibana/tree/main/src/core/public/index.ts#:~:text=SavedObjectsStart), [index.ts](https://github.com/elastic/kibana/tree/main/src/core/server/index.ts#:~:text=SavedObjectsStart) | - | | | [mocks.ts](https://github.com/elastic/kibana/tree/main/src/core/public/mocks.ts#:~:text=savedObjectsServiceMock) | - | | | [mocks.ts](https://github.com/elastic/kibana/tree/main/src/core/public/mocks.ts#:~:text=simpleSavedObjectMock) | - | -| | [index.ts](https://github.com/elastic/kibana/tree/main/src/core/types/index.ts#:~:text=SavedObject), [index.ts](https://github.com/elastic/kibana/tree/main/src/core/public/index.ts#:~:text=SavedObject) | - | -| | [index.ts](https://github.com/elastic/kibana/tree/main/src/core/types/index.ts#:~:text=SavedObjectAttributeSingle), [index.ts](https://github.com/elastic/kibana/tree/main/src/core/public/index.ts#:~:text=SavedObjectAttributeSingle) | - | -| | [index.ts](https://github.com/elastic/kibana/tree/main/src/core/types/index.ts#:~:text=SavedObjectAttribute), [index.ts](https://github.com/elastic/kibana/tree/main/src/core/public/index.ts#:~:text=SavedObjectAttribute) | - | -| | [index.ts](https://github.com/elastic/kibana/tree/main/src/core/types/index.ts#:~:text=SavedObjectReference), [index.ts](https://github.com/elastic/kibana/tree/main/src/core/public/index.ts#:~:text=SavedObjectReference) | - | +| | [index.ts](https://github.com/elastic/kibana/tree/main/src/core/public/index.ts#:~:text=SavedObject), [index.ts](https://github.com/elastic/kibana/tree/main/src/core/types/index.ts#:~:text=SavedObject) | - | +| | [index.ts](https://github.com/elastic/kibana/tree/main/src/core/public/index.ts#:~:text=SavedObjectAttributeSingle), [index.ts](https://github.com/elastic/kibana/tree/main/src/core/types/index.ts#:~:text=SavedObjectAttributeSingle) | - | +| | [index.ts](https://github.com/elastic/kibana/tree/main/src/core/public/index.ts#:~:text=SavedObjectAttribute), [index.ts](https://github.com/elastic/kibana/tree/main/src/core/types/index.ts#:~:text=SavedObjectAttribute) | - | +| | [index.ts](https://github.com/elastic/kibana/tree/main/src/core/public/index.ts#:~:text=SavedObjectReference), [index.ts](https://github.com/elastic/kibana/tree/main/src/core/types/index.ts#:~:text=SavedObjectReference) | - | @@ -560,9 +560,9 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [get_display_value.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/query/filter_manager/lib/get_display_value.ts#:~:text=title), [inspector_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/search_source/inspect/inspector_stats.ts#:~:text=title), [response_writer.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/tabify/response_writer.ts#:~:text=title), [painless_error.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/search/errors/painless_error.tsx#:~:text=title), [field.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/param_types/field.ts#:~:text=title), [agg_config.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/agg_config.test.ts#:~:text=title), [_terms_other_bucket_helper.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.test.ts#:~:text=title), [multi_terms.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/multi_terms.test.ts#:~:text=title), [multi_terms.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/multi_terms.test.ts#:~:text=title), [rare_terms.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/rare_terms.test.ts#:~:text=title)+ 3 more | - | -| | [get_display_value.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/query/filter_manager/lib/get_display_value.ts#:~:text=title), [inspector_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/search_source/inspect/inspector_stats.ts#:~:text=title), [response_writer.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/tabify/response_writer.ts#:~:text=title), [painless_error.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/search/errors/painless_error.tsx#:~:text=title), [field.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/param_types/field.ts#:~:text=title), [agg_config.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/agg_config.test.ts#:~:text=title), [_terms_other_bucket_helper.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.test.ts#:~:text=title), [multi_terms.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/multi_terms.test.ts#:~:text=title), [multi_terms.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/multi_terms.test.ts#:~:text=title), [rare_terms.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/rare_terms.test.ts#:~:text=title)+ 3 more | - | -| | [get_display_value.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/query/filter_manager/lib/get_display_value.ts#:~:text=title), [inspector_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/search_source/inspect/inspector_stats.ts#:~:text=title), [response_writer.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/tabify/response_writer.ts#:~:text=title), [painless_error.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/search/errors/painless_error.tsx#:~:text=title), [field.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/param_types/field.ts#:~:text=title), [agg_config.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/agg_config.test.ts#:~:text=title), [_terms_other_bucket_helper.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.test.ts#:~:text=title), [multi_terms.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/multi_terms.test.ts#:~:text=title), [multi_terms.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/multi_terms.test.ts#:~:text=title), [rare_terms.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/rare_terms.test.ts#:~:text=title)+ 3 more | - | +| | [inspector_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/search_source/inspect/inspector_stats.ts#:~:text=title), [response_writer.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/tabify/response_writer.ts#:~:text=title), [field.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/param_types/field.ts#:~:text=title), [get_display_value.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/query/filter_manager/lib/get_display_value.ts#:~:text=title), [painless_error.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/search/errors/painless_error.tsx#:~:text=title), [agg_config.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/agg_config.test.ts#:~:text=title), [_terms_other_bucket_helper.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.test.ts#:~:text=title), [multi_terms.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/multi_terms.test.ts#:~:text=title), [multi_terms.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/multi_terms.test.ts#:~:text=title), [rare_terms.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/rare_terms.test.ts#:~:text=title)+ 3 more | - | +| | [inspector_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/search_source/inspect/inspector_stats.ts#:~:text=title), [response_writer.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/tabify/response_writer.ts#:~:text=title), [field.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/param_types/field.ts#:~:text=title), [get_display_value.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/query/filter_manager/lib/get_display_value.ts#:~:text=title), [painless_error.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/search/errors/painless_error.tsx#:~:text=title), [agg_config.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/agg_config.test.ts#:~:text=title), [_terms_other_bucket_helper.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.test.ts#:~:text=title), [multi_terms.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/multi_terms.test.ts#:~:text=title), [multi_terms.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/multi_terms.test.ts#:~:text=title), [rare_terms.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/rare_terms.test.ts#:~:text=title)+ 3 more | - | +| | [inspector_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/search_source/inspect/inspector_stats.ts#:~:text=title), [response_writer.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/tabify/response_writer.ts#:~:text=title), [field.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/param_types/field.ts#:~:text=title), [get_display_value.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/query/filter_manager/lib/get_display_value.ts#:~:text=title), [painless_error.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/search/errors/painless_error.tsx#:~:text=title), [agg_config.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/agg_config.test.ts#:~:text=title), [_terms_other_bucket_helper.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.test.ts#:~:text=title), [multi_terms.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/multi_terms.test.ts#:~:text=title), [multi_terms.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/multi_terms.test.ts#:~:text=title), [rare_terms.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/common/search/aggs/buckets/rare_terms.test.ts#:~:text=title)+ 3 more | - | | | [search_interceptor.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/search/search_interceptor/search_interceptor.ts#:~:text=toMountPoint), [search_interceptor.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/search/search_interceptor/search_interceptor.ts#:~:text=toMountPoint), [search_interceptor.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/search/search_interceptor/search_interceptor.ts#:~:text=toMountPoint), [search_interceptor.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/search/search_interceptor/search_interceptor.ts#:~:text=toMountPoint), [open_incomplete_results_modal_button.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/incomplete_results_modal/open_incomplete_results_modal_button.tsx#:~:text=toMountPoint), [open_incomplete_results_modal_button.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/incomplete_results_modal/open_incomplete_results_modal_button.tsx#:~:text=toMountPoint), [handle_warnings.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/search/fetch/handle_warnings.tsx#:~:text=toMountPoint), [handle_warnings.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/search/fetch/handle_warnings.tsx#:~:text=toMountPoint), [delete_button.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/search/session/sessions_mgmt/components/actions/delete_button.tsx#:~:text=toMountPoint), [delete_button.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/search/session/sessions_mgmt/components/actions/delete_button.tsx#:~:text=toMountPoint)+ 8 more | - | | | [get_columns.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/search/session/sessions_mgmt/lib/get_columns.tsx#:~:text=RedirectAppLinks), [get_columns.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/search/session/sessions_mgmt/lib/get_columns.tsx#:~:text=RedirectAppLinks), [get_columns.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/search/session/sessions_mgmt/lib/get_columns.tsx#:~:text=RedirectAppLinks), [connected_search_session_indicator.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/connected_search_session_indicator.tsx#:~:text=RedirectAppLinks), [connected_search_session_indicator.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/connected_search_session_indicator.tsx#:~:text=RedirectAppLinks), [connected_search_session_indicator.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/connected_search_session_indicator.tsx#:~:text=RedirectAppLinks) | - | | | [session_service.ts](https://github.com/elastic/kibana/tree/main/src/plugins/data/server/search/session/session_service.ts#:~:text=authc) | - | @@ -1082,7 +1082,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [find_object_by_title.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/persistence/saved_objects_utils/find_object_by_title.test.ts#:~:text=SimpleSavedObject), [find_object_by_title.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/persistence/saved_objects_utils/find_object_by_title.test.ts#:~:text=SimpleSavedObject) | - | | | [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/types.ts#:~:text=ResolvedSimpleSavedObject), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/types.ts#:~:text=ResolvedSimpleSavedObject), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/types.ts#:~:text=ResolvedSimpleSavedObject), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/types.ts#:~:text=ResolvedSimpleSavedObject) | - | | | [find_object_by_title.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/persistence/saved_objects_utils/find_object_by_title.test.ts#:~:text=simpleSavedObjectMock), [find_object_by_title.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/persistence/saved_objects_utils/find_object_by_title.test.ts#:~:text=simpleSavedObjectMock) | - | -| | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/common/embeddable_factory/index.ts#:~:text=SavedObjectReference), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/common/embeddable_factory/index.ts#:~:text=SavedObjectReference), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/common/embeddable_factory/index.ts#:~:text=SavedObjectReference), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/common/embeddable_factory/index.ts#:~:text=SavedObjectReference), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/common/embeddable_factory/index.ts#:~:text=SavedObjectReference), [saved_object_store.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/persistence/saved_object_store.ts#:~:text=SavedObjectReference), [saved_object_store.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/persistence/saved_object_store.ts#:~:text=SavedObjectReference), [saved_object_store.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/persistence/saved_object_store.ts#:~:text=SavedObjectReference), [selectors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/state_management/selectors.ts#:~:text=SavedObjectReference), [selectors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/state_management/selectors.ts#:~:text=SavedObjectReference)+ 51 more | - | +| | [saved_object_store.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/persistence/saved_object_store.ts#:~:text=SavedObjectReference), [saved_object_store.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/persistence/saved_object_store.ts#:~:text=SavedObjectReference), [saved_object_store.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/persistence/saved_object_store.ts#:~:text=SavedObjectReference), [selectors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/state_management/selectors.ts#:~:text=SavedObjectReference), [selectors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/state_management/selectors.ts#:~:text=SavedObjectReference), [selectors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/state_management/selectors.ts#:~:text=SavedObjectReference), [state_helpers.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts#:~:text=SavedObjectReference), [state_helpers.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts#:~:text=SavedObjectReference), [state_helpers.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts#:~:text=SavedObjectReference), [state_helpers.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts#:~:text=SavedObjectReference)+ 51 more | - | | | [saved_objects.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/server/saved_objects.ts#:~:text=convertToMultiNamespaceTypeVersion) | - | @@ -1183,10 +1183,10 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| | | [register_ml_alerts.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/alerting/register_ml_alerts.ts#:~:text=registerNavigation) | - | -| | [register_jobs_monitoring_rule_type.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/lib/alerts/register_jobs_monitoring_rule_type.ts#:~:text=alertFactory), [register_jobs_monitoring_rule_type.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/lib/alerts/register_jobs_monitoring_rule_type.ts#:~:text=alertFactory), [register_anomaly_detection_alert_type.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts#:~:text=alertFactory), [register_anomaly_detection_alert_type.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts#:~:text=alertFactory) | - | -| | [configuration_step_details.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx#:~:text=title), [data_loader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [configuration_step_form.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx#:~:text=title), [configuration_step_form.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx#:~:text=title), [configuration_step_form.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx#:~:text=title), [page.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx#:~:text=title)+ 38 more | - | -| | [configuration_step_details.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx#:~:text=title), [data_loader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [configuration_step_form.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx#:~:text=title), [configuration_step_form.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx#:~:text=title), [configuration_step_form.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx#:~:text=title), [page.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx#:~:text=title)+ 38 more | - | -| | [configuration_step_details.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx#:~:text=title), [data_loader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [configuration_step_form.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx#:~:text=title), [configuration_step_form.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx#:~:text=title), [configuration_step_form.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx#:~:text=title), [page.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx#:~:text=title)+ 14 more | - | +| | [register_jobs_monitoring_rule_type.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/lib/alerts/register_jobs_monitoring_rule_type.ts#:~:text=alertFactory), [register_jobs_monitoring_rule_type.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/lib/alerts/register_jobs_monitoring_rule_type.ts#:~:text=alertFactory) | - | +| | [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts#:~:text=title), [rollup.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts#:~:text=title), [alerting_service.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/lib/alerts/alerting_service.ts#:~:text=title), [data_recognizer.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts#:~:text=title), [configuration_step_details.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx#:~:text=title), [data_loader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title)+ 38 more | - | +| | [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts#:~:text=title), [rollup.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts#:~:text=title), [alerting_service.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/lib/alerts/alerting_service.ts#:~:text=title), [data_recognizer.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts#:~:text=title), [configuration_step_details.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx#:~:text=title), [data_loader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title)+ 38 more | - | +| | [index_patterns.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts#:~:text=title), [rollup.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts#:~:text=title), [alerting_service.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/lib/alerts/alerting_service.ts#:~:text=title), [data_recognizer.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts#:~:text=title), [configuration_step_details.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_details.tsx#:~:text=title), [data_loader.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title), [use_index_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts#:~:text=title)+ 14 more | - | | | [jobs_list_page.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx#:~:text=RedirectAppLinks), [jobs_list_page.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx#:~:text=RedirectAppLinks), [jobs_list_page.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx#:~:text=RedirectAppLinks) | - | | | [anomaly_charts_embeddable.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable.tsx#:~:text=KibanaThemeProvider), [anomaly_charts_embeddable.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable.tsx#:~:text=KibanaThemeProvider), [anomaly_charts_embeddable.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable.tsx#:~:text=KibanaThemeProvider), [anomaly_swimlane_embeddable.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/anomaly_swimlane_embeddable.tsx#:~:text=KibanaThemeProvider), [anomaly_swimlane_embeddable.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/anomaly_swimlane_embeddable.tsx#:~:text=KibanaThemeProvider), [anomaly_swimlane_embeddable.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/anomaly_swimlane_embeddable.tsx#:~:text=KibanaThemeProvider), [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/app.tsx#:~:text=KibanaThemeProvider), [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/app.tsx#:~:text=KibanaThemeProvider), [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/app.tsx#:~:text=KibanaThemeProvider), [jobs_list_page.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx#:~:text=KibanaThemeProvider)+ 2 more | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/ml/public/plugin.ts#:~:text=license%24) | 8.8.0 | @@ -1233,7 +1233,6 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts#:~:text=title), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts#:~:text=title), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts#:~:text=title), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts#:~:text=title), [custom_threshold_rule_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/custom_threshold_rule_expression.tsx#:~:text=title), [alert_details_app_section.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/components/alert_details_app_section.tsx#:~:text=title), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts#:~:text=title), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts#:~:text=title), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts#:~:text=title), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts#:~:text=title)+ 2 more | - | | | [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts#:~:text=title), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts#:~:text=title), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts#:~:text=title), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts#:~:text=title), [custom_threshold_rule_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/custom_threshold_rule_expression.tsx#:~:text=title), [alert_details_app_section.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/components/alert_details_app_section.tsx#:~:text=title), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts#:~:text=title), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts#:~:text=title), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts#:~:text=title), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts#:~:text=title)+ 2 more | - | | | [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts#:~:text=title), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts#:~:text=title), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts#:~:text=title), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/hooks/use_metrics_explorer_data.ts#:~:text=title), [custom_threshold_rule_expression.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/custom_threshold_rule_expression.tsx#:~:text=title), [alert_details_app_section.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/custom_threshold/components/alert_details_app_section.tsx#:~:text=title) | - | -| | [header_menu_portal.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/pages/overview/components/header_menu/header_menu_portal.tsx#:~:text=toMountPoint), [header_menu_portal.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/pages/overview/components/header_menu/header_menu_portal.tsx#:~:text=toMountPoint) | - | | | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/application/index.tsx#:~:text=RedirectAppLinks), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/application/index.tsx#:~:text=RedirectAppLinks), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/application/index.tsx#:~:text=RedirectAppLinks) | - | | | [render_cell_value.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/alerts_table/render_cell_value.tsx#:~:text=DeprecatedCellValueElementProps), [render_cell_value.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/alerts_table/render_cell_value.tsx#:~:text=DeprecatedCellValueElementProps) | - | @@ -1386,8 +1385,8 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [open_modal.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/open_modal.tsx#:~:text=toMountPoint), [open_modal.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/open_modal.tsx#:~:text=toMountPoint), [open_modal.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/open_modal.tsx#:~:text=toMountPoint), [open_assign_flyout.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/components/assign_flyout/open_assign_flyout.tsx#:~:text=toMountPoint), [open_assign_flyout.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/components/assign_flyout/open_assign_flyout.tsx#:~:text=toMountPoint) | - | | | [mount_section.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/management/mount_section.tsx#:~:text=KibanaThemeProvider), [mount_section.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/management/mount_section.tsx#:~:text=KibanaThemeProvider), [mount_section.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/management/mount_section.tsx#:~:text=KibanaThemeProvider) | - | | | [request_handler_context.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/server/request_handler_context.ts#:~:text=authz) | - | -| | [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/common/types.ts#:~:text=SavedObject), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/common/types.ts#:~:text=SavedObject), [utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/utils.ts#:~:text=SavedObject), [utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/utils.ts#:~:text=SavedObject), [utils.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/utils.test.ts#:~:text=SavedObject), [utils.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/utils.test.ts#:~:text=SavedObject), [utils.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/utils.test.ts#:~:text=SavedObject), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/common/test_utils/index.ts#:~:text=SavedObject), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/common/test_utils/index.ts#:~:text=SavedObject), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/common/test_utils/index.ts#:~:text=SavedObject)+ 3 more | - | -| | [references.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/common/references.ts#:~:text=SavedObjectReference), [references.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/common/references.ts#:~:text=SavedObjectReference), [references.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/common/references.ts#:~:text=SavedObjectReference), [references.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/common/references.ts#:~:text=SavedObjectReference), [references.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/common/references.ts#:~:text=SavedObjectReference), [references.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/common/references.ts#:~:text=SavedObjectReference), [utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/utils.ts#:~:text=SavedObjectReference), [utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/utils.ts#:~:text=SavedObjectReference), [utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/utils.ts#:~:text=SavedObjectReference), [utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/utils.ts#:~:text=SavedObjectReference)+ 11 more | - | +| | [get_table_column_definition.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/ui_api/get_table_column_definition.tsx#:~:text=SavedObject), [get_table_column_definition.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/ui_api/get_table_column_definition.tsx#:~:text=SavedObject), [get_table_column_definition.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/ui_api/get_table_column_definition.tsx#:~:text=SavedObject), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/common/types.ts#:~:text=SavedObject), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/common/types.ts#:~:text=SavedObject), [utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/utils.ts#:~:text=SavedObject), [utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/utils.ts#:~:text=SavedObject), [utils.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/utils.test.ts#:~:text=SavedObject), [utils.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/utils.test.ts#:~:text=SavedObject), [utils.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/utils.test.ts#:~:text=SavedObject)+ 3 more | - | +| | [get_table_column_definition.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/ui_api/get_table_column_definition.tsx#:~:text=SavedObjectReference), [get_table_column_definition.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/ui_api/get_table_column_definition.tsx#:~:text=SavedObjectReference), [references.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/common/references.ts#:~:text=SavedObjectReference), [references.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/common/references.ts#:~:text=SavedObjectReference), [references.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/common/references.ts#:~:text=SavedObjectReference), [references.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/common/references.ts#:~:text=SavedObjectReference), [references.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/common/references.ts#:~:text=SavedObjectReference), [references.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/common/references.ts#:~:text=SavedObjectReference), [utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/utils.ts#:~:text=SavedObjectReference), [utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/public/utils.ts#:~:text=SavedObjectReference)+ 11 more | - | | | [tag.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/saved_objects_tagging/server/saved_objects/tag.ts#:~:text=convertToMultiNamespaceTypeVersion) | - | @@ -1398,7 +1397,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | ---------------|-----------|-----------| | | [api.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/api.ts#:~:text=SavedObject), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/decorator/types.ts#:~:text=SavedObject), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/decorator/types.ts#:~:text=SavedObject), [api.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/api.ts#:~:text=SavedObject), [api.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/api.ts#:~:text=SavedObject) | 8.8.0 | | | [api.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/api.ts#:~:text=SavedObject), [api.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/api.ts#:~:text=SavedObject), [api.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/api.ts#:~:text=SavedObject) | - | -| | [api.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/api.ts#:~:text=SavedObjectReference), [api.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/api.ts#:~:text=SavedObjectReference), [api.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/api.ts#:~:text=SavedObjectReference), [api.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/api.ts#:~:text=SavedObjectReference), [extract_tag_references.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts#:~:text=SavedObjectReference), [extract_tag_references.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts#:~:text=SavedObjectReference), [extract_tag_references.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts#:~:text=SavedObjectReference), [extract_tag_references.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts#:~:text=SavedObjectReference), [extract_tag_references.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts#:~:text=SavedObjectReference), [extract_tag_references.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts#:~:text=SavedObjectReference)+ 2 more | - | +| | [extract_tag_references.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts#:~:text=SavedObjectReference), [extract_tag_references.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts#:~:text=SavedObjectReference), [extract_tag_references.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts#:~:text=SavedObjectReference), [extract_tag_references.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts#:~:text=SavedObjectReference), [extract_tag_references.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts#:~:text=SavedObjectReference), [extract_tag_references.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts#:~:text=SavedObjectReference), [inject_tag_references.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/decorator/inject_tag_references.test.ts#:~:text=SavedObjectReference), [inject_tag_references.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/decorator/inject_tag_references.test.ts#:~:text=SavedObjectReference), [api.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/api.ts#:~:text=SavedObjectReference), [api.ts](https://github.com/elastic/kibana/tree/main/src/plugins/saved_objects_tagging_oss/public/api.ts#:~:text=SavedObjectReference)+ 2 more | - | @@ -1796,7 +1795,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | | [services.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/services.ts#:~:text=SavedObjectsStart), [services.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/services.ts#:~:text=SavedObjectsStart) | - | | | [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectAttribute), [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectAttribute) | - | | | [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectAttributes), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectAttributes), [visualize_embeddable.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx#:~:text=SavedObjectAttributes), [visualize_embeddable.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx#:~:text=SavedObjectAttributes), [visualize_embeddable_factory.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx#:~:text=SavedObjectAttributes), [visualize_embeddable_factory.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx#:~:text=SavedObjectAttributes) | - | -| | [controls_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/controls_references.ts#:~:text=SavedObjectReference), [controls_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/controls_references.ts#:~:text=SavedObjectReference), [controls_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/controls_references.ts#:~:text=SavedObjectReference), [timeseries_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/timeseries_references.ts#:~:text=SavedObjectReference), [timeseries_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/timeseries_references.ts#:~:text=SavedObjectReference), [timeseries_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/timeseries_references.ts#:~:text=SavedObjectReference), [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectReference), [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectReference), [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectReference), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectReference)+ 10 more | - | +| | [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectReference), [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectReference), [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectReference), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectReference), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectReference), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectReference), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectReference), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectReference), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectReference), [visualize_embeddable_factory.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx#:~:text=SavedObjectReference)+ 10 more | - | | | [visualization.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/server/saved_objects/visualization.ts#:~:text=convertToMultiNamespaceTypeVersion) | - | diff --git a/api_docs/deprecations_by_team.mdx b/api_docs/deprecations_by_team.mdx index d054cf4f50421..365da0975aedb 100644 --- a/api_docs/deprecations_by_team.mdx +++ b/api_docs/deprecations_by_team.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsDueByTeam slug: /kibana-dev-docs/api-meta/deprecations-due-by-team title: Deprecated APIs due to be removed, by team description: Lists the teams that are referencing deprecated APIs with a remove by date. -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- diff --git a/api_docs/dev_tools.mdx b/api_docs/dev_tools.mdx index 681d6ea6ee0f8..6421ce1e3794d 100644 --- a/api_docs/dev_tools.mdx +++ b/api_docs/dev_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/devTools title: "devTools" image: https://source.unsplash.com/400x175/?github description: API docs for the devTools plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'devTools'] --- import devToolsObj from './dev_tools.devdocs.json'; diff --git a/api_docs/discover.devdocs.json b/api_docs/discover.devdocs.json index 953ad5b563cf6..f9574171a342d 100644 --- a/api_docs/discover.devdocs.json +++ b/api_docs/discover.devdocs.json @@ -567,6 +567,22 @@ "deprecated": false, "trackAdoption": false, "children": [ + { + "parentPluginId": "discover", + "id": "def-public.DiscoverStateContainer.globalState", + "type": "Object", + "tags": [], + "label": "globalState", + "description": [ + "\nGlobal State, the _g part of the URL" + ], + "signature": [ + "DiscoverGlobalStateContainer" + ], + "path": "src/plugins/discover/public/application/main/services/discover_state.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "discover", "id": "def-public.DiscoverStateContainer.appState", @@ -2000,14 +2016,6 @@ "deprecated": true, "trackAdoption": false, "references": [ - { - "plugin": "dataVisualizer", - "path": "x-pack/plugins/data_visualizer/public/application/common/components/results_links/results_links.tsx" - }, - { - "plugin": "dataVisualizer", - "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx" - }, { "plugin": "exploratoryView", "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_discover_link.tsx" @@ -2016,6 +2024,14 @@ "plugin": "fleet", "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/hooks/use_get_logs_discover_link.tsx" }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/results_links/results_links.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx" + }, { "plugin": "cloudSecurityPosture", "path": "x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/overview_tab.tsx" diff --git a/api_docs/discover.mdx b/api_docs/discover.mdx index 7e4613c8b526e..153155617895f 100644 --- a/api_docs/discover.mdx +++ b/api_docs/discover.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discover title: "discover" image: https://source.unsplash.com/400x175/?github description: API docs for the discover plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discover'] --- import discoverObj from './discover.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/k | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 116 | 0 | 75 | 17 | +| 117 | 0 | 75 | 18 | ## Client diff --git a/api_docs/discover_enhanced.mdx b/api_docs/discover_enhanced.mdx index 2662254790013..4d8065a31a4ed 100644 --- a/api_docs/discover_enhanced.mdx +++ b/api_docs/discover_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discoverEnhanced title: "discoverEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the discoverEnhanced plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discoverEnhanced'] --- import discoverEnhancedObj from './discover_enhanced.devdocs.json'; diff --git a/api_docs/ecs_data_quality_dashboard.mdx b/api_docs/ecs_data_quality_dashboard.mdx index 2952cedf21aac..f53a9080e6eb6 100644 --- a/api_docs/ecs_data_quality_dashboard.mdx +++ b/api_docs/ecs_data_quality_dashboard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ecsDataQualityDashboard title: "ecsDataQualityDashboard" image: https://source.unsplash.com/400x175/?github description: API docs for the ecsDataQualityDashboard plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ecsDataQualityDashboard'] --- import ecsDataQualityDashboardObj from './ecs_data_quality_dashboard.devdocs.json'; diff --git a/api_docs/elastic_assistant.mdx b/api_docs/elastic_assistant.mdx index b44b2760277af..bbecc0e86e012 100644 --- a/api_docs/elastic_assistant.mdx +++ b/api_docs/elastic_assistant.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/elasticAssistant title: "elasticAssistant" image: https://source.unsplash.com/400x175/?github description: API docs for the elasticAssistant plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'elasticAssistant'] --- import elasticAssistantObj from './elastic_assistant.devdocs.json'; diff --git a/api_docs/embeddable.mdx b/api_docs/embeddable.mdx index 389b472c14882..0c898c8a44361 100644 --- a/api_docs/embeddable.mdx +++ b/api_docs/embeddable.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/embeddable title: "embeddable" image: https://source.unsplash.com/400x175/?github description: API docs for the embeddable plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddable'] --- import embeddableObj from './embeddable.devdocs.json'; diff --git a/api_docs/embeddable_enhanced.mdx b/api_docs/embeddable_enhanced.mdx index 802133f6f3c4d..04b3bcc44120f 100644 --- a/api_docs/embeddable_enhanced.mdx +++ b/api_docs/embeddable_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/embeddableEnhanced title: "embeddableEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the embeddableEnhanced plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddableEnhanced'] --- import embeddableEnhancedObj from './embeddable_enhanced.devdocs.json'; diff --git a/api_docs/encrypted_saved_objects.mdx b/api_docs/encrypted_saved_objects.mdx index 1d63bf970b425..17a1a19e3f746 100644 --- a/api_docs/encrypted_saved_objects.mdx +++ b/api_docs/encrypted_saved_objects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/encryptedSavedObjects title: "encryptedSavedObjects" image: https://source.unsplash.com/400x175/?github description: API docs for the encryptedSavedObjects plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'encryptedSavedObjects'] --- import encryptedSavedObjectsObj from './encrypted_saved_objects.devdocs.json'; diff --git a/api_docs/enterprise_search.mdx b/api_docs/enterprise_search.mdx index e591dad53c18e..6c9106768cfa3 100644 --- a/api_docs/enterprise_search.mdx +++ b/api_docs/enterprise_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/enterpriseSearch title: "enterpriseSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the enterpriseSearch plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'enterpriseSearch'] --- import enterpriseSearchObj from './enterprise_search.devdocs.json'; diff --git a/api_docs/es_ui_shared.mdx b/api_docs/es_ui_shared.mdx index 96da6af418e4a..2ea7d1aa2cb99 100644 --- a/api_docs/es_ui_shared.mdx +++ b/api_docs/es_ui_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/esUiShared title: "esUiShared" image: https://source.unsplash.com/400x175/?github description: API docs for the esUiShared plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esUiShared'] --- import esUiSharedObj from './es_ui_shared.devdocs.json'; diff --git a/api_docs/event_annotation.mdx b/api_docs/event_annotation.mdx index dc4606d5d2d4f..ba3a8c7c66d0f 100644 --- a/api_docs/event_annotation.mdx +++ b/api_docs/event_annotation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventAnnotation title: "eventAnnotation" image: https://source.unsplash.com/400x175/?github description: API docs for the eventAnnotation plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventAnnotation'] --- import eventAnnotationObj from './event_annotation.devdocs.json'; diff --git a/api_docs/event_annotation_listing.mdx b/api_docs/event_annotation_listing.mdx index 0707c1b1383a7..e5c5001cafeeb 100644 --- a/api_docs/event_annotation_listing.mdx +++ b/api_docs/event_annotation_listing.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventAnnotationListing title: "eventAnnotationListing" image: https://source.unsplash.com/400x175/?github description: API docs for the eventAnnotationListing plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventAnnotationListing'] --- import eventAnnotationListingObj from './event_annotation_listing.devdocs.json'; diff --git a/api_docs/event_log.mdx b/api_docs/event_log.mdx index e2af544c6e6b5..6f2f1da578d8a 100644 --- a/api_docs/event_log.mdx +++ b/api_docs/event_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventLog title: "eventLog" image: https://source.unsplash.com/400x175/?github description: API docs for the eventLog plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventLog'] --- import eventLogObj from './event_log.devdocs.json'; diff --git a/api_docs/exploratory_view.mdx b/api_docs/exploratory_view.mdx index 2ae6be49ddd0f..97546b9bc8e85 100644 --- a/api_docs/exploratory_view.mdx +++ b/api_docs/exploratory_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/exploratoryView title: "exploratoryView" image: https://source.unsplash.com/400x175/?github description: API docs for the exploratoryView plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'exploratoryView'] --- import exploratoryViewObj from './exploratory_view.devdocs.json'; diff --git a/api_docs/expression_error.mdx b/api_docs/expression_error.mdx index 1bcc90f528d1b..b4b96a336ceb5 100644 --- a/api_docs/expression_error.mdx +++ b/api_docs/expression_error.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionError title: "expressionError" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionError plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionError'] --- import expressionErrorObj from './expression_error.devdocs.json'; diff --git a/api_docs/expression_gauge.mdx b/api_docs/expression_gauge.mdx index 2ce1a615ca238..1508f1c2d2f69 100644 --- a/api_docs/expression_gauge.mdx +++ b/api_docs/expression_gauge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionGauge title: "expressionGauge" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionGauge plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionGauge'] --- import expressionGaugeObj from './expression_gauge.devdocs.json'; diff --git a/api_docs/expression_heatmap.mdx b/api_docs/expression_heatmap.mdx index df39e25be4c53..1ef4516602d25 100644 --- a/api_docs/expression_heatmap.mdx +++ b/api_docs/expression_heatmap.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionHeatmap title: "expressionHeatmap" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionHeatmap plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionHeatmap'] --- import expressionHeatmapObj from './expression_heatmap.devdocs.json'; diff --git a/api_docs/expression_image.mdx b/api_docs/expression_image.mdx index 75d74beedbbee..299659157d7ae 100644 --- a/api_docs/expression_image.mdx +++ b/api_docs/expression_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionImage title: "expressionImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionImage plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionImage'] --- import expressionImageObj from './expression_image.devdocs.json'; diff --git a/api_docs/expression_legacy_metric_vis.mdx b/api_docs/expression_legacy_metric_vis.mdx index b723258dfddb6..af92b8d8b414c 100644 --- a/api_docs/expression_legacy_metric_vis.mdx +++ b/api_docs/expression_legacy_metric_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionLegacyMetricVis title: "expressionLegacyMetricVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionLegacyMetricVis plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionLegacyMetricVis'] --- import expressionLegacyMetricVisObj from './expression_legacy_metric_vis.devdocs.json'; diff --git a/api_docs/expression_metric.mdx b/api_docs/expression_metric.mdx index 68a4290d60a09..0b3b39bba61f7 100644 --- a/api_docs/expression_metric.mdx +++ b/api_docs/expression_metric.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionMetric title: "expressionMetric" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionMetric plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetric'] --- import expressionMetricObj from './expression_metric.devdocs.json'; diff --git a/api_docs/expression_metric_vis.mdx b/api_docs/expression_metric_vis.mdx index a2b32a9605615..333184d384f26 100644 --- a/api_docs/expression_metric_vis.mdx +++ b/api_docs/expression_metric_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionMetricVis title: "expressionMetricVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionMetricVis plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetricVis'] --- import expressionMetricVisObj from './expression_metric_vis.devdocs.json'; diff --git a/api_docs/expression_partition_vis.mdx b/api_docs/expression_partition_vis.mdx index 782c09bf5dfa0..064e380109faa 100644 --- a/api_docs/expression_partition_vis.mdx +++ b/api_docs/expression_partition_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionPartitionVis title: "expressionPartitionVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionPartitionVis plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionPartitionVis'] --- import expressionPartitionVisObj from './expression_partition_vis.devdocs.json'; diff --git a/api_docs/expression_repeat_image.mdx b/api_docs/expression_repeat_image.mdx index 8a8abcb0986f5..250e7b9ce2aa3 100644 --- a/api_docs/expression_repeat_image.mdx +++ b/api_docs/expression_repeat_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionRepeatImage title: "expressionRepeatImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionRepeatImage plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRepeatImage'] --- import expressionRepeatImageObj from './expression_repeat_image.devdocs.json'; diff --git a/api_docs/expression_reveal_image.mdx b/api_docs/expression_reveal_image.mdx index 885a5bc817153..5a3f681a18a29 100644 --- a/api_docs/expression_reveal_image.mdx +++ b/api_docs/expression_reveal_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionRevealImage title: "expressionRevealImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionRevealImage plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRevealImage'] --- import expressionRevealImageObj from './expression_reveal_image.devdocs.json'; diff --git a/api_docs/expression_shape.mdx b/api_docs/expression_shape.mdx index 333ac75323a6d..1197694f13f92 100644 --- a/api_docs/expression_shape.mdx +++ b/api_docs/expression_shape.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionShape title: "expressionShape" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionShape plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionShape'] --- import expressionShapeObj from './expression_shape.devdocs.json'; diff --git a/api_docs/expression_tagcloud.mdx b/api_docs/expression_tagcloud.mdx index 40ae51a93fefd..e74ea70f70b2d 100644 --- a/api_docs/expression_tagcloud.mdx +++ b/api_docs/expression_tagcloud.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionTagcloud title: "expressionTagcloud" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionTagcloud plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionTagcloud'] --- import expressionTagcloudObj from './expression_tagcloud.devdocs.json'; diff --git a/api_docs/expression_x_y.devdocs.json b/api_docs/expression_x_y.devdocs.json index 02acfe81488e7..145e5309cfeac 100644 --- a/api_docs/expression_x_y.devdocs.json +++ b/api_docs/expression_x_y.devdocs.json @@ -811,6 +811,20 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "expressionXY", + "id": "def-common.DataLayerArgs.colorMapping", + "type": "string", + "tags": [], + "label": "colorMapping", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "expressionXY", "id": "def-common.DataLayerArgs.decorations", diff --git a/api_docs/expression_x_y.mdx b/api_docs/expression_x_y.mdx index 6e295133add2b..a2ff7356c2995 100644 --- a/api_docs/expression_x_y.mdx +++ b/api_docs/expression_x_y.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionXY title: "expressionXY" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionXY plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionXY'] --- import expressionXYObj from './expression_x_y.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/k | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 175 | 0 | 165 | 13 | +| 176 | 0 | 166 | 13 | ## Client diff --git a/api_docs/expressions.mdx b/api_docs/expressions.mdx index 7c1f8bc7e457a..e54c8ba17baca 100644 --- a/api_docs/expressions.mdx +++ b/api_docs/expressions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressions title: "expressions" image: https://source.unsplash.com/400x175/?github description: API docs for the expressions plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressions'] --- import expressionsObj from './expressions.devdocs.json'; diff --git a/api_docs/features.mdx b/api_docs/features.mdx index 5d59732350fe7..de92b5328057b 100644 --- a/api_docs/features.mdx +++ b/api_docs/features.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/features title: "features" image: https://source.unsplash.com/400x175/?github description: API docs for the features plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'features'] --- import featuresObj from './features.devdocs.json'; diff --git a/api_docs/field_formats.mdx b/api_docs/field_formats.mdx index 4e9a554d0015e..753a55c915ec6 100644 --- a/api_docs/field_formats.mdx +++ b/api_docs/field_formats.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fieldFormats title: "fieldFormats" image: https://source.unsplash.com/400x175/?github description: API docs for the fieldFormats plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fieldFormats'] --- import fieldFormatsObj from './field_formats.devdocs.json'; diff --git a/api_docs/file_upload.mdx b/api_docs/file_upload.mdx index be3cfb4b97deb..d493a2c994f22 100644 --- a/api_docs/file_upload.mdx +++ b/api_docs/file_upload.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fileUpload title: "fileUpload" image: https://source.unsplash.com/400x175/?github description: API docs for the fileUpload plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fileUpload'] --- import fileUploadObj from './file_upload.devdocs.json'; diff --git a/api_docs/files.mdx b/api_docs/files.mdx index 5086e4beec0e0..9c242accac5b7 100644 --- a/api_docs/files.mdx +++ b/api_docs/files.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/files title: "files" image: https://source.unsplash.com/400x175/?github description: API docs for the files plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'files'] --- import filesObj from './files.devdocs.json'; diff --git a/api_docs/files_management.mdx b/api_docs/files_management.mdx index 8f52135ba4dd6..c4f75fe970c6f 100644 --- a/api_docs/files_management.mdx +++ b/api_docs/files_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/filesManagement title: "filesManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the filesManagement plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'filesManagement'] --- import filesManagementObj from './files_management.devdocs.json'; diff --git a/api_docs/fleet.mdx b/api_docs/fleet.mdx index 6cf756020fa68..fe23f8f927613 100644 --- a/api_docs/fleet.mdx +++ b/api_docs/fleet.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fleet title: "fleet" image: https://source.unsplash.com/400x175/?github description: API docs for the fleet plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fleet'] --- import fleetObj from './fleet.devdocs.json'; diff --git a/api_docs/global_search.mdx b/api_docs/global_search.mdx index 456dac06309b8..e77e6ebdad68d 100644 --- a/api_docs/global_search.mdx +++ b/api_docs/global_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/globalSearch title: "globalSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the globalSearch plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'globalSearch'] --- import globalSearchObj from './global_search.devdocs.json'; diff --git a/api_docs/guided_onboarding.mdx b/api_docs/guided_onboarding.mdx index 8bfce4cd57e0e..88455fec675f1 100644 --- a/api_docs/guided_onboarding.mdx +++ b/api_docs/guided_onboarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/guidedOnboarding title: "guidedOnboarding" image: https://source.unsplash.com/400x175/?github description: API docs for the guidedOnboarding plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'guidedOnboarding'] --- import guidedOnboardingObj from './guided_onboarding.devdocs.json'; diff --git a/api_docs/home.mdx b/api_docs/home.mdx index e67d44b43c7b4..030987ebb5d80 100644 --- a/api_docs/home.mdx +++ b/api_docs/home.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/home title: "home" image: https://source.unsplash.com/400x175/?github description: API docs for the home plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'home'] --- import homeObj from './home.devdocs.json'; diff --git a/api_docs/image_embeddable.mdx b/api_docs/image_embeddable.mdx index 42ba88f74ce76..b869e4488ac5a 100644 --- a/api_docs/image_embeddable.mdx +++ b/api_docs/image_embeddable.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/imageEmbeddable title: "imageEmbeddable" image: https://source.unsplash.com/400x175/?github description: API docs for the imageEmbeddable plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'imageEmbeddable'] --- import imageEmbeddableObj from './image_embeddable.devdocs.json'; diff --git a/api_docs/index_lifecycle_management.mdx b/api_docs/index_lifecycle_management.mdx index bd719fbceab66..39c6694dc76d2 100644 --- a/api_docs/index_lifecycle_management.mdx +++ b/api_docs/index_lifecycle_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/indexLifecycleManagement title: "indexLifecycleManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the indexLifecycleManagement plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexLifecycleManagement'] --- import indexLifecycleManagementObj from './index_lifecycle_management.devdocs.json'; diff --git a/api_docs/index_management.mdx b/api_docs/index_management.mdx index a481bc52815a3..a5f4a339c0de1 100644 --- a/api_docs/index_management.mdx +++ b/api_docs/index_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/indexManagement title: "indexManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the indexManagement plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexManagement'] --- import indexManagementObj from './index_management.devdocs.json'; diff --git a/api_docs/infra.mdx b/api_docs/infra.mdx index 5bfc662f9e4b7..701d20f072c9e 100644 --- a/api_docs/infra.mdx +++ b/api_docs/infra.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/infra title: "infra" image: https://source.unsplash.com/400x175/?github description: API docs for the infra plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'infra'] --- import infraObj from './infra.devdocs.json'; diff --git a/api_docs/inspector.mdx b/api_docs/inspector.mdx index e111316a051c0..595daca8277db 100644 --- a/api_docs/inspector.mdx +++ b/api_docs/inspector.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/inspector title: "inspector" image: https://source.unsplash.com/400x175/?github description: API docs for the inspector plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inspector'] --- import inspectorObj from './inspector.devdocs.json'; diff --git a/api_docs/interactive_setup.mdx b/api_docs/interactive_setup.mdx index cc1e3742faa20..b7268bb72763b 100644 --- a/api_docs/interactive_setup.mdx +++ b/api_docs/interactive_setup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/interactiveSetup title: "interactiveSetup" image: https://source.unsplash.com/400x175/?github description: API docs for the interactiveSetup plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'interactiveSetup'] --- import interactiveSetupObj from './interactive_setup.devdocs.json'; diff --git a/api_docs/kbn_ace.mdx b/api_docs/kbn_ace.mdx index 077667c0faf96..1a213d4913d90 100644 --- a/api_docs/kbn_ace.mdx +++ b/api_docs/kbn_ace.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ace title: "@kbn/ace" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ace plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ace'] --- import kbnAceObj from './kbn_ace.devdocs.json'; diff --git a/api_docs/kbn_aiops_components.mdx b/api_docs/kbn_aiops_components.mdx index 5c69c8b12cbbe..6970009ba694c 100644 --- a/api_docs/kbn_aiops_components.mdx +++ b/api_docs/kbn_aiops_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-components title: "@kbn/aiops-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-components plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-components'] --- import kbnAiopsComponentsObj from './kbn_aiops_components.devdocs.json'; diff --git a/api_docs/kbn_aiops_utils.mdx b/api_docs/kbn_aiops_utils.mdx index c757fd7c1582a..a02ac3ad0c2b8 100644 --- a/api_docs/kbn_aiops_utils.mdx +++ b/api_docs/kbn_aiops_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-utils title: "@kbn/aiops-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-utils'] --- import kbnAiopsUtilsObj from './kbn_aiops_utils.devdocs.json'; diff --git a/api_docs/kbn_alerting_api_integration_helpers.devdocs.json b/api_docs/kbn_alerting_api_integration_helpers.devdocs.json index 8f4c6849b5061..7eb38635c563c 100644 --- a/api_docs/kbn_alerting_api_integration_helpers.devdocs.json +++ b/api_docs/kbn_alerting_api_integration_helpers.devdocs.json @@ -111,6 +111,55 @@ "children": [], "returnComment": [] }, + { + "parentPluginId": "@kbn/alerting-api-integration-helpers", + "id": "def-common.ESTestIndexTool.indexDoc", + "type": "Function", + "tags": [], + "label": "indexDoc", + "description": [], + "signature": [ + "(source: string, reference?: string | undefined) => Promise<", + "WriteResponseBase", + ">" + ], + "path": "x-pack/test/alerting_api_integration/packages/helpers/es_test_index_tool.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerting-api-integration-helpers", + "id": "def-common.ESTestIndexTool.indexDoc.$1", + "type": "string", + "tags": [], + "label": "source", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/test/alerting_api_integration/packages/helpers/es_test_index_tool.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/alerting-api-integration-helpers", + "id": "def-common.ESTestIndexTool.indexDoc.$2", + "type": "string", + "tags": [], + "label": "reference", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/test/alerting_api_integration/packages/helpers/es_test_index_tool.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, { "parentPluginId": "@kbn/alerting-api-integration-helpers", "id": "def-common.ESTestIndexTool.destroy", diff --git a/api_docs/kbn_alerting_api_integration_helpers.mdx b/api_docs/kbn_alerting_api_integration_helpers.mdx index a397098b06097..362e451ad21de 100644 --- a/api_docs/kbn_alerting_api_integration_helpers.mdx +++ b/api_docs/kbn_alerting_api_integration_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerting-api-integration-helpers title: "@kbn/alerting-api-integration-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerting-api-integration-helpers plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerting-api-integration-helpers'] --- import kbnAlertingApiIntegrationHelpersObj from './kbn_alerting_api_integration_helpers.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-o | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 24 | 3 | 24 | 0 | +| 27 | 3 | 27 | 0 | ## Common diff --git a/api_docs/kbn_alerting_state_types.mdx b/api_docs/kbn_alerting_state_types.mdx index a524f5f57697f..f6f03c1b9a9c7 100644 --- a/api_docs/kbn_alerting_state_types.mdx +++ b/api_docs/kbn_alerting_state_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerting-state-types title: "@kbn/alerting-state-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerting-state-types plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerting-state-types'] --- import kbnAlertingStateTypesObj from './kbn_alerting_state_types.devdocs.json'; diff --git a/api_docs/kbn_alerts_as_data_utils.devdocs.json b/api_docs/kbn_alerts_as_data_utils.devdocs.json index 2d2e9c678ef98..3fdca19e4c044 100644 --- a/api_docs/kbn_alerts_as_data_utils.devdocs.json +++ b/api_docs/kbn_alerts_as_data_utils.devdocs.json @@ -118,7 +118,7 @@ "id": "def-common.FieldMap.Unnamed", "type": "IndexSignature", "tags": [], - "label": "[key: string]: { type: string; required: boolean; array?: boolean | undefined; doc_values?: boolean | undefined; enabled?: boolean | undefined; format?: string | undefined; ignore_above?: number | undefined; ... 4 more ...; dynamic?: boolean | ... 1 more ... | undefined; }", + "label": "[key: string]: { type: string; required: boolean; array?: boolean | undefined; doc_values?: boolean | undefined; enabled?: boolean | undefined; format?: string | undefined; ignore_above?: number | undefined; ... 5 more ...; properties?: Record<...> | undefined; }", "description": [], "signature": [ "[key: string]: { type: string; required: boolean; array?: boolean | undefined; doc_values?: boolean | undefined; enabled?: boolean | undefined; format?: string | undefined; ignore_above?: number | undefined; multi_fields?: ", @@ -129,7 +129,7 @@ "section": "def-common.MultiField", "text": "MultiField" }, - "[] | undefined; index?: boolean | undefined; path?: string | undefined; scaling_factor?: number | undefined; dynamic?: boolean | \"strict\" | undefined; }" + "[] | undefined; index?: boolean | undefined; path?: string | undefined; scaling_factor?: number | undefined; dynamic?: boolean | \"strict\" | undefined; properties?: Record | undefined; }" ], "path": "packages/kbn-alerts-as-data-utils/src/field_maps/types.ts", "deprecated": false, @@ -196,7 +196,7 @@ "label": "AADAlert", "description": [], "signature": [ - "({ '@timestamp': string; kibana: { alert: { instance: { id: string; }; rule: { category: string; consumer: string; name: string; producer: string; revision: string | number; rule_type_id: string; uuid: string; }; status: string; uuid: string; }; space_ids: string[]; }; } & { event?: { action?: string | undefined; kind?: string | undefined; } | undefined; kibana?: { alert?: { action_group?: string | undefined; case_ids?: string[] | undefined; duration?: { us?: string | number | undefined; } | undefined; end?: string | undefined; flapping?: boolean | undefined; flapping_history?: boolean[] | undefined; last_detected?: string | undefined; maintenance_window_ids?: string[] | undefined; reason?: string | undefined; rule?: { execution?: { uuid?: string | undefined; } | undefined; parameters?: unknown; tags?: string[] | undefined; } | undefined; start?: string | undefined; time_range?: { gte?: string | undefined; lte?: string | undefined; } | undefined; url?: string | undefined; workflow_status?: string | undefined; workflow_tags?: string[] | undefined; } | undefined; version?: string | undefined; } | undefined; tags?: string[] | undefined; }) | ({} & { agent?: { name?: string | undefined; } | undefined; error?: { grouping_key?: string | undefined; grouping_name?: string | undefined; } | undefined; kibana?: { alert?: { evaluation?: { threshold?: string | number | undefined; value?: string | number | undefined; values?: (string | number)[] | undefined; } | undefined; } | undefined; } | undefined; processor?: { event?: string | undefined; } | undefined; service?: { environment?: string | undefined; language?: { name?: string | undefined; } | undefined; name?: string | undefined; } | undefined; transaction?: { name?: string | undefined; type?: string | undefined; } | undefined; } & { '@timestamp': string; kibana: { alert: { instance: { id: string; }; rule: { category: string; consumer: string; name: string; producer: string; revision: string | number; rule_type_id: string; uuid: string; }; status: string; uuid: string; }; space_ids: string[]; }; } & { event?: { action?: string | undefined; kind?: string | undefined; } | undefined; kibana?: { alert?: { action_group?: string | undefined; case_ids?: string[] | undefined; duration?: { us?: string | number | undefined; } | undefined; end?: string | undefined; flapping?: boolean | undefined; flapping_history?: boolean[] | undefined; last_detected?: string | undefined; maintenance_window_ids?: string[] | undefined; reason?: string | undefined; rule?: { execution?: { uuid?: string | undefined; } | undefined; parameters?: unknown; tags?: string[] | undefined; } | undefined; start?: string | undefined; time_range?: { gte?: string | undefined; lte?: string | undefined; } | undefined; url?: string | undefined; workflow_status?: string | undefined; workflow_tags?: string[] | undefined; } | undefined; version?: string | undefined; } | undefined; tags?: string[] | undefined; } & {} & { ecs?: { version?: string | undefined; } | undefined; kibana?: { alert?: { risk_score?: number | undefined; rule?: { author?: string | undefined; created_at?: string | undefined; created_by?: string | undefined; description?: string | undefined; enabled?: string | undefined; from?: string | undefined; interval?: string | undefined; license?: string | undefined; note?: string | undefined; references?: string[] | undefined; rule_id?: string | undefined; rule_name_override?: string | undefined; to?: string | undefined; type?: string | undefined; updated_at?: string | undefined; updated_by?: string | undefined; version?: string | undefined; } | undefined; severity?: string | undefined; suppression?: { docs_count?: string | number | undefined; end?: string | undefined; start?: string | undefined; terms?: { field?: string[] | undefined; value?: string[] | undefined; } | undefined; } | undefined; system_status?: string | undefined; workflow_reason?: string | undefined; workflow_user?: string | undefined; } | undefined; } | undefined; }) | ({} & { kibana?: { alert?: { evaluation?: { threshold?: string | number | undefined; value?: string | number | undefined; values?: (string | number)[] | undefined; } | undefined; } | undefined; } | undefined; } & { '@timestamp': string; kibana: { alert: { instance: { id: string; }; rule: { category: string; consumer: string; name: string; producer: string; revision: string | number; rule_type_id: string; uuid: string; }; status: string; uuid: string; }; space_ids: string[]; }; } & { event?: { action?: string | undefined; kind?: string | undefined; } | undefined; kibana?: { alert?: { action_group?: string | undefined; case_ids?: string[] | undefined; duration?: { us?: string | number | undefined; } | undefined; end?: string | undefined; flapping?: boolean | undefined; flapping_history?: boolean[] | undefined; last_detected?: string | undefined; maintenance_window_ids?: string[] | undefined; reason?: string | undefined; rule?: { execution?: { uuid?: string | undefined; } | undefined; parameters?: unknown; tags?: string[] | undefined; } | undefined; start?: string | undefined; time_range?: { gte?: string | undefined; lte?: string | undefined; } | undefined; url?: string | undefined; workflow_status?: string | undefined; workflow_tags?: string[] | undefined; } | undefined; version?: string | undefined; } | undefined; tags?: string[] | undefined; } & { '@timestamp': string; ecs: { version: string; }; } & { agent?: { build?: { original?: string | undefined; } | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; client?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; cloud?: { account?: { id?: string | undefined; name?: string | undefined; } | undefined; availability_zone?: string | undefined; instance?: { id?: string | undefined; name?: string | undefined; } | undefined; machine?: { type?: string | undefined; } | undefined; origin?: { account?: { id?: string | undefined; name?: string | undefined; } | undefined; availability_zone?: string | undefined; instance?: { id?: string | undefined; name?: string | undefined; } | undefined; machine?: { type?: string | undefined; } | undefined; project?: { id?: string | undefined; name?: string | undefined; } | undefined; provider?: string | undefined; region?: string | undefined; service?: { name?: string | undefined; } | undefined; } | undefined; project?: { id?: string | undefined; name?: string | undefined; } | undefined; provider?: string | undefined; region?: string | undefined; service?: { name?: string | undefined; } | undefined; target?: { account?: { id?: string | undefined; name?: string | undefined; } | undefined; availability_zone?: string | undefined; instance?: { id?: string | undefined; name?: string | undefined; } | undefined; machine?: { type?: string | undefined; } | undefined; project?: { id?: string | undefined; name?: string | undefined; } | undefined; provider?: string | undefined; region?: string | undefined; service?: { name?: string | undefined; } | undefined; } | undefined; } | undefined; container?: { cpu?: { usage?: string | number | undefined; } | undefined; disk?: { read?: { bytes?: string | number | undefined; } | undefined; write?: { bytes?: string | number | undefined; } | undefined; } | undefined; id?: string | undefined; image?: { hash?: { all?: string[] | undefined; } | undefined; name?: string | undefined; tag?: string[] | undefined; } | undefined; memory?: { usage?: string | number | undefined; } | undefined; name?: string | undefined; network?: { egress?: { bytes?: string | number | undefined; } | undefined; ingress?: { bytes?: string | number | undefined; } | undefined; } | undefined; runtime?: string | undefined; } | undefined; destination?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; device?: { id?: string | undefined; manufacturer?: string | undefined; model?: { identifier?: string | undefined; name?: string | undefined; } | undefined; } | undefined; dll?: { code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; name?: string | undefined; path?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; } | undefined; dns?: { answers?: { class?: string | undefined; data?: string | undefined; name?: string | undefined; ttl?: string | number | undefined; type?: string | undefined; }[] | undefined; header_flags?: string[] | undefined; id?: string | undefined; op_code?: string | undefined; question?: { class?: string | undefined; name?: string | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; type?: string | undefined; } | undefined; resolved_ip?: string[] | undefined; response_code?: string | undefined; type?: string | undefined; } | undefined; email?: { attachments?: { file?: { extension?: string | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; mime_type?: string | undefined; name?: string | undefined; size?: string | number | undefined; } | undefined; }[] | undefined; bcc?: { address?: string[] | undefined; } | undefined; cc?: { address?: string[] | undefined; } | undefined; content_type?: string | undefined; delivery_timestamp?: string | undefined; direction?: string | undefined; from?: { address?: string[] | undefined; } | undefined; local_id?: string | undefined; message_id?: string | undefined; origination_timestamp?: string | undefined; reply_to?: { address?: string[] | undefined; } | undefined; sender?: { address?: string | undefined; } | undefined; subject?: string | undefined; to?: { address?: string[] | undefined; } | undefined; x_mailer?: string | undefined; } | undefined; error?: { code?: string | undefined; id?: string | undefined; message?: string | undefined; stack_trace?: string | undefined; type?: string | undefined; } | undefined; event?: { action?: string | undefined; agent_id_status?: string | undefined; category?: string[] | undefined; code?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: string | number | undefined; end?: string | undefined; hash?: string | undefined; id?: string | undefined; ingested?: string | undefined; kind?: string | undefined; module?: string | undefined; original?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; severity?: string | number | undefined; start?: string | undefined; timezone?: string | undefined; type?: string[] | undefined; url?: string | undefined; } | undefined; faas?: { coldstart?: boolean | undefined; execution?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; } | undefined; file?: { accessed?: string | undefined; attributes?: string[] | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; created?: string | undefined; ctime?: string | undefined; device?: string | undefined; directory?: string | undefined; drive_letter?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; extension?: string | undefined; fork_name?: string | undefined; gid?: string | undefined; group?: string | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; inode?: string | undefined; mime_type?: string | undefined; mode?: string | undefined; mtime?: string | undefined; name?: string | undefined; owner?: string | undefined; path?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; size?: string | number | undefined; target_path?: string | undefined; type?: string | undefined; uid?: string | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; host?: { architecture?: string | undefined; boot?: { id?: string | undefined; } | undefined; cpu?: { usage?: string | number | undefined; } | undefined; disk?: { read?: { bytes?: string | number | undefined; } | undefined; write?: { bytes?: string | number | undefined; } | undefined; } | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; hostname?: string | undefined; id?: string | undefined; ip?: string[] | undefined; mac?: string[] | undefined; name?: string | undefined; network?: { egress?: { bytes?: string | number | undefined; packets?: string | number | undefined; } | undefined; ingress?: { bytes?: string | number | undefined; packets?: string | number | undefined; } | undefined; } | undefined; os?: { family?: string | undefined; full?: string | undefined; kernel?: string | undefined; name?: string | undefined; platform?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; pid_ns_ino?: string | undefined; risk?: { calculated_level?: string | undefined; calculated_score?: number | undefined; calculated_score_norm?: number | undefined; static_level?: string | undefined; static_score?: number | undefined; static_score_norm?: number | undefined; } | undefined; type?: string | undefined; uptime?: string | number | undefined; } | undefined; http?: { request?: { body?: { bytes?: string | number | undefined; content?: string | undefined; } | undefined; bytes?: string | number | undefined; id?: string | undefined; method?: string | undefined; mime_type?: string | undefined; referrer?: string | undefined; } | undefined; response?: { body?: { bytes?: string | number | undefined; content?: string | undefined; } | undefined; bytes?: string | number | undefined; mime_type?: string | undefined; status_code?: string | number | undefined; } | undefined; version?: string | undefined; } | undefined; log?: { file?: { path?: string | undefined; } | undefined; level?: string | undefined; logger?: string | undefined; origin?: { file?: { line?: string | number | undefined; name?: string | undefined; } | undefined; function?: string | undefined; } | undefined; } | undefined; message?: string | undefined; network?: { application?: string | undefined; bytes?: string | number | undefined; community_id?: string | undefined; direction?: string | undefined; forwarded_ip?: string | undefined; iana_number?: string | undefined; name?: string | undefined; packets?: string | number | undefined; protocol?: string | undefined; transport?: string | undefined; type?: string | undefined; vlan?: { id?: string | undefined; name?: string | undefined; } | undefined; } | undefined; observer?: { geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; hostname?: string | undefined; ip?: string[] | undefined; mac?: string[] | undefined; name?: string | undefined; os?: { family?: string | undefined; full?: string | undefined; kernel?: string | undefined; name?: string | undefined; platform?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; product?: string | undefined; serial_number?: string | undefined; type?: string | undefined; vendor?: string | undefined; version?: string | undefined; } | undefined; orchestrator?: { api_version?: string | undefined; cluster?: { id?: string | undefined; name?: string | undefined; url?: string | undefined; version?: string | undefined; } | undefined; namespace?: string | undefined; organization?: string | undefined; resource?: { id?: string | undefined; ip?: string[] | undefined; name?: string | undefined; parent?: { type?: string | undefined; } | undefined; type?: string | undefined; } | undefined; type?: string | undefined; } | undefined; organization?: { id?: string | undefined; name?: string | undefined; } | undefined; package?: { architecture?: string | undefined; build_version?: string | undefined; checksum?: string | undefined; description?: string | undefined; install_scope?: string | undefined; installed?: string | undefined; license?: string | undefined; name?: string | undefined; path?: string | undefined; reference?: string | undefined; size?: string | number | undefined; type?: string | undefined; version?: string | undefined; } | undefined; process?: { args?: string[] | undefined; args_count?: string | number | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; command_line?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; end?: string | undefined; entity_id?: string | undefined; entry_leader?: { args?: string[] | undefined; args_count?: string | number | undefined; attested_groups?: { name?: string | undefined; } | undefined; attested_user?: { id?: string | undefined; name?: string | undefined; } | undefined; command_line?: string | undefined; entity_id?: string | undefined; entry_meta?: { source?: { ip?: string | undefined; } | undefined; type?: string | undefined; } | undefined; executable?: string | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; parent?: { entity_id?: string | undefined; pid?: string | number | undefined; session_leader?: { entity_id?: string | undefined; pid?: string | number | undefined; start?: string | undefined; } | undefined; start?: string | undefined; } | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; same_as_process?: boolean | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; env_vars?: string[] | undefined; executable?: string | undefined; exit_code?: string | number | undefined; group_leader?: { args?: string[] | undefined; args_count?: string | number | undefined; command_line?: string | undefined; entity_id?: string | undefined; executable?: string | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; same_as_process?: boolean | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; parent?: { args?: string[] | undefined; args_count?: string | number | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; command_line?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; end?: string | undefined; entity_id?: string | undefined; executable?: string | undefined; exit_code?: string | number | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; group_leader?: { entity_id?: string | undefined; pid?: string | number | undefined; start?: string | undefined; } | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; pgid?: string | number | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; thread?: { id?: string | number | undefined; name?: string | undefined; } | undefined; title?: string | undefined; uptime?: string | number | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; pgid?: string | number | undefined; pid?: string | number | undefined; previous?: { args?: string[] | undefined; args_count?: string | number | undefined; executable?: string | undefined; } | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; session_leader?: { args?: string[] | undefined; args_count?: string | number | undefined; command_line?: string | undefined; entity_id?: string | undefined; executable?: string | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; parent?: { entity_id?: string | undefined; pid?: string | number | undefined; session_leader?: { entity_id?: string | undefined; pid?: string | number | undefined; start?: string | undefined; } | undefined; start?: string | undefined; } | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; same_as_process?: boolean | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; thread?: { id?: string | number | undefined; name?: string | undefined; } | undefined; title?: string | undefined; uptime?: string | number | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; registry?: { data?: { bytes?: string | undefined; strings?: string[] | undefined; type?: string | undefined; } | undefined; hive?: string | undefined; key?: string | undefined; path?: string | undefined; value?: string | undefined; } | undefined; related?: { hash?: string[] | undefined; hosts?: string[] | undefined; ip?: string[] | undefined; user?: string[] | undefined; } | undefined; rule?: { author?: string[] | undefined; category?: string | undefined; description?: string | undefined; id?: string | undefined; license?: string | undefined; name?: string | undefined; reference?: string | undefined; ruleset?: string | undefined; uuid?: string | undefined; version?: string | undefined; } | undefined; server?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; service?: { address?: string | undefined; environment?: string | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; node?: { name?: string | undefined; role?: string | undefined; roles?: string[] | undefined; } | undefined; origin?: { address?: string | undefined; environment?: string | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; node?: { name?: string | undefined; role?: string | undefined; roles?: string[] | undefined; } | undefined; state?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; state?: string | undefined; target?: { address?: string | undefined; environment?: string | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; node?: { name?: string | undefined; role?: string | undefined; roles?: string[] | undefined; } | undefined; state?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; type?: string | undefined; version?: string | undefined; } | undefined; source?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; span?: { id?: string | undefined; } | undefined; tags?: string[] | undefined; threat?: { enrichments?: { matched?: { atomic?: string | undefined; field?: string | undefined; id?: string | undefined; index?: string | undefined; occurred?: string | undefined; type?: string | undefined; } | undefined; }[] | undefined; feed?: { dashboard_id?: string | undefined; description?: string | undefined; name?: string | undefined; reference?: string | undefined; } | undefined; framework?: string | undefined; group?: { alias?: string[] | undefined; id?: string | undefined; name?: string | undefined; reference?: string | undefined; } | undefined; indicator?: { as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; confidence?: string | undefined; description?: string | undefined; email?: { address?: string | undefined; } | undefined; file?: { accessed?: string | undefined; attributes?: string[] | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; created?: string | undefined; ctime?: string | undefined; device?: string | undefined; directory?: string | undefined; drive_letter?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; extension?: string | undefined; fork_name?: string | undefined; gid?: string | undefined; group?: string | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; inode?: string | undefined; mime_type?: string | undefined; mode?: string | undefined; mtime?: string | undefined; name?: string | undefined; owner?: string | undefined; path?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; size?: string | number | undefined; target_path?: string | undefined; type?: string | undefined; uid?: string | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; first_seen?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; last_seen?: string | undefined; marking?: { tlp?: string | undefined; tlp_version?: string | undefined; } | undefined; modified_at?: string | undefined; port?: string | number | undefined; provider?: string | undefined; reference?: string | undefined; registry?: { data?: { bytes?: string | undefined; strings?: string[] | undefined; type?: string | undefined; } | undefined; hive?: string | undefined; key?: string | undefined; path?: string | undefined; value?: string | undefined; } | undefined; scanner_stats?: string | number | undefined; sightings?: string | number | undefined; type?: string | undefined; url?: { domain?: string | undefined; extension?: string | undefined; fragment?: string | undefined; full?: string | undefined; original?: string | undefined; password?: string | undefined; path?: string | undefined; port?: string | number | undefined; query?: string | undefined; registered_domain?: string | undefined; scheme?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; username?: string | undefined; } | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; software?: { alias?: string[] | undefined; id?: string | undefined; name?: string | undefined; platforms?: string[] | undefined; reference?: string | undefined; type?: string | undefined; } | undefined; tactic?: { id?: string[] | undefined; name?: string[] | undefined; reference?: string[] | undefined; } | undefined; technique?: { id?: string[] | undefined; name?: string[] | undefined; reference?: string[] | undefined; subtechnique?: { id?: string[] | undefined; name?: string[] | undefined; reference?: string[] | undefined; } | undefined; } | undefined; } | undefined; tls?: { cipher?: string | undefined; client?: { certificate?: string | undefined; certificate_chain?: string[] | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; } | undefined; issuer?: string | undefined; ja3?: string | undefined; not_after?: string | undefined; not_before?: string | undefined; server_name?: string | undefined; subject?: string | undefined; supported_ciphers?: string[] | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; curve?: string | undefined; established?: boolean | undefined; next_protocol?: string | undefined; resumed?: boolean | undefined; server?: { certificate?: string | undefined; certificate_chain?: string[] | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; } | undefined; issuer?: string | undefined; ja3s?: string | undefined; not_after?: string | undefined; not_before?: string | undefined; subject?: string | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; version?: string | undefined; version_protocol?: string | undefined; } | undefined; trace?: { id?: string | undefined; } | undefined; transaction?: { id?: string | undefined; } | undefined; url?: { domain?: string | undefined; extension?: string | undefined; fragment?: string | undefined; full?: string | undefined; original?: string | undefined; password?: string | undefined; path?: string | undefined; port?: string | number | undefined; query?: string | undefined; registered_domain?: string | undefined; scheme?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; username?: string | undefined; } | undefined; user?: { changes?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; domain?: string | undefined; effective?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; risk?: { calculated_level?: string | undefined; calculated_score?: number | undefined; calculated_score_norm?: number | undefined; static_level?: string | undefined; static_score?: number | undefined; static_score_norm?: number | undefined; } | undefined; roles?: string[] | undefined; target?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; user_agent?: { device?: { name?: string | undefined; } | undefined; name?: string | undefined; original?: string | undefined; os?: { family?: string | undefined; full?: string | undefined; kernel?: string | undefined; name?: string | undefined; platform?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; version?: string | undefined; } | undefined; vulnerability?: { category?: string[] | undefined; classification?: string | undefined; description?: string | undefined; enumeration?: string | undefined; id?: string | undefined; reference?: string | undefined; report_id?: string | undefined; scanner?: { vendor?: string | undefined; } | undefined; score?: { base?: number | undefined; environmental?: number | undefined; temporal?: number | undefined; version?: string | undefined; } | undefined; severity?: string | undefined; } | undefined; } & {} & { ecs?: { version?: string | undefined; } | undefined; kibana?: { alert?: { risk_score?: number | undefined; rule?: { author?: string | undefined; created_at?: string | undefined; created_by?: string | undefined; description?: string | undefined; enabled?: string | undefined; from?: string | undefined; interval?: string | undefined; license?: string | undefined; note?: string | undefined; references?: string[] | undefined; rule_id?: string | undefined; rule_name_override?: string | undefined; to?: string | undefined; type?: string | undefined; updated_at?: string | undefined; updated_by?: string | undefined; version?: string | undefined; } | undefined; severity?: string | undefined; suppression?: { docs_count?: string | number | undefined; end?: string | undefined; start?: string | undefined; terms?: { field?: string[] | undefined; value?: string[] | undefined; } | undefined; } | undefined; system_status?: string | undefined; workflow_reason?: string | undefined; workflow_user?: string | undefined; } | undefined; } | undefined; }) | ({} & { kibana?: { alert?: { evaluation?: { threshold?: string | number | undefined; value?: string | number | undefined; values?: (string | number)[] | undefined; } | undefined; } | undefined; } | undefined; } & { '@timestamp': string; kibana: { alert: { instance: { id: string; }; rule: { category: string; consumer: string; name: string; producer: string; revision: string | number; rule_type_id: string; uuid: string; }; status: string; uuid: string; }; space_ids: string[]; }; } & { event?: { action?: string | undefined; kind?: string | undefined; } | undefined; kibana?: { alert?: { action_group?: string | undefined; case_ids?: string[] | undefined; duration?: { us?: string | number | undefined; } | undefined; end?: string | undefined; flapping?: boolean | undefined; flapping_history?: boolean[] | undefined; last_detected?: string | undefined; maintenance_window_ids?: string[] | undefined; reason?: string | undefined; rule?: { execution?: { uuid?: string | undefined; } | undefined; parameters?: unknown; tags?: string[] | undefined; } | undefined; start?: string | undefined; time_range?: { gte?: string | undefined; lte?: string | undefined; } | undefined; url?: string | undefined; workflow_status?: string | undefined; workflow_tags?: string[] | undefined; } | undefined; version?: string | undefined; } | undefined; tags?: string[] | undefined; } & { '@timestamp': string; ecs: { version: string; }; } & { agent?: { build?: { original?: string | undefined; } | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; client?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; cloud?: { account?: { id?: string | undefined; name?: string | undefined; } | undefined; availability_zone?: string | undefined; instance?: { id?: string | undefined; name?: string | undefined; } | undefined; machine?: { type?: string | undefined; } | undefined; origin?: { account?: { id?: string | undefined; name?: string | undefined; } | undefined; availability_zone?: string | undefined; instance?: { id?: string | undefined; name?: string | undefined; } | undefined; machine?: { type?: string | undefined; } | undefined; project?: { id?: string | undefined; name?: string | undefined; } | undefined; provider?: string | undefined; region?: string | undefined; service?: { name?: string | undefined; } | undefined; } | undefined; project?: { id?: string | undefined; name?: string | undefined; } | undefined; provider?: string | undefined; region?: string | undefined; service?: { name?: string | undefined; } | undefined; target?: { account?: { id?: string | undefined; name?: string | undefined; } | undefined; availability_zone?: string | undefined; instance?: { id?: string | undefined; name?: string | undefined; } | undefined; machine?: { type?: string | undefined; } | undefined; project?: { id?: string | undefined; name?: string | undefined; } | undefined; provider?: string | undefined; region?: string | undefined; service?: { name?: string | undefined; } | undefined; } | undefined; } | undefined; container?: { cpu?: { usage?: string | number | undefined; } | undefined; disk?: { read?: { bytes?: string | number | undefined; } | undefined; write?: { bytes?: string | number | undefined; } | undefined; } | undefined; id?: string | undefined; image?: { hash?: { all?: string[] | undefined; } | undefined; name?: string | undefined; tag?: string[] | undefined; } | undefined; memory?: { usage?: string | number | undefined; } | undefined; name?: string | undefined; network?: { egress?: { bytes?: string | number | undefined; } | undefined; ingress?: { bytes?: string | number | undefined; } | undefined; } | undefined; runtime?: string | undefined; } | undefined; destination?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; device?: { id?: string | undefined; manufacturer?: string | undefined; model?: { identifier?: string | undefined; name?: string | undefined; } | undefined; } | undefined; dll?: { code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; name?: string | undefined; path?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; } | undefined; dns?: { answers?: { class?: string | undefined; data?: string | undefined; name?: string | undefined; ttl?: string | number | undefined; type?: string | undefined; }[] | undefined; header_flags?: string[] | undefined; id?: string | undefined; op_code?: string | undefined; question?: { class?: string | undefined; name?: string | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; type?: string | undefined; } | undefined; resolved_ip?: string[] | undefined; response_code?: string | undefined; type?: string | undefined; } | undefined; email?: { attachments?: { file?: { extension?: string | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; mime_type?: string | undefined; name?: string | undefined; size?: string | number | undefined; } | undefined; }[] | undefined; bcc?: { address?: string[] | undefined; } | undefined; cc?: { address?: string[] | undefined; } | undefined; content_type?: string | undefined; delivery_timestamp?: string | undefined; direction?: string | undefined; from?: { address?: string[] | undefined; } | undefined; local_id?: string | undefined; message_id?: string | undefined; origination_timestamp?: string | undefined; reply_to?: { address?: string[] | undefined; } | undefined; sender?: { address?: string | undefined; } | undefined; subject?: string | undefined; to?: { address?: string[] | undefined; } | undefined; x_mailer?: string | undefined; } | undefined; error?: { code?: string | undefined; id?: string | undefined; message?: string | undefined; stack_trace?: string | undefined; type?: string | undefined; } | undefined; event?: { action?: string | undefined; agent_id_status?: string | undefined; category?: string[] | undefined; code?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: string | number | undefined; end?: string | undefined; hash?: string | undefined; id?: string | undefined; ingested?: string | undefined; kind?: string | undefined; module?: string | undefined; original?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; severity?: string | number | undefined; start?: string | undefined; timezone?: string | undefined; type?: string[] | undefined; url?: string | undefined; } | undefined; faas?: { coldstart?: boolean | undefined; execution?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; } | undefined; file?: { accessed?: string | undefined; attributes?: string[] | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; created?: string | undefined; ctime?: string | undefined; device?: string | undefined; directory?: string | undefined; drive_letter?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; extension?: string | undefined; fork_name?: string | undefined; gid?: string | undefined; group?: string | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; inode?: string | undefined; mime_type?: string | undefined; mode?: string | undefined; mtime?: string | undefined; name?: string | undefined; owner?: string | undefined; path?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; size?: string | number | undefined; target_path?: string | undefined; type?: string | undefined; uid?: string | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; host?: { architecture?: string | undefined; boot?: { id?: string | undefined; } | undefined; cpu?: { usage?: string | number | undefined; } | undefined; disk?: { read?: { bytes?: string | number | undefined; } | undefined; write?: { bytes?: string | number | undefined; } | undefined; } | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; hostname?: string | undefined; id?: string | undefined; ip?: string[] | undefined; mac?: string[] | undefined; name?: string | undefined; network?: { egress?: { bytes?: string | number | undefined; packets?: string | number | undefined; } | undefined; ingress?: { bytes?: string | number | undefined; packets?: string | number | undefined; } | undefined; } | undefined; os?: { family?: string | undefined; full?: string | undefined; kernel?: string | undefined; name?: string | undefined; platform?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; pid_ns_ino?: string | undefined; risk?: { calculated_level?: string | undefined; calculated_score?: number | undefined; calculated_score_norm?: number | undefined; static_level?: string | undefined; static_score?: number | undefined; static_score_norm?: number | undefined; } | undefined; type?: string | undefined; uptime?: string | number | undefined; } | undefined; http?: { request?: { body?: { bytes?: string | number | undefined; content?: string | undefined; } | undefined; bytes?: string | number | undefined; id?: string | undefined; method?: string | undefined; mime_type?: string | undefined; referrer?: string | undefined; } | undefined; response?: { body?: { bytes?: string | number | undefined; content?: string | undefined; } | undefined; bytes?: string | number | undefined; mime_type?: string | undefined; status_code?: string | number | undefined; } | undefined; version?: string | undefined; } | undefined; log?: { file?: { path?: string | undefined; } | undefined; level?: string | undefined; logger?: string | undefined; origin?: { file?: { line?: string | number | undefined; name?: string | undefined; } | undefined; function?: string | undefined; } | undefined; } | undefined; message?: string | undefined; network?: { application?: string | undefined; bytes?: string | number | undefined; community_id?: string | undefined; direction?: string | undefined; forwarded_ip?: string | undefined; iana_number?: string | undefined; name?: string | undefined; packets?: string | number | undefined; protocol?: string | undefined; transport?: string | undefined; type?: string | undefined; vlan?: { id?: string | undefined; name?: string | undefined; } | undefined; } | undefined; observer?: { geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; hostname?: string | undefined; ip?: string[] | undefined; mac?: string[] | undefined; name?: string | undefined; os?: { family?: string | undefined; full?: string | undefined; kernel?: string | undefined; name?: string | undefined; platform?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; product?: string | undefined; serial_number?: string | undefined; type?: string | undefined; vendor?: string | undefined; version?: string | undefined; } | undefined; orchestrator?: { api_version?: string | undefined; cluster?: { id?: string | undefined; name?: string | undefined; url?: string | undefined; version?: string | undefined; } | undefined; namespace?: string | undefined; organization?: string | undefined; resource?: { id?: string | undefined; ip?: string[] | undefined; name?: string | undefined; parent?: { type?: string | undefined; } | undefined; type?: string | undefined; } | undefined; type?: string | undefined; } | undefined; organization?: { id?: string | undefined; name?: string | undefined; } | undefined; package?: { architecture?: string | undefined; build_version?: string | undefined; checksum?: string | undefined; description?: string | undefined; install_scope?: string | undefined; installed?: string | undefined; license?: string | undefined; name?: string | undefined; path?: string | undefined; reference?: string | undefined; size?: string | number | undefined; type?: string | undefined; version?: string | undefined; } | undefined; process?: { args?: string[] | undefined; args_count?: string | number | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; command_line?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; end?: string | undefined; entity_id?: string | undefined; entry_leader?: { args?: string[] | undefined; args_count?: string | number | undefined; attested_groups?: { name?: string | undefined; } | undefined; attested_user?: { id?: string | undefined; name?: string | undefined; } | undefined; command_line?: string | undefined; entity_id?: string | undefined; entry_meta?: { source?: { ip?: string | undefined; } | undefined; type?: string | undefined; } | undefined; executable?: string | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; parent?: { entity_id?: string | undefined; pid?: string | number | undefined; session_leader?: { entity_id?: string | undefined; pid?: string | number | undefined; start?: string | undefined; } | undefined; start?: string | undefined; } | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; same_as_process?: boolean | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; env_vars?: string[] | undefined; executable?: string | undefined; exit_code?: string | number | undefined; group_leader?: { args?: string[] | undefined; args_count?: string | number | undefined; command_line?: string | undefined; entity_id?: string | undefined; executable?: string | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; same_as_process?: boolean | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; parent?: { args?: string[] | undefined; args_count?: string | number | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; command_line?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; end?: string | undefined; entity_id?: string | undefined; executable?: string | undefined; exit_code?: string | number | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; group_leader?: { entity_id?: string | undefined; pid?: string | number | undefined; start?: string | undefined; } | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; pgid?: string | number | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; thread?: { id?: string | number | undefined; name?: string | undefined; } | undefined; title?: string | undefined; uptime?: string | number | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; pgid?: string | number | undefined; pid?: string | number | undefined; previous?: { args?: string[] | undefined; args_count?: string | number | undefined; executable?: string | undefined; } | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; session_leader?: { args?: string[] | undefined; args_count?: string | number | undefined; command_line?: string | undefined; entity_id?: string | undefined; executable?: string | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; parent?: { entity_id?: string | undefined; pid?: string | number | undefined; session_leader?: { entity_id?: string | undefined; pid?: string | number | undefined; start?: string | undefined; } | undefined; start?: string | undefined; } | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; same_as_process?: boolean | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; thread?: { id?: string | number | undefined; name?: string | undefined; } | undefined; title?: string | undefined; uptime?: string | number | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; registry?: { data?: { bytes?: string | undefined; strings?: string[] | undefined; type?: string | undefined; } | undefined; hive?: string | undefined; key?: string | undefined; path?: string | undefined; value?: string | undefined; } | undefined; related?: { hash?: string[] | undefined; hosts?: string[] | undefined; ip?: string[] | undefined; user?: string[] | undefined; } | undefined; rule?: { author?: string[] | undefined; category?: string | undefined; description?: string | undefined; id?: string | undefined; license?: string | undefined; name?: string | undefined; reference?: string | undefined; ruleset?: string | undefined; uuid?: string | undefined; version?: string | undefined; } | undefined; server?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; service?: { address?: string | undefined; environment?: string | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; node?: { name?: string | undefined; role?: string | undefined; roles?: string[] | undefined; } | undefined; origin?: { address?: string | undefined; environment?: string | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; node?: { name?: string | undefined; role?: string | undefined; roles?: string[] | undefined; } | undefined; state?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; state?: string | undefined; target?: { address?: string | undefined; environment?: string | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; node?: { name?: string | undefined; role?: string | undefined; roles?: string[] | undefined; } | undefined; state?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; type?: string | undefined; version?: string | undefined; } | undefined; source?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; span?: { id?: string | undefined; } | undefined; tags?: string[] | undefined; threat?: { enrichments?: { matched?: { atomic?: string | undefined; field?: string | undefined; id?: string | undefined; index?: string | undefined; occurred?: string | undefined; type?: string | undefined; } | undefined; }[] | undefined; feed?: { dashboard_id?: string | undefined; description?: string | undefined; name?: string | undefined; reference?: string | undefined; } | undefined; framework?: string | undefined; group?: { alias?: string[] | undefined; id?: string | undefined; name?: string | undefined; reference?: string | undefined; } | undefined; indicator?: { as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; confidence?: string | undefined; description?: string | undefined; email?: { address?: string | undefined; } | undefined; file?: { accessed?: string | undefined; attributes?: string[] | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; created?: string | undefined; ctime?: string | undefined; device?: string | undefined; directory?: string | undefined; drive_letter?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; extension?: string | undefined; fork_name?: string | undefined; gid?: string | undefined; group?: string | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; inode?: string | undefined; mime_type?: string | undefined; mode?: string | undefined; mtime?: string | undefined; name?: string | undefined; owner?: string | undefined; path?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; size?: string | number | undefined; target_path?: string | undefined; type?: string | undefined; uid?: string | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; first_seen?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; last_seen?: string | undefined; marking?: { tlp?: string | undefined; tlp_version?: string | undefined; } | undefined; modified_at?: string | undefined; port?: string | number | undefined; provider?: string | undefined; reference?: string | undefined; registry?: { data?: { bytes?: string | undefined; strings?: string[] | undefined; type?: string | undefined; } | undefined; hive?: string | undefined; key?: string | undefined; path?: string | undefined; value?: string | undefined; } | undefined; scanner_stats?: string | number | undefined; sightings?: string | number | undefined; type?: string | undefined; url?: { domain?: string | undefined; extension?: string | undefined; fragment?: string | undefined; full?: string | undefined; original?: string | undefined; password?: string | undefined; path?: string | undefined; port?: string | number | undefined; query?: string | undefined; registered_domain?: string | undefined; scheme?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; username?: string | undefined; } | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; software?: { alias?: string[] | undefined; id?: string | undefined; name?: string | undefined; platforms?: string[] | undefined; reference?: string | undefined; type?: string | undefined; } | undefined; tactic?: { id?: string[] | undefined; name?: string[] | undefined; reference?: string[] | undefined; } | undefined; technique?: { id?: string[] | undefined; name?: string[] | undefined; reference?: string[] | undefined; subtechnique?: { id?: string[] | undefined; name?: string[] | undefined; reference?: string[] | undefined; } | undefined; } | undefined; } | undefined; tls?: { cipher?: string | undefined; client?: { certificate?: string | undefined; certificate_chain?: string[] | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; } | undefined; issuer?: string | undefined; ja3?: string | undefined; not_after?: string | undefined; not_before?: string | undefined; server_name?: string | undefined; subject?: string | undefined; supported_ciphers?: string[] | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; curve?: string | undefined; established?: boolean | undefined; next_protocol?: string | undefined; resumed?: boolean | undefined; server?: { certificate?: string | undefined; certificate_chain?: string[] | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; } | undefined; issuer?: string | undefined; ja3s?: string | undefined; not_after?: string | undefined; not_before?: string | undefined; subject?: string | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; version?: string | undefined; version_protocol?: string | undefined; } | undefined; trace?: { id?: string | undefined; } | undefined; transaction?: { id?: string | undefined; } | undefined; url?: { domain?: string | undefined; extension?: string | undefined; fragment?: string | undefined; full?: string | undefined; original?: string | undefined; password?: string | undefined; path?: string | undefined; port?: string | number | undefined; query?: string | undefined; registered_domain?: string | undefined; scheme?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; username?: string | undefined; } | undefined; user?: { changes?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; domain?: string | undefined; effective?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; risk?: { calculated_level?: string | undefined; calculated_score?: number | undefined; calculated_score_norm?: number | undefined; static_level?: string | undefined; static_score?: number | undefined; static_score_norm?: number | undefined; } | undefined; roles?: string[] | undefined; target?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; user_agent?: { device?: { name?: string | undefined; } | undefined; name?: string | undefined; original?: string | undefined; os?: { family?: string | undefined; full?: string | undefined; kernel?: string | undefined; name?: string | undefined; platform?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; version?: string | undefined; } | undefined; vulnerability?: { category?: string[] | undefined; classification?: string | undefined; description?: string | undefined; enumeration?: string | undefined; id?: string | undefined; reference?: string | undefined; report_id?: string | undefined; scanner?: { vendor?: string | undefined; } | undefined; score?: { base?: number | undefined; environmental?: number | undefined; temporal?: number | undefined; version?: string | undefined; } | undefined; severity?: string | undefined; } | undefined; } & {} & { ecs?: { version?: string | undefined; } | undefined; kibana?: { alert?: { risk_score?: number | undefined; rule?: { author?: string | undefined; created_at?: string | undefined; created_by?: string | undefined; description?: string | undefined; enabled?: string | undefined; from?: string | undefined; interval?: string | undefined; license?: string | undefined; note?: string | undefined; references?: string[] | undefined; rule_id?: string | undefined; rule_name_override?: string | undefined; to?: string | undefined; type?: string | undefined; updated_at?: string | undefined; updated_by?: string | undefined; version?: string | undefined; } | undefined; severity?: string | undefined; suppression?: { docs_count?: string | number | undefined; end?: string | undefined; start?: string | undefined; terms?: { field?: string[] | undefined; value?: string[] | undefined; } | undefined; } | undefined; system_status?: string | undefined; workflow_reason?: string | undefined; workflow_user?: string | undefined; } | undefined; } | undefined; }) | ({} & { kibana?: { alert?: { evaluation?: { threshold?: string | number | undefined; value?: string | number | undefined; values?: (string | number)[] | undefined; } | undefined; } | undefined; } | undefined; slo?: { id?: string | undefined; instanceId?: string | undefined; revision?: string | number | undefined; } | undefined; } & { '@timestamp': string; kibana: { alert: { instance: { id: string; }; rule: { category: string; consumer: string; name: string; producer: string; revision: string | number; rule_type_id: string; uuid: string; }; status: string; uuid: string; }; space_ids: string[]; }; } & { event?: { action?: string | undefined; kind?: string | undefined; } | undefined; kibana?: { alert?: { action_group?: string | undefined; case_ids?: string[] | undefined; duration?: { us?: string | number | undefined; } | undefined; end?: string | undefined; flapping?: boolean | undefined; flapping_history?: boolean[] | undefined; last_detected?: string | undefined; maintenance_window_ids?: string[] | undefined; reason?: string | undefined; rule?: { execution?: { uuid?: string | undefined; } | undefined; parameters?: unknown; tags?: string[] | undefined; } | undefined; start?: string | undefined; time_range?: { gte?: string | undefined; lte?: string | undefined; } | undefined; url?: string | undefined; workflow_status?: string | undefined; workflow_tags?: string[] | undefined; } | undefined; version?: string | undefined; } | undefined; tags?: string[] | undefined; } & {} & { ecs?: { version?: string | undefined; } | undefined; kibana?: { alert?: { risk_score?: number | undefined; rule?: { author?: string | undefined; created_at?: string | undefined; created_by?: string | undefined; description?: string | undefined; enabled?: string | undefined; from?: string | undefined; interval?: string | undefined; license?: string | undefined; note?: string | undefined; references?: string[] | undefined; rule_id?: string | undefined; rule_name_override?: string | undefined; to?: string | undefined; type?: string | undefined; updated_at?: string | undefined; updated_by?: string | undefined; version?: string | undefined; } | undefined; severity?: string | undefined; suppression?: { docs_count?: string | number | undefined; end?: string | undefined; start?: string | undefined; terms?: { field?: string[] | undefined; value?: string[] | undefined; } | undefined; } | undefined; system_status?: string | undefined; workflow_reason?: string | undefined; workflow_user?: string | undefined; } | undefined; } | undefined; }) | ({} & { agent?: { name?: string | undefined; } | undefined; anomaly?: { bucket_span?: { minutes?: string | undefined; } | undefined; start?: string | undefined; } | undefined; error?: { message?: string | undefined; } | undefined; kibana?: { alert?: { evaluation?: { threshold?: string | number | undefined; value?: string | number | undefined; values?: (string | number)[] | undefined; } | undefined; } | undefined; } | undefined; monitor?: { id?: string | undefined; name?: string | undefined; type?: string | undefined; } | undefined; observer?: { geo?: { name?: string | undefined; } | undefined; } | undefined; tls?: { server?: { hash?: { sha256?: string | undefined; } | undefined; x509?: { issuer?: { common_name?: string | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; subject?: { common_name?: string | undefined; } | undefined; } | undefined; } | undefined; } | undefined; url?: { full?: string | undefined; } | undefined; } & { '@timestamp': string; kibana: { alert: { instance: { id: string; }; rule: { category: string; consumer: string; name: string; producer: string; revision: string | number; rule_type_id: string; uuid: string; }; status: string; uuid: string; }; space_ids: string[]; }; } & { event?: { action?: string | undefined; kind?: string | undefined; } | undefined; kibana?: { alert?: { action_group?: string | undefined; case_ids?: string[] | undefined; duration?: { us?: string | number | undefined; } | undefined; end?: string | undefined; flapping?: boolean | undefined; flapping_history?: boolean[] | undefined; last_detected?: string | undefined; maintenance_window_ids?: string[] | undefined; reason?: string | undefined; rule?: { execution?: { uuid?: string | undefined; } | undefined; parameters?: unknown; tags?: string[] | undefined; } | undefined; start?: string | undefined; time_range?: { gte?: string | undefined; lte?: string | undefined; } | undefined; url?: string | undefined; workflow_status?: string | undefined; workflow_tags?: string[] | undefined; } | undefined; version?: string | undefined; } | undefined; tags?: string[] | undefined; } & {} & { ecs?: { version?: string | undefined; } | undefined; kibana?: { alert?: { risk_score?: number | undefined; rule?: { author?: string | undefined; created_at?: string | undefined; created_by?: string | undefined; description?: string | undefined; enabled?: string | undefined; from?: string | undefined; interval?: string | undefined; license?: string | undefined; note?: string | undefined; references?: string[] | undefined; rule_id?: string | undefined; rule_name_override?: string | undefined; to?: string | undefined; type?: string | undefined; updated_at?: string | undefined; updated_by?: string | undefined; version?: string | undefined; } | undefined; severity?: string | undefined; suppression?: { docs_count?: string | number | undefined; end?: string | undefined; start?: string | undefined; terms?: { field?: string[] | undefined; value?: string[] | undefined; } | undefined; } | undefined; system_status?: string | undefined; workflow_reason?: string | undefined; workflow_user?: string | undefined; } | undefined; } | undefined; }) | ({ '@timestamp': string; kibana: { alert: { ancestors: { depth: string | number; id: string; index: string; type: string; }[]; depth: string | number; instance: { id: string; }; original_event: { action: string; category: string[]; created: string; dataset: string; id: string; ingested: string; kind: string; module: string; original: string; outcome: string; provider: string; sequence: string | number; type: string[]; }; original_time: string; rule: { category: string; consumer: string; false_positives: string[]; max_signals: (string | number)[]; name: string; producer: string; revision: string | number; rule_type_id: string; threat: { framework: string; tactic: { id: string; name: string; reference: string; }; technique: { id: string; name: string; reference: string; subtechnique: { id: string; name: string; reference: string; }; }; }; uuid: string; }; status: string; uuid: string; }; space_ids: string[]; }; } & { ecs?: { version?: string | undefined; } | undefined; event?: { action?: string | undefined; kind?: string | undefined; } | undefined; kibana?: { alert?: { action_group?: string | undefined; ancestors?: { rule?: string | undefined; } | undefined; building_block_type?: string | undefined; case_ids?: string[] | undefined; duration?: { us?: string | number | undefined; } | undefined; end?: string | undefined; flapping?: boolean | undefined; flapping_history?: boolean[] | undefined; group?: { id?: string | undefined; index?: number | undefined; } | undefined; last_detected?: string | undefined; maintenance_window_ids?: string[] | undefined; new_terms?: string[] | undefined; original_event?: { agent_id_status?: string | undefined; code?: string | undefined; duration?: string | undefined; end?: string | undefined; hash?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; severity?: string | number | undefined; start?: string | undefined; timezone?: string | undefined; url?: string | undefined; } | undefined; reason?: string | undefined; risk_score?: number | undefined; rule?: { author?: string | undefined; building_block_type?: string | undefined; created_at?: string | undefined; created_by?: string | undefined; description?: string | undefined; enabled?: string | undefined; execution?: { uuid?: string | undefined; } | undefined; from?: string | undefined; immutable?: string[] | undefined; interval?: string | undefined; license?: string | undefined; note?: string | undefined; parameters?: unknown; references?: string[] | undefined; rule_id?: string | undefined; rule_name_override?: string | undefined; tags?: string[] | undefined; timeline_id?: string[] | undefined; timeline_title?: string[] | undefined; timestamp_override?: string | undefined; to?: string | undefined; type?: string | undefined; updated_at?: string | undefined; updated_by?: string | undefined; version?: string | undefined; } | undefined; severity?: string | undefined; start?: string | undefined; suppression?: { docs_count?: string | number | undefined; end?: string | undefined; start?: string | undefined; terms?: { field?: string[] | undefined; value?: string[] | undefined; } | undefined; } | undefined; system_status?: string | undefined; threshold_result?: { count?: string | number | undefined; from?: string | undefined; terms?: { field?: string | undefined; value?: string | undefined; }[] | undefined; } | undefined; time_range?: { gte?: string | undefined; lte?: string | undefined; } | undefined; url?: string | undefined; workflow_reason?: string | undefined; workflow_status?: string | undefined; workflow_tags?: string[] | undefined; workflow_user?: string | undefined; } | undefined; version?: string | undefined; } | undefined; signal?: { ancestors?: { depth?: unknown; id?: unknown; index?: unknown; type?: unknown; } | undefined; depth?: unknown; group?: { id?: unknown; index?: unknown; } | undefined; original_event?: { action?: unknown; category?: unknown; code?: unknown; created?: unknown; dataset?: unknown; duration?: unknown; end?: unknown; hash?: unknown; id?: unknown; kind?: unknown; module?: unknown; outcome?: unknown; provider?: unknown; reason?: unknown; risk_score?: unknown; risk_score_norm?: unknown; sequence?: unknown; severity?: unknown; start?: unknown; timezone?: unknown; type?: unknown; } | undefined; original_time?: unknown; reason?: unknown; rule?: { author?: unknown; building_block_type?: unknown; created_at?: unknown; created_by?: unknown; description?: unknown; enabled?: unknown; false_positives?: unknown; from?: unknown; id?: unknown; immutable?: unknown; interval?: unknown; license?: unknown; max_signals?: unknown; name?: unknown; note?: unknown; references?: unknown; risk_score?: unknown; rule_id?: unknown; rule_name_override?: unknown; severity?: unknown; tags?: unknown; threat?: { framework?: unknown; tactic?: { id?: unknown; name?: unknown; reference?: unknown; } | undefined; technique?: { id?: unknown; name?: unknown; reference?: unknown; subtechnique?: { id?: unknown; name?: unknown; reference?: unknown; } | undefined; } | undefined; } | undefined; timeline_id?: unknown; timeline_title?: unknown; timestamp_override?: unknown; to?: unknown; type?: unknown; updated_at?: unknown; updated_by?: unknown; version?: unknown; } | undefined; status?: unknown; threshold_result?: { cardinality?: { field?: unknown; value?: unknown; } | undefined; count?: unknown; from?: unknown; terms?: { field?: unknown; value?: unknown; } | undefined; } | undefined; } | undefined; tags?: string[] | undefined; } & { '@timestamp': string; kibana: { alert: { instance: { id: string; }; rule: { category: string; consumer: string; name: string; producer: string; revision: string | number; rule_type_id: string; uuid: string; }; status: string; uuid: string; }; space_ids: string[]; }; } & { event?: { action?: string | undefined; kind?: string | undefined; } | undefined; kibana?: { alert?: { action_group?: string | undefined; case_ids?: string[] | undefined; duration?: { us?: string | number | undefined; } | undefined; end?: string | undefined; flapping?: boolean | undefined; flapping_history?: boolean[] | undefined; last_detected?: string | undefined; maintenance_window_ids?: string[] | undefined; reason?: string | undefined; rule?: { execution?: { uuid?: string | undefined; } | undefined; parameters?: unknown; tags?: string[] | undefined; } | undefined; start?: string | undefined; time_range?: { gte?: string | undefined; lte?: string | undefined; } | undefined; url?: string | undefined; workflow_status?: string | undefined; workflow_tags?: string[] | undefined; } | undefined; version?: string | undefined; } | undefined; tags?: string[] | undefined; } & { '@timestamp': string; ecs: { version: string; }; } & { agent?: { build?: { original?: string | undefined; } | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; client?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; cloud?: { account?: { id?: string | undefined; name?: string | undefined; } | undefined; availability_zone?: string | undefined; instance?: { id?: string | undefined; name?: string | undefined; } | undefined; machine?: { type?: string | undefined; } | undefined; origin?: { account?: { id?: string | undefined; name?: string | undefined; } | undefined; availability_zone?: string | undefined; instance?: { id?: string | undefined; name?: string | undefined; } | undefined; machine?: { type?: string | undefined; } | undefined; project?: { id?: string | undefined; name?: string | undefined; } | undefined; provider?: string | undefined; region?: string | undefined; service?: { name?: string | undefined; } | undefined; } | undefined; project?: { id?: string | undefined; name?: string | undefined; } | undefined; provider?: string | undefined; region?: string | undefined; service?: { name?: string | undefined; } | undefined; target?: { account?: { id?: string | undefined; name?: string | undefined; } | undefined; availability_zone?: string | undefined; instance?: { id?: string | undefined; name?: string | undefined; } | undefined; machine?: { type?: string | undefined; } | undefined; project?: { id?: string | undefined; name?: string | undefined; } | undefined; provider?: string | undefined; region?: string | undefined; service?: { name?: string | undefined; } | undefined; } | undefined; } | undefined; container?: { cpu?: { usage?: string | number | undefined; } | undefined; disk?: { read?: { bytes?: string | number | undefined; } | undefined; write?: { bytes?: string | number | undefined; } | undefined; } | undefined; id?: string | undefined; image?: { hash?: { all?: string[] | undefined; } | undefined; name?: string | undefined; tag?: string[] | undefined; } | undefined; memory?: { usage?: string | number | undefined; } | undefined; name?: string | undefined; network?: { egress?: { bytes?: string | number | undefined; } | undefined; ingress?: { bytes?: string | number | undefined; } | undefined; } | undefined; runtime?: string | undefined; } | undefined; destination?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; device?: { id?: string | undefined; manufacturer?: string | undefined; model?: { identifier?: string | undefined; name?: string | undefined; } | undefined; } | undefined; dll?: { code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; name?: string | undefined; path?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; } | undefined; dns?: { answers?: { class?: string | undefined; data?: string | undefined; name?: string | undefined; ttl?: string | number | undefined; type?: string | undefined; }[] | undefined; header_flags?: string[] | undefined; id?: string | undefined; op_code?: string | undefined; question?: { class?: string | undefined; name?: string | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; type?: string | undefined; } | undefined; resolved_ip?: string[] | undefined; response_code?: string | undefined; type?: string | undefined; } | undefined; email?: { attachments?: { file?: { extension?: string | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; mime_type?: string | undefined; name?: string | undefined; size?: string | number | undefined; } | undefined; }[] | undefined; bcc?: { address?: string[] | undefined; } | undefined; cc?: { address?: string[] | undefined; } | undefined; content_type?: string | undefined; delivery_timestamp?: string | undefined; direction?: string | undefined; from?: { address?: string[] | undefined; } | undefined; local_id?: string | undefined; message_id?: string | undefined; origination_timestamp?: string | undefined; reply_to?: { address?: string[] | undefined; } | undefined; sender?: { address?: string | undefined; } | undefined; subject?: string | undefined; to?: { address?: string[] | undefined; } | undefined; x_mailer?: string | undefined; } | undefined; error?: { code?: string | undefined; id?: string | undefined; message?: string | undefined; stack_trace?: string | undefined; type?: string | undefined; } | undefined; event?: { action?: string | undefined; agent_id_status?: string | undefined; category?: string[] | undefined; code?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: string | number | undefined; end?: string | undefined; hash?: string | undefined; id?: string | undefined; ingested?: string | undefined; kind?: string | undefined; module?: string | undefined; original?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; severity?: string | number | undefined; start?: string | undefined; timezone?: string | undefined; type?: string[] | undefined; url?: string | undefined; } | undefined; faas?: { coldstart?: boolean | undefined; execution?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; } | undefined; file?: { accessed?: string | undefined; attributes?: string[] | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; created?: string | undefined; ctime?: string | undefined; device?: string | undefined; directory?: string | undefined; drive_letter?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; extension?: string | undefined; fork_name?: string | undefined; gid?: string | undefined; group?: string | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; inode?: string | undefined; mime_type?: string | undefined; mode?: string | undefined; mtime?: string | undefined; name?: string | undefined; owner?: string | undefined; path?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; size?: string | number | undefined; target_path?: string | undefined; type?: string | undefined; uid?: string | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; host?: { architecture?: string | undefined; boot?: { id?: string | undefined; } | undefined; cpu?: { usage?: string | number | undefined; } | undefined; disk?: { read?: { bytes?: string | number | undefined; } | undefined; write?: { bytes?: string | number | undefined; } | undefined; } | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; hostname?: string | undefined; id?: string | undefined; ip?: string[] | undefined; mac?: string[] | undefined; name?: string | undefined; network?: { egress?: { bytes?: string | number | undefined; packets?: string | number | undefined; } | undefined; ingress?: { bytes?: string | number | undefined; packets?: string | number | undefined; } | undefined; } | undefined; os?: { family?: string | undefined; full?: string | undefined; kernel?: string | undefined; name?: string | undefined; platform?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; pid_ns_ino?: string | undefined; risk?: { calculated_level?: string | undefined; calculated_score?: number | undefined; calculated_score_norm?: number | undefined; static_level?: string | undefined; static_score?: number | undefined; static_score_norm?: number | undefined; } | undefined; type?: string | undefined; uptime?: string | number | undefined; } | undefined; http?: { request?: { body?: { bytes?: string | number | undefined; content?: string | undefined; } | undefined; bytes?: string | number | undefined; id?: string | undefined; method?: string | undefined; mime_type?: string | undefined; referrer?: string | undefined; } | undefined; response?: { body?: { bytes?: string | number | undefined; content?: string | undefined; } | undefined; bytes?: string | number | undefined; mime_type?: string | undefined; status_code?: string | number | undefined; } | undefined; version?: string | undefined; } | undefined; log?: { file?: { path?: string | undefined; } | undefined; level?: string | undefined; logger?: string | undefined; origin?: { file?: { line?: string | number | undefined; name?: string | undefined; } | undefined; function?: string | undefined; } | undefined; } | undefined; message?: string | undefined; network?: { application?: string | undefined; bytes?: string | number | undefined; community_id?: string | undefined; direction?: string | undefined; forwarded_ip?: string | undefined; iana_number?: string | undefined; name?: string | undefined; packets?: string | number | undefined; protocol?: string | undefined; transport?: string | undefined; type?: string | undefined; vlan?: { id?: string | undefined; name?: string | undefined; } | undefined; } | undefined; observer?: { geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; hostname?: string | undefined; ip?: string[] | undefined; mac?: string[] | undefined; name?: string | undefined; os?: { family?: string | undefined; full?: string | undefined; kernel?: string | undefined; name?: string | undefined; platform?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; product?: string | undefined; serial_number?: string | undefined; type?: string | undefined; vendor?: string | undefined; version?: string | undefined; } | undefined; orchestrator?: { api_version?: string | undefined; cluster?: { id?: string | undefined; name?: string | undefined; url?: string | undefined; version?: string | undefined; } | undefined; namespace?: string | undefined; organization?: string | undefined; resource?: { id?: string | undefined; ip?: string[] | undefined; name?: string | undefined; parent?: { type?: string | undefined; } | undefined; type?: string | undefined; } | undefined; type?: string | undefined; } | undefined; organization?: { id?: string | undefined; name?: string | undefined; } | undefined; package?: { architecture?: string | undefined; build_version?: string | undefined; checksum?: string | undefined; description?: string | undefined; install_scope?: string | undefined; installed?: string | undefined; license?: string | undefined; name?: string | undefined; path?: string | undefined; reference?: string | undefined; size?: string | number | undefined; type?: string | undefined; version?: string | undefined; } | undefined; process?: { args?: string[] | undefined; args_count?: string | number | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; command_line?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; end?: string | undefined; entity_id?: string | undefined; entry_leader?: { args?: string[] | undefined; args_count?: string | number | undefined; attested_groups?: { name?: string | undefined; } | undefined; attested_user?: { id?: string | undefined; name?: string | undefined; } | undefined; command_line?: string | undefined; entity_id?: string | undefined; entry_meta?: { source?: { ip?: string | undefined; } | undefined; type?: string | undefined; } | undefined; executable?: string | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; parent?: { entity_id?: string | undefined; pid?: string | number | undefined; session_leader?: { entity_id?: string | undefined; pid?: string | number | undefined; start?: string | undefined; } | undefined; start?: string | undefined; } | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; same_as_process?: boolean | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; env_vars?: string[] | undefined; executable?: string | undefined; exit_code?: string | number | undefined; group_leader?: { args?: string[] | undefined; args_count?: string | number | undefined; command_line?: string | undefined; entity_id?: string | undefined; executable?: string | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; same_as_process?: boolean | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; parent?: { args?: string[] | undefined; args_count?: string | number | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; command_line?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; end?: string | undefined; entity_id?: string | undefined; executable?: string | undefined; exit_code?: string | number | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; group_leader?: { entity_id?: string | undefined; pid?: string | number | undefined; start?: string | undefined; } | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; pgid?: string | number | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; thread?: { id?: string | number | undefined; name?: string | undefined; } | undefined; title?: string | undefined; uptime?: string | number | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; pgid?: string | number | undefined; pid?: string | number | undefined; previous?: { args?: string[] | undefined; args_count?: string | number | undefined; executable?: string | undefined; } | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; session_leader?: { args?: string[] | undefined; args_count?: string | number | undefined; command_line?: string | undefined; entity_id?: string | undefined; executable?: string | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; parent?: { entity_id?: string | undefined; pid?: string | number | undefined; session_leader?: { entity_id?: string | undefined; pid?: string | number | undefined; start?: string | undefined; } | undefined; start?: string | undefined; } | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; same_as_process?: boolean | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; thread?: { id?: string | number | undefined; name?: string | undefined; } | undefined; title?: string | undefined; uptime?: string | number | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; registry?: { data?: { bytes?: string | undefined; strings?: string[] | undefined; type?: string | undefined; } | undefined; hive?: string | undefined; key?: string | undefined; path?: string | undefined; value?: string | undefined; } | undefined; related?: { hash?: string[] | undefined; hosts?: string[] | undefined; ip?: string[] | undefined; user?: string[] | undefined; } | undefined; rule?: { author?: string[] | undefined; category?: string | undefined; description?: string | undefined; id?: string | undefined; license?: string | undefined; name?: string | undefined; reference?: string | undefined; ruleset?: string | undefined; uuid?: string | undefined; version?: string | undefined; } | undefined; server?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; service?: { address?: string | undefined; environment?: string | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; node?: { name?: string | undefined; role?: string | undefined; roles?: string[] | undefined; } | undefined; origin?: { address?: string | undefined; environment?: string | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; node?: { name?: string | undefined; role?: string | undefined; roles?: string[] | undefined; } | undefined; state?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; state?: string | undefined; target?: { address?: string | undefined; environment?: string | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; node?: { name?: string | undefined; role?: string | undefined; roles?: string[] | undefined; } | undefined; state?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; type?: string | undefined; version?: string | undefined; } | undefined; source?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; span?: { id?: string | undefined; } | undefined; tags?: string[] | undefined; threat?: { enrichments?: { matched?: { atomic?: string | undefined; field?: string | undefined; id?: string | undefined; index?: string | undefined; occurred?: string | undefined; type?: string | undefined; } | undefined; }[] | undefined; feed?: { dashboard_id?: string | undefined; description?: string | undefined; name?: string | undefined; reference?: string | undefined; } | undefined; framework?: string | undefined; group?: { alias?: string[] | undefined; id?: string | undefined; name?: string | undefined; reference?: string | undefined; } | undefined; indicator?: { as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; confidence?: string | undefined; description?: string | undefined; email?: { address?: string | undefined; } | undefined; file?: { accessed?: string | undefined; attributes?: string[] | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; created?: string | undefined; ctime?: string | undefined; device?: string | undefined; directory?: string | undefined; drive_letter?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; extension?: string | undefined; fork_name?: string | undefined; gid?: string | undefined; group?: string | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; inode?: string | undefined; mime_type?: string | undefined; mode?: string | undefined; mtime?: string | undefined; name?: string | undefined; owner?: string | undefined; path?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; size?: string | number | undefined; target_path?: string | undefined; type?: string | undefined; uid?: string | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; first_seen?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; last_seen?: string | undefined; marking?: { tlp?: string | undefined; tlp_version?: string | undefined; } | undefined; modified_at?: string | undefined; port?: string | number | undefined; provider?: string | undefined; reference?: string | undefined; registry?: { data?: { bytes?: string | undefined; strings?: string[] | undefined; type?: string | undefined; } | undefined; hive?: string | undefined; key?: string | undefined; path?: string | undefined; value?: string | undefined; } | undefined; scanner_stats?: string | number | undefined; sightings?: string | number | undefined; type?: string | undefined; url?: { domain?: string | undefined; extension?: string | undefined; fragment?: string | undefined; full?: string | undefined; original?: string | undefined; password?: string | undefined; path?: string | undefined; port?: string | number | undefined; query?: string | undefined; registered_domain?: string | undefined; scheme?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; username?: string | undefined; } | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; software?: { alias?: string[] | undefined; id?: string | undefined; name?: string | undefined; platforms?: string[] | undefined; reference?: string | undefined; type?: string | undefined; } | undefined; tactic?: { id?: string[] | undefined; name?: string[] | undefined; reference?: string[] | undefined; } | undefined; technique?: { id?: string[] | undefined; name?: string[] | undefined; reference?: string[] | undefined; subtechnique?: { id?: string[] | undefined; name?: string[] | undefined; reference?: string[] | undefined; } | undefined; } | undefined; } | undefined; tls?: { cipher?: string | undefined; client?: { certificate?: string | undefined; certificate_chain?: string[] | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; } | undefined; issuer?: string | undefined; ja3?: string | undefined; not_after?: string | undefined; not_before?: string | undefined; server_name?: string | undefined; subject?: string | undefined; supported_ciphers?: string[] | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; curve?: string | undefined; established?: boolean | undefined; next_protocol?: string | undefined; resumed?: boolean | undefined; server?: { certificate?: string | undefined; certificate_chain?: string[] | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; } | undefined; issuer?: string | undefined; ja3s?: string | undefined; not_after?: string | undefined; not_before?: string | undefined; subject?: string | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; version?: string | undefined; version_protocol?: string | undefined; } | undefined; trace?: { id?: string | undefined; } | undefined; transaction?: { id?: string | undefined; } | undefined; url?: { domain?: string | undefined; extension?: string | undefined; fragment?: string | undefined; full?: string | undefined; original?: string | undefined; password?: string | undefined; path?: string | undefined; port?: string | number | undefined; query?: string | undefined; registered_domain?: string | undefined; scheme?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; username?: string | undefined; } | undefined; user?: { changes?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; domain?: string | undefined; effective?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; risk?: { calculated_level?: string | undefined; calculated_score?: number | undefined; calculated_score_norm?: number | undefined; static_level?: string | undefined; static_score?: number | undefined; static_score_norm?: number | undefined; } | undefined; roles?: string[] | undefined; target?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; user_agent?: { device?: { name?: string | undefined; } | undefined; name?: string | undefined; original?: string | undefined; os?: { family?: string | undefined; full?: string | undefined; kernel?: string | undefined; name?: string | undefined; platform?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; version?: string | undefined; } | undefined; vulnerability?: { category?: string[] | undefined; classification?: string | undefined; description?: string | undefined; enumeration?: string | undefined; id?: string | undefined; reference?: string | undefined; report_id?: string | undefined; scanner?: { vendor?: string | undefined; } | undefined; score?: { base?: number | undefined; environmental?: number | undefined; temporal?: number | undefined; version?: string | undefined; } | undefined; severity?: string | undefined; } | undefined; } & {} & { ecs?: { version?: string | undefined; } | undefined; kibana?: { alert?: { risk_score?: number | undefined; rule?: { author?: string | undefined; created_at?: string | undefined; created_by?: string | undefined; description?: string | undefined; enabled?: string | undefined; from?: string | undefined; interval?: string | undefined; license?: string | undefined; note?: string | undefined; references?: string[] | undefined; rule_id?: string | undefined; rule_name_override?: string | undefined; to?: string | undefined; type?: string | undefined; updated_at?: string | undefined; updated_by?: string | undefined; version?: string | undefined; } | undefined; severity?: string | undefined; suppression?: { docs_count?: string | number | undefined; end?: string | undefined; start?: string | undefined; terms?: { field?: string[] | undefined; value?: string[] | undefined; } | undefined; } | undefined; system_status?: string | undefined; workflow_reason?: string | undefined; workflow_user?: string | undefined; } | undefined; } | undefined; })" + "({ '@timestamp': string; kibana: { alert: { instance: { id: string; }; rule: { category: string; consumer: string; name: string; producer: string; revision: string | number; rule_type_id: string; uuid: string; }; status: string; uuid: string; }; space_ids: string[]; }; } & { event?: { action?: string | undefined; kind?: string | undefined; } | undefined; kibana?: { alert?: { action_group?: string | undefined; case_ids?: string[] | undefined; duration?: { us?: string | number | undefined; } | undefined; end?: string | undefined; flapping?: boolean | undefined; flapping_history?: boolean[] | undefined; last_detected?: string | undefined; maintenance_window_ids?: string[] | undefined; reason?: string | undefined; rule?: { execution?: { uuid?: string | undefined; } | undefined; parameters?: unknown; tags?: string[] | undefined; } | undefined; start?: string | undefined; time_range?: { gte?: string | undefined; lte?: string | undefined; } | undefined; url?: string | undefined; workflow_status?: string | undefined; workflow_tags?: string[] | undefined; } | undefined; version?: string | undefined; } | undefined; tags?: string[] | undefined; }) | ({} & { agent?: { name?: string | undefined; } | undefined; error?: { grouping_key?: string | undefined; grouping_name?: string | undefined; } | undefined; kibana?: { alert?: { evaluation?: { threshold?: string | number | undefined; value?: string | number | undefined; values?: (string | number)[] | undefined; } | undefined; } | undefined; } | undefined; processor?: { event?: string | undefined; } | undefined; service?: { environment?: string | undefined; language?: { name?: string | undefined; } | undefined; name?: string | undefined; } | undefined; transaction?: { name?: string | undefined; type?: string | undefined; } | undefined; } & { '@timestamp': string; kibana: { alert: { instance: { id: string; }; rule: { category: string; consumer: string; name: string; producer: string; revision: string | number; rule_type_id: string; uuid: string; }; status: string; uuid: string; }; space_ids: string[]; }; } & { event?: { action?: string | undefined; kind?: string | undefined; } | undefined; kibana?: { alert?: { action_group?: string | undefined; case_ids?: string[] | undefined; duration?: { us?: string | number | undefined; } | undefined; end?: string | undefined; flapping?: boolean | undefined; flapping_history?: boolean[] | undefined; last_detected?: string | undefined; maintenance_window_ids?: string[] | undefined; reason?: string | undefined; rule?: { execution?: { uuid?: string | undefined; } | undefined; parameters?: unknown; tags?: string[] | undefined; } | undefined; start?: string | undefined; time_range?: { gte?: string | undefined; lte?: string | undefined; } | undefined; url?: string | undefined; workflow_status?: string | undefined; workflow_tags?: string[] | undefined; } | undefined; version?: string | undefined; } | undefined; tags?: string[] | undefined; } & {} & { ecs?: { version?: string | undefined; } | undefined; kibana?: { alert?: { risk_score?: number | undefined; rule?: { author?: string | undefined; created_at?: string | undefined; created_by?: string | undefined; description?: string | undefined; enabled?: string | undefined; from?: string | undefined; interval?: string | undefined; license?: string | undefined; note?: string | undefined; references?: string[] | undefined; rule_id?: string | undefined; rule_name_override?: string | undefined; to?: string | undefined; type?: string | undefined; updated_at?: string | undefined; updated_by?: string | undefined; version?: string | undefined; } | undefined; severity?: string | undefined; suppression?: { docs_count?: string | number | undefined; end?: string | undefined; start?: string | undefined; terms?: { field?: string[] | undefined; value?: string[] | undefined; } | undefined; } | undefined; system_status?: string | undefined; workflow_reason?: string | undefined; workflow_user?: string | undefined; } | undefined; } | undefined; }) | ({} & { kibana?: { alert?: { evaluation?: { threshold?: string | number | undefined; value?: string | number | undefined; values?: (string | number)[] | undefined; } | undefined; } | undefined; } | undefined; } & { '@timestamp': string; kibana: { alert: { instance: { id: string; }; rule: { category: string; consumer: string; name: string; producer: string; revision: string | number; rule_type_id: string; uuid: string; }; status: string; uuid: string; }; space_ids: string[]; }; } & { event?: { action?: string | undefined; kind?: string | undefined; } | undefined; kibana?: { alert?: { action_group?: string | undefined; case_ids?: string[] | undefined; duration?: { us?: string | number | undefined; } | undefined; end?: string | undefined; flapping?: boolean | undefined; flapping_history?: boolean[] | undefined; last_detected?: string | undefined; maintenance_window_ids?: string[] | undefined; reason?: string | undefined; rule?: { execution?: { uuid?: string | undefined; } | undefined; parameters?: unknown; tags?: string[] | undefined; } | undefined; start?: string | undefined; time_range?: { gte?: string | undefined; lte?: string | undefined; } | undefined; url?: string | undefined; workflow_status?: string | undefined; workflow_tags?: string[] | undefined; } | undefined; version?: string | undefined; } | undefined; tags?: string[] | undefined; } & { '@timestamp': string; ecs: { version: string; }; } & { agent?: { build?: { original?: string | undefined; } | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; client?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; cloud?: { account?: { id?: string | undefined; name?: string | undefined; } | undefined; availability_zone?: string | undefined; instance?: { id?: string | undefined; name?: string | undefined; } | undefined; machine?: { type?: string | undefined; } | undefined; origin?: { account?: { id?: string | undefined; name?: string | undefined; } | undefined; availability_zone?: string | undefined; instance?: { id?: string | undefined; name?: string | undefined; } | undefined; machine?: { type?: string | undefined; } | undefined; project?: { id?: string | undefined; name?: string | undefined; } | undefined; provider?: string | undefined; region?: string | undefined; service?: { name?: string | undefined; } | undefined; } | undefined; project?: { id?: string | undefined; name?: string | undefined; } | undefined; provider?: string | undefined; region?: string | undefined; service?: { name?: string | undefined; } | undefined; target?: { account?: { id?: string | undefined; name?: string | undefined; } | undefined; availability_zone?: string | undefined; instance?: { id?: string | undefined; name?: string | undefined; } | undefined; machine?: { type?: string | undefined; } | undefined; project?: { id?: string | undefined; name?: string | undefined; } | undefined; provider?: string | undefined; region?: string | undefined; service?: { name?: string | undefined; } | undefined; } | undefined; } | undefined; container?: { cpu?: { usage?: string | number | undefined; } | undefined; disk?: { read?: { bytes?: string | number | undefined; } | undefined; write?: { bytes?: string | number | undefined; } | undefined; } | undefined; id?: string | undefined; image?: { hash?: { all?: string[] | undefined; } | undefined; name?: string | undefined; tag?: string[] | undefined; } | undefined; memory?: { usage?: string | number | undefined; } | undefined; name?: string | undefined; network?: { egress?: { bytes?: string | number | undefined; } | undefined; ingress?: { bytes?: string | number | undefined; } | undefined; } | undefined; runtime?: string | undefined; } | undefined; destination?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; device?: { id?: string | undefined; manufacturer?: string | undefined; model?: { identifier?: string | undefined; name?: string | undefined; } | undefined; } | undefined; dll?: { code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; name?: string | undefined; path?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; } | undefined; dns?: { answers?: { class?: string | undefined; data?: string | undefined; name?: string | undefined; ttl?: string | number | undefined; type?: string | undefined; }[] | undefined; header_flags?: string[] | undefined; id?: string | undefined; op_code?: string | undefined; question?: { class?: string | undefined; name?: string | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; type?: string | undefined; } | undefined; resolved_ip?: string[] | undefined; response_code?: string | undefined; type?: string | undefined; } | undefined; email?: { attachments?: { file?: { extension?: string | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; mime_type?: string | undefined; name?: string | undefined; size?: string | number | undefined; } | undefined; }[] | undefined; bcc?: { address?: string[] | undefined; } | undefined; cc?: { address?: string[] | undefined; } | undefined; content_type?: string | undefined; delivery_timestamp?: string | undefined; direction?: string | undefined; from?: { address?: string[] | undefined; } | undefined; local_id?: string | undefined; message_id?: string | undefined; origination_timestamp?: string | undefined; reply_to?: { address?: string[] | undefined; } | undefined; sender?: { address?: string | undefined; } | undefined; subject?: string | undefined; to?: { address?: string[] | undefined; } | undefined; x_mailer?: string | undefined; } | undefined; error?: { code?: string | undefined; id?: string | undefined; message?: string | undefined; stack_trace?: string | undefined; type?: string | undefined; } | undefined; event?: { action?: string | undefined; agent_id_status?: string | undefined; category?: string[] | undefined; code?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: string | number | undefined; end?: string | undefined; hash?: string | undefined; id?: string | undefined; ingested?: string | undefined; kind?: string | undefined; module?: string | undefined; original?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; severity?: string | number | undefined; start?: string | undefined; timezone?: string | undefined; type?: string[] | undefined; url?: string | undefined; } | undefined; faas?: { coldstart?: boolean | undefined; execution?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; } | undefined; file?: { accessed?: string | undefined; attributes?: string[] | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; created?: string | undefined; ctime?: string | undefined; device?: string | undefined; directory?: string | undefined; drive_letter?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; extension?: string | undefined; fork_name?: string | undefined; gid?: string | undefined; group?: string | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; inode?: string | undefined; mime_type?: string | undefined; mode?: string | undefined; mtime?: string | undefined; name?: string | undefined; owner?: string | undefined; path?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; size?: string | number | undefined; target_path?: string | undefined; type?: string | undefined; uid?: string | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; host?: { architecture?: string | undefined; boot?: { id?: string | undefined; } | undefined; cpu?: { usage?: string | number | undefined; } | undefined; disk?: { read?: { bytes?: string | number | undefined; } | undefined; write?: { bytes?: string | number | undefined; } | undefined; } | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; hostname?: string | undefined; id?: string | undefined; ip?: string[] | undefined; mac?: string[] | undefined; name?: string | undefined; network?: { egress?: { bytes?: string | number | undefined; packets?: string | number | undefined; } | undefined; ingress?: { bytes?: string | number | undefined; packets?: string | number | undefined; } | undefined; } | undefined; os?: { family?: string | undefined; full?: string | undefined; kernel?: string | undefined; name?: string | undefined; platform?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; pid_ns_ino?: string | undefined; risk?: { calculated_level?: string | undefined; calculated_score?: number | undefined; calculated_score_norm?: number | undefined; static_level?: string | undefined; static_score?: number | undefined; static_score_norm?: number | undefined; } | undefined; type?: string | undefined; uptime?: string | number | undefined; } | undefined; http?: { request?: { body?: { bytes?: string | number | undefined; content?: string | undefined; } | undefined; bytes?: string | number | undefined; id?: string | undefined; method?: string | undefined; mime_type?: string | undefined; referrer?: string | undefined; } | undefined; response?: { body?: { bytes?: string | number | undefined; content?: string | undefined; } | undefined; bytes?: string | number | undefined; mime_type?: string | undefined; status_code?: string | number | undefined; } | undefined; version?: string | undefined; } | undefined; log?: { file?: { path?: string | undefined; } | undefined; level?: string | undefined; logger?: string | undefined; origin?: { file?: { line?: string | number | undefined; name?: string | undefined; } | undefined; function?: string | undefined; } | undefined; } | undefined; message?: string | undefined; network?: { application?: string | undefined; bytes?: string | number | undefined; community_id?: string | undefined; direction?: string | undefined; forwarded_ip?: string | undefined; iana_number?: string | undefined; name?: string | undefined; packets?: string | number | undefined; protocol?: string | undefined; transport?: string | undefined; type?: string | undefined; vlan?: { id?: string | undefined; name?: string | undefined; } | undefined; } | undefined; observer?: { geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; hostname?: string | undefined; ip?: string[] | undefined; mac?: string[] | undefined; name?: string | undefined; os?: { family?: string | undefined; full?: string | undefined; kernel?: string | undefined; name?: string | undefined; platform?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; product?: string | undefined; serial_number?: string | undefined; type?: string | undefined; vendor?: string | undefined; version?: string | undefined; } | undefined; orchestrator?: { api_version?: string | undefined; cluster?: { id?: string | undefined; name?: string | undefined; url?: string | undefined; version?: string | undefined; } | undefined; namespace?: string | undefined; organization?: string | undefined; resource?: { id?: string | undefined; ip?: string[] | undefined; name?: string | undefined; parent?: { type?: string | undefined; } | undefined; type?: string | undefined; } | undefined; type?: string | undefined; } | undefined; organization?: { id?: string | undefined; name?: string | undefined; } | undefined; package?: { architecture?: string | undefined; build_version?: string | undefined; checksum?: string | undefined; description?: string | undefined; install_scope?: string | undefined; installed?: string | undefined; license?: string | undefined; name?: string | undefined; path?: string | undefined; reference?: string | undefined; size?: string | number | undefined; type?: string | undefined; version?: string | undefined; } | undefined; process?: { args?: string[] | undefined; args_count?: string | number | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; command_line?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; end?: string | undefined; entity_id?: string | undefined; entry_leader?: { args?: string[] | undefined; args_count?: string | number | undefined; attested_groups?: { name?: string | undefined; } | undefined; attested_user?: { id?: string | undefined; name?: string | undefined; } | undefined; command_line?: string | undefined; entity_id?: string | undefined; entry_meta?: { source?: { ip?: string | undefined; } | undefined; type?: string | undefined; } | undefined; executable?: string | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; parent?: { entity_id?: string | undefined; pid?: string | number | undefined; session_leader?: { entity_id?: string | undefined; pid?: string | number | undefined; start?: string | undefined; } | undefined; start?: string | undefined; } | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; same_as_process?: boolean | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; env_vars?: string[] | undefined; executable?: string | undefined; exit_code?: string | number | undefined; group_leader?: { args?: string[] | undefined; args_count?: string | number | undefined; command_line?: string | undefined; entity_id?: string | undefined; executable?: string | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; same_as_process?: boolean | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; parent?: { args?: string[] | undefined; args_count?: string | number | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; command_line?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; end?: string | undefined; entity_id?: string | undefined; executable?: string | undefined; exit_code?: string | number | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; group_leader?: { entity_id?: string | undefined; pid?: string | number | undefined; start?: string | undefined; } | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; pgid?: string | number | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; thread?: { id?: string | number | undefined; name?: string | undefined; } | undefined; title?: string | undefined; uptime?: string | number | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; pgid?: string | number | undefined; pid?: string | number | undefined; previous?: { args?: string[] | undefined; args_count?: string | number | undefined; executable?: string | undefined; } | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; session_leader?: { args?: string[] | undefined; args_count?: string | number | undefined; command_line?: string | undefined; entity_id?: string | undefined; executable?: string | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; parent?: { entity_id?: string | undefined; pid?: string | number | undefined; session_leader?: { entity_id?: string | undefined; pid?: string | number | undefined; start?: string | undefined; } | undefined; start?: string | undefined; } | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; same_as_process?: boolean | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; thread?: { id?: string | number | undefined; name?: string | undefined; } | undefined; title?: string | undefined; uptime?: string | number | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; registry?: { data?: { bytes?: string | undefined; strings?: string[] | undefined; type?: string | undefined; } | undefined; hive?: string | undefined; key?: string | undefined; path?: string | undefined; value?: string | undefined; } | undefined; related?: { hash?: string[] | undefined; hosts?: string[] | undefined; ip?: string[] | undefined; user?: string[] | undefined; } | undefined; rule?: { author?: string[] | undefined; category?: string | undefined; description?: string | undefined; id?: string | undefined; license?: string | undefined; name?: string | undefined; reference?: string | undefined; ruleset?: string | undefined; uuid?: string | undefined; version?: string | undefined; } | undefined; server?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; service?: { address?: string | undefined; environment?: string | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; node?: { name?: string | undefined; role?: string | undefined; roles?: string[] | undefined; } | undefined; origin?: { address?: string | undefined; environment?: string | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; node?: { name?: string | undefined; role?: string | undefined; roles?: string[] | undefined; } | undefined; state?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; state?: string | undefined; target?: { address?: string | undefined; environment?: string | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; node?: { name?: string | undefined; role?: string | undefined; roles?: string[] | undefined; } | undefined; state?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; type?: string | undefined; version?: string | undefined; } | undefined; source?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; span?: { id?: string | undefined; } | undefined; tags?: string[] | undefined; threat?: { enrichments?: { matched?: { atomic?: string | undefined; field?: string | undefined; id?: string | undefined; index?: string | undefined; occurred?: string | undefined; type?: string | undefined; } | undefined; }[] | undefined; feed?: { dashboard_id?: string | undefined; description?: string | undefined; name?: string | undefined; reference?: string | undefined; } | undefined; framework?: string | undefined; group?: { alias?: string[] | undefined; id?: string | undefined; name?: string | undefined; reference?: string | undefined; } | undefined; indicator?: { as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; confidence?: string | undefined; description?: string | undefined; email?: { address?: string | undefined; } | undefined; file?: { accessed?: string | undefined; attributes?: string[] | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; created?: string | undefined; ctime?: string | undefined; device?: string | undefined; directory?: string | undefined; drive_letter?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; extension?: string | undefined; fork_name?: string | undefined; gid?: string | undefined; group?: string | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; inode?: string | undefined; mime_type?: string | undefined; mode?: string | undefined; mtime?: string | undefined; name?: string | undefined; owner?: string | undefined; path?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; size?: string | number | undefined; target_path?: string | undefined; type?: string | undefined; uid?: string | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; first_seen?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; last_seen?: string | undefined; marking?: { tlp?: string | undefined; tlp_version?: string | undefined; } | undefined; modified_at?: string | undefined; port?: string | number | undefined; provider?: string | undefined; reference?: string | undefined; registry?: { data?: { bytes?: string | undefined; strings?: string[] | undefined; type?: string | undefined; } | undefined; hive?: string | undefined; key?: string | undefined; path?: string | undefined; value?: string | undefined; } | undefined; scanner_stats?: string | number | undefined; sightings?: string | number | undefined; type?: string | undefined; url?: { domain?: string | undefined; extension?: string | undefined; fragment?: string | undefined; full?: string | undefined; original?: string | undefined; password?: string | undefined; path?: string | undefined; port?: string | number | undefined; query?: string | undefined; registered_domain?: string | undefined; scheme?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; username?: string | undefined; } | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; software?: { alias?: string[] | undefined; id?: string | undefined; name?: string | undefined; platforms?: string[] | undefined; reference?: string | undefined; type?: string | undefined; } | undefined; tactic?: { id?: string[] | undefined; name?: string[] | undefined; reference?: string[] | undefined; } | undefined; technique?: { id?: string[] | undefined; name?: string[] | undefined; reference?: string[] | undefined; subtechnique?: { id?: string[] | undefined; name?: string[] | undefined; reference?: string[] | undefined; } | undefined; } | undefined; } | undefined; tls?: { cipher?: string | undefined; client?: { certificate?: string | undefined; certificate_chain?: string[] | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; } | undefined; issuer?: string | undefined; ja3?: string | undefined; not_after?: string | undefined; not_before?: string | undefined; server_name?: string | undefined; subject?: string | undefined; supported_ciphers?: string[] | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; curve?: string | undefined; established?: boolean | undefined; next_protocol?: string | undefined; resumed?: boolean | undefined; server?: { certificate?: string | undefined; certificate_chain?: string[] | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; } | undefined; issuer?: string | undefined; ja3s?: string | undefined; not_after?: string | undefined; not_before?: string | undefined; subject?: string | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; version?: string | undefined; version_protocol?: string | undefined; } | undefined; trace?: { id?: string | undefined; } | undefined; transaction?: { id?: string | undefined; } | undefined; url?: { domain?: string | undefined; extension?: string | undefined; fragment?: string | undefined; full?: string | undefined; original?: string | undefined; password?: string | undefined; path?: string | undefined; port?: string | number | undefined; query?: string | undefined; registered_domain?: string | undefined; scheme?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; username?: string | undefined; } | undefined; user?: { changes?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; domain?: string | undefined; effective?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; risk?: { calculated_level?: string | undefined; calculated_score?: number | undefined; calculated_score_norm?: number | undefined; static_level?: string | undefined; static_score?: number | undefined; static_score_norm?: number | undefined; } | undefined; roles?: string[] | undefined; target?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; user_agent?: { device?: { name?: string | undefined; } | undefined; name?: string | undefined; original?: string | undefined; os?: { family?: string | undefined; full?: string | undefined; kernel?: string | undefined; name?: string | undefined; platform?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; version?: string | undefined; } | undefined; vulnerability?: { category?: string[] | undefined; classification?: string | undefined; description?: string | undefined; enumeration?: string | undefined; id?: string | undefined; reference?: string | undefined; report_id?: string | undefined; scanner?: { vendor?: string | undefined; } | undefined; score?: { base?: number | undefined; environmental?: number | undefined; temporal?: number | undefined; version?: string | undefined; } | undefined; severity?: string | undefined; } | undefined; } & {} & { ecs?: { version?: string | undefined; } | undefined; kibana?: { alert?: { risk_score?: number | undefined; rule?: { author?: string | undefined; created_at?: string | undefined; created_by?: string | undefined; description?: string | undefined; enabled?: string | undefined; from?: string | undefined; interval?: string | undefined; license?: string | undefined; note?: string | undefined; references?: string[] | undefined; rule_id?: string | undefined; rule_name_override?: string | undefined; to?: string | undefined; type?: string | undefined; updated_at?: string | undefined; updated_by?: string | undefined; version?: string | undefined; } | undefined; severity?: string | undefined; suppression?: { docs_count?: string | number | undefined; end?: string | undefined; start?: string | undefined; terms?: { field?: string[] | undefined; value?: string[] | undefined; } | undefined; } | undefined; system_status?: string | undefined; workflow_reason?: string | undefined; workflow_user?: string | undefined; } | undefined; } | undefined; }) | ({} & { kibana?: { alert?: { evaluation?: { threshold?: string | number | undefined; value?: string | number | undefined; values?: (string | number)[] | undefined; } | undefined; } | undefined; } | undefined; } & { '@timestamp': string; kibana: { alert: { instance: { id: string; }; rule: { category: string; consumer: string; name: string; producer: string; revision: string | number; rule_type_id: string; uuid: string; }; status: string; uuid: string; }; space_ids: string[]; }; } & { event?: { action?: string | undefined; kind?: string | undefined; } | undefined; kibana?: { alert?: { action_group?: string | undefined; case_ids?: string[] | undefined; duration?: { us?: string | number | undefined; } | undefined; end?: string | undefined; flapping?: boolean | undefined; flapping_history?: boolean[] | undefined; last_detected?: string | undefined; maintenance_window_ids?: string[] | undefined; reason?: string | undefined; rule?: { execution?: { uuid?: string | undefined; } | undefined; parameters?: unknown; tags?: string[] | undefined; } | undefined; start?: string | undefined; time_range?: { gte?: string | undefined; lte?: string | undefined; } | undefined; url?: string | undefined; workflow_status?: string | undefined; workflow_tags?: string[] | undefined; } | undefined; version?: string | undefined; } | undefined; tags?: string[] | undefined; } & { '@timestamp': string; ecs: { version: string; }; } & { agent?: { build?: { original?: string | undefined; } | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; client?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; cloud?: { account?: { id?: string | undefined; name?: string | undefined; } | undefined; availability_zone?: string | undefined; instance?: { id?: string | undefined; name?: string | undefined; } | undefined; machine?: { type?: string | undefined; } | undefined; origin?: { account?: { id?: string | undefined; name?: string | undefined; } | undefined; availability_zone?: string | undefined; instance?: { id?: string | undefined; name?: string | undefined; } | undefined; machine?: { type?: string | undefined; } | undefined; project?: { id?: string | undefined; name?: string | undefined; } | undefined; provider?: string | undefined; region?: string | undefined; service?: { name?: string | undefined; } | undefined; } | undefined; project?: { id?: string | undefined; name?: string | undefined; } | undefined; provider?: string | undefined; region?: string | undefined; service?: { name?: string | undefined; } | undefined; target?: { account?: { id?: string | undefined; name?: string | undefined; } | undefined; availability_zone?: string | undefined; instance?: { id?: string | undefined; name?: string | undefined; } | undefined; machine?: { type?: string | undefined; } | undefined; project?: { id?: string | undefined; name?: string | undefined; } | undefined; provider?: string | undefined; region?: string | undefined; service?: { name?: string | undefined; } | undefined; } | undefined; } | undefined; container?: { cpu?: { usage?: string | number | undefined; } | undefined; disk?: { read?: { bytes?: string | number | undefined; } | undefined; write?: { bytes?: string | number | undefined; } | undefined; } | undefined; id?: string | undefined; image?: { hash?: { all?: string[] | undefined; } | undefined; name?: string | undefined; tag?: string[] | undefined; } | undefined; memory?: { usage?: string | number | undefined; } | undefined; name?: string | undefined; network?: { egress?: { bytes?: string | number | undefined; } | undefined; ingress?: { bytes?: string | number | undefined; } | undefined; } | undefined; runtime?: string | undefined; } | undefined; destination?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; device?: { id?: string | undefined; manufacturer?: string | undefined; model?: { identifier?: string | undefined; name?: string | undefined; } | undefined; } | undefined; dll?: { code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; name?: string | undefined; path?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; } | undefined; dns?: { answers?: { class?: string | undefined; data?: string | undefined; name?: string | undefined; ttl?: string | number | undefined; type?: string | undefined; }[] | undefined; header_flags?: string[] | undefined; id?: string | undefined; op_code?: string | undefined; question?: { class?: string | undefined; name?: string | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; type?: string | undefined; } | undefined; resolved_ip?: string[] | undefined; response_code?: string | undefined; type?: string | undefined; } | undefined; email?: { attachments?: { file?: { extension?: string | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; mime_type?: string | undefined; name?: string | undefined; size?: string | number | undefined; } | undefined; }[] | undefined; bcc?: { address?: string[] | undefined; } | undefined; cc?: { address?: string[] | undefined; } | undefined; content_type?: string | undefined; delivery_timestamp?: string | undefined; direction?: string | undefined; from?: { address?: string[] | undefined; } | undefined; local_id?: string | undefined; message_id?: string | undefined; origination_timestamp?: string | undefined; reply_to?: { address?: string[] | undefined; } | undefined; sender?: { address?: string | undefined; } | undefined; subject?: string | undefined; to?: { address?: string[] | undefined; } | undefined; x_mailer?: string | undefined; } | undefined; error?: { code?: string | undefined; id?: string | undefined; message?: string | undefined; stack_trace?: string | undefined; type?: string | undefined; } | undefined; event?: { action?: string | undefined; agent_id_status?: string | undefined; category?: string[] | undefined; code?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: string | number | undefined; end?: string | undefined; hash?: string | undefined; id?: string | undefined; ingested?: string | undefined; kind?: string | undefined; module?: string | undefined; original?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; severity?: string | number | undefined; start?: string | undefined; timezone?: string | undefined; type?: string[] | undefined; url?: string | undefined; } | undefined; faas?: { coldstart?: boolean | undefined; execution?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; } | undefined; file?: { accessed?: string | undefined; attributes?: string[] | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; created?: string | undefined; ctime?: string | undefined; device?: string | undefined; directory?: string | undefined; drive_letter?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; extension?: string | undefined; fork_name?: string | undefined; gid?: string | undefined; group?: string | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; inode?: string | undefined; mime_type?: string | undefined; mode?: string | undefined; mtime?: string | undefined; name?: string | undefined; owner?: string | undefined; path?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; size?: string | number | undefined; target_path?: string | undefined; type?: string | undefined; uid?: string | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; host?: { architecture?: string | undefined; boot?: { id?: string | undefined; } | undefined; cpu?: { usage?: string | number | undefined; } | undefined; disk?: { read?: { bytes?: string | number | undefined; } | undefined; write?: { bytes?: string | number | undefined; } | undefined; } | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; hostname?: string | undefined; id?: string | undefined; ip?: string[] | undefined; mac?: string[] | undefined; name?: string | undefined; network?: { egress?: { bytes?: string | number | undefined; packets?: string | number | undefined; } | undefined; ingress?: { bytes?: string | number | undefined; packets?: string | number | undefined; } | undefined; } | undefined; os?: { family?: string | undefined; full?: string | undefined; kernel?: string | undefined; name?: string | undefined; platform?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; pid_ns_ino?: string | undefined; risk?: { calculated_level?: string | undefined; calculated_score?: number | undefined; calculated_score_norm?: number | undefined; static_level?: string | undefined; static_score?: number | undefined; static_score_norm?: number | undefined; } | undefined; type?: string | undefined; uptime?: string | number | undefined; } | undefined; http?: { request?: { body?: { bytes?: string | number | undefined; content?: string | undefined; } | undefined; bytes?: string | number | undefined; id?: string | undefined; method?: string | undefined; mime_type?: string | undefined; referrer?: string | undefined; } | undefined; response?: { body?: { bytes?: string | number | undefined; content?: string | undefined; } | undefined; bytes?: string | number | undefined; mime_type?: string | undefined; status_code?: string | number | undefined; } | undefined; version?: string | undefined; } | undefined; log?: { file?: { path?: string | undefined; } | undefined; level?: string | undefined; logger?: string | undefined; origin?: { file?: { line?: string | number | undefined; name?: string | undefined; } | undefined; function?: string | undefined; } | undefined; } | undefined; message?: string | undefined; network?: { application?: string | undefined; bytes?: string | number | undefined; community_id?: string | undefined; direction?: string | undefined; forwarded_ip?: string | undefined; iana_number?: string | undefined; name?: string | undefined; packets?: string | number | undefined; protocol?: string | undefined; transport?: string | undefined; type?: string | undefined; vlan?: { id?: string | undefined; name?: string | undefined; } | undefined; } | undefined; observer?: { geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; hostname?: string | undefined; ip?: string[] | undefined; mac?: string[] | undefined; name?: string | undefined; os?: { family?: string | undefined; full?: string | undefined; kernel?: string | undefined; name?: string | undefined; platform?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; product?: string | undefined; serial_number?: string | undefined; type?: string | undefined; vendor?: string | undefined; version?: string | undefined; } | undefined; orchestrator?: { api_version?: string | undefined; cluster?: { id?: string | undefined; name?: string | undefined; url?: string | undefined; version?: string | undefined; } | undefined; namespace?: string | undefined; organization?: string | undefined; resource?: { id?: string | undefined; ip?: string[] | undefined; name?: string | undefined; parent?: { type?: string | undefined; } | undefined; type?: string | undefined; } | undefined; type?: string | undefined; } | undefined; organization?: { id?: string | undefined; name?: string | undefined; } | undefined; package?: { architecture?: string | undefined; build_version?: string | undefined; checksum?: string | undefined; description?: string | undefined; install_scope?: string | undefined; installed?: string | undefined; license?: string | undefined; name?: string | undefined; path?: string | undefined; reference?: string | undefined; size?: string | number | undefined; type?: string | undefined; version?: string | undefined; } | undefined; process?: { args?: string[] | undefined; args_count?: string | number | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; command_line?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; end?: string | undefined; entity_id?: string | undefined; entry_leader?: { args?: string[] | undefined; args_count?: string | number | undefined; attested_groups?: { name?: string | undefined; } | undefined; attested_user?: { id?: string | undefined; name?: string | undefined; } | undefined; command_line?: string | undefined; entity_id?: string | undefined; entry_meta?: { source?: { ip?: string | undefined; } | undefined; type?: string | undefined; } | undefined; executable?: string | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; parent?: { entity_id?: string | undefined; pid?: string | number | undefined; session_leader?: { entity_id?: string | undefined; pid?: string | number | undefined; start?: string | undefined; } | undefined; start?: string | undefined; } | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; same_as_process?: boolean | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; env_vars?: string[] | undefined; executable?: string | undefined; exit_code?: string | number | undefined; group_leader?: { args?: string[] | undefined; args_count?: string | number | undefined; command_line?: string | undefined; entity_id?: string | undefined; executable?: string | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; same_as_process?: boolean | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; parent?: { args?: string[] | undefined; args_count?: string | number | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; command_line?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; end?: string | undefined; entity_id?: string | undefined; executable?: string | undefined; exit_code?: string | number | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; group_leader?: { entity_id?: string | undefined; pid?: string | number | undefined; start?: string | undefined; } | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; pgid?: string | number | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; thread?: { id?: string | number | undefined; name?: string | undefined; } | undefined; title?: string | undefined; uptime?: string | number | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; pgid?: string | number | undefined; pid?: string | number | undefined; previous?: { args?: string[] | undefined; args_count?: string | number | undefined; executable?: string | undefined; } | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; session_leader?: { args?: string[] | undefined; args_count?: string | number | undefined; command_line?: string | undefined; entity_id?: string | undefined; executable?: string | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; parent?: { entity_id?: string | undefined; pid?: string | number | undefined; session_leader?: { entity_id?: string | undefined; pid?: string | number | undefined; start?: string | undefined; } | undefined; start?: string | undefined; } | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; same_as_process?: boolean | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; thread?: { id?: string | number | undefined; name?: string | undefined; } | undefined; title?: string | undefined; uptime?: string | number | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; registry?: { data?: { bytes?: string | undefined; strings?: string[] | undefined; type?: string | undefined; } | undefined; hive?: string | undefined; key?: string | undefined; path?: string | undefined; value?: string | undefined; } | undefined; related?: { hash?: string[] | undefined; hosts?: string[] | undefined; ip?: string[] | undefined; user?: string[] | undefined; } | undefined; rule?: { author?: string[] | undefined; category?: string | undefined; description?: string | undefined; id?: string | undefined; license?: string | undefined; name?: string | undefined; reference?: string | undefined; ruleset?: string | undefined; uuid?: string | undefined; version?: string | undefined; } | undefined; server?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; service?: { address?: string | undefined; environment?: string | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; node?: { name?: string | undefined; role?: string | undefined; roles?: string[] | undefined; } | undefined; origin?: { address?: string | undefined; environment?: string | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; node?: { name?: string | undefined; role?: string | undefined; roles?: string[] | undefined; } | undefined; state?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; state?: string | undefined; target?: { address?: string | undefined; environment?: string | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; node?: { name?: string | undefined; role?: string | undefined; roles?: string[] | undefined; } | undefined; state?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; type?: string | undefined; version?: string | undefined; } | undefined; source?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; span?: { id?: string | undefined; } | undefined; tags?: string[] | undefined; threat?: { enrichments?: { matched?: { atomic?: string | undefined; field?: string | undefined; id?: string | undefined; index?: string | undefined; occurred?: string | undefined; type?: string | undefined; } | undefined; }[] | undefined; feed?: { dashboard_id?: string | undefined; description?: string | undefined; name?: string | undefined; reference?: string | undefined; } | undefined; framework?: string | undefined; group?: { alias?: string[] | undefined; id?: string | undefined; name?: string | undefined; reference?: string | undefined; } | undefined; indicator?: { as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; confidence?: string | undefined; description?: string | undefined; email?: { address?: string | undefined; } | undefined; file?: { accessed?: string | undefined; attributes?: string[] | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; created?: string | undefined; ctime?: string | undefined; device?: string | undefined; directory?: string | undefined; drive_letter?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; extension?: string | undefined; fork_name?: string | undefined; gid?: string | undefined; group?: string | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; inode?: string | undefined; mime_type?: string | undefined; mode?: string | undefined; mtime?: string | undefined; name?: string | undefined; owner?: string | undefined; path?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; size?: string | number | undefined; target_path?: string | undefined; type?: string | undefined; uid?: string | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; first_seen?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; last_seen?: string | undefined; marking?: { tlp?: string | undefined; tlp_version?: string | undefined; } | undefined; modified_at?: string | undefined; port?: string | number | undefined; provider?: string | undefined; reference?: string | undefined; registry?: { data?: { bytes?: string | undefined; strings?: string[] | undefined; type?: string | undefined; } | undefined; hive?: string | undefined; key?: string | undefined; path?: string | undefined; value?: string | undefined; } | undefined; scanner_stats?: string | number | undefined; sightings?: string | number | undefined; type?: string | undefined; url?: { domain?: string | undefined; extension?: string | undefined; fragment?: string | undefined; full?: string | undefined; original?: string | undefined; password?: string | undefined; path?: string | undefined; port?: string | number | undefined; query?: string | undefined; registered_domain?: string | undefined; scheme?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; username?: string | undefined; } | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; software?: { alias?: string[] | undefined; id?: string | undefined; name?: string | undefined; platforms?: string[] | undefined; reference?: string | undefined; type?: string | undefined; } | undefined; tactic?: { id?: string[] | undefined; name?: string[] | undefined; reference?: string[] | undefined; } | undefined; technique?: { id?: string[] | undefined; name?: string[] | undefined; reference?: string[] | undefined; subtechnique?: { id?: string[] | undefined; name?: string[] | undefined; reference?: string[] | undefined; } | undefined; } | undefined; } | undefined; tls?: { cipher?: string | undefined; client?: { certificate?: string | undefined; certificate_chain?: string[] | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; } | undefined; issuer?: string | undefined; ja3?: string | undefined; not_after?: string | undefined; not_before?: string | undefined; server_name?: string | undefined; subject?: string | undefined; supported_ciphers?: string[] | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; curve?: string | undefined; established?: boolean | undefined; next_protocol?: string | undefined; resumed?: boolean | undefined; server?: { certificate?: string | undefined; certificate_chain?: string[] | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; } | undefined; issuer?: string | undefined; ja3s?: string | undefined; not_after?: string | undefined; not_before?: string | undefined; subject?: string | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; version?: string | undefined; version_protocol?: string | undefined; } | undefined; trace?: { id?: string | undefined; } | undefined; transaction?: { id?: string | undefined; } | undefined; url?: { domain?: string | undefined; extension?: string | undefined; fragment?: string | undefined; full?: string | undefined; original?: string | undefined; password?: string | undefined; path?: string | undefined; port?: string | number | undefined; query?: string | undefined; registered_domain?: string | undefined; scheme?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; username?: string | undefined; } | undefined; user?: { changes?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; domain?: string | undefined; effective?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; risk?: { calculated_level?: string | undefined; calculated_score?: number | undefined; calculated_score_norm?: number | undefined; static_level?: string | undefined; static_score?: number | undefined; static_score_norm?: number | undefined; } | undefined; roles?: string[] | undefined; target?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; user_agent?: { device?: { name?: string | undefined; } | undefined; name?: string | undefined; original?: string | undefined; os?: { family?: string | undefined; full?: string | undefined; kernel?: string | undefined; name?: string | undefined; platform?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; version?: string | undefined; } | undefined; vulnerability?: { category?: string[] | undefined; classification?: string | undefined; description?: string | undefined; enumeration?: string | undefined; id?: string | undefined; reference?: string | undefined; report_id?: string | undefined; scanner?: { vendor?: string | undefined; } | undefined; score?: { base?: number | undefined; environmental?: number | undefined; temporal?: number | undefined; version?: string | undefined; } | undefined; severity?: string | undefined; } | undefined; } & {} & { ecs?: { version?: string | undefined; } | undefined; kibana?: { alert?: { risk_score?: number | undefined; rule?: { author?: string | undefined; created_at?: string | undefined; created_by?: string | undefined; description?: string | undefined; enabled?: string | undefined; from?: string | undefined; interval?: string | undefined; license?: string | undefined; note?: string | undefined; references?: string[] | undefined; rule_id?: string | undefined; rule_name_override?: string | undefined; to?: string | undefined; type?: string | undefined; updated_at?: string | undefined; updated_by?: string | undefined; version?: string | undefined; } | undefined; severity?: string | undefined; suppression?: { docs_count?: string | number | undefined; end?: string | undefined; start?: string | undefined; terms?: { field?: string[] | undefined; value?: string[] | undefined; } | undefined; } | undefined; system_status?: string | undefined; workflow_reason?: string | undefined; workflow_user?: string | undefined; } | undefined; } | undefined; }) | ({} & { kibana?: { alert?: { evaluation?: { threshold?: string | number | undefined; value?: string | number | undefined; values?: (string | number)[] | undefined; } | undefined; } | undefined; } | undefined; slo?: { id?: string | undefined; instanceId?: string | undefined; revision?: string | number | undefined; } | undefined; } & { '@timestamp': string; kibana: { alert: { instance: { id: string; }; rule: { category: string; consumer: string; name: string; producer: string; revision: string | number; rule_type_id: string; uuid: string; }; status: string; uuid: string; }; space_ids: string[]; }; } & { event?: { action?: string | undefined; kind?: string | undefined; } | undefined; kibana?: { alert?: { action_group?: string | undefined; case_ids?: string[] | undefined; duration?: { us?: string | number | undefined; } | undefined; end?: string | undefined; flapping?: boolean | undefined; flapping_history?: boolean[] | undefined; last_detected?: string | undefined; maintenance_window_ids?: string[] | undefined; reason?: string | undefined; rule?: { execution?: { uuid?: string | undefined; } | undefined; parameters?: unknown; tags?: string[] | undefined; } | undefined; start?: string | undefined; time_range?: { gte?: string | undefined; lte?: string | undefined; } | undefined; url?: string | undefined; workflow_status?: string | undefined; workflow_tags?: string[] | undefined; } | undefined; version?: string | undefined; } | undefined; tags?: string[] | undefined; } & {} & { ecs?: { version?: string | undefined; } | undefined; kibana?: { alert?: { risk_score?: number | undefined; rule?: { author?: string | undefined; created_at?: string | undefined; created_by?: string | undefined; description?: string | undefined; enabled?: string | undefined; from?: string | undefined; interval?: string | undefined; license?: string | undefined; note?: string | undefined; references?: string[] | undefined; rule_id?: string | undefined; rule_name_override?: string | undefined; to?: string | undefined; type?: string | undefined; updated_at?: string | undefined; updated_by?: string | undefined; version?: string | undefined; } | undefined; severity?: string | undefined; suppression?: { docs_count?: string | number | undefined; end?: string | undefined; start?: string | undefined; terms?: { field?: string[] | undefined; value?: string[] | undefined; } | undefined; } | undefined; system_status?: string | undefined; workflow_reason?: string | undefined; workflow_user?: string | undefined; } | undefined; } | undefined; }) | ({} & { agent?: { name?: string | undefined; } | undefined; anomaly?: { bucket_span?: { minutes?: string | undefined; } | undefined; start?: string | undefined; } | undefined; error?: { message?: string | undefined; } | undefined; kibana?: { alert?: { evaluation?: { threshold?: string | number | undefined; value?: string | number | undefined; values?: (string | number)[] | undefined; } | undefined; } | undefined; } | undefined; monitor?: { id?: string | undefined; name?: string | undefined; type?: string | undefined; } | undefined; observer?: { geo?: { name?: string | undefined; } | undefined; } | undefined; tls?: { server?: { hash?: { sha256?: string | undefined; } | undefined; x509?: { issuer?: { common_name?: string | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; subject?: { common_name?: string | undefined; } | undefined; } | undefined; } | undefined; } | undefined; url?: { full?: string | undefined; } | undefined; } & { '@timestamp': string; kibana: { alert: { instance: { id: string; }; rule: { category: string; consumer: string; name: string; producer: string; revision: string | number; rule_type_id: string; uuid: string; }; status: string; uuid: string; }; space_ids: string[]; }; } & { event?: { action?: string | undefined; kind?: string | undefined; } | undefined; kibana?: { alert?: { action_group?: string | undefined; case_ids?: string[] | undefined; duration?: { us?: string | number | undefined; } | undefined; end?: string | undefined; flapping?: boolean | undefined; flapping_history?: boolean[] | undefined; last_detected?: string | undefined; maintenance_window_ids?: string[] | undefined; reason?: string | undefined; rule?: { execution?: { uuid?: string | undefined; } | undefined; parameters?: unknown; tags?: string[] | undefined; } | undefined; start?: string | undefined; time_range?: { gte?: string | undefined; lte?: string | undefined; } | undefined; url?: string | undefined; workflow_status?: string | undefined; workflow_tags?: string[] | undefined; } | undefined; version?: string | undefined; } | undefined; tags?: string[] | undefined; } & {} & { ecs?: { version?: string | undefined; } | undefined; kibana?: { alert?: { risk_score?: number | undefined; rule?: { author?: string | undefined; created_at?: string | undefined; created_by?: string | undefined; description?: string | undefined; enabled?: string | undefined; from?: string | undefined; interval?: string | undefined; license?: string | undefined; note?: string | undefined; references?: string[] | undefined; rule_id?: string | undefined; rule_name_override?: string | undefined; to?: string | undefined; type?: string | undefined; updated_at?: string | undefined; updated_by?: string | undefined; version?: string | undefined; } | undefined; severity?: string | undefined; suppression?: { docs_count?: string | number | undefined; end?: string | undefined; start?: string | undefined; terms?: { field?: string[] | undefined; value?: string[] | undefined; } | undefined; } | undefined; system_status?: string | undefined; workflow_reason?: string | undefined; workflow_user?: string | undefined; } | undefined; } | undefined; }) | ({ '@timestamp': string; kibana: { alert: { ancestors: { depth: string | number; id: string; index: string; type: string; }[]; depth: string | number; instance: { id: string; }; original_event: { action: string; category: string[]; created: string; dataset: string; id: string; ingested: string; kind: string; module: string; original: string; outcome: string; provider: string; sequence: string | number; type: string[]; }; original_time: string; rule: { category: string; consumer: string; false_positives: string[]; max_signals: (string | number)[]; name: string; producer: string; revision: string | number; rule_type_id: string; threat: { framework: string; tactic: { id: string; name: string; reference: string; }; technique: { id: string; name: string; reference: string; subtechnique: { id: string; name: string; reference: string; }; }; }; uuid: string; }; status: string; uuid: string; }; space_ids: string[]; }; } & { ecs?: { version?: string | undefined; } | undefined; event?: { action?: string | undefined; kind?: string | undefined; } | undefined; kibana?: { alert?: { action_group?: string | undefined; ancestors?: { rule?: string | undefined; } | undefined; building_block_type?: string | undefined; case_ids?: string[] | undefined; duration?: { us?: string | number | undefined; } | undefined; end?: string | undefined; flapping?: boolean | undefined; flapping_history?: boolean[] | undefined; group?: { id?: string | undefined; index?: number | undefined; } | undefined; last_detected?: string | undefined; maintenance_window_ids?: string[] | undefined; new_terms?: string[] | undefined; original_event?: { agent_id_status?: string | undefined; code?: string | undefined; duration?: string | undefined; end?: string | undefined; hash?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; severity?: string | number | undefined; start?: string | undefined; timezone?: string | undefined; url?: string | undefined; } | undefined; reason?: string | undefined; risk_score?: number | undefined; rule?: { author?: string | undefined; building_block_type?: string | undefined; created_at?: string | undefined; created_by?: string | undefined; description?: string | undefined; enabled?: string | undefined; execution?: { uuid?: string | undefined; } | undefined; from?: string | undefined; immutable?: string[] | undefined; interval?: string | undefined; license?: string | undefined; note?: string | undefined; parameters?: unknown; references?: string[] | undefined; rule_id?: string | undefined; rule_name_override?: string | undefined; tags?: string[] | undefined; timeline_id?: string[] | undefined; timeline_title?: string[] | undefined; timestamp_override?: string | undefined; to?: string | undefined; type?: string | undefined; updated_at?: string | undefined; updated_by?: string | undefined; version?: string | undefined; } | undefined; severity?: string | undefined; start?: string | undefined; suppression?: { docs_count?: string | number | undefined; end?: string | undefined; start?: string | undefined; terms?: { field?: string[] | undefined; value?: string[] | undefined; } | undefined; } | undefined; system_status?: string | undefined; threshold_result?: { count?: string | number | undefined; from?: string | undefined; terms?: { field?: string | undefined; value?: string | undefined; }[] | undefined; } | undefined; time_range?: { gte?: string | undefined; lte?: string | undefined; } | undefined; url?: string | undefined; workflow_reason?: string | undefined; workflow_status?: string | undefined; workflow_tags?: string[] | undefined; workflow_user?: string | undefined; } | undefined; version?: string | undefined; } | undefined; signal?: { ancestors?: { depth?: unknown; id?: unknown; index?: unknown; type?: unknown; } | undefined; depth?: unknown; group?: { id?: unknown; index?: unknown; } | undefined; original_event?: { action?: unknown; category?: unknown; code?: unknown; created?: unknown; dataset?: unknown; duration?: unknown; end?: unknown; hash?: unknown; id?: unknown; kind?: unknown; module?: unknown; outcome?: unknown; provider?: unknown; reason?: unknown; risk_score?: unknown; risk_score_norm?: unknown; sequence?: unknown; severity?: unknown; start?: unknown; timezone?: unknown; type?: unknown; } | undefined; original_time?: unknown; reason?: unknown; rule?: { author?: unknown; building_block_type?: unknown; created_at?: unknown; created_by?: unknown; description?: unknown; enabled?: unknown; false_positives?: unknown; from?: unknown; id?: unknown; immutable?: unknown; interval?: unknown; license?: unknown; max_signals?: unknown; name?: unknown; note?: unknown; references?: unknown; risk_score?: unknown; rule_id?: unknown; rule_name_override?: unknown; severity?: unknown; tags?: unknown; threat?: { framework?: unknown; tactic?: { id?: unknown; name?: unknown; reference?: unknown; } | undefined; technique?: { id?: unknown; name?: unknown; reference?: unknown; subtechnique?: { id?: unknown; name?: unknown; reference?: unknown; } | undefined; } | undefined; } | undefined; timeline_id?: unknown; timeline_title?: unknown; timestamp_override?: unknown; to?: unknown; type?: unknown; updated_at?: unknown; updated_by?: unknown; version?: unknown; } | undefined; status?: unknown; threshold_result?: { cardinality?: { field?: unknown; value?: unknown; } | undefined; count?: unknown; from?: unknown; terms?: { field?: unknown; value?: unknown; } | undefined; } | undefined; } | undefined; tags?: string[] | undefined; } & { '@timestamp': string; kibana: { alert: { instance: { id: string; }; rule: { category: string; consumer: string; name: string; producer: string; revision: string | number; rule_type_id: string; uuid: string; }; status: string; uuid: string; }; space_ids: string[]; }; } & { event?: { action?: string | undefined; kind?: string | undefined; } | undefined; kibana?: { alert?: { action_group?: string | undefined; case_ids?: string[] | undefined; duration?: { us?: string | number | undefined; } | undefined; end?: string | undefined; flapping?: boolean | undefined; flapping_history?: boolean[] | undefined; last_detected?: string | undefined; maintenance_window_ids?: string[] | undefined; reason?: string | undefined; rule?: { execution?: { uuid?: string | undefined; } | undefined; parameters?: unknown; tags?: string[] | undefined; } | undefined; start?: string | undefined; time_range?: { gte?: string | undefined; lte?: string | undefined; } | undefined; url?: string | undefined; workflow_status?: string | undefined; workflow_tags?: string[] | undefined; } | undefined; version?: string | undefined; } | undefined; tags?: string[] | undefined; } & { '@timestamp': string; ecs: { version: string; }; } & { agent?: { build?: { original?: string | undefined; } | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; client?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; cloud?: { account?: { id?: string | undefined; name?: string | undefined; } | undefined; availability_zone?: string | undefined; instance?: { id?: string | undefined; name?: string | undefined; } | undefined; machine?: { type?: string | undefined; } | undefined; origin?: { account?: { id?: string | undefined; name?: string | undefined; } | undefined; availability_zone?: string | undefined; instance?: { id?: string | undefined; name?: string | undefined; } | undefined; machine?: { type?: string | undefined; } | undefined; project?: { id?: string | undefined; name?: string | undefined; } | undefined; provider?: string | undefined; region?: string | undefined; service?: { name?: string | undefined; } | undefined; } | undefined; project?: { id?: string | undefined; name?: string | undefined; } | undefined; provider?: string | undefined; region?: string | undefined; service?: { name?: string | undefined; } | undefined; target?: { account?: { id?: string | undefined; name?: string | undefined; } | undefined; availability_zone?: string | undefined; instance?: { id?: string | undefined; name?: string | undefined; } | undefined; machine?: { type?: string | undefined; } | undefined; project?: { id?: string | undefined; name?: string | undefined; } | undefined; provider?: string | undefined; region?: string | undefined; service?: { name?: string | undefined; } | undefined; } | undefined; } | undefined; container?: { cpu?: { usage?: string | number | undefined; } | undefined; disk?: { read?: { bytes?: string | number | undefined; } | undefined; write?: { bytes?: string | number | undefined; } | undefined; } | undefined; id?: string | undefined; image?: { hash?: { all?: string[] | undefined; } | undefined; name?: string | undefined; tag?: string[] | undefined; } | undefined; memory?: { usage?: string | number | undefined; } | undefined; name?: string | undefined; network?: { egress?: { bytes?: string | number | undefined; } | undefined; ingress?: { bytes?: string | number | undefined; } | undefined; } | undefined; runtime?: string | undefined; } | undefined; destination?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; device?: { id?: string | undefined; manufacturer?: string | undefined; model?: { identifier?: string | undefined; name?: string | undefined; } | undefined; } | undefined; dll?: { code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; name?: string | undefined; path?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; } | undefined; dns?: { answers?: { class?: string | undefined; data?: string | undefined; name?: string | undefined; ttl?: string | number | undefined; type?: string | undefined; }[] | undefined; header_flags?: string[] | undefined; id?: string | undefined; op_code?: string | undefined; question?: { class?: string | undefined; name?: string | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; type?: string | undefined; } | undefined; resolved_ip?: string[] | undefined; response_code?: string | undefined; type?: string | undefined; } | undefined; email?: { attachments?: { file?: { extension?: string | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; mime_type?: string | undefined; name?: string | undefined; size?: string | number | undefined; } | undefined; }[] | undefined; bcc?: { address?: string[] | undefined; } | undefined; cc?: { address?: string[] | undefined; } | undefined; content_type?: string | undefined; delivery_timestamp?: string | undefined; direction?: string | undefined; from?: { address?: string[] | undefined; } | undefined; local_id?: string | undefined; message_id?: string | undefined; origination_timestamp?: string | undefined; reply_to?: { address?: string[] | undefined; } | undefined; sender?: { address?: string | undefined; } | undefined; subject?: string | undefined; to?: { address?: string[] | undefined; } | undefined; x_mailer?: string | undefined; } | undefined; error?: { code?: string | undefined; id?: string | undefined; message?: string | undefined; stack_trace?: string | undefined; type?: string | undefined; } | undefined; event?: { action?: string | undefined; agent_id_status?: string | undefined; category?: string[] | undefined; code?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: string | number | undefined; end?: string | undefined; hash?: string | undefined; id?: string | undefined; ingested?: string | undefined; kind?: string | undefined; module?: string | undefined; original?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; severity?: string | number | undefined; start?: string | undefined; timezone?: string | undefined; type?: string[] | undefined; url?: string | undefined; } | undefined; faas?: { coldstart?: boolean | undefined; execution?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; } | undefined; file?: { accessed?: string | undefined; attributes?: string[] | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; created?: string | undefined; ctime?: string | undefined; device?: string | undefined; directory?: string | undefined; drive_letter?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; extension?: string | undefined; fork_name?: string | undefined; gid?: string | undefined; group?: string | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; inode?: string | undefined; mime_type?: string | undefined; mode?: string | undefined; mtime?: string | undefined; name?: string | undefined; owner?: string | undefined; path?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; size?: string | number | undefined; target_path?: string | undefined; type?: string | undefined; uid?: string | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; host?: { architecture?: string | undefined; boot?: { id?: string | undefined; } | undefined; cpu?: { usage?: string | number | undefined; } | undefined; disk?: { read?: { bytes?: string | number | undefined; } | undefined; write?: { bytes?: string | number | undefined; } | undefined; } | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; hostname?: string | undefined; id?: string | undefined; ip?: string[] | undefined; mac?: string[] | undefined; name?: string | undefined; network?: { egress?: { bytes?: string | number | undefined; packets?: string | number | undefined; } | undefined; ingress?: { bytes?: string | number | undefined; packets?: string | number | undefined; } | undefined; } | undefined; os?: { family?: string | undefined; full?: string | undefined; kernel?: string | undefined; name?: string | undefined; platform?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; pid_ns_ino?: string | undefined; risk?: { calculated_level?: string | undefined; calculated_score?: number | undefined; calculated_score_norm?: number | undefined; static_level?: string | undefined; static_score?: number | undefined; static_score_norm?: number | undefined; } | undefined; type?: string | undefined; uptime?: string | number | undefined; } | undefined; http?: { request?: { body?: { bytes?: string | number | undefined; content?: string | undefined; } | undefined; bytes?: string | number | undefined; id?: string | undefined; method?: string | undefined; mime_type?: string | undefined; referrer?: string | undefined; } | undefined; response?: { body?: { bytes?: string | number | undefined; content?: string | undefined; } | undefined; bytes?: string | number | undefined; mime_type?: string | undefined; status_code?: string | number | undefined; } | undefined; version?: string | undefined; } | undefined; log?: { file?: { path?: string | undefined; } | undefined; level?: string | undefined; logger?: string | undefined; origin?: { file?: { line?: string | number | undefined; name?: string | undefined; } | undefined; function?: string | undefined; } | undefined; } | undefined; message?: string | undefined; network?: { application?: string | undefined; bytes?: string | number | undefined; community_id?: string | undefined; direction?: string | undefined; forwarded_ip?: string | undefined; iana_number?: string | undefined; name?: string | undefined; packets?: string | number | undefined; protocol?: string | undefined; transport?: string | undefined; type?: string | undefined; vlan?: { id?: string | undefined; name?: string | undefined; } | undefined; } | undefined; observer?: { geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; hostname?: string | undefined; ip?: string[] | undefined; mac?: string[] | undefined; name?: string | undefined; os?: { family?: string | undefined; full?: string | undefined; kernel?: string | undefined; name?: string | undefined; platform?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; product?: string | undefined; serial_number?: string | undefined; type?: string | undefined; vendor?: string | undefined; version?: string | undefined; } | undefined; orchestrator?: { api_version?: string | undefined; cluster?: { id?: string | undefined; name?: string | undefined; url?: string | undefined; version?: string | undefined; } | undefined; namespace?: string | undefined; organization?: string | undefined; resource?: { id?: string | undefined; ip?: string[] | undefined; name?: string | undefined; parent?: { type?: string | undefined; } | undefined; type?: string | undefined; } | undefined; type?: string | undefined; } | undefined; organization?: { id?: string | undefined; name?: string | undefined; } | undefined; package?: { architecture?: string | undefined; build_version?: string | undefined; checksum?: string | undefined; description?: string | undefined; install_scope?: string | undefined; installed?: string | undefined; license?: string | undefined; name?: string | undefined; path?: string | undefined; reference?: string | undefined; size?: string | number | undefined; type?: string | undefined; version?: string | undefined; } | undefined; process?: { args?: string[] | undefined; args_count?: string | number | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; command_line?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; end?: string | undefined; entity_id?: string | undefined; entry_leader?: { args?: string[] | undefined; args_count?: string | number | undefined; attested_groups?: { name?: string | undefined; } | undefined; attested_user?: { id?: string | undefined; name?: string | undefined; } | undefined; command_line?: string | undefined; entity_id?: string | undefined; entry_meta?: { source?: { ip?: string | undefined; } | undefined; type?: string | undefined; } | undefined; executable?: string | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; parent?: { entity_id?: string | undefined; pid?: string | number | undefined; session_leader?: { entity_id?: string | undefined; pid?: string | number | undefined; start?: string | undefined; } | undefined; start?: string | undefined; } | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; same_as_process?: boolean | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; env_vars?: string[] | undefined; executable?: string | undefined; exit_code?: string | number | undefined; group_leader?: { args?: string[] | undefined; args_count?: string | number | undefined; command_line?: string | undefined; entity_id?: string | undefined; executable?: string | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; same_as_process?: boolean | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; parent?: { args?: string[] | undefined; args_count?: string | number | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; command_line?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; end?: string | undefined; entity_id?: string | undefined; executable?: string | undefined; exit_code?: string | number | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; group_leader?: { entity_id?: string | undefined; pid?: string | number | undefined; start?: string | undefined; } | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; pgid?: string | number | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; thread?: { id?: string | number | undefined; name?: string | undefined; } | undefined; title?: string | undefined; uptime?: string | number | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; pgid?: string | number | undefined; pid?: string | number | undefined; previous?: { args?: string[] | undefined; args_count?: string | number | undefined; executable?: string | undefined; } | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; session_leader?: { args?: string[] | undefined; args_count?: string | number | undefined; command_line?: string | undefined; entity_id?: string | undefined; executable?: string | undefined; group?: { id?: string | undefined; name?: string | undefined; } | undefined; interactive?: boolean | undefined; name?: string | undefined; parent?: { entity_id?: string | undefined; pid?: string | number | undefined; session_leader?: { entity_id?: string | undefined; pid?: string | number | undefined; start?: string | undefined; } | undefined; start?: string | undefined; } | undefined; pid?: string | number | undefined; real_group?: { id?: string | undefined; name?: string | undefined; } | undefined; real_user?: { id?: string | undefined; name?: string | undefined; } | undefined; same_as_process?: boolean | undefined; saved_group?: { id?: string | undefined; name?: string | undefined; } | undefined; saved_user?: { id?: string | undefined; name?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; start?: string | undefined; supplemental_groups?: { id?: string | undefined; name?: string | undefined; } | undefined; thread?: { id?: string | number | undefined; name?: string | undefined; } | undefined; title?: string | undefined; uptime?: string | number | undefined; user?: { id?: string | undefined; name?: string | undefined; } | undefined; working_directory?: string | undefined; } | undefined; registry?: { data?: { bytes?: string | undefined; strings?: string[] | undefined; type?: string | undefined; } | undefined; hive?: string | undefined; key?: string | undefined; path?: string | undefined; value?: string | undefined; } | undefined; related?: { hash?: string[] | undefined; hosts?: string[] | undefined; ip?: string[] | undefined; user?: string[] | undefined; } | undefined; rule?: { author?: string[] | undefined; category?: string | undefined; description?: string | undefined; id?: string | undefined; license?: string | undefined; name?: string | undefined; reference?: string | undefined; ruleset?: string | undefined; uuid?: string | undefined; version?: string | undefined; } | undefined; server?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; service?: { address?: string | undefined; environment?: string | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; node?: { name?: string | undefined; role?: string | undefined; roles?: string[] | undefined; } | undefined; origin?: { address?: string | undefined; environment?: string | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; node?: { name?: string | undefined; role?: string | undefined; roles?: string[] | undefined; } | undefined; state?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; state?: string | undefined; target?: { address?: string | undefined; environment?: string | undefined; ephemeral_id?: string | undefined; id?: string | undefined; name?: string | undefined; node?: { name?: string | undefined; role?: string | undefined; roles?: string[] | undefined; } | undefined; state?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; type?: string | undefined; version?: string | undefined; } | undefined; source?: { address?: string | undefined; as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; bytes?: string | number | undefined; domain?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; mac?: string | undefined; nat?: { ip?: string | undefined; port?: string | number | undefined; } | undefined; packets?: string | number | undefined; port?: string | number | undefined; registered_domain?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; user?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; span?: { id?: string | undefined; } | undefined; tags?: string[] | undefined; threat?: { enrichments?: { matched?: { atomic?: string | undefined; field?: string | undefined; id?: string | undefined; index?: string | undefined; occurred?: string | undefined; type?: string | undefined; } | undefined; }[] | undefined; feed?: { dashboard_id?: string | undefined; description?: string | undefined; name?: string | undefined; reference?: string | undefined; } | undefined; framework?: string | undefined; group?: { alias?: string[] | undefined; id?: string | undefined; name?: string | undefined; reference?: string | undefined; } | undefined; indicator?: { as?: { number?: string | number | undefined; organization?: { name?: string | undefined; } | undefined; } | undefined; confidence?: string | undefined; description?: string | undefined; email?: { address?: string | undefined; } | undefined; file?: { accessed?: string | undefined; attributes?: string[] | undefined; code_signature?: { digest_algorithm?: string | undefined; exists?: boolean | undefined; signing_id?: string | undefined; status?: string | undefined; subject_name?: string | undefined; team_id?: string | undefined; timestamp?: string | undefined; trusted?: boolean | undefined; valid?: boolean | undefined; } | undefined; created?: string | undefined; ctime?: string | undefined; device?: string | undefined; directory?: string | undefined; drive_letter?: string | undefined; elf?: { architecture?: string | undefined; byte_order?: string | undefined; cpu_type?: string | undefined; creation_date?: string | undefined; exports?: unknown[] | undefined; header?: { abi_version?: string | undefined; class?: string | undefined; data?: string | undefined; entrypoint?: string | number | undefined; object_version?: string | undefined; os_abi?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; imports?: unknown[] | undefined; sections?: { chi2?: string | number | undefined; entropy?: string | number | undefined; flags?: string | undefined; name?: string | undefined; physical_offset?: string | undefined; physical_size?: string | number | undefined; type?: string | undefined; virtual_address?: string | number | undefined; virtual_size?: string | number | undefined; }[] | undefined; segments?: { sections?: string | undefined; type?: string | undefined; }[] | undefined; shared_libraries?: string[] | undefined; telfhash?: string | undefined; } | undefined; extension?: string | undefined; fork_name?: string | undefined; gid?: string | undefined; group?: string | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; sha384?: string | undefined; sha512?: string | undefined; ssdeep?: string | undefined; tlsh?: string | undefined; } | undefined; inode?: string | undefined; mime_type?: string | undefined; mode?: string | undefined; mtime?: string | undefined; name?: string | undefined; owner?: string | undefined; path?: string | undefined; pe?: { architecture?: string | undefined; company?: string | undefined; description?: string | undefined; file_version?: string | undefined; imphash?: string | undefined; original_file_name?: string | undefined; pehash?: string | undefined; product?: string | undefined; } | undefined; size?: string | number | undefined; target_path?: string | undefined; type?: string | undefined; uid?: string | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; first_seen?: string | undefined; geo?: { city_name?: string | undefined; continent_code?: string | undefined; continent_name?: string | undefined; country_iso_code?: string | undefined; country_name?: string | undefined; location?: string | { type: string; coordinates: number[]; } | { lat: number; lon: number; } | { location: number[]; } | { location: string; } | undefined; name?: string | undefined; postal_code?: string | undefined; region_iso_code?: string | undefined; region_name?: string | undefined; timezone?: string | undefined; } | undefined; ip?: string | undefined; last_seen?: string | undefined; marking?: { tlp?: string | undefined; tlp_version?: string | undefined; } | undefined; modified_at?: string | undefined; port?: string | number | undefined; provider?: string | undefined; reference?: string | undefined; registry?: { data?: { bytes?: string | undefined; strings?: string[] | undefined; type?: string | undefined; } | undefined; hive?: string | undefined; key?: string | undefined; path?: string | undefined; value?: string | undefined; } | undefined; scanner_stats?: string | number | undefined; sightings?: string | number | undefined; type?: string | undefined; url?: { domain?: string | undefined; extension?: string | undefined; fragment?: string | undefined; full?: string | undefined; original?: string | undefined; password?: string | undefined; path?: string | undefined; port?: string | number | undefined; query?: string | undefined; registered_domain?: string | undefined; scheme?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; username?: string | undefined; } | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; software?: { alias?: string[] | undefined; id?: string | undefined; name?: string | undefined; platforms?: string[] | undefined; reference?: string | undefined; type?: string | undefined; } | undefined; tactic?: { id?: string[] | undefined; name?: string[] | undefined; reference?: string[] | undefined; } | undefined; technique?: { id?: string[] | undefined; name?: string[] | undefined; reference?: string[] | undefined; subtechnique?: { id?: string[] | undefined; name?: string[] | undefined; reference?: string[] | undefined; } | undefined; } | undefined; } | undefined; tls?: { cipher?: string | undefined; client?: { certificate?: string | undefined; certificate_chain?: string[] | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; } | undefined; issuer?: string | undefined; ja3?: string | undefined; not_after?: string | undefined; not_before?: string | undefined; server_name?: string | undefined; subject?: string | undefined; supported_ciphers?: string[] | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; curve?: string | undefined; established?: boolean | undefined; next_protocol?: string | undefined; resumed?: boolean | undefined; server?: { certificate?: string | undefined; certificate_chain?: string[] | undefined; hash?: { md5?: string | undefined; sha1?: string | undefined; sha256?: string | undefined; } | undefined; issuer?: string | undefined; ja3s?: string | undefined; not_after?: string | undefined; not_before?: string | undefined; subject?: string | undefined; x509?: { alternative_names?: string[] | undefined; issuer?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; not_after?: string | undefined; not_before?: string | undefined; public_key_algorithm?: string | undefined; public_key_curve?: string | undefined; public_key_exponent?: string | number | undefined; public_key_size?: string | number | undefined; serial_number?: string | undefined; signature_algorithm?: string | undefined; subject?: { common_name?: string[] | undefined; country?: string[] | undefined; distinguished_name?: string | undefined; locality?: string[] | undefined; organization?: string[] | undefined; organizational_unit?: string[] | undefined; state_or_province?: string[] | undefined; } | undefined; version_number?: string | undefined; } | undefined; } | undefined; version?: string | undefined; version_protocol?: string | undefined; } | undefined; trace?: { id?: string | undefined; } | undefined; transaction?: { id?: string | undefined; } | undefined; url?: { domain?: string | undefined; extension?: string | undefined; fragment?: string | undefined; full?: string | undefined; original?: string | undefined; password?: string | undefined; path?: string | undefined; port?: string | number | undefined; query?: string | undefined; registered_domain?: string | undefined; scheme?: string | undefined; subdomain?: string | undefined; top_level_domain?: string | undefined; username?: string | undefined; } | undefined; user?: { changes?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; domain?: string | undefined; effective?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; risk?: { calculated_level?: string | undefined; calculated_score?: number | undefined; calculated_score_norm?: number | undefined; static_level?: string | undefined; static_score?: number | undefined; static_score_norm?: number | undefined; } | undefined; roles?: string[] | undefined; target?: { domain?: string | undefined; email?: string | undefined; full_name?: string | undefined; group?: { domain?: string | undefined; id?: string | undefined; name?: string | undefined; } | undefined; hash?: string | undefined; id?: string | undefined; name?: string | undefined; roles?: string[] | undefined; } | undefined; } | undefined; user_agent?: { device?: { name?: string | undefined; } | undefined; name?: string | undefined; original?: string | undefined; os?: { family?: string | undefined; full?: string | undefined; kernel?: string | undefined; name?: string | undefined; platform?: string | undefined; type?: string | undefined; version?: string | undefined; } | undefined; version?: string | undefined; } | undefined; vulnerability?: { category?: string[] | undefined; classification?: string | undefined; description?: string | undefined; enumeration?: string | undefined; id?: string | undefined; reference?: string | undefined; report_id?: string | undefined; scanner?: { vendor?: string | undefined; } | undefined; score?: { base?: number | undefined; environmental?: number | undefined; temporal?: number | undefined; version?: string | undefined; } | undefined; severity?: string | undefined; } | undefined; } & {} & { ecs?: { version?: string | undefined; } | undefined; kibana?: { alert?: { risk_score?: number | undefined; rule?: { author?: string | undefined; created_at?: string | undefined; created_by?: string | undefined; description?: string | undefined; enabled?: string | undefined; from?: string | undefined; interval?: string | undefined; license?: string | undefined; note?: string | undefined; references?: string[] | undefined; rule_id?: string | undefined; rule_name_override?: string | undefined; to?: string | undefined; type?: string | undefined; updated_at?: string | undefined; updated_by?: string | undefined; version?: string | undefined; } | undefined; severity?: string | undefined; suppression?: { docs_count?: string | number | undefined; end?: string | undefined; start?: string | undefined; terms?: { field?: string[] | undefined; value?: string[] | undefined; } | undefined; } | undefined; system_status?: string | undefined; workflow_reason?: string | undefined; workflow_user?: string | undefined; } | undefined; } | undefined; }) | ({ kibana: { alert: { job_id: string; }; }; } & { kibana?: { alert?: { anomaly_score?: number | undefined; anomaly_timestamp?: string | undefined; is_interim?: boolean | undefined; top_influencers?: { influencer_field_name?: string | undefined; influencer_field_value?: string | undefined; influencer_score?: number | undefined; initial_influencer_score?: number | undefined; is_interim?: boolean | undefined; job_id?: string | undefined; timestamp?: string | undefined; }[] | undefined; top_records?: { actual?: number | undefined; by_field_name?: string | undefined; by_field_value?: string | undefined; detector_index?: number | undefined; field_name?: string | undefined; function?: string | undefined; initial_record_score?: number | undefined; is_interim?: boolean | undefined; job_id?: string | undefined; over_field_name?: string | undefined; over_field_value?: string | undefined; partition_field_name?: string | undefined; partition_field_value?: string | undefined; record_score?: number | undefined; timestamp?: string | undefined; typical?: number | undefined; }[] | undefined; } | undefined; } | undefined; } & { '@timestamp': string; kibana: { alert: { instance: { id: string; }; rule: { category: string; consumer: string; name: string; producer: string; revision: string | number; rule_type_id: string; uuid: string; }; status: string; uuid: string; }; space_ids: string[]; }; } & { event?: { action?: string | undefined; kind?: string | undefined; } | undefined; kibana?: { alert?: { action_group?: string | undefined; case_ids?: string[] | undefined; duration?: { us?: string | number | undefined; } | undefined; end?: string | undefined; flapping?: boolean | undefined; flapping_history?: boolean[] | undefined; last_detected?: string | undefined; maintenance_window_ids?: string[] | undefined; reason?: string | undefined; rule?: { execution?: { uuid?: string | undefined; } | undefined; parameters?: unknown; tags?: string[] | undefined; } | undefined; start?: string | undefined; time_range?: { gte?: string | undefined; lte?: string | undefined; } | undefined; url?: string | undefined; workflow_status?: string | undefined; workflow_tags?: string[] | undefined; } | undefined; version?: string | undefined; } | undefined; tags?: string[] | undefined; })" ], "path": "packages/kbn-alerts-as-data-utils/src/schemas/index.ts", "deprecated": false, @@ -299,6 +299,21 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/alerts-as-data-utils", + "id": "def-common.MlAnomalyDetectionAlert", + "type": "Type", + "tags": [], + "label": "MlAnomalyDetectionAlert", + "description": [], + "signature": [ + "{ kibana: { alert: { job_id: string; }; }; } & { kibana?: { alert?: { anomaly_score?: number | undefined; anomaly_timestamp?: string | undefined; is_interim?: boolean | undefined; top_influencers?: { influencer_field_name?: string | undefined; influencer_field_value?: string | undefined; influencer_score?: number | undefined; initial_influencer_score?: number | undefined; is_interim?: boolean | undefined; job_id?: string | undefined; timestamp?: string | undefined; }[] | undefined; top_records?: { actual?: number | undefined; by_field_name?: string | undefined; by_field_value?: string | undefined; detector_index?: number | undefined; field_name?: string | undefined; function?: string | undefined; initial_record_score?: number | undefined; is_interim?: boolean | undefined; job_id?: string | undefined; over_field_name?: string | undefined; over_field_value?: string | undefined; partition_field_name?: string | undefined; partition_field_value?: string | undefined; record_score?: number | undefined; timestamp?: string | undefined; typical?: number | undefined; }[] | undefined; } | undefined; } | undefined; } & { '@timestamp': string; kibana: { alert: { instance: { id: string; }; rule: { category: string; consumer: string; name: string; producer: string; revision: string | number; rule_type_id: string; uuid: string; }; status: string; uuid: string; }; space_ids: string[]; }; } & { event?: { action?: string | undefined; kind?: string | undefined; } | undefined; kibana?: { alert?: { action_group?: string | undefined; case_ids?: string[] | undefined; duration?: { us?: string | number | undefined; } | undefined; end?: string | undefined; flapping?: boolean | undefined; flapping_history?: boolean[] | undefined; last_detected?: string | undefined; maintenance_window_ids?: string[] | undefined; reason?: string | undefined; rule?: { execution?: { uuid?: string | undefined; } | undefined; parameters?: unknown; tags?: string[] | undefined; } | undefined; start?: string | undefined; time_range?: { gte?: string | undefined; lte?: string | undefined; } | undefined; url?: string | undefined; workflow_status?: string | undefined; workflow_tags?: string[] | undefined; } | undefined; version?: string | undefined; } | undefined; tags?: string[] | undefined; }" + ], + "path": "packages/kbn-alerts-as-data-utils/src/schemas/generated/ml_anomaly_detection_schema.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/alerts-as-data-utils", "id": "def-common.ObservabilityApmAlert", diff --git a/api_docs/kbn_alerts_as_data_utils.mdx b/api_docs/kbn_alerts_as_data_utils.mdx index ee877bbdcf4bf..48de10419d576 100644 --- a/api_docs/kbn_alerts_as_data_utils.mdx +++ b/api_docs/kbn_alerts_as_data_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerts-as-data-utils title: "@kbn/alerts-as-data-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerts-as-data-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts-as-data-utils'] --- import kbnAlertsAsDataUtilsObj from './kbn_alerts_as_data_utils.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-o | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 29 | 0 | 29 | 0 | +| 30 | 0 | 30 | 0 | ## Common diff --git a/api_docs/kbn_alerts_ui_shared.mdx b/api_docs/kbn_alerts_ui_shared.mdx index d97e765f4470d..f8bf72aeaf8a6 100644 --- a/api_docs/kbn_alerts_ui_shared.mdx +++ b/api_docs/kbn_alerts_ui_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerts-ui-shared title: "@kbn/alerts-ui-shared" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerts-ui-shared plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts-ui-shared'] --- import kbnAlertsUiSharedObj from './kbn_alerts_ui_shared.devdocs.json'; diff --git a/api_docs/kbn_analytics.mdx b/api_docs/kbn_analytics.mdx index 2bdd1ea5a93f5..b1805a3ae6ab8 100644 --- a/api_docs/kbn_analytics.mdx +++ b/api_docs/kbn_analytics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics title: "@kbn/analytics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics'] --- import kbnAnalyticsObj from './kbn_analytics.devdocs.json'; diff --git a/api_docs/kbn_analytics_client.devdocs.json b/api_docs/kbn_analytics_client.devdocs.json index b207525eeca92..4182878c7975c 100644 --- a/api_docs/kbn_analytics_client.devdocs.json +++ b/api_docs/kbn_analytics_client.devdocs.json @@ -602,6 +602,46 @@ "deprecated": false, "trackAdoption": true, "references": [ + { + "plugin": "@kbn/core-notifications-browser-internal", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/telemetry/event_reporter.ts" + }, + { + "plugin": "@kbn/core-notifications-browser-internal", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/telemetry/event_reporter.ts" + }, + { + "plugin": "@kbn/ebt-tools", + "path": "packages/kbn-ebt-tools/src/performance_metric_events/helpers.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.ts" + }, { "plugin": "@kbn/core-status-server-internal", "path": "packages/core/status/core-status-server-internal/src/status_service.ts" @@ -630,10 +670,6 @@ "plugin": "@kbn/core-plugins-server-internal", "path": "packages/core/plugins/core-plugins-server-internal/src/plugin_context.ts" }, - { - "plugin": "@kbn/ebt-tools", - "path": "packages/kbn-ebt-tools/src/performance_metric_events/helpers.ts" - }, { "plugin": "@kbn/core-analytics-server-internal", "path": "packages/core/analytics/core-analytics-server-internal/src/analytics_service.ts" @@ -663,44 +699,16 @@ "path": "packages/core/root/core-root-server-internal/src/server.ts" }, { - "plugin": "@kbn/core-notifications-browser-internal", - "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/telemetry/event_reporter.ts" - }, - { - "plugin": "@kbn/core-notifications-browser-internal", - "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/telemetry/event_reporter.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/track_clicks.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + "plugin": "security", + "path": "x-pack/plugins/security/server/analytics/analytics_service.ts" }, { - "plugin": "@kbn/core-root-browser-internal", - "path": "packages/core/root/core-root-browser-internal/src/core_system.ts" + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/services/analytics/types.ts" }, { - "plugin": "security", - "path": "x-pack/plugins/security/server/analytics/analytics_service.ts" + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/services/analytics/analytics_service.ts" }, { "plugin": "@kbn/subscription-tracking", @@ -710,14 +718,6 @@ "plugin": "@kbn/subscription-tracking", "path": "packages/kbn-subscription-tracking/src/use_impression.ts" }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/services/analytics/types.ts" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/services/analytics/analytics_service.ts" - }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/telemetry/fleet_usage_sender.ts" @@ -730,22 +730,6 @@ "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/telemetry/fleet_usage_sender.ts" }, - { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" - }, - { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" - }, - { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" - }, - { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" - }, { "plugin": "infra", "path": "x-pack/plugins/infra/public/services/telemetry/telemetry_client.ts" @@ -786,6 +770,22 @@ "plugin": "globalSearchBar", "path": "x-pack/plugins/global_search_bar/public/telemetry/event_reporter.ts" }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/lib/telemetry/sender.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/common/lib/telemetry/telemetry_client.ts" @@ -1300,6 +1300,46 @@ "deprecated": false, "trackAdoption": true, "references": [ + { + "plugin": "@kbn/core-application-browser-internal", + "path": "packages/core/application/core-application-browser-internal/src/register_analytics_context_provider.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-analytics-browser-internal", + "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" + }, + { + "plugin": "@kbn/core-execution-context-browser-internal", + "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_service.ts" + }, + { + "plugin": "@kbn/core-chrome-browser-internal", + "path": "packages/core/chrome/core-chrome-browser-internal/src/register_analytics_context_provider.ts" + }, { "plugin": "@kbn/core-elasticsearch-server-internal", "path": "packages/core/elasticsearch/core-elasticsearch-server-internal/src/register_analytics_context_provider.ts" @@ -1352,46 +1392,6 @@ "plugin": "licensing", "path": "x-pack/plugins/licensing/common/register_analytics_context_provider.ts" }, - { - "plugin": "@kbn/core-application-browser-internal", - "path": "packages/core/application/core-application-browser-internal/src/register_analytics_context_provider.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-analytics-browser-internal", - "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" - }, - { - "plugin": "@kbn/core-execution-context-browser-internal", - "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_service.ts" - }, - { - "plugin": "@kbn/core-chrome-browser-internal", - "path": "packages/core/chrome/core-chrome-browser-internal/src/register_analytics_context_provider.ts" - }, { "plugin": "cloud", "path": "x-pack/plugins/cloud/common/register_cloud_deployment_id_analytics_context.ts" @@ -1402,11 +1402,11 @@ }, { "plugin": "telemetry", - "path": "src/plugins/telemetry/public/plugin.ts" + "path": "src/plugins/telemetry/server/plugin.ts" }, { "plugin": "telemetry", - "path": "src/plugins/telemetry/server/plugin.ts" + "path": "src/plugins/telemetry/public/plugin.ts" }, { "plugin": "securitySolution", diff --git a/api_docs/kbn_analytics_client.mdx b/api_docs/kbn_analytics_client.mdx index 3f6ff18a4f42f..9cdb748af1325 100644 --- a/api_docs/kbn_analytics_client.mdx +++ b/api_docs/kbn_analytics_client.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-client title: "@kbn/analytics-client" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-client plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-client'] --- import kbnAnalyticsClientObj from './kbn_analytics_client.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx index 4803378aa63a0..779a5b1af7bf1 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx @@ -8,7 +8,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 description: API docs for the @kbn/analytics-shippers-elastic-v3-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-browser'] --- import kbnAnalyticsShippersElasticV3BrowserObj from './kbn_analytics_shippers_elastic_v3_browser.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx index 34dc08a375b81..19e76efc69ff5 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx @@ -8,7 +8,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 description: API docs for the @kbn/analytics-shippers-elastic-v3-common plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-common'] --- import kbnAnalyticsShippersElasticV3CommonObj from './kbn_analytics_shippers_elastic_v3_common.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx index fc0e5978ed743..efad35cfb62d3 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx @@ -8,7 +8,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 description: API docs for the @kbn/analytics-shippers-elastic-v3-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-server'] --- import kbnAnalyticsShippersElasticV3ServerObj from './kbn_analytics_shippers_elastic_v3_server.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_fullstory.mdx b/api_docs/kbn_analytics_shippers_fullstory.mdx index ede4f2872b3cf..4cf8f20838cff 100644 --- a/api_docs/kbn_analytics_shippers_fullstory.mdx +++ b/api_docs/kbn_analytics_shippers_fullstory.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-fullstory title: "@kbn/analytics-shippers-fullstory" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-fullstory plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-fullstory'] --- import kbnAnalyticsShippersFullstoryObj from './kbn_analytics_shippers_fullstory.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_gainsight.mdx b/api_docs/kbn_analytics_shippers_gainsight.mdx index 7efddd2313255..2fd375228e24c 100644 --- a/api_docs/kbn_analytics_shippers_gainsight.mdx +++ b/api_docs/kbn_analytics_shippers_gainsight.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-gainsight title: "@kbn/analytics-shippers-gainsight" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-gainsight plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-gainsight'] --- import kbnAnalyticsShippersGainsightObj from './kbn_analytics_shippers_gainsight.devdocs.json'; diff --git a/api_docs/kbn_apm_config_loader.mdx b/api_docs/kbn_apm_config_loader.mdx index dd6617c10f1da..772d8239a51da 100644 --- a/api_docs/kbn_apm_config_loader.mdx +++ b/api_docs/kbn_apm_config_loader.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-config-loader title: "@kbn/apm-config-loader" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-config-loader plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-config-loader'] --- import kbnApmConfigLoaderObj from './kbn_apm_config_loader.devdocs.json'; diff --git a/api_docs/kbn_apm_synthtrace.mdx b/api_docs/kbn_apm_synthtrace.mdx index 19c84f38c9be1..68cc09d693453 100644 --- a/api_docs/kbn_apm_synthtrace.mdx +++ b/api_docs/kbn_apm_synthtrace.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-synthtrace title: "@kbn/apm-synthtrace" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-synthtrace plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-synthtrace'] --- import kbnApmSynthtraceObj from './kbn_apm_synthtrace.devdocs.json'; diff --git a/api_docs/kbn_apm_synthtrace_client.mdx b/api_docs/kbn_apm_synthtrace_client.mdx index cc124e0c5ecbc..104a40be6ba70 100644 --- a/api_docs/kbn_apm_synthtrace_client.mdx +++ b/api_docs/kbn_apm_synthtrace_client.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-synthtrace-client title: "@kbn/apm-synthtrace-client" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-synthtrace-client plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-synthtrace-client'] --- import kbnApmSynthtraceClientObj from './kbn_apm_synthtrace_client.devdocs.json'; diff --git a/api_docs/kbn_apm_utils.mdx b/api_docs/kbn_apm_utils.mdx index a80ea0d589ab4..5120b34f8c628 100644 --- a/api_docs/kbn_apm_utils.mdx +++ b/api_docs/kbn_apm_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-utils title: "@kbn/apm-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-utils'] --- import kbnApmUtilsObj from './kbn_apm_utils.devdocs.json'; diff --git a/api_docs/kbn_axe_config.mdx b/api_docs/kbn_axe_config.mdx index e96e1040a5cd6..3a9ba6e899237 100644 --- a/api_docs/kbn_axe_config.mdx +++ b/api_docs/kbn_axe_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-axe-config title: "@kbn/axe-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/axe-config plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/axe-config'] --- import kbnAxeConfigObj from './kbn_axe_config.devdocs.json'; diff --git a/api_docs/kbn_cases_components.mdx b/api_docs/kbn_cases_components.mdx index d9132b2a63e0f..8517769bf2856 100644 --- a/api_docs/kbn_cases_components.mdx +++ b/api_docs/kbn_cases_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cases-components title: "@kbn/cases-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cases-components plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cases-components'] --- import kbnCasesComponentsObj from './kbn_cases_components.devdocs.json'; diff --git a/api_docs/kbn_cell_actions.mdx b/api_docs/kbn_cell_actions.mdx index 2edf70d5494d1..1331c44dd5fb0 100644 --- a/api_docs/kbn_cell_actions.mdx +++ b/api_docs/kbn_cell_actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cell-actions title: "@kbn/cell-actions" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cell-actions plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cell-actions'] --- import kbnCellActionsObj from './kbn_cell_actions.devdocs.json'; diff --git a/api_docs/kbn_chart_expressions_common.devdocs.json b/api_docs/kbn_chart_expressions_common.devdocs.json index bdf2e8ff476f8..de54c17861fdd 100644 --- a/api_docs/kbn_chart_expressions_common.devdocs.json +++ b/api_docs/kbn_chart_expressions_common.devdocs.json @@ -115,6 +115,71 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/chart-expressions-common", + "id": "def-common.getColorCategories", + "type": "Function", + "tags": [], + "label": "getColorCategories", + "description": [ + "\nGet the stringified version of all the categories that needs to be colored in the chart.\nMultifield keys will return as array of string and simple fields (numeric, string) will be returned as a plain unformatted string." + ], + "signature": [ + "(rows: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.DatatableRow", + "text": "DatatableRow" + }, + "[], accessor: string | undefined) => (string | string[])[]" + ], + "path": "src/plugins/chart_expressions/common/color_categories.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/chart-expressions-common", + "id": "def-common.getColorCategories.$1", + "type": "Array", + "tags": [], + "label": "rows", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.DatatableRow", + "text": "DatatableRow" + }, + "[]" + ], + "path": "src/plugins/chart_expressions/common/color_categories.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/chart-expressions-common", + "id": "def-common.getColorCategories.$2", + "type": "string", + "tags": [], + "label": "accessor", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/chart_expressions/common/color_categories.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/chart-expressions-common", "id": "def-common.getOverridesFor", diff --git a/api_docs/kbn_chart_expressions_common.mdx b/api_docs/kbn_chart_expressions_common.mdx index b5c46e686c2dd..4813ec1adfcbf 100644 --- a/api_docs/kbn_chart_expressions_common.mdx +++ b/api_docs/kbn_chart_expressions_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-chart-expressions-common title: "@kbn/chart-expressions-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/chart-expressions-common plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/chart-expressions-common'] --- import kbnChartExpressionsCommonObj from './kbn_chart_expressions_common.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/k | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 11 | 0 | 8 | 0 | +| 14 | 0 | 10 | 0 | ## Common diff --git a/api_docs/kbn_chart_icons.mdx b/api_docs/kbn_chart_icons.mdx index 284f86b7ebc35..fd4ebd748d927 100644 --- a/api_docs/kbn_chart_icons.mdx +++ b/api_docs/kbn_chart_icons.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-chart-icons title: "@kbn/chart-icons" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/chart-icons plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/chart-icons'] --- import kbnChartIconsObj from './kbn_chart_icons.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_core.mdx b/api_docs/kbn_ci_stats_core.mdx index f7fb52a4efdaf..c08344aef6186 100644 --- a/api_docs/kbn_ci_stats_core.mdx +++ b/api_docs/kbn_ci_stats_core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-core title: "@kbn/ci-stats-core" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-core plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-core'] --- import kbnCiStatsCoreObj from './kbn_ci_stats_core.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_performance_metrics.mdx b/api_docs/kbn_ci_stats_performance_metrics.mdx index 9dec5dcb66049..41d93ad7f45e2 100644 --- a/api_docs/kbn_ci_stats_performance_metrics.mdx +++ b/api_docs/kbn_ci_stats_performance_metrics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-performance-metrics title: "@kbn/ci-stats-performance-metrics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-performance-metrics plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-performance-metrics'] --- import kbnCiStatsPerformanceMetricsObj from './kbn_ci_stats_performance_metrics.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_reporter.mdx b/api_docs/kbn_ci_stats_reporter.mdx index 0586b9f3d1864..0469bd534cdef 100644 --- a/api_docs/kbn_ci_stats_reporter.mdx +++ b/api_docs/kbn_ci_stats_reporter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-reporter title: "@kbn/ci-stats-reporter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-reporter plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-reporter'] --- import kbnCiStatsReporterObj from './kbn_ci_stats_reporter.devdocs.json'; diff --git a/api_docs/kbn_cli_dev_mode.mdx b/api_docs/kbn_cli_dev_mode.mdx index 5b6983d6155c8..1990068f5fbfc 100644 --- a/api_docs/kbn_cli_dev_mode.mdx +++ b/api_docs/kbn_cli_dev_mode.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cli-dev-mode title: "@kbn/cli-dev-mode" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cli-dev-mode plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cli-dev-mode'] --- import kbnCliDevModeObj from './kbn_cli_dev_mode.devdocs.json'; diff --git a/api_docs/kbn_code_editor.mdx b/api_docs/kbn_code_editor.mdx index 3b19c755cd895..28738eed726f4 100644 --- a/api_docs/kbn_code_editor.mdx +++ b/api_docs/kbn_code_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-code-editor title: "@kbn/code-editor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/code-editor plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/code-editor'] --- import kbnCodeEditorObj from './kbn_code_editor.devdocs.json'; diff --git a/api_docs/kbn_code_editor_mocks.mdx b/api_docs/kbn_code_editor_mocks.mdx index dc746f3c840d7..decf718eb969c 100644 --- a/api_docs/kbn_code_editor_mocks.mdx +++ b/api_docs/kbn_code_editor_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-code-editor-mocks title: "@kbn/code-editor-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/code-editor-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/code-editor-mocks'] --- import kbnCodeEditorMocksObj from './kbn_code_editor_mocks.devdocs.json'; diff --git a/api_docs/kbn_coloring.devdocs.json b/api_docs/kbn_coloring.devdocs.json index 75bd30fc6e9e4..22b0920bc0b2a 100644 --- a/api_docs/kbn_coloring.devdocs.json +++ b/api_docs/kbn_coloring.devdocs.json @@ -17,7 +17,197 @@ "objects": [] }, "common": { - "classes": [], + "classes": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.CategoricalColorMapping", + "type": "Class", + "tags": [], + "label": "CategoricalColorMapping", + "description": [ + "\nThe React component for mapping categorical values to colors" + ], + "signature": [ + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.CategoricalColorMapping", + "text": "CategoricalColorMapping" + }, + " extends React.Component<", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.ColorMappingProps", + "text": "ColorMappingProps" + }, + ", {}, any>" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.CategoricalColorMapping.store", + "type": "Object", + "tags": [], + "label": "store", + "description": [], + "signature": [ + "EnhancedStore", + "<{ colorMapping: ", + "Config", + "; }, ", + "AnyAction", + ", Middlewares<{ colorMapping: ", + "Config", + "; }>>" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.CategoricalColorMapping.unsubscribe", + "type": "Function", + "tags": [], + "label": "unsubscribe", + "description": [], + "signature": [ + "() => void" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.CategoricalColorMapping.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.CategoricalColorMapping.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "props", + "description": [], + "signature": [ + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.ColorMappingProps", + "text": "ColorMappingProps" + } + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.CategoricalColorMapping.componentWillUnmount", + "type": "Function", + "tags": [], + "label": "componentWillUnmount", + "description": [], + "signature": [ + "() => void" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.CategoricalColorMapping.componentDidUpdate", + "type": "Function", + "tags": [], + "label": "componentDidUpdate", + "description": [], + "signature": [ + "(prevProps: Readonly<", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.ColorMappingProps", + "text": "ColorMappingProps" + }, + ">) => void" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.CategoricalColorMapping.componentDidUpdate.$1", + "type": "Object", + "tags": [], + "label": "prevProps", + "description": [], + "signature": [ + "Readonly<", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.ColorMappingProps", + "text": "ColorMappingProps" + }, + ">" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.CategoricalColorMapping.render", + "type": "Function", + "tags": [], + "label": "render", + "description": [], + "signature": [ + "() => JSX.Element" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], "functions": [ { "parentPluginId": "@kbn/coloring", @@ -239,32 +429,126 @@ }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.getColorAlpha", + "id": "def-common.getAssignmentColor", "type": "Function", "tags": [], - "label": "getColorAlpha", + "label": "getAssignmentColor", "description": [], "signature": [ - "(color?: string | null | undefined) => number" + "(colorMode: ", + "CategoricalColorMode", + " | ", + "GradientColorMode", + ", color: ", + "CategoricalColor", + " | ", + "ColorCode", + " | ", + "GradientColor", + ", getPaletteFn: (paletteId: string) => ", + "CategoricalPalette", + ", isDarkMode: boolean, index: number, total: number) => string" ], - "path": "packages/kbn-coloring/src/color_manipulation/index.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.getColorAlpha.$1", + "id": "def-common.getAssignmentColor.$1", + "type": "CompoundType", + "tags": [], + "label": "colorMode", + "description": [], + "signature": [ + "CategoricalColorMode", + " | ", + "GradientColorMode" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getAssignmentColor.$2", "type": "CompoundType", "tags": [], "label": "color", "description": [], "signature": [ - "string | null | undefined" + "CategoricalColor", + " | ", + "ColorCode", + " | ", + "GradientColor" ], - "path": "packages/kbn-coloring/src/color_manipulation/index.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getAssignmentColor.$3", + "type": "Function", + "tags": [], + "label": "getPaletteFn", + "description": [], + "signature": [ + "(paletteId: string) => ", + "CategoricalPalette" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getAssignmentColor.$4", + "type": "boolean", + "tags": [], + "label": "isDarkMode", + "description": [], + "signature": [ + "boolean" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getAssignmentColor.$5", + "type": "number", + "tags": [], + "label": "index", + "description": [], + "signature": [ + "number" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getAssignmentColor.$6", + "type": "number", + "tags": [], + "label": "total", + "description": [], + "signature": [ + "number" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true } ], "returnComment": [], @@ -272,58 +556,68 @@ }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.getDataMinMax", + "id": "def-common.getColor", "type": "Function", "tags": [], - "label": "getDataMinMax", + "label": "getColor", "description": [], "signature": [ - "(rangeType: \"number\" | \"percent\" | undefined, dataBounds: ", - { - "pluginId": "@kbn/coloring", - "scope": "common", - "docId": "kibKbnColoringPluginApi", - "section": "def-common.DataBounds", - "text": "DataBounds" - }, - ") => { min: number; max: number; }" + "(color: ", + "CategoricalColor", + " | ", + "ColorCode", + ", getPaletteFn: (paletteId: string) => ", + "CategoricalPalette", + ", isDarkMode: boolean) => string" ], - "path": "packages/kbn-coloring/src/palettes/utils.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.getDataMinMax.$1", + "id": "def-common.getColor.$1", "type": "CompoundType", "tags": [], - "label": "rangeType", + "label": "color", "description": [], "signature": [ - "\"number\" | \"percent\" | undefined" + "CategoricalColor", + " | ", + "ColorCode" ], - "path": "packages/kbn-coloring/src/palettes/utils.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.getDataMinMax.$2", - "type": "Object", + "id": "def-common.getColor.$2", + "type": "Function", "tags": [], - "label": "dataBounds", + "label": "getPaletteFn", "description": [], "signature": [ - { - "pluginId": "@kbn/coloring", - "scope": "common", - "docId": "kibKbnColoringPluginApi", - "section": "def-common.DataBounds", - "text": "DataBounds" - } + "(paletteId: string) => ", + "CategoricalPalette" ], - "path": "packages/kbn-coloring/src/palettes/utils.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getColor.$3", + "type": "boolean", + "tags": [], + "label": "isDarkMode", + "description": [], + "signature": [ + "boolean" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -334,36 +628,29 @@ }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.getFallbackDataBounds", + "id": "def-common.getColorAlpha", "type": "Function", "tags": [], - "label": "getFallbackDataBounds", + "label": "getColorAlpha", "description": [], "signature": [ - "(rangeType?: \"number\" | \"percent\" | undefined) => ", - { - "pluginId": "@kbn/coloring", - "scope": "common", - "docId": "kibKbnColoringPluginApi", - "section": "def-common.DataBounds", - "text": "DataBounds" - } + "(color?: string | null | undefined) => number" ], - "path": "packages/kbn-coloring/src/palettes/utils.ts", + "path": "packages/kbn-coloring/src/color_manipulation/index.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.getFallbackDataBounds.$1", + "id": "def-common.getColorAlpha.$1", "type": "CompoundType", "tags": [], - "label": "rangeType", + "label": "color", "description": [], "signature": [ - "\"number\" | \"percent\" | undefined" + "string | null | undefined" ], - "path": "packages/kbn-coloring/src/palettes/utils.ts", + "path": "packages/kbn-coloring/src/color_manipulation/index.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -374,160 +661,147 @@ }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.getPaletteStops", + "id": "def-common.getColorFactory", "type": "Function", "tags": [], - "label": "getPaletteStops", - "description": [ - "\nThis is a generic function to compute stops from the current parameters." - ], + "label": "getColorFactory", + "description": [], "signature": [ - "(palettes: ", - { - "pluginId": "@kbn/coloring", - "scope": "common", - "docId": "kibKbnColoringPluginApi", - "section": "def-common.PaletteRegistry", - "text": "PaletteRegistry" - }, - ", activePaletteParams: ", - { - "pluginId": "@kbn/coloring", - "scope": "common", - "docId": "kibKbnColoringPluginApi", - "section": "def-common.CustomPaletteParams", - "text": "CustomPaletteParams" - }, - ", {\n prevPalette,\n dataBounds,\n mapFromMinValue,\n defaultPaletteName,\n }: { prevPalette?: string | undefined; dataBounds: ", + "(model: ", + "Config", + ", getPaletteFn: (paletteId: string) => ", + "CategoricalPalette", + ", isDarkMode: boolean, data: ", { "pluginId": "@kbn/coloring", "scope": "common", "docId": "kibKbnColoringPluginApi", - "section": "def-common.DataBounds", - "text": "DataBounds" + "section": "def-common.ColorMappingInputData", + "text": "ColorMappingInputData" }, - "; mapFromMinValue?: boolean | undefined; defaultPaletteName?: string | undefined; }) => { stop: number; color: string; }[]" + ") => (category: string | string[]) => string" ], - "path": "packages/kbn-coloring/src/palettes/utils.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.getPaletteStops.$1", + "id": "def-common.getColorFactory.$1", "type": "Object", "tags": [], - "label": "palettes", + "label": "model", "description": [], "signature": [ - { - "pluginId": "@kbn/coloring", - "scope": "common", - "docId": "kibKbnColoringPluginApi", - "section": "def-common.PaletteRegistry", - "text": "PaletteRegistry" - } + "Config" ], - "path": "packages/kbn-coloring/src/palettes/utils.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", "deprecated": false, "trackAdoption": false, "isRequired": true }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.getPaletteStops.$2", - "type": "Object", + "id": "def-common.getColorFactory.$2", + "type": "Function", "tags": [], - "label": "activePaletteParams", + "label": "getPaletteFn", + "description": [], + "signature": [ + "(paletteId: string) => ", + "CategoricalPalette" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getColorFactory.$3", + "type": "boolean", + "tags": [], + "label": "isDarkMode", + "description": [], + "signature": [ + "boolean" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getColorFactory.$4", + "type": "CompoundType", + "tags": [], + "label": "data", "description": [], "signature": [ { "pluginId": "@kbn/coloring", "scope": "common", "docId": "kibKbnColoringPluginApi", - "section": "def-common.CustomPaletteParams", - "text": "CustomPaletteParams" + "section": "def-common.ColorMappingInputData", + "text": "ColorMappingInputData" } ], - "path": "packages/kbn-coloring/src/palettes/utils.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getColorsFromMapping", + "type": "Function", + "tags": [], + "label": "getColorsFromMapping", + "description": [], + "signature": [ + "(isDarkMode: boolean, colorMappings: ", + "Config", + " | undefined) => string[]" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getColorsFromMapping.$1", + "type": "boolean", + "tags": [], + "label": "isDarkMode", + "description": [], + "signature": [ + "boolean" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts", "deprecated": false, "trackAdoption": false, "isRequired": true }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.getPaletteStops.$3", + "id": "def-common.getColorsFromMapping.$2", "type": "Object", "tags": [], - "label": "{\n prevPalette,\n dataBounds,\n mapFromMinValue,\n defaultPaletteName,\n }", + "label": "colorMappings", "description": [], - "path": "packages/kbn-coloring/src/palettes/utils.ts", + "signature": [ + "Config", + " | undefined" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts", "deprecated": false, "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.getPaletteStops.$3.prevPalette", - "type": "string", - "tags": [], - "label": "prevPalette", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-coloring/src/palettes/utils.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.getPaletteStops.$3.dataBounds", - "type": "Object", - "tags": [], - "label": "dataBounds", - "description": [], - "signature": [ - { - "pluginId": "@kbn/coloring", - "scope": "common", - "docId": "kibKbnColoringPluginApi", - "section": "def-common.DataBounds", - "text": "DataBounds" - } - ], - "path": "packages/kbn-coloring/src/palettes/utils.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.getPaletteStops.$3.mapFromMinValue", - "type": "CompoundType", - "tags": [], - "label": "mapFromMinValue", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "packages/kbn-coloring/src/palettes/utils.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.getPaletteStops.$3.defaultPaletteName", - "type": "string", - "tags": [], - "label": "defaultPaletteName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-coloring/src/palettes/utils.ts", - "deprecated": false, - "trackAdoption": false - } - ] + "isRequired": false } ], "returnComment": [], @@ -535,29 +809,21 @@ }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.getStepValue", + "id": "def-common.getDataMinMax", "type": "Function", "tags": [], - "label": "getStepValue", + "label": "getDataMinMax", "description": [], "signature": [ - "(colorStops: ", - { - "pluginId": "@kbn/coloring", - "scope": "common", - "docId": "kibKbnColoringPluginApi", - "section": "def-common.ColorStop", - "text": "ColorStop" - }, - "[], newColorStops: ", + "(rangeType: \"number\" | \"percent\" | undefined, dataBounds: ", { "pluginId": "@kbn/coloring", "scope": "common", "docId": "kibKbnColoringPluginApi", - "section": "def-common.ColorStop", - "text": "ColorStop" + "section": "def-common.DataBounds", + "text": "DataBounds" }, - "[], max: number) => number" + ") => { min: number; max: number; }" ], "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, @@ -565,57 +831,34 @@ "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.getStepValue.$1", - "type": "Array", + "id": "def-common.getDataMinMax.$1", + "type": "CompoundType", "tags": [], - "label": "colorStops", + "label": "rangeType", "description": [], "signature": [ - { - "pluginId": "@kbn/coloring", - "scope": "common", - "docId": "kibKbnColoringPluginApi", - "section": "def-common.ColorStop", - "text": "ColorStop" - }, - "[]" + "\"number\" | \"percent\" | undefined" ], "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, "trackAdoption": false, - "isRequired": true + "isRequired": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.getStepValue.$2", - "type": "Array", + "id": "def-common.getDataMinMax.$2", + "type": "Object", "tags": [], - "label": "newColorStops", + "label": "dataBounds", "description": [], "signature": [ { "pluginId": "@kbn/coloring", "scope": "common", "docId": "kibKbnColoringPluginApi", - "section": "def-common.ColorStop", - "text": "ColorStop" - }, - "[]" - ], - "path": "packages/kbn-coloring/src/palettes/utils.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.getStepValue.$3", - "type": "number", - "tags": [], - "label": "max", - "description": [], - "signature": [ - "number" + "section": "def-common.DataBounds", + "text": "DataBounds" + } ], "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, @@ -628,29 +871,36 @@ }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.isValidColor", + "id": "def-common.getFallbackDataBounds", "type": "Function", "tags": [], - "label": "isValidColor", + "label": "getFallbackDataBounds", "description": [], "signature": [ - "(colorString: string | undefined) => boolean" + "(rangeType?: \"number\" | \"percent\" | undefined) => ", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.DataBounds", + "text": "DataBounds" + } ], - "path": "packages/kbn-coloring/src/color_manipulation/index.ts", + "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.isValidColor.$1", - "type": "string", + "id": "def-common.getFallbackDataBounds.$1", + "type": "CompoundType", "tags": [], - "label": "colorString", + "label": "rangeType", "description": [], "signature": [ - "string | undefined" + "\"number\" | \"percent\" | undefined" ], - "path": "packages/kbn-coloring/src/color_manipulation/index.ts", + "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -661,44 +911,64 @@ }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.makeColorWithAlpha", + "id": "def-common.getGradientColorScale", "type": "Function", "tags": [], - "label": "makeColorWithAlpha", + "label": "getGradientColorScale", "description": [], "signature": [ - "(color: string, newAlpha: number) => chroma.Color" + "(colorMode: ", + "GradientColorMode", + ", getPaletteFn: (paletteId: string) => ", + "CategoricalPalette", + ", isDarkMode: boolean) => (value: number) => string" ], - "path": "packages/kbn-coloring/src/color_manipulation/index.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.makeColorWithAlpha.$1", - "type": "string", + "id": "def-common.getGradientColorScale.$1", + "type": "Object", "tags": [], - "label": "color", + "label": "colorMode", "description": [], "signature": [ - "string" + "GradientColorMode" ], - "path": "packages/kbn-coloring/src/color_manipulation/index.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", "deprecated": false, "trackAdoption": false, "isRequired": true }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.makeColorWithAlpha.$2", - "type": "number", + "id": "def-common.getGradientColorScale.$2", + "type": "Function", "tags": [], - "label": "newAlpha", + "label": "getPaletteFn", "description": [], "signature": [ - "number" + "(paletteId: string) => ", + "CategoricalPalette" ], - "path": "packages/kbn-coloring/src/color_manipulation/index.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getGradientColorScale.$3", + "type": "boolean", + "tags": [], + "label": "isDarkMode", + "description": [], + "signature": [ + "boolean" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -709,21 +979,147 @@ }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.remapStopsByNewInterval", + "id": "def-common.getPalette", "type": "Function", "tags": [], - "label": "remapStopsByNewInterval", + "label": "getPalette", + "description": [ + "\nThis function should be instanciated once at the root of the component with the available palettes and\na choosed default one and shared across components to keep a single point of truth of the available palettes and the default\none." + ], + "signature": [ + "(palettes: Map, defaultPalette: ", + "CategoricalPalette", + ") => (paletteId: string) => ", + "CategoricalPalette" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getPalette.$1", + "type": "Object", + "tags": [], + "label": "palettes", + "description": [], + "signature": [ + "Map" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/index.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getPalette.$2", + "type": "Object", + "tags": [], + "label": "defaultPalette", + "description": [], + "signature": [ + "CategoricalPalette" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/index.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getPaletteColors", + "type": "Function", + "tags": [], + "label": "getPaletteColors", "description": [], "signature": [ - "(controlStops: ", + "(isDarkMode: boolean, colorMappings: ", + "Config", + " | undefined) => string[]" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getPaletteColors.$1", + "type": "boolean", + "tags": [], + "label": "isDarkMode", + "description": [], + "signature": [ + "boolean" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getPaletteColors.$2", + "type": "Object", + "tags": [], + "label": "colorMappings", + "description": [], + "signature": [ + "Config", + " | undefined" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getPaletteStops", + "type": "Function", + "tags": [], + "label": "getPaletteStops", + "description": [ + "\nThis is a generic function to compute stops from the current parameters." + ], + "signature": [ + "(palettes: ", { "pluginId": "@kbn/coloring", "scope": "common", "docId": "kibKbnColoringPluginApi", - "section": "def-common.ColorStop", - "text": "ColorStop" + "section": "def-common.PaletteRegistry", + "text": "PaletteRegistry" }, - "[], {\n newInterval,\n oldInterval,\n newMin,\n oldMin,\n }: { newInterval: number; oldInterval: number; newMin: number; oldMin: number; }) => { color: string; stop: number; }[]" + ", activePaletteParams: ", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.CustomPaletteParams", + "text": "CustomPaletteParams" + }, + ", {\n prevPalette,\n dataBounds,\n mapFromMinValue,\n defaultPaletteName,\n }: { prevPalette?: string | undefined; dataBounds: ", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.DataBounds", + "text": "DataBounds" + }, + "; mapFromMinValue?: boolean | undefined; defaultPaletteName?: string | undefined; }) => { stop: number; color: string; }[]" ], "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, @@ -731,20 +1127,19 @@ "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.remapStopsByNewInterval.$1", - "type": "Array", + "id": "def-common.getPaletteStops.$1", + "type": "Object", "tags": [], - "label": "controlStops", + "label": "palettes", "description": [], "signature": [ { "pluginId": "@kbn/coloring", "scope": "common", "docId": "kibKbnColoringPluginApi", - "section": "def-common.ColorStop", - "text": "ColorStop" - }, - "[]" + "section": "def-common.PaletteRegistry", + "text": "PaletteRegistry" + } ], "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, @@ -753,10 +1148,31 @@ }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.remapStopsByNewInterval.$2", + "id": "def-common.getPaletteStops.$2", "type": "Object", "tags": [], - "label": "{\n newInterval,\n oldInterval,\n newMin,\n oldMin,\n }", + "label": "activePaletteParams", + "description": [], + "signature": [ + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.CustomPaletteParams", + "text": "CustomPaletteParams" + } + ], + "path": "packages/kbn-coloring/src/palettes/utils.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getPaletteStops.$3", + "type": "Object", + "tags": [], + "label": "{\n prevPalette,\n dataBounds,\n mapFromMinValue,\n defaultPaletteName,\n }", "description": [], "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, @@ -764,44 +1180,62 @@ "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.remapStopsByNewInterval.$2.newInterval", - "type": "number", + "id": "def-common.getPaletteStops.$3.prevPalette", + "type": "string", "tags": [], - "label": "newInterval", + "label": "prevPalette", "description": [], + "signature": [ + "string | undefined" + ], "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.remapStopsByNewInterval.$2.oldInterval", - "type": "number", + "id": "def-common.getPaletteStops.$3.dataBounds", + "type": "Object", "tags": [], - "label": "oldInterval", + "label": "dataBounds", "description": [], + "signature": [ + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.DataBounds", + "text": "DataBounds" + } + ], "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.remapStopsByNewInterval.$2.newMin", - "type": "number", + "id": "def-common.getPaletteStops.$3.mapFromMinValue", + "type": "CompoundType", "tags": [], - "label": "newMin", + "label": "mapFromMinValue", "description": [], + "signature": [ + "boolean | undefined" + ], "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.remapStopsByNewInterval.$2.oldMin", - "type": "number", + "id": "def-common.getPaletteStops.$3.defaultPaletteName", + "type": "string", "tags": [], - "label": "oldMin", + "label": "defaultPaletteName", "description": [], + "signature": [ + "string | undefined" + ], "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, "trackAdoption": false @@ -814,13 +1248,13 @@ }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.reversePalette", + "id": "def-common.getStepValue", "type": "Function", "tags": [], - "label": "reversePalette", + "label": "getStepValue", "description": [], "signature": [ - "(paletteColorRepresentation: ", + "(colorStops: ", { "pluginId": "@kbn/coloring", "scope": "common", @@ -828,7 +1262,15 @@ "section": "def-common.ColorStop", "text": "ColorStop" }, - "[]) => { color: string; stop: number; }[]" + "[], newColorStops: ", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.ColorStop", + "text": "ColorStop" + }, + "[], max: number) => number" ], "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, @@ -836,10 +1278,10 @@ "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.reversePalette.$1", + "id": "def-common.getStepValue.$1", "type": "Array", "tags": [], - "label": "paletteColorRepresentation", + "label": "colorStops", "description": [], "signature": [ { @@ -855,87 +1297,13 @@ "deprecated": false, "trackAdoption": false, "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.roundValue", - "type": "Function", - "tags": [], - "label": "roundValue", - "description": [], - "signature": [ - "(value: number, fractionDigits: number) => number" - ], - "path": "packages/kbn-coloring/src/palettes/utils.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ + }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.roundValue.$1", - "type": "number", + "id": "def-common.getStepValue.$2", + "type": "Array", "tags": [], - "label": "value", - "description": [], - "signature": [ - "number" - ], - "path": "packages/kbn-coloring/src/palettes/utils.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.roundValue.$2", - "type": "number", - "tags": [], - "label": "fractionDigits", - "description": [], - "signature": [ - "number" - ], - "path": "packages/kbn-coloring/src/palettes/utils.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.shiftPalette", - "type": "Function", - "tags": [], - "label": "shiftPalette", - "description": [], - "signature": [ - "(stops: ", - { - "pluginId": "@kbn/coloring", - "scope": "common", - "docId": "kibKbnColoringPluginApi", - "section": "def-common.ColorStop", - "text": "ColorStop" - }, - "[], max: number) => { stop: number; color: string; }[]" - ], - "path": "packages/kbn-coloring/src/palettes/utils.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.shiftPalette.$1", - "type": "Array", - "tags": [], - "label": "stops", + "label": "newColorStops", "description": [], "signature": [ { @@ -954,7 +1322,7 @@ }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.shiftPalette.$2", + "id": "def-common.getStepValue.$3", "type": "number", "tags": [], "label": "max", @@ -970,268 +1338,317 @@ ], "returnComment": [], "initialIsOpen": false - } - ], - "interfaces": [ + }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.ChartColorConfiguration", - "type": "Interface", + "id": "def-common.isValidColor", + "type": "Function", "tags": [], - "label": "ChartColorConfiguration", - "description": [ - "\nInformation about the structure of a chart to determine the color of a series within it." + "label": "isValidColor", + "description": [], + "signature": [ + "(colorString: string | undefined) => boolean" ], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "path": "packages/kbn-coloring/src/color_manipulation/index.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.ChartColorConfiguration.totalSeries", - "type": "number", - "tags": [], - "label": "totalSeries", - "description": [ - "\nOverall number of series in the current chart" - ], - "signature": [ - "number | undefined" - ], - "path": "packages/kbn-coloring/src/palettes/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.ChartColorConfiguration.maxDepth", - "type": "number", - "tags": [], - "label": "maxDepth", - "description": [ - "\nMax nesting depth of the series tree" - ], - "signature": [ - "number | undefined" - ], - "path": "packages/kbn-coloring/src/palettes/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.ChartColorConfiguration.behindText", - "type": "CompoundType", - "tags": [], - "label": "behindText", - "description": [ - "\nFlag whether the color will be used behind text. The palette can use this information to\nadjust colors for better a11y. Might be ignored depending on the palette." - ], - "signature": [ - "boolean | undefined" - ], - "path": "packages/kbn-coloring/src/palettes/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.ChartColorConfiguration.syncColors", - "type": "CompoundType", + "id": "def-common.isValidColor.$1", + "type": "string", "tags": [], - "label": "syncColors", - "description": [ - "\nFlag whether a color assignment to a given key should be remembered and re-used the next time the key shows up.\nThis setting might be ignored based on the palette." - ], + "label": "colorString", + "description": [], "signature": [ - "boolean | undefined" + "string | undefined" ], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "path": "packages/kbn-coloring/src/color_manipulation/index.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": false } ], + "returnComment": [], "initialIsOpen": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.ColorStop", - "type": "Interface", + "id": "def-common.makeColorWithAlpha", + "type": "Function", "tags": [], - "label": "ColorStop", + "label": "makeColorWithAlpha", "description": [], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "signature": [ + "(color: string, newAlpha: number) => chroma.Color" + ], + "path": "packages/kbn-coloring/src/color_manipulation/index.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.ColorStop.color", + "id": "def-common.makeColorWithAlpha.$1", "type": "string", "tags": [], "label": "color", "description": [], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "signature": [ + "string" + ], + "path": "packages/kbn-coloring/src/color_manipulation/index.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.ColorStop.stop", + "id": "def-common.makeColorWithAlpha.$2", "type": "number", "tags": [], - "label": "stop", + "label": "newAlpha", "description": [], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "signature": [ + "number" + ], + "path": "packages/kbn-coloring/src/color_manipulation/index.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true } ], + "returnComment": [], "initialIsOpen": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.CustomPaletteParams", - "type": "Interface", + "id": "def-common.remapStopsByNewInterval", + "type": "Function", "tags": [], - "label": "CustomPaletteParams", + "label": "remapStopsByNewInterval", "description": [], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "signature": [ + "(controlStops: ", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.ColorStop", + "text": "ColorStop" + }, + "[], {\n newInterval,\n oldInterval,\n newMin,\n oldMin,\n }: { newInterval: number; oldInterval: number; newMin: number; oldMin: number; }) => { color: string; stop: number; }[]" + ], + "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.CustomPaletteParams.name", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-coloring/src/palettes/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.CustomPaletteParams.reverse", - "type": "CompoundType", - "tags": [], - "label": "reverse", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "packages/kbn-coloring/src/palettes/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.CustomPaletteParams.rangeType", - "type": "CompoundType", - "tags": [], - "label": "rangeType", - "description": [], - "signature": [ - "\"number\" | \"percent\" | undefined" - ], - "path": "packages/kbn-coloring/src/palettes/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.CustomPaletteParams.continuity", - "type": "CompoundType", + "id": "def-common.remapStopsByNewInterval.$1", + "type": "Array", "tags": [], - "label": "continuity", + "label": "controlStops", "description": [], "signature": [ { "pluginId": "@kbn/coloring", "scope": "common", "docId": "kibKbnColoringPluginApi", - "section": "def-common.PaletteContinuity", - "text": "PaletteContinuity" + "section": "def-common.ColorStop", + "text": "ColorStop" }, - " | undefined" + "[]" ], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.CustomPaletteParams.progression", - "type": "string", + "id": "def-common.remapStopsByNewInterval.$2", + "type": "Object", "tags": [], - "label": "progression", + "label": "{\n newInterval,\n oldInterval,\n newMin,\n oldMin,\n }", "description": [], - "signature": [ - "\"fixed\" | undefined" - ], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.remapStopsByNewInterval.$2.newInterval", + "type": "number", + "tags": [], + "label": "newInterval", + "description": [], + "path": "packages/kbn-coloring/src/palettes/utils.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.remapStopsByNewInterval.$2.oldInterval", + "type": "number", + "tags": [], + "label": "oldInterval", + "description": [], + "path": "packages/kbn-coloring/src/palettes/utils.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.remapStopsByNewInterval.$2.newMin", + "type": "number", + "tags": [], + "label": "newMin", + "description": [], + "path": "packages/kbn-coloring/src/palettes/utils.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.remapStopsByNewInterval.$2.oldMin", + "type": "number", + "tags": [], + "label": "oldMin", + "description": [], + "path": "packages/kbn-coloring/src/palettes/utils.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.reversePalette", + "type": "Function", + "tags": [], + "label": "reversePalette", + "description": [], + "signature": [ + "(paletteColorRepresentation: ", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.ColorStop", + "text": "ColorStop" }, + "[]) => { color: string; stop: number; }[]" + ], + "path": "packages/kbn-coloring/src/palettes/utils.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.CustomPaletteParams.rangeMin", - "type": "number", + "id": "def-common.reversePalette.$1", + "type": "Array", "tags": [], - "label": "rangeMin", + "label": "paletteColorRepresentation", "description": [], "signature": [ - "number | undefined" + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.ColorStop", + "text": "ColorStop" + }, + "[]" ], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, - "trackAdoption": false - }, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.roundValue", + "type": "Function", + "tags": [], + "label": "roundValue", + "description": [], + "signature": [ + "(value: number, fractionDigits: number) => number" + ], + "path": "packages/kbn-coloring/src/palettes/utils.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.CustomPaletteParams.rangeMax", + "id": "def-common.roundValue.$1", "type": "number", "tags": [], - "label": "rangeMax", + "label": "value", "description": [], "signature": [ - "number | undefined" + "number" ], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.CustomPaletteParams.stops", - "type": "Array", + "id": "def-common.roundValue.$2", + "type": "number", "tags": [], - "label": "stops", + "label": "fractionDigits", "description": [], "signature": [ - { - "pluginId": "@kbn/coloring", - "scope": "common", - "docId": "kibKbnColoringPluginApi", - "section": "def-common.ColorStop", - "text": "ColorStop" - }, - "[] | undefined" + "number" ], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.shiftPalette", + "type": "Function", + "tags": [], + "label": "shiftPalette", + "description": [], + "signature": [ + "(stops: ", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.ColorStop", + "text": "ColorStop" }, + "[], max: number) => { stop: number; color: string; }[]" + ], + "path": "packages/kbn-coloring/src/palettes/utils.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.CustomPaletteParams.colorStops", + "id": "def-common.shiftPalette.$1", "type": "Array", "tags": [], - "label": "colorStops", + "label": "stops", "description": [], "signature": [ { @@ -1241,83 +1658,104 @@ "section": "def-common.ColorStop", "text": "ColorStop" }, - "[] | undefined" - ], - "path": "packages/kbn-coloring/src/palettes/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.CustomPaletteParams.steps", - "type": "number", - "tags": [], - "label": "steps", - "description": [], - "signature": [ - "number | undefined" + "[]" ], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.CustomPaletteParams.maxSteps", + "id": "def-common.shiftPalette.$2", "type": "number", "tags": [], - "label": "maxSteps", + "label": "max", "description": [], "signature": [ - "number | undefined" + "number" ], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true } ], + "returnComment": [], "initialIsOpen": false - }, + } + ], + "interfaces": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.DataBounds", + "id": "def-common.ChartColorConfiguration", "type": "Interface", "tags": [], - "label": "DataBounds", - "description": [], + "label": "ChartColorConfiguration", + "description": [ + "\nInformation about the structure of a chart to determine the color of a series within it." + ], "path": "packages/kbn-coloring/src/palettes/types.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.DataBounds.min", + "id": "def-common.ChartColorConfiguration.totalSeries", "type": "number", "tags": [], - "label": "min", - "description": [], + "label": "totalSeries", + "description": [ + "\nOverall number of series in the current chart" + ], + "signature": [ + "number | undefined" + ], "path": "packages/kbn-coloring/src/palettes/types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.DataBounds.max", + "id": "def-common.ChartColorConfiguration.maxDepth", "type": "number", "tags": [], - "label": "max", - "description": [], + "label": "maxDepth", + "description": [ + "\nMax nesting depth of the series tree" + ], + "signature": [ + "number | undefined" + ], "path": "packages/kbn-coloring/src/palettes/types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.DataBounds.fallback", + "id": "def-common.ChartColorConfiguration.behindText", "type": "CompoundType", "tags": [], - "label": "fallback", - "description": [], + "label": "behindText", + "description": [ + "\nFlag whether the color will be used behind text. The palette can use this information to\nadjust colors for better a11y. Might be ignored depending on the palette." + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.ChartColorConfiguration.syncColors", + "type": "CompoundType", + "tags": [], + "label": "syncColors", + "description": [ + "\nFlag whether a color assignment to a given key should be remembered and re-used the next time the key shows up.\nThis setting might be ignored based on the palette." + ], "signature": [ "boolean | undefined" ], @@ -1330,392 +1768,191 @@ }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteDefinition", + "id": "def-common.ColorMappingProps", "type": "Interface", "tags": [], - "label": "PaletteDefinition", + "label": "ColorMappingProps", "description": [ - "\nDefinition of a global palette.\n\nA palette controls the appearance of Lens charts on an editor level.\nThe palette wont get reset when switching charts.\n\nA palette can hold internal state (e.g. for customizations) and also includes\nan editor component to edit the internal state." - ], - "signature": [ - { - "pluginId": "@kbn/coloring", - "scope": "common", - "docId": "kibKbnColoringPluginApi", - "section": "def-common.PaletteDefinition", - "text": "PaletteDefinition" - }, - "" + "\nThe props of the CategoricalColorMapping component" ], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteDefinition.id", - "type": "string", + "id": "def-common.ColorMappingProps.model", + "type": "Object", "tags": [], - "label": "id", + "label": "model", "description": [ - "\nUnique id of the palette (this will be persisted along with the visualization state)" + "The initial color mapping model, usually coming from a the visualization saved object" ], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "signature": [ + "Config" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteDefinition.title", - "type": "string", + "id": "def-common.ColorMappingProps.palettes", + "type": "Object", "tags": [], - "label": "title", + "label": "palettes", "description": [ - "\nUser facing title (should be i18n-ized)" + "A map of paletteId and palette configuration" ], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "signature": [ + "Map" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteDefinition.internal", + "id": "def-common.ColorMappingProps.data", "type": "CompoundType", "tags": [], - "label": "internal", + "label": "data", "description": [ - "\nFlag indicating whether users should be able to pick this palette manually." + "A data description of what needs to be colored" ], "signature": [ - "boolean | undefined" + "{ type: \"categories\"; categories: (string | string[])[]; } | { type: \"ranges\"; min: number; max: number; bins: number; }" ], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteDefinition.toExpression", - "type": "Function", + "id": "def-common.ColorMappingProps.isDarkMode", + "type": "boolean", "tags": [], - "label": "toExpression", + "label": "isDarkMode", "description": [ - "\nSerialize the internal state of the palette into an expression function.\nThis function should be used to pass the palette to the expression function applying color and other styles" - ], - "signature": [ - "(state?: T | undefined) => ", - { - "pluginId": "@kbn/interpreter", - "scope": "common", - "docId": "kibKbnInterpreterPluginApi", - "section": "def-common.Ast", - "text": "Ast" - } + "Theme dark mode" ], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteDefinition.toExpression.$1", - "type": "Uncategorized", - "tags": [], - "label": "state", - "description": [ - "The internal state of the palette" - ], - "signature": [ - "T | undefined" - ], - "path": "packages/kbn-coloring/src/palettes/types.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - } - ], - "returnComment": [] + "trackAdoption": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteDefinition.getCategoricalColor", - "type": "Function", + "id": "def-common.ColorMappingProps.specialTokens", + "type": "Object", "tags": [], - "label": "getCategoricalColor", + "label": "specialTokens", "description": [ - "\nColor a series according to the internal rules of the palette." + "A map between original and formatted tokens used to handle special cases, like the Other bucket and the empty bucket" ], "signature": [ - "(series: ", - { - "pluginId": "@kbn/coloring", - "scope": "common", - "docId": "kibKbnColoringPluginApi", - "section": "def-common.SeriesLayer", - "text": "SeriesLayer" - }, - "[], chartConfiguration?: ", - { - "pluginId": "@kbn/coloring", - "scope": "common", - "docId": "kibKbnColoringPluginApi", - "section": "def-common.ChartColorConfiguration", - "text": "ChartColorConfiguration" - }, - " | undefined, state?: T | undefined) => string | null" + "Map" ], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteDefinition.getCategoricalColor.$1", - "type": "Array", - "tags": [], - "label": "series", - "description": [ - "The current series along with its ancestors." - ], - "signature": [ - { - "pluginId": "@kbn/coloring", - "scope": "common", - "docId": "kibKbnColoringPluginApi", - "section": "def-common.SeriesLayer", - "text": "SeriesLayer" - }, - "[]" - ], - "path": "packages/kbn-coloring/src/palettes/types.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteDefinition.getCategoricalColor.$2", - "type": "Object", - "tags": [], - "label": "chartConfiguration", - "description": [], - "signature": [ - { - "pluginId": "@kbn/coloring", - "scope": "common", - "docId": "kibKbnColoringPluginApi", - "section": "def-common.ChartColorConfiguration", - "text": "ChartColorConfiguration" - }, - " | undefined" - ], - "path": "packages/kbn-coloring/src/palettes/types.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteDefinition.getCategoricalColor.$3", - "type": "Uncategorized", - "tags": [], - "label": "state", - "description": [ - "The internal state of the palette" - ], - "signature": [ - "T | undefined" - ], - "path": "packages/kbn-coloring/src/palettes/types.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - } - ], - "returnComment": [] + "trackAdoption": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteDefinition.getCategoricalColors", + "id": "def-common.ColorMappingProps.onModelUpdate", "type": "Function", "tags": [], - "label": "getCategoricalColors", + "label": "onModelUpdate", "description": [ - "\nGet a spectrum of colors of the current palette.\nThis can be used if the chart wants to control color assignment locally." + "A function called at every change in the model" ], "signature": [ - "(size: number, state?: T | undefined) => string[]" + "(model: ", + "Config", + ") => void" ], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteDefinition.getCategoricalColors.$1", - "type": "number", + "id": "def-common.ColorMappingProps.onModelUpdate.$1", + "type": "Object", "tags": [], - "label": "size", + "label": "model", "description": [], "signature": [ - "number" + "Config" ], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteDefinition.getCategoricalColors.$2", - "type": "Uncategorized", - "tags": [], - "label": "state", - "description": [], - "signature": [ - "T | undefined" - ], - "path": "packages/kbn-coloring/src/palettes/types.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false } ], "returnComment": [] - }, + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.ColorStop", + "type": "Interface", + "tags": [], + "label": "ColorStop", + "description": [], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteDefinition.canDynamicColoring", - "type": "CompoundType", + "id": "def-common.ColorStop.color", + "type": "string", "tags": [], - "label": "canDynamicColoring", - "description": [ - "\nDefine whether a palette supports dynamic coloring (i.e. gradient colors mapped to number values)" - ], - "signature": [ - "boolean | undefined" - ], + "label": "color", + "description": [], "path": "packages/kbn-coloring/src/palettes/types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteDefinition.getColorForValue", - "type": "Function", + "id": "def-common.ColorStop.stop", + "type": "number", "tags": [], - "label": "getColorForValue", - "description": [ - "\nGet the assigned color for the given value based on its data domain and state settings.\nThis can be used for dynamic coloring based on uniform color distribution or custom stops." - ], - "signature": [ - "((value: number | undefined, state: T, { min, max }: { min: number; max: number; }) => string | undefined) | undefined" - ], + "label": "stop", + "description": [], "path": "packages/kbn-coloring/src/palettes/types.ts", "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteDefinition.getColorForValue.$1", - "type": "number", - "tags": [], - "label": "value", - "description": [], - "signature": [ - "number | undefined" - ], - "path": "packages/kbn-coloring/src/palettes/types.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteDefinition.getColorForValue.$2", - "type": "Uncategorized", - "tags": [], - "label": "state", - "description": [], - "signature": [ - "T" - ], - "path": "packages/kbn-coloring/src/palettes/types.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteDefinition.getColorForValue.$3", - "type": "Object", - "tags": [], - "label": "{ min, max }", - "description": [], - "path": "packages/kbn-coloring/src/palettes/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteDefinition.getColorForValue.$3.min", - "type": "number", - "tags": [], - "label": "min", - "description": [], - "path": "packages/kbn-coloring/src/palettes/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteDefinition.getColorForValue.$3.max", - "type": "number", - "tags": [], - "label": "max", - "description": [], - "path": "packages/kbn-coloring/src/palettes/types.ts", - "deprecated": false, - "trackAdoption": false - } - ] - } - ], - "returnComment": [] + "trackAdoption": false } ], "initialIsOpen": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteOutput", + "id": "def-common.CustomPaletteParams", "type": "Interface", "tags": [], - "label": "PaletteOutput", + "label": "CustomPaletteParams", "description": [], - "signature": [ - { - "pluginId": "@kbn/coloring", - "scope": "common", - "docId": "kibKbnColoringPluginApi", - "section": "def-common.PaletteOutput", - "text": "PaletteOutput" - }, - "" - ], "path": "packages/kbn-coloring/src/palettes/types.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteOutput.type", - "type": "CompoundType", + "id": "def-common.CustomPaletteParams.name", + "type": "string", "tags": [], - "label": "type", + "label": "name", "description": [], "signature": [ - "\"palette\" | \"system_palette\"" + "string | undefined" ], "path": "packages/kbn-coloring/src/palettes/types.ts", "deprecated": false, @@ -1723,131 +1960,132 @@ }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteOutput.name", - "type": "string", + "id": "def-common.CustomPaletteParams.reverse", + "type": "CompoundType", "tags": [], - "label": "name", + "label": "reverse", "description": [], + "signature": [ + "boolean | undefined" + ], "path": "packages/kbn-coloring/src/palettes/types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteOutput.params", - "type": "Uncategorized", + "id": "def-common.CustomPaletteParams.rangeType", + "type": "CompoundType", "tags": [], - "label": "params", + "label": "rangeType", "description": [], "signature": [ - "T | undefined" + "\"number\" | \"percent\" | undefined" ], "path": "packages/kbn-coloring/src/palettes/types.ts", "deprecated": false, "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteRegistry", - "type": "Interface", - "tags": [], - "label": "PaletteRegistry", - "description": [], - "path": "packages/kbn-coloring/src/palettes/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ + }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteRegistry.get", - "type": "Function", + "id": "def-common.CustomPaletteParams.continuity", + "type": "CompoundType", "tags": [], - "label": "get", + "label": "continuity", "description": [], "signature": [ - "(name: string) => ", { "pluginId": "@kbn/coloring", "scope": "common", "docId": "kibKbnColoringPluginApi", - "section": "def-common.PaletteDefinition", - "text": "PaletteDefinition" + "section": "def-common.PaletteContinuity", + "text": "PaletteContinuity" }, - "" + " | undefined" ], "path": "packages/kbn-coloring/src/palettes/types.ts", "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteRegistry.get.$1", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "signature": [ - "string" - ], - "path": "packages/kbn-coloring/src/palettes/types.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.CustomPaletteParams.progression", + "type": "string", + "tags": [], + "label": "progression", + "description": [], + "signature": [ + "\"fixed\" | undefined" ], - "returnComment": [] + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteRegistry.getAll", - "type": "Function", + "id": "def-common.CustomPaletteParams.rangeMin", + "type": "number", "tags": [], - "label": "getAll", + "label": "rangeMin", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.CustomPaletteParams.rangeMax", + "type": "number", + "tags": [], + "label": "rangeMax", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.CustomPaletteParams.stops", + "type": "Array", + "tags": [], + "label": "stops", "description": [], "signature": [ - "() => ", { "pluginId": "@kbn/coloring", "scope": "common", "docId": "kibKbnColoringPluginApi", - "section": "def-common.PaletteDefinition", - "text": "PaletteDefinition" + "section": "def-common.ColorStop", + "text": "ColorStop" }, - "[]" + "[] | undefined" ], "path": "packages/kbn-coloring/src/palettes/types.ts", "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.SeriesLayer", - "type": "Interface", - "tags": [], - "label": "SeriesLayer", - "description": [ - "\nInformation about a series in a chart used to determine its color.\nSeries layers can be nested, this means each series layer can have an ancestor." - ], - "path": "packages/kbn-coloring/src/palettes/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ + "trackAdoption": false + }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.SeriesLayer.name", - "type": "string", + "id": "def-common.CustomPaletteParams.colorStops", + "type": "Array", "tags": [], - "label": "name", - "description": [ - "\nName of the series (can be used for lookup-based coloring)" + "label": "colorStops", + "description": [], + "signature": [ + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.ColorStop", + "text": "ColorStop" + }, + "[] | undefined" ], "path": "packages/kbn-coloring/src/palettes/types.ts", "deprecated": false, @@ -1855,12 +2093,13 @@ }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.SeriesLayer.rankAtDepth", + "id": "def-common.CustomPaletteParams.steps", "type": "number", "tags": [], - "label": "rankAtDepth", - "description": [ - "\nRank of the series compared to siblings with the same ancestor" + "label": "steps", + "description": [], + "signature": [ + "number | undefined" ], "path": "packages/kbn-coloring/src/palettes/types.ts", "deprecated": false, @@ -1868,11 +2107,616 @@ }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.SeriesLayer.totalSeriesAtDepth", + "id": "def-common.CustomPaletteParams.maxSteps", "type": "number", "tags": [], - "label": "totalSeriesAtDepth", - "description": [ + "label": "maxSteps", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.DataBounds", + "type": "Interface", + "tags": [], + "label": "DataBounds", + "description": [], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.DataBounds.min", + "type": "number", + "tags": [], + "label": "min", + "description": [], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.DataBounds.max", + "type": "number", + "tags": [], + "label": "max", + "description": [], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.DataBounds.fallback", + "type": "CompoundType", + "tags": [], + "label": "fallback", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteDefinition", + "type": "Interface", + "tags": [], + "label": "PaletteDefinition", + "description": [ + "\nDefinition of a global palette.\n\nA palette controls the appearance of Lens charts on an editor level.\nThe palette wont get reset when switching charts.\n\nA palette can hold internal state (e.g. for customizations) and also includes\nan editor component to edit the internal state." + ], + "signature": [ + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteDefinition", + "text": "PaletteDefinition" + }, + "" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteDefinition.id", + "type": "string", + "tags": [], + "label": "id", + "description": [ + "\nUnique id of the palette (this will be persisted along with the visualization state)" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteDefinition.title", + "type": "string", + "tags": [], + "label": "title", + "description": [ + "\nUser facing title (should be i18n-ized)" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteDefinition.internal", + "type": "CompoundType", + "tags": [], + "label": "internal", + "description": [ + "\nFlag indicating whether users should be able to pick this palette manually." + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteDefinition.toExpression", + "type": "Function", + "tags": [], + "label": "toExpression", + "description": [ + "\nSerialize the internal state of the palette into an expression function.\nThis function should be used to pass the palette to the expression function applying color and other styles" + ], + "signature": [ + "(state?: T | undefined) => ", + { + "pluginId": "@kbn/interpreter", + "scope": "common", + "docId": "kibKbnInterpreterPluginApi", + "section": "def-common.Ast", + "text": "Ast" + } + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteDefinition.toExpression.$1", + "type": "Uncategorized", + "tags": [], + "label": "state", + "description": [ + "The internal state of the palette" + ], + "signature": [ + "T | undefined" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteDefinition.getCategoricalColor", + "type": "Function", + "tags": [], + "label": "getCategoricalColor", + "description": [ + "\nColor a series according to the internal rules of the palette." + ], + "signature": [ + "(series: ", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.SeriesLayer", + "text": "SeriesLayer" + }, + "[], chartConfiguration?: ", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.ChartColorConfiguration", + "text": "ChartColorConfiguration" + }, + " | undefined, state?: T | undefined) => string | null" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteDefinition.getCategoricalColor.$1", + "type": "Array", + "tags": [], + "label": "series", + "description": [ + "The current series along with its ancestors." + ], + "signature": [ + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.SeriesLayer", + "text": "SeriesLayer" + }, + "[]" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteDefinition.getCategoricalColor.$2", + "type": "Object", + "tags": [], + "label": "chartConfiguration", + "description": [], + "signature": [ + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.ChartColorConfiguration", + "text": "ChartColorConfiguration" + }, + " | undefined" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteDefinition.getCategoricalColor.$3", + "type": "Uncategorized", + "tags": [], + "label": "state", + "description": [ + "The internal state of the palette" + ], + "signature": [ + "T | undefined" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteDefinition.getCategoricalColors", + "type": "Function", + "tags": [], + "label": "getCategoricalColors", + "description": [ + "\nGet a spectrum of colors of the current palette.\nThis can be used if the chart wants to control color assignment locally." + ], + "signature": [ + "(size: number, state?: T | undefined) => string[]" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteDefinition.getCategoricalColors.$1", + "type": "number", + "tags": [], + "label": "size", + "description": [], + "signature": [ + "number" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteDefinition.getCategoricalColors.$2", + "type": "Uncategorized", + "tags": [], + "label": "state", + "description": [], + "signature": [ + "T | undefined" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteDefinition.canDynamicColoring", + "type": "CompoundType", + "tags": [], + "label": "canDynamicColoring", + "description": [ + "\nDefine whether a palette supports dynamic coloring (i.e. gradient colors mapped to number values)" + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteDefinition.getColorForValue", + "type": "Function", + "tags": [], + "label": "getColorForValue", + "description": [ + "\nGet the assigned color for the given value based on its data domain and state settings.\nThis can be used for dynamic coloring based on uniform color distribution or custom stops." + ], + "signature": [ + "((value: number | undefined, state: T, { min, max }: { min: number; max: number; }) => string | undefined) | undefined" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteDefinition.getColorForValue.$1", + "type": "number", + "tags": [], + "label": "value", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteDefinition.getColorForValue.$2", + "type": "Uncategorized", + "tags": [], + "label": "state", + "description": [], + "signature": [ + "T" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteDefinition.getColorForValue.$3", + "type": "Object", + "tags": [], + "label": "{ min, max }", + "description": [], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteDefinition.getColorForValue.$3.min", + "type": "number", + "tags": [], + "label": "min", + "description": [], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteDefinition.getColorForValue.$3.max", + "type": "number", + "tags": [], + "label": "max", + "description": [], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteOutput", + "type": "Interface", + "tags": [], + "label": "PaletteOutput", + "description": [], + "signature": [ + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, + "" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteOutput.type", + "type": "CompoundType", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"palette\" | \"system_palette\"" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteOutput.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteOutput.params", + "type": "Uncategorized", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "T | undefined" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteRegistry", + "type": "Interface", + "tags": [], + "label": "PaletteRegistry", + "description": [], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteRegistry.get", + "type": "Function", + "tags": [], + "label": "get", + "description": [], + "signature": [ + "(name: string) => ", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteDefinition", + "text": "PaletteDefinition" + }, + "" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteRegistry.get.$1", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "signature": [ + "string" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteRegistry.getAll", + "type": "Function", + "tags": [], + "label": "getAll", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteDefinition", + "text": "PaletteDefinition" + }, + "[]" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.SeriesLayer", + "type": "Interface", + "tags": [], + "label": "SeriesLayer", + "description": [ + "\nInformation about a series in a chart used to determine its color.\nSeries layers can be nested, this means each series layer can have an ancestor." + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.SeriesLayer.name", + "type": "string", + "tags": [], + "label": "name", + "description": [ + "\nName of the series (can be used for lookup-based coloring)" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.SeriesLayer.rankAtDepth", + "type": "number", + "tags": [], + "label": "rankAtDepth", + "description": [ + "\nRank of the series compared to siblings with the same ancestor" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.SeriesLayer.totalSeriesAtDepth", + "type": "number", + "tags": [], + "label": "totalSeriesAtDepth", + "description": [ "\nTotal number of series with the same ancestor" ], "path": "packages/kbn-coloring/src/palettes/types.ts", @@ -1881,19 +2725,126 @@ } ], "initialIsOpen": false - } - ], - "enums": [], - "misc": [ + } + ], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.ColorMappingInputData", + "type": "Type", + "tags": [], + "label": "ColorMappingInputData", + "description": [ + "\nA configuration object that is required to populate correctly the visible categories\nor the ranges in the CategoricalColorMapping component" + ], + "signature": [ + "{ type: \"categories\"; categories: (string | string[])[]; } | { type: \"ranges\"; min: number; max: number; bins: number; }" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.CUSTOM_PALETTE", + "type": "string", + "tags": [], + "label": "CUSTOM_PALETTE", + "description": [], + "signature": [ + "\"custom\"" + ], + "path": "packages/kbn-coloring/src/palettes/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.DEFAULT_COLOR_STEPS", + "type": "number", + "tags": [], + "label": "DEFAULT_COLOR_STEPS", + "description": [], + "signature": [ + "5" + ], + "path": "packages/kbn-coloring/src/palettes/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.DEFAULT_CONTINUITY", + "type": "string", + "tags": [], + "label": "DEFAULT_CONTINUITY", + "description": [], + "signature": [ + "\"above\"" + ], + "path": "packages/kbn-coloring/src/palettes/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.DEFAULT_MAX_STOP", + "type": "number", + "tags": [], + "label": "DEFAULT_MAX_STOP", + "description": [], + "signature": [ + "100" + ], + "path": "packages/kbn-coloring/src/palettes/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.DEFAULT_MIN_STOP", + "type": "number", + "tags": [], + "label": "DEFAULT_MIN_STOP", + "description": [], + "signature": [ + "0" + ], + "path": "packages/kbn-coloring/src/palettes/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.DEFAULT_PALETTE_NAME", + "type": "string", + "tags": [], + "label": "DEFAULT_PALETTE_NAME", + "description": [], + "signature": [ + "\"positive\"" + ], + "path": "packages/kbn-coloring/src/palettes/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.CUSTOM_PALETTE", + "id": "def-common.DEFAULT_RANGE_TYPE", "type": "string", "tags": [], - "label": "CUSTOM_PALETTE", + "label": "DEFAULT_RANGE_TYPE", "description": [], "signature": [ - "\"custom\"" + "\"percent\"" ], "path": "packages/kbn-coloring/src/palettes/constants.ts", "deprecated": false, @@ -1902,28 +2853,43 @@ }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.DEFAULT_COLOR_STEPS", - "type": "number", + "id": "def-common.ELASTIC_BRAND_PALETTE_COLORS", + "type": "Array", "tags": [], - "label": "DEFAULT_COLOR_STEPS", + "label": "ELASTIC_BRAND_PALETTE_COLORS", "description": [], "signature": [ - "5" + "string[]" ], - "path": "packages/kbn-coloring/src/palettes/constants.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.DEFAULT_CONTINUITY", + "id": "def-common.EUI_AMSTERDAM_PALETTE_COLORS", + "type": "Array", + "tags": [], + "label": "EUI_AMSTERDAM_PALETTE_COLORS", + "description": [], + "signature": [ + "string[]" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.FIXED_PROGRESSION", "type": "string", "tags": [], - "label": "DEFAULT_CONTINUITY", + "label": "FIXED_PROGRESSION", "description": [], "signature": [ - "\"above\"" + "\"fixed\"" ], "path": "packages/kbn-coloring/src/palettes/constants.ts", "deprecated": false, @@ -1932,134 +2898,620 @@ }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.DEFAULT_MAX_STOP", - "type": "number", + "id": "def-common.KIBANA_V7_LEGACY_PALETTE_COLORS", + "type": "Array", "tags": [], - "label": "DEFAULT_MAX_STOP", + "label": "KIBANA_V7_LEGACY_PALETTE_COLORS", "description": [], "signature": [ - "100" + "string[]" ], - "path": "packages/kbn-coloring/src/palettes/constants.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.DEFAULT_MIN_STOP", - "type": "number", + "id": "def-common.NEUTRAL_COLOR_DARK", + "type": "Array", "tags": [], - "label": "DEFAULT_MIN_STOP", + "label": "NEUTRAL_COLOR_DARK", "description": [], "signature": [ - "0" + "string[]" ], - "path": "packages/kbn-coloring/src/palettes/constants.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.DEFAULT_PALETTE_NAME", - "type": "string", + "id": "def-common.NEUTRAL_COLOR_LIGHT", + "type": "Array", "tags": [], - "label": "DEFAULT_PALETTE_NAME", + "label": "NEUTRAL_COLOR_LIGHT", "description": [], "signature": [ - "\"positive\"" + "string[]" ], - "path": "packages/kbn-coloring/src/palettes/constants.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.PaletteContinuity", + "type": "Type", + "tags": [], + "label": "PaletteContinuity", + "description": [], + "signature": [ + "\"none\" | \"all\" | \"above\" | \"below\"" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.RequiredPaletteParamTypes", + "type": "Type", + "tags": [], + "label": "RequiredPaletteParamTypes", + "description": [], + "signature": [ + "{ reverse: boolean; name: string; rangeType: \"number\" | \"percent\"; continuity: ", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteContinuity", + "text": "PaletteContinuity" + }, + "; progression: \"fixed\"; rangeMin: number; rangeMax: number; stops: ", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.ColorStop", + "text": "ColorStop" + }, + "[]; colorStops: ", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.ColorStop", + "text": "ColorStop" + }, + "[]; steps: number; maxSteps?: number | undefined; }" + ], + "path": "packages/kbn-coloring/src/palettes/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.AVAILABLE_PALETTES", + "type": "Object", + "tags": [], + "label": "AVAILABLE_PALETTES", + "description": [], + "signature": [ + "Map" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/index.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.DEFAULT_COLOR_MAPPING_CONFIG", + "type": "Object", + "tags": [], + "label": "DEFAULT_COLOR_MAPPING_CONFIG", + "description": [ + "\nThe default color mapping used in Kibana, starts with the EUI color palette" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.DEFAULT_COLOR_MAPPING_CONFIG.assignmentMode", + "type": "string", + "tags": [], + "label": "assignmentMode", + "description": [], + "signature": [ + "\"auto\"" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.DEFAULT_COLOR_MAPPING_CONFIG.assignments", + "type": "Array", + "tags": [], + "label": "assignments", + "description": [], + "signature": [ + "never[]" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.DEFAULT_COLOR_MAPPING_CONFIG.specialAssignments", + "type": "Array", + "tags": [], + "label": "specialAssignments", + "description": [], + "signature": [ + "{ rule: { type: \"other\"; }; color: { type: \"categorical\"; paletteId: string; colorIndex: number; }; touched: false; }[]" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.DEFAULT_COLOR_MAPPING_CONFIG.paletteId", + "type": "string", + "tags": [], + "label": "paletteId", + "description": [], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.DEFAULT_COLOR_MAPPING_CONFIG.colorMode", + "type": "Object", + "tags": [], + "label": "colorMode", + "description": [], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.DEFAULT_COLOR_MAPPING_CONFIG.colorMode.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"categorical\"" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.ElasticBrandPalette", + "type": "Object", + "tags": [], + "label": "ElasticBrandPalette", + "description": [], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts", "deprecated": false, "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.ElasticBrandPalette.id", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.ElasticBrandPalette.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.ElasticBrandPalette.colorCount", + "type": "number", + "tags": [], + "label": "colorCount", + "description": [], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.ElasticBrandPalette.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"categorical\"" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.ElasticBrandPalette.getColor", + "type": "Function", + "tags": [], + "label": "getColor", + "description": [], + "signature": [ + "(valueInRange: number) => string" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.ElasticBrandPalette.getColor.$1", + "type": "number", + "tags": [], + "label": "valueInRange", + "description": [], + "signature": [ + "number" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], "initialIsOpen": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.DEFAULT_RANGE_TYPE", - "type": "string", + "id": "def-common.EUIAmsterdamColorBlindPalette", + "type": "Object", "tags": [], - "label": "DEFAULT_RANGE_TYPE", + "label": "EUIAmsterdamColorBlindPalette", "description": [], - "signature": [ - "\"percent\"" - ], - "path": "packages/kbn-coloring/src/palettes/constants.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts", "deprecated": false, "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.EUIAmsterdamColorBlindPalette.id", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.EUIAmsterdamColorBlindPalette.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.EUIAmsterdamColorBlindPalette.colorCount", + "type": "number", + "tags": [], + "label": "colorCount", + "description": [], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.EUIAmsterdamColorBlindPalette.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"categorical\"" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.EUIAmsterdamColorBlindPalette.getColor", + "type": "Function", + "tags": [], + "label": "getColor", + "description": [], + "signature": [ + "(valueInRange: number) => string" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.EUIAmsterdamColorBlindPalette.getColor.$1", + "type": "number", + "tags": [], + "label": "valueInRange", + "description": [], + "signature": [ + "number" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], "initialIsOpen": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.FIXED_PROGRESSION", - "type": "string", + "id": "def-common.KibanaV7LegacyPalette", + "type": "Object", "tags": [], - "label": "FIXED_PROGRESSION", + "label": "KibanaV7LegacyPalette", "description": [], - "signature": [ - "\"fixed\"" - ], - "path": "packages/kbn-coloring/src/palettes/constants.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts", "deprecated": false, "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.KibanaV7LegacyPalette.id", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.KibanaV7LegacyPalette.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.KibanaV7LegacyPalette.colorCount", + "type": "number", + "tags": [], + "label": "colorCount", + "description": [], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.KibanaV7LegacyPalette.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"categorical\"" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.KibanaV7LegacyPalette.getColor", + "type": "Function", + "tags": [], + "label": "getColor", + "description": [], + "signature": [ + "(valueInRange: number) => string" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.KibanaV7LegacyPalette.getColor.$1", + "type": "number", + "tags": [], + "label": "valueInRange", + "description": [], + "signature": [ + "number" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], "initialIsOpen": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.PaletteContinuity", - "type": "Type", + "id": "def-common.NeutralPalette", + "type": "Object", "tags": [], - "label": "PaletteContinuity", + "label": "NeutralPalette", "description": [], - "signature": [ - "\"none\" | \"all\" | \"above\" | \"below\"" - ], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts", "deprecated": false, "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.NeutralPalette.id", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.NeutralPalette.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.NeutralPalette.colorCount", + "type": "number", + "tags": [], + "label": "colorCount", + "description": [], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.NeutralPalette.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"categorical\"" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.NeutralPalette.getColor", + "type": "Function", + "tags": [], + "label": "getColor", + "description": [], + "signature": [ + "(valueInRange: number, isDarkMode: boolean) => string" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.NeutralPalette.getColor.$1", + "type": "number", + "tags": [], + "label": "valueInRange", + "description": [], + "signature": [ + "number" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.NeutralPalette.getColor.$2", + "type": "boolean", + "tags": [], + "label": "isDarkMode", + "description": [], + "signature": [ + "boolean" + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], "initialIsOpen": false }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.RequiredPaletteParamTypes", - "type": "Type", + "id": "def-common.SPECIAL_TOKENS_STRING_CONVERTION", + "type": "Object", "tags": [], - "label": "RequiredPaletteParamTypes", + "label": "SPECIAL_TOKENS_STRING_CONVERTION", "description": [], "signature": [ - "{ reverse: boolean; name: string; rangeType: \"number\" | \"percent\"; continuity: ", - { - "pluginId": "@kbn/coloring", - "scope": "common", - "docId": "kibKbnColoringPluginApi", - "section": "def-common.PaletteContinuity", - "text": "PaletteContinuity" - }, - "; progression: \"fixed\"; rangeMin: number; rangeMax: number; stops: ", - { - "pluginId": "@kbn/coloring", - "scope": "common", - "docId": "kibKbnColoringPluginApi", - "section": "def-common.ColorStop", - "text": "ColorStop" - }, - "[]; colorStops: ", - { - "pluginId": "@kbn/coloring", - "scope": "common", - "docId": "kibKbnColoringPluginApi", - "section": "def-common.ColorStop", - "text": "ColorStop" - }, - "[]; steps: number; maxSteps?: number | undefined; }" + "Map" ], - "path": "packages/kbn-coloring/src/palettes/types.ts", + "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/rule_matching.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false } - ], - "objects": [] + ] } } \ No newline at end of file diff --git a/api_docs/kbn_coloring.mdx b/api_docs/kbn_coloring.mdx index bdd3b49c0565b..fa51e1a9f842c 100644 --- a/api_docs/kbn_coloring.mdx +++ b/api_docs/kbn_coloring.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-coloring title: "@kbn/coloring" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/coloring plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/coloring'] --- import kbnColoringObj from './kbn_coloring.devdocs.json'; @@ -21,13 +21,19 @@ Contact [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/k | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 116 | 0 | 90 | 1 | +| 206 | 0 | 169 | 8 | ## Common +### Objects + + ### Functions +### Classes + + ### Interfaces diff --git a/api_docs/kbn_config.mdx b/api_docs/kbn_config.mdx index 922a04674ff80..0973106d52365 100644 --- a/api_docs/kbn_config.mdx +++ b/api_docs/kbn_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config title: "@kbn/config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config'] --- import kbnConfigObj from './kbn_config.devdocs.json'; diff --git a/api_docs/kbn_config_mocks.mdx b/api_docs/kbn_config_mocks.mdx index 592bf9ea4897f..75e397b9fdcd8 100644 --- a/api_docs/kbn_config_mocks.mdx +++ b/api_docs/kbn_config_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config-mocks title: "@kbn/config-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-mocks'] --- import kbnConfigMocksObj from './kbn_config_mocks.devdocs.json'; diff --git a/api_docs/kbn_config_schema.mdx b/api_docs/kbn_config_schema.mdx index 97be862ab5a26..87db3115f8a44 100644 --- a/api_docs/kbn_config_schema.mdx +++ b/api_docs/kbn_config_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config-schema title: "@kbn/config-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config-schema plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-schema'] --- import kbnConfigSchemaObj from './kbn_config_schema.devdocs.json'; diff --git a/api_docs/kbn_content_management_content_editor.mdx b/api_docs/kbn_content_management_content_editor.mdx index 7cb613c139af1..bd2fe72e4e640 100644 --- a/api_docs/kbn_content_management_content_editor.mdx +++ b/api_docs/kbn_content_management_content_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-content-editor title: "@kbn/content-management-content-editor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-content-editor plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-content-editor'] --- import kbnContentManagementContentEditorObj from './kbn_content_management_content_editor.devdocs.json'; diff --git a/api_docs/kbn_content_management_tabbed_table_list_view.mdx b/api_docs/kbn_content_management_tabbed_table_list_view.mdx index 1890f2283fe09..e880fcd1c169e 100644 --- a/api_docs/kbn_content_management_tabbed_table_list_view.mdx +++ b/api_docs/kbn_content_management_tabbed_table_list_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-tabbed-table-list-view title: "@kbn/content-management-tabbed-table-list-view" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-tabbed-table-list-view plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-tabbed-table-list-view'] --- import kbnContentManagementTabbedTableListViewObj from './kbn_content_management_tabbed_table_list_view.devdocs.json'; diff --git a/api_docs/kbn_content_management_table_list_view.mdx b/api_docs/kbn_content_management_table_list_view.mdx index bb796b11a5873..ae4d41e709cc9 100644 --- a/api_docs/kbn_content_management_table_list_view.mdx +++ b/api_docs/kbn_content_management_table_list_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-table-list-view title: "@kbn/content-management-table-list-view" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-table-list-view plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-table-list-view'] --- import kbnContentManagementTableListViewObj from './kbn_content_management_table_list_view.devdocs.json'; diff --git a/api_docs/kbn_content_management_table_list_view_table.mdx b/api_docs/kbn_content_management_table_list_view_table.mdx index 9251b84da18a4..cd53d86e63fba 100644 --- a/api_docs/kbn_content_management_table_list_view_table.mdx +++ b/api_docs/kbn_content_management_table_list_view_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-table-list-view-table title: "@kbn/content-management-table-list-view-table" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-table-list-view-table plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-table-list-view-table'] --- import kbnContentManagementTableListViewTableObj from './kbn_content_management_table_list_view_table.devdocs.json'; diff --git a/api_docs/kbn_content_management_utils.devdocs.json b/api_docs/kbn_content_management_utils.devdocs.json index 966c526f89231..545ea911e0490 100644 --- a/api_docs/kbn_content_management_utils.devdocs.json +++ b/api_docs/kbn_content_management_utils.devdocs.json @@ -74,7 +74,7 @@ "id": "def-common.SOContentStorage.Unnamed.$1", "type": "Object", "tags": [], - "label": "{\n savedObjectType,\n cmServicesDefinition,\n createArgsToSoCreateOptions,\n updateArgsToSoUpdateOptions,\n searchArgsToSOFindOptions,\n enableMSearch,\n allowedSavedObjectAttributes,\n mSearchAdditionalSearchFields,\n }", + "label": "{\n savedObjectType,\n cmServicesDefinition,\n createArgsToSoCreateOptions,\n updateArgsToSoUpdateOptions,\n searchArgsToSOFindOptions,\n enableMSearch,\n allowedSavedObjectAttributes,\n mSearchAdditionalSearchFields,\n logger,\n throwOnResultValidationError,\n }", "description": [], "signature": [ { @@ -2879,6 +2879,37 @@ "path": "packages/kbn-content-management-utils/src/saved_object_content_storage.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/content-management-utils", + "id": "def-common.SOContentStorageConstrutorParams.logger", + "type": "Object", + "tags": [], + "label": "logger", + "description": [], + "signature": [ + { + "pluginId": "@kbn/logging", + "scope": "common", + "docId": "kibKbnLoggingPluginApi", + "section": "def-common.Logger", + "text": "Logger" + } + ], + "path": "packages/kbn-content-management-utils/src/saved_object_content_storage.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/content-management-utils", + "id": "def-common.SOContentStorageConstrutorParams.throwOnResultValidationError", + "type": "boolean", + "tags": [], + "label": "throwOnResultValidationError", + "description": [], + "path": "packages/kbn-content-management-utils/src/saved_object_content_storage.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/kbn_content_management_utils.mdx b/api_docs/kbn_content_management_utils.mdx index d4cebb9c0bf3e..30f5ee8852fa9 100644 --- a/api_docs/kbn_content_management_utils.mdx +++ b/api_docs/kbn_content_management_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-utils title: "@kbn/content-management-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-utils'] --- import kbnContentManagementUtilsObj from './kbn_content_management_utils.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/k | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 189 | 1 | 124 | 0 | +| 191 | 1 | 126 | 0 | ## Common diff --git a/api_docs/kbn_core_analytics_browser.mdx b/api_docs/kbn_core_analytics_browser.mdx index d4533e8a3ca29..80105cee5b984 100644 --- a/api_docs/kbn_core_analytics_browser.mdx +++ b/api_docs/kbn_core_analytics_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser title: "@kbn/core-analytics-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser'] --- import kbnCoreAnalyticsBrowserObj from './kbn_core_analytics_browser.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser_internal.mdx b/api_docs/kbn_core_analytics_browser_internal.mdx index 79d0dacbb6976..2bf8096861e66 100644 --- a/api_docs/kbn_core_analytics_browser_internal.mdx +++ b/api_docs/kbn_core_analytics_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-internal title: "@kbn/core-analytics-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-internal'] --- import kbnCoreAnalyticsBrowserInternalObj from './kbn_core_analytics_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser_mocks.mdx b/api_docs/kbn_core_analytics_browser_mocks.mdx index 36cb7ba1c0d91..c4347ddf1b74a 100644 --- a/api_docs/kbn_core_analytics_browser_mocks.mdx +++ b/api_docs/kbn_core_analytics_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-mocks title: "@kbn/core-analytics-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-mocks'] --- import kbnCoreAnalyticsBrowserMocksObj from './kbn_core_analytics_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server.mdx b/api_docs/kbn_core_analytics_server.mdx index 6309657c04668..4e96886c05842 100644 --- a/api_docs/kbn_core_analytics_server.mdx +++ b/api_docs/kbn_core_analytics_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server title: "@kbn/core-analytics-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server'] --- import kbnCoreAnalyticsServerObj from './kbn_core_analytics_server.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server_internal.mdx b/api_docs/kbn_core_analytics_server_internal.mdx index 0a3412e046074..88a51e0672da8 100644 --- a/api_docs/kbn_core_analytics_server_internal.mdx +++ b/api_docs/kbn_core_analytics_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-internal title: "@kbn/core-analytics-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-internal'] --- import kbnCoreAnalyticsServerInternalObj from './kbn_core_analytics_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server_mocks.mdx b/api_docs/kbn_core_analytics_server_mocks.mdx index 26b1fba642918..4459c1ed06626 100644 --- a/api_docs/kbn_core_analytics_server_mocks.mdx +++ b/api_docs/kbn_core_analytics_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-mocks title: "@kbn/core-analytics-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-mocks'] --- import kbnCoreAnalyticsServerMocksObj from './kbn_core_analytics_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser.devdocs.json b/api_docs/kbn_core_application_browser.devdocs.json index 20496e028aadf..3a19d55a1ffda 100644 --- a/api_docs/kbn_core_application_browser.devdocs.json +++ b/api_docs/kbn_core_application_browser.devdocs.json @@ -1170,14 +1170,14 @@ "plugin": "@kbn/core-application-browser-internal", "path": "packages/core/application/core-application-browser-internal/src/ui/app_container.tsx" }, - { - "plugin": "management", - "path": "src/plugins/management/public/application.tsx" - }, { "plugin": "@kbn/core-application-browser-mocks", "path": "packages/core/application/core-application-browser-mocks/src/application_service.mock.ts" }, + { + "plugin": "management", + "path": "src/plugins/management/public/application.tsx" + }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/public/applications/integrations/index.tsx" diff --git a/api_docs/kbn_core_application_browser.mdx b/api_docs/kbn_core_application_browser.mdx index 8ebb8fb09de65..9c405809354a7 100644 --- a/api_docs/kbn_core_application_browser.mdx +++ b/api_docs/kbn_core_application_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser title: "@kbn/core-application-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser'] --- import kbnCoreApplicationBrowserObj from './kbn_core_application_browser.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser_internal.mdx b/api_docs/kbn_core_application_browser_internal.mdx index 39aebf4ffbb82..e02e3dd8fdd67 100644 --- a/api_docs/kbn_core_application_browser_internal.mdx +++ b/api_docs/kbn_core_application_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser-internal title: "@kbn/core-application-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser-internal'] --- import kbnCoreApplicationBrowserInternalObj from './kbn_core_application_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser_mocks.mdx b/api_docs/kbn_core_application_browser_mocks.mdx index a6aacb26293bb..329b391f9e783 100644 --- a/api_docs/kbn_core_application_browser_mocks.mdx +++ b/api_docs/kbn_core_application_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser-mocks title: "@kbn/core-application-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser-mocks'] --- import kbnCoreApplicationBrowserMocksObj from './kbn_core_application_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_application_common.mdx b/api_docs/kbn_core_application_common.mdx index 3a957dde7e4e9..924bb81945c3b 100644 --- a/api_docs/kbn_core_application_common.mdx +++ b/api_docs/kbn_core_application_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-common title: "@kbn/core-application-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-common plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-common'] --- import kbnCoreApplicationCommonObj from './kbn_core_application_common.devdocs.json'; diff --git a/api_docs/kbn_core_apps_browser_internal.mdx b/api_docs/kbn_core_apps_browser_internal.mdx index 0d8658fe737d0..80a7d30c1486c 100644 --- a/api_docs/kbn_core_apps_browser_internal.mdx +++ b/api_docs/kbn_core_apps_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-apps-browser-internal title: "@kbn/core-apps-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-apps-browser-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-apps-browser-internal'] --- import kbnCoreAppsBrowserInternalObj from './kbn_core_apps_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_apps_browser_mocks.mdx b/api_docs/kbn_core_apps_browser_mocks.mdx index 478e7174601ec..5f1be86cb3fbd 100644 --- a/api_docs/kbn_core_apps_browser_mocks.mdx +++ b/api_docs/kbn_core_apps_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-apps-browser-mocks title: "@kbn/core-apps-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-apps-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-apps-browser-mocks'] --- import kbnCoreAppsBrowserMocksObj from './kbn_core_apps_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_apps_server_internal.mdx b/api_docs/kbn_core_apps_server_internal.mdx index ebc951ec9dd25..811f4dce0cafe 100644 --- a/api_docs/kbn_core_apps_server_internal.mdx +++ b/api_docs/kbn_core_apps_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-apps-server-internal title: "@kbn/core-apps-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-apps-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-apps-server-internal'] --- import kbnCoreAppsServerInternalObj from './kbn_core_apps_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_base_browser_mocks.mdx b/api_docs/kbn_core_base_browser_mocks.mdx index 5180cf1af8416..ec6e595bc7760 100644 --- a/api_docs/kbn_core_base_browser_mocks.mdx +++ b/api_docs/kbn_core_base_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-browser-mocks title: "@kbn/core-base-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-browser-mocks'] --- import kbnCoreBaseBrowserMocksObj from './kbn_core_base_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_base_common.mdx b/api_docs/kbn_core_base_common.mdx index 39f937c122185..312fb39d6ab83 100644 --- a/api_docs/kbn_core_base_common.mdx +++ b/api_docs/kbn_core_base_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-common title: "@kbn/core-base-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-common plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-common'] --- import kbnCoreBaseCommonObj from './kbn_core_base_common.devdocs.json'; diff --git a/api_docs/kbn_core_base_server_internal.mdx b/api_docs/kbn_core_base_server_internal.mdx index 31a1d4182c3c0..fd0cd5bc0561a 100644 --- a/api_docs/kbn_core_base_server_internal.mdx +++ b/api_docs/kbn_core_base_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-internal title: "@kbn/core-base-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-internal'] --- import kbnCoreBaseServerInternalObj from './kbn_core_base_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_base_server_mocks.mdx b/api_docs/kbn_core_base_server_mocks.mdx index 5a19bc8be74a2..0b32d438827ed 100644 --- a/api_docs/kbn_core_base_server_mocks.mdx +++ b/api_docs/kbn_core_base_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-mocks title: "@kbn/core-base-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-mocks'] --- import kbnCoreBaseServerMocksObj from './kbn_core_base_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_browser_mocks.mdx b/api_docs/kbn_core_capabilities_browser_mocks.mdx index b71d5a4556622..4f159e0cdce76 100644 --- a/api_docs/kbn_core_capabilities_browser_mocks.mdx +++ b/api_docs/kbn_core_capabilities_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-browser-mocks title: "@kbn/core-capabilities-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-browser-mocks'] --- import kbnCoreCapabilitiesBrowserMocksObj from './kbn_core_capabilities_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_common.mdx b/api_docs/kbn_core_capabilities_common.mdx index a1ccb5925ab90..71d5a3b84262c 100644 --- a/api_docs/kbn_core_capabilities_common.mdx +++ b/api_docs/kbn_core_capabilities_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-common title: "@kbn/core-capabilities-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-common plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-common'] --- import kbnCoreCapabilitiesCommonObj from './kbn_core_capabilities_common.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_server.mdx b/api_docs/kbn_core_capabilities_server.mdx index c4cf94e48060b..6463c11bfab70 100644 --- a/api_docs/kbn_core_capabilities_server.mdx +++ b/api_docs/kbn_core_capabilities_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-server title: "@kbn/core-capabilities-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-server'] --- import kbnCoreCapabilitiesServerObj from './kbn_core_capabilities_server.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_server_mocks.mdx b/api_docs/kbn_core_capabilities_server_mocks.mdx index b33b1085edc95..e8b02443c4cf1 100644 --- a/api_docs/kbn_core_capabilities_server_mocks.mdx +++ b/api_docs/kbn_core_capabilities_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-server-mocks title: "@kbn/core-capabilities-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-server-mocks'] --- import kbnCoreCapabilitiesServerMocksObj from './kbn_core_capabilities_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_chrome_browser.devdocs.json b/api_docs/kbn_core_chrome_browser.devdocs.json index be4abc8f65299..54ae388a3ef42 100644 --- a/api_docs/kbn_core_chrome_browser.devdocs.json +++ b/api_docs/kbn_core_chrome_browser.devdocs.json @@ -700,6 +700,9 @@ "tags": [], "label": "href", "description": [], + "signature": [ + "string | undefined" + ], "path": "packages/core/chrome/core-chrome-browser/src/nav_controls.ts", "deprecated": false, "trackAdoption": false @@ -717,6 +720,36 @@ "path": "packages/core/chrome/core-chrome-browser/src/nav_controls.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-chrome-browser", + "id": "def-common.ChromeHelpMenuLink.onClick", + "type": "Function", + "tags": [], + "label": "onClick", + "description": [], + "signature": [ + "(() => void) | undefined" + ], + "path": "packages/core/chrome/core-chrome-browser/src/nav_controls.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-chrome-browser", + "id": "def-common.ChromeHelpMenuLink.dataTestSubj", + "type": "string", + "tags": [], + "label": "dataTestSubj", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/core/chrome/core-chrome-browser/src/nav_controls.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/kbn_core_chrome_browser.mdx b/api_docs/kbn_core_chrome_browser.mdx index 1c7562d3c4a28..59a0cda12361b 100644 --- a/api_docs/kbn_core_chrome_browser.mdx +++ b/api_docs/kbn_core_chrome_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-chrome-browser title: "@kbn/core-chrome-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-chrome-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-chrome-browser'] --- import kbnCoreChromeBrowserObj from './kbn_core_chrome_browser.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sh | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 170 | 0 | 68 | 1 | +| 172 | 0 | 70 | 1 | ## Common diff --git a/api_docs/kbn_core_chrome_browser_mocks.mdx b/api_docs/kbn_core_chrome_browser_mocks.mdx index 191515f6604d3..8324a6ebe0dfc 100644 --- a/api_docs/kbn_core_chrome_browser_mocks.mdx +++ b/api_docs/kbn_core_chrome_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-chrome-browser-mocks title: "@kbn/core-chrome-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-chrome-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-chrome-browser-mocks'] --- import kbnCoreChromeBrowserMocksObj from './kbn_core_chrome_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_config_server_internal.mdx b/api_docs/kbn_core_config_server_internal.mdx index 88080e02a8983..5e92d75109f5c 100644 --- a/api_docs/kbn_core_config_server_internal.mdx +++ b/api_docs/kbn_core_config_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-config-server-internal title: "@kbn/core-config-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-config-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-config-server-internal'] --- import kbnCoreConfigServerInternalObj from './kbn_core_config_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_browser.mdx b/api_docs/kbn_core_custom_branding_browser.mdx index e2d167831114d..154d3e7b5e715 100644 --- a/api_docs/kbn_core_custom_branding_browser.mdx +++ b/api_docs/kbn_core_custom_branding_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-browser title: "@kbn/core-custom-branding-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-browser'] --- import kbnCoreCustomBrandingBrowserObj from './kbn_core_custom_branding_browser.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_browser_internal.mdx b/api_docs/kbn_core_custom_branding_browser_internal.mdx index 83e190da1dfe0..2af4673e2efd5 100644 --- a/api_docs/kbn_core_custom_branding_browser_internal.mdx +++ b/api_docs/kbn_core_custom_branding_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-browser-internal title: "@kbn/core-custom-branding-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-browser-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-browser-internal'] --- import kbnCoreCustomBrandingBrowserInternalObj from './kbn_core_custom_branding_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_browser_mocks.mdx b/api_docs/kbn_core_custom_branding_browser_mocks.mdx index 23ff77dd3f0ac..a79ac6f867082 100644 --- a/api_docs/kbn_core_custom_branding_browser_mocks.mdx +++ b/api_docs/kbn_core_custom_branding_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-browser-mocks title: "@kbn/core-custom-branding-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-browser-mocks'] --- import kbnCoreCustomBrandingBrowserMocksObj from './kbn_core_custom_branding_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_common.mdx b/api_docs/kbn_core_custom_branding_common.mdx index b7726c6f59946..d762d332ed18a 100644 --- a/api_docs/kbn_core_custom_branding_common.mdx +++ b/api_docs/kbn_core_custom_branding_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-common title: "@kbn/core-custom-branding-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-common plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-common'] --- import kbnCoreCustomBrandingCommonObj from './kbn_core_custom_branding_common.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_server.mdx b/api_docs/kbn_core_custom_branding_server.mdx index 74ce0af21b331..4ad8ee89830cc 100644 --- a/api_docs/kbn_core_custom_branding_server.mdx +++ b/api_docs/kbn_core_custom_branding_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-server title: "@kbn/core-custom-branding-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-server'] --- import kbnCoreCustomBrandingServerObj from './kbn_core_custom_branding_server.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_server_internal.mdx b/api_docs/kbn_core_custom_branding_server_internal.mdx index 23ce5a0d344bf..0f46fb0c2151b 100644 --- a/api_docs/kbn_core_custom_branding_server_internal.mdx +++ b/api_docs/kbn_core_custom_branding_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-server-internal title: "@kbn/core-custom-branding-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-server-internal'] --- import kbnCoreCustomBrandingServerInternalObj from './kbn_core_custom_branding_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_server_mocks.mdx b/api_docs/kbn_core_custom_branding_server_mocks.mdx index 0df2f3d89c584..b7a0b0feefc78 100644 --- a/api_docs/kbn_core_custom_branding_server_mocks.mdx +++ b/api_docs/kbn_core_custom_branding_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-server-mocks title: "@kbn/core-custom-branding-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-server-mocks'] --- import kbnCoreCustomBrandingServerMocksObj from './kbn_core_custom_branding_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser.mdx b/api_docs/kbn_core_deprecations_browser.mdx index cb3c461f38ee0..a34e4260a873d 100644 --- a/api_docs/kbn_core_deprecations_browser.mdx +++ b/api_docs/kbn_core_deprecations_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser title: "@kbn/core-deprecations-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser'] --- import kbnCoreDeprecationsBrowserObj from './kbn_core_deprecations_browser.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser_internal.mdx b/api_docs/kbn_core_deprecations_browser_internal.mdx index a1298bb3b7bf3..7162643cf2823 100644 --- a/api_docs/kbn_core_deprecations_browser_internal.mdx +++ b/api_docs/kbn_core_deprecations_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser-internal title: "@kbn/core-deprecations-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser-internal'] --- import kbnCoreDeprecationsBrowserInternalObj from './kbn_core_deprecations_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser_mocks.mdx b/api_docs/kbn_core_deprecations_browser_mocks.mdx index fbc7d7c427c44..7557e9e825803 100644 --- a/api_docs/kbn_core_deprecations_browser_mocks.mdx +++ b/api_docs/kbn_core_deprecations_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser-mocks title: "@kbn/core-deprecations-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser-mocks'] --- import kbnCoreDeprecationsBrowserMocksObj from './kbn_core_deprecations_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_common.mdx b/api_docs/kbn_core_deprecations_common.mdx index 4424ce41db670..72e439815136a 100644 --- a/api_docs/kbn_core_deprecations_common.mdx +++ b/api_docs/kbn_core_deprecations_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-common title: "@kbn/core-deprecations-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-common plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-common'] --- import kbnCoreDeprecationsCommonObj from './kbn_core_deprecations_common.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_server.mdx b/api_docs/kbn_core_deprecations_server.mdx index ad60ef30c0fa5..f0b5d3f995c1d 100644 --- a/api_docs/kbn_core_deprecations_server.mdx +++ b/api_docs/kbn_core_deprecations_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server title: "@kbn/core-deprecations-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server'] --- import kbnCoreDeprecationsServerObj from './kbn_core_deprecations_server.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_server_internal.mdx b/api_docs/kbn_core_deprecations_server_internal.mdx index 53b91671f8f47..07f535a1bf647 100644 --- a/api_docs/kbn_core_deprecations_server_internal.mdx +++ b/api_docs/kbn_core_deprecations_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server-internal title: "@kbn/core-deprecations-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server-internal'] --- import kbnCoreDeprecationsServerInternalObj from './kbn_core_deprecations_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_server_mocks.mdx b/api_docs/kbn_core_deprecations_server_mocks.mdx index a56e3b4359ca2..27b0323be7f10 100644 --- a/api_docs/kbn_core_deprecations_server_mocks.mdx +++ b/api_docs/kbn_core_deprecations_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server-mocks title: "@kbn/core-deprecations-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server-mocks'] --- import kbnCoreDeprecationsServerMocksObj from './kbn_core_deprecations_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_browser.mdx b/api_docs/kbn_core_doc_links_browser.mdx index f2c525376d8d4..cdd950ff14033 100644 --- a/api_docs/kbn_core_doc_links_browser.mdx +++ b/api_docs/kbn_core_doc_links_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser title: "@kbn/core-doc-links-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-browser'] --- import kbnCoreDocLinksBrowserObj from './kbn_core_doc_links_browser.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_browser_mocks.mdx b/api_docs/kbn_core_doc_links_browser_mocks.mdx index 7d7c855cd3d13..bd9ea4fb8955f 100644 --- a/api_docs/kbn_core_doc_links_browser_mocks.mdx +++ b/api_docs/kbn_core_doc_links_browser_mocks.mdx @@ -8,7 +8,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 description: API docs for the @kbn/core-doc-links-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-browser-mocks'] --- import kbnCoreDocLinksBrowserMocksObj from './kbn_core_doc_links_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_server.mdx b/api_docs/kbn_core_doc_links_server.mdx index 9efbbdcdfcbef..ea4311aabbeb8 100644 --- a/api_docs/kbn_core_doc_links_server.mdx +++ b/api_docs/kbn_core_doc_links_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server title: "@kbn/core-doc-links-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-server'] --- import kbnCoreDocLinksServerObj from './kbn_core_doc_links_server.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_server_mocks.mdx b/api_docs/kbn_core_doc_links_server_mocks.mdx index cb7d1b750f10d..8bb4e3394f635 100644 --- a/api_docs/kbn_core_doc_links_server_mocks.mdx +++ b/api_docs/kbn_core_doc_links_server_mocks.mdx @@ -8,7 +8,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 description: API docs for the @kbn/core-doc-links-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-server-mocks'] --- import kbnCoreDocLinksServerMocksObj from './kbn_core_doc_links_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_client_server_internal.mdx b/api_docs/kbn_core_elasticsearch_client_server_internal.mdx index d8e3722069bf9..268cb7e7c1857 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_internal.mdx +++ b/api_docs/kbn_core_elasticsearch_client_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-client-server-internal title: "@kbn/core-elasticsearch-client-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-client-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-internal'] --- import kbnCoreElasticsearchClientServerInternalObj from './kbn_core_elasticsearch_client_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx index 0aa926b62157c..a67e62fe3404b 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx +++ b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-client-server-mocks title: "@kbn/core-elasticsearch-client-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-client-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-mocks'] --- import kbnCoreElasticsearchClientServerMocksObj from './kbn_core_elasticsearch_client_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server.mdx b/api_docs/kbn_core_elasticsearch_server.mdx index 7cce4be09ce73..450df17770638 100644 --- a/api_docs/kbn_core_elasticsearch_server.mdx +++ b/api_docs/kbn_core_elasticsearch_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server title: "@kbn/core-elasticsearch-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server'] --- import kbnCoreElasticsearchServerObj from './kbn_core_elasticsearch_server.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server_internal.mdx b/api_docs/kbn_core_elasticsearch_server_internal.mdx index de3db14329cbc..38555d64e55a2 100644 --- a/api_docs/kbn_core_elasticsearch_server_internal.mdx +++ b/api_docs/kbn_core_elasticsearch_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server-internal title: "@kbn/core-elasticsearch-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server-internal'] --- import kbnCoreElasticsearchServerInternalObj from './kbn_core_elasticsearch_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_server_mocks.mdx index b6a1f74cddad6..31fd80c0ff57f 100644 --- a/api_docs/kbn_core_elasticsearch_server_mocks.mdx +++ b/api_docs/kbn_core_elasticsearch_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server-mocks title: "@kbn/core-elasticsearch-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server-mocks'] --- import kbnCoreElasticsearchServerMocksObj from './kbn_core_elasticsearch_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_environment_server_internal.mdx b/api_docs/kbn_core_environment_server_internal.mdx index 691311e977e5d..c75d22cb5537d 100644 --- a/api_docs/kbn_core_environment_server_internal.mdx +++ b/api_docs/kbn_core_environment_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-internal title: "@kbn/core-environment-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-environment-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-internal'] --- import kbnCoreEnvironmentServerInternalObj from './kbn_core_environment_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_environment_server_mocks.mdx b/api_docs/kbn_core_environment_server_mocks.mdx index 80295a3083d69..fbb2baa9d5df4 100644 --- a/api_docs/kbn_core_environment_server_mocks.mdx +++ b/api_docs/kbn_core_environment_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-mocks title: "@kbn/core-environment-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-environment-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-mocks'] --- import kbnCoreEnvironmentServerMocksObj from './kbn_core_environment_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser.mdx b/api_docs/kbn_core_execution_context_browser.mdx index 634cf3dcbd8bb..a15efa64555c9 100644 --- a/api_docs/kbn_core_execution_context_browser.mdx +++ b/api_docs/kbn_core_execution_context_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser title: "@kbn/core-execution-context-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser'] --- import kbnCoreExecutionContextBrowserObj from './kbn_core_execution_context_browser.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser_internal.mdx b/api_docs/kbn_core_execution_context_browser_internal.mdx index c593bbc12074d..3c7721972b81b 100644 --- a/api_docs/kbn_core_execution_context_browser_internal.mdx +++ b/api_docs/kbn_core_execution_context_browser_internal.mdx @@ -8,7 +8,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 description: API docs for the @kbn/core-execution-context-browser-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-internal'] --- import kbnCoreExecutionContextBrowserInternalObj from './kbn_core_execution_context_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser_mocks.mdx b/api_docs/kbn_core_execution_context_browser_mocks.mdx index fd7a220911d48..5a085df5e5e7d 100644 --- a/api_docs/kbn_core_execution_context_browser_mocks.mdx +++ b/api_docs/kbn_core_execution_context_browser_mocks.mdx @@ -8,7 +8,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 description: API docs for the @kbn/core-execution-context-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-mocks'] --- import kbnCoreExecutionContextBrowserMocksObj from './kbn_core_execution_context_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_common.mdx b/api_docs/kbn_core_execution_context_common.mdx index 86c30b168377b..d8b8f9d526ce7 100644 --- a/api_docs/kbn_core_execution_context_common.mdx +++ b/api_docs/kbn_core_execution_context_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-common title: "@kbn/core-execution-context-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-common plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-common'] --- import kbnCoreExecutionContextCommonObj from './kbn_core_execution_context_common.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server.mdx b/api_docs/kbn_core_execution_context_server.mdx index 00cdaa00caea3..d501fa7dcab43 100644 --- a/api_docs/kbn_core_execution_context_server.mdx +++ b/api_docs/kbn_core_execution_context_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server title: "@kbn/core-execution-context-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server'] --- import kbnCoreExecutionContextServerObj from './kbn_core_execution_context_server.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server_internal.mdx b/api_docs/kbn_core_execution_context_server_internal.mdx index 10b8ec36f3db9..719543549d16c 100644 --- a/api_docs/kbn_core_execution_context_server_internal.mdx +++ b/api_docs/kbn_core_execution_context_server_internal.mdx @@ -8,7 +8,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 description: API docs for the @kbn/core-execution-context-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server-internal'] --- import kbnCoreExecutionContextServerInternalObj from './kbn_core_execution_context_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server_mocks.mdx b/api_docs/kbn_core_execution_context_server_mocks.mdx index 749548052ec4b..f6613da48118c 100644 --- a/api_docs/kbn_core_execution_context_server_mocks.mdx +++ b/api_docs/kbn_core_execution_context_server_mocks.mdx @@ -8,7 +8,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 description: API docs for the @kbn/core-execution-context-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server-mocks'] --- import kbnCoreExecutionContextServerMocksObj from './kbn_core_execution_context_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_fatal_errors_browser.mdx b/api_docs/kbn_core_fatal_errors_browser.mdx index db3810525894e..c4360c51fd432 100644 --- a/api_docs/kbn_core_fatal_errors_browser.mdx +++ b/api_docs/kbn_core_fatal_errors_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser title: "@kbn/core-fatal-errors-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-fatal-errors-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser'] --- import kbnCoreFatalErrorsBrowserObj from './kbn_core_fatal_errors_browser.devdocs.json'; diff --git a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx index d23a328991d08..fa5917ff4ee3a 100644 --- a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx +++ b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx @@ -8,7 +8,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 description: API docs for the @kbn/core-fatal-errors-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser-mocks'] --- import kbnCoreFatalErrorsBrowserMocksObj from './kbn_core_fatal_errors_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser.mdx b/api_docs/kbn_core_http_browser.mdx index 4dea726a477fc..93e539b212943 100644 --- a/api_docs/kbn_core_http_browser.mdx +++ b/api_docs/kbn_core_http_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser title: "@kbn/core-http-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser'] --- import kbnCoreHttpBrowserObj from './kbn_core_http_browser.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser_internal.mdx b/api_docs/kbn_core_http_browser_internal.mdx index 6a2de46613a31..386704f1902d6 100644 --- a/api_docs/kbn_core_http_browser_internal.mdx +++ b/api_docs/kbn_core_http_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-internal title: "@kbn/core-http-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-internal'] --- import kbnCoreHttpBrowserInternalObj from './kbn_core_http_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser_mocks.mdx b/api_docs/kbn_core_http_browser_mocks.mdx index a7a286980e44c..5472b00ca926d 100644 --- a/api_docs/kbn_core_http_browser_mocks.mdx +++ b/api_docs/kbn_core_http_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-mocks title: "@kbn/core-http-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-mocks'] --- import kbnCoreHttpBrowserMocksObj from './kbn_core_http_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_common.mdx b/api_docs/kbn_core_http_common.mdx index 12eb176db54fa..5cdf94fe763cf 100644 --- a/api_docs/kbn_core_http_common.mdx +++ b/api_docs/kbn_core_http_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-common title: "@kbn/core-http-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-common plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-common'] --- import kbnCoreHttpCommonObj from './kbn_core_http_common.devdocs.json'; diff --git a/api_docs/kbn_core_http_context_server_mocks.mdx b/api_docs/kbn_core_http_context_server_mocks.mdx index 5e02cb98942e7..d7f9f9c9c8e6d 100644 --- a/api_docs/kbn_core_http_context_server_mocks.mdx +++ b/api_docs/kbn_core_http_context_server_mocks.mdx @@ -8,7 +8,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 description: API docs for the @kbn/core-http-context-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-context-server-mocks'] --- import kbnCoreHttpContextServerMocksObj from './kbn_core_http_context_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_request_handler_context_server.mdx b/api_docs/kbn_core_http_request_handler_context_server.mdx index 2868840a5b79e..4b82248b23ccc 100644 --- a/api_docs/kbn_core_http_request_handler_context_server.mdx +++ b/api_docs/kbn_core_http_request_handler_context_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-request-handler-context-server title: "@kbn/core-http-request-handler-context-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-request-handler-context-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-request-handler-context-server'] --- import kbnCoreHttpRequestHandlerContextServerObj from './kbn_core_http_request_handler_context_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server.mdx b/api_docs/kbn_core_http_resources_server.mdx index 2a8e5aa4f1674..6883961a57846 100644 --- a/api_docs/kbn_core_http_resources_server.mdx +++ b/api_docs/kbn_core_http_resources_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server title: "@kbn/core-http-resources-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server'] --- import kbnCoreHttpResourcesServerObj from './kbn_core_http_resources_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server_internal.mdx b/api_docs/kbn_core_http_resources_server_internal.mdx index 873b5e1bc49c8..c214c339d429b 100644 --- a/api_docs/kbn_core_http_resources_server_internal.mdx +++ b/api_docs/kbn_core_http_resources_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server-internal title: "@kbn/core-http-resources-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server-internal'] --- import kbnCoreHttpResourcesServerInternalObj from './kbn_core_http_resources_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server_mocks.mdx b/api_docs/kbn_core_http_resources_server_mocks.mdx index 3b3ff461777e1..1f6da382e3b85 100644 --- a/api_docs/kbn_core_http_resources_server_mocks.mdx +++ b/api_docs/kbn_core_http_resources_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server-mocks title: "@kbn/core-http-resources-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server-mocks'] --- import kbnCoreHttpResourcesServerMocksObj from './kbn_core_http_resources_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_router_server_internal.mdx b/api_docs/kbn_core_http_router_server_internal.mdx index a075a2a2bd853..e93b17de62c71 100644 --- a/api_docs/kbn_core_http_router_server_internal.mdx +++ b/api_docs/kbn_core_http_router_server_internal.mdx @@ -8,7 +8,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 description: API docs for the @kbn/core-http-router-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-router-server-internal'] --- import kbnCoreHttpRouterServerInternalObj from './kbn_core_http_router_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_router_server_mocks.mdx b/api_docs/kbn_core_http_router_server_mocks.mdx index e57b8659b7643..a2cb206f5fc90 100644 --- a/api_docs/kbn_core_http_router_server_mocks.mdx +++ b/api_docs/kbn_core_http_router_server_mocks.mdx @@ -8,7 +8,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 description: API docs for the @kbn/core-http-router-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-router-server-mocks'] --- import kbnCoreHttpRouterServerMocksObj from './kbn_core_http_router_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_server.devdocs.json b/api_docs/kbn_core_http_server.devdocs.json index 480bb9d8a76a7..b7a7972e5a401 100644 --- a/api_docs/kbn_core_http_server.devdocs.json +++ b/api_docs/kbn_core_http_server.devdocs.json @@ -3619,26 +3619,6 @@ "plugin": "ruleRegistry", "path": "x-pack/plugins/rule_registry/server/routes/get_aad_fields_by_rule_type.ts" }, - { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/server/routes/tags/get_all_tags.ts" - }, - { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/server/routes/tags/get_tag.ts" - }, - { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/server/routes/assignments/find_assignable_objects.ts" - }, - { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/server/routes/assignments/get_assignable_types.ts" - }, - { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/server/routes/internal/find_tags.ts" - }, { "plugin": "guidedOnboarding", "path": "src/plugins/guided_onboarding/server/routes/guide_state_routes.ts" @@ -3652,48 +3632,36 @@ "path": "src/plugins/guided_onboarding/server/routes/config_routes.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/get_timeline/index.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/get_timelines/index.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/resolve_timeline/index.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/draft_timelines/get_draft_timelines/index.ts" + "plugin": "observability", + "path": "x-pack/plugins/observability/server/lib/annotations/register_annotation_apis.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts" + "plugin": "triggersActionsUi", + "path": "x-pack/plugins/triggers_actions_ui/server/routes/health.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/routes/read_prebuilt_dev_tool_content_route.ts" + "plugin": "triggersActionsUi", + "path": "x-pack/plugins/triggers_actions_ui/server/routes/config.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/index_status/index.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/server/routes/tags/get_all_tags.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_status_route.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/server/routes/tags/get_tag.ts" }, { - "plugin": "observability", - "path": "x-pack/plugins/observability/server/lib/annotations/register_annotation_apis.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/server/routes/assignments/find_assignable_objects.ts" }, { - "plugin": "triggersActionsUi", - "path": "x-pack/plugins/triggers_actions_ui/server/routes/health.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/server/routes/assignments/get_assignable_types.ts" }, { - "plugin": "triggersActionsUi", - "path": "x-pack/plugins/triggers_actions_ui/server/routes/config.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/server/routes/internal/find_tags.ts" }, { "plugin": "assetManager", @@ -4323,6 +4291,34 @@ "plugin": "monitoring", "path": "x-pack/plugins/monitoring/server/plugin.ts" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/get_timeline/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/get_timelines/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/resolve_timeline/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/draft_timelines/get_draft_timelines/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/routes/read_prebuilt_dev_tool_content_route.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/risk_score/index_status/index.ts" + }, { "plugin": "profiling", "path": "x-pack/plugins/profiling/server/routes/flamechart.ts" @@ -6130,104 +6126,40 @@ "path": "x-pack/plugins/rule_registry/server/routes/get_alert_summary.ts" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/server/routes/tags/create_tag.ts" - }, - { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/server/routes/tags/update_tag.ts" - }, - { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/server/routes/assignments/update_tags_assignments.ts" - }, - { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/server/routes/internal/bulk_delete.ts" + "plugin": "observability", + "path": "x-pack/plugins/observability/server/lib/annotations/register_annotation_apis.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/index.ts" + "plugin": "triggersActionsUi", + "path": "x-pack/plugins/triggers_actions_ui/server/data/routes/time_series_query.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/index.ts" + "plugin": "triggersActionsUi", + "path": "x-pack/plugins/triggers_actions_ui/server/data/routes/fields.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/index.ts" + "plugin": "triggersActionsUi", + "path": "x-pack/plugins/triggers_actions_ui/server/data/routes/indices.ts" }, { "plugin": "ml", "path": "x-pack/plugins/ml/server/routes/job_service.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/export_timelines/index.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/draft_timelines/clean_draft_timelines/index.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/indices/delete_indices_route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/create_prebuilt_saved_objects.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/delete_prebuilt_saved_objects.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/onboarding/routes/install_risk_scores.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_score_preview_route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_init_route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_enable_route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_disable_route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_score_calculation_route.ts" - }, - { - "plugin": "observability", - "path": "x-pack/plugins/observability/server/lib/annotations/register_annotation_apis.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/server/routes/tags/create_tag.ts" }, { - "plugin": "triggersActionsUi", - "path": "x-pack/plugins/triggers_actions_ui/server/data/routes/time_series_query.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/server/routes/tags/update_tag.ts" }, { - "plugin": "triggersActionsUi", - "path": "x-pack/plugins/triggers_actions_ui/server/data/routes/fields.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/server/routes/assignments/update_tags_assignments.ts" }, { - "plugin": "triggersActionsUi", - "path": "x-pack/plugins/triggers_actions_ui/server/data/routes/indices.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/server/routes/internal/bulk_delete.ts" }, { "plugin": "assetManager", @@ -6761,6 +6693,50 @@ "plugin": "monitoring", "path": "x-pack/plugins/monitoring/server/plugin.ts" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/export_timelines/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/draft_timelines/clean_draft_timelines/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/risk_score/indices/delete_indices_route.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/create_prebuilt_saved_objects.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/delete_prebuilt_saved_objects.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/risk_score/onboarding/routes/install_risk_scores.ts" + }, { "plugin": "painlessLab", "path": "x-pack/plugins/painless_lab/server/routes/api/execute.ts" @@ -7955,14 +7931,6 @@ "plugin": "guidedOnboarding", "path": "src/plugins/guided_onboarding/server/routes/plugin_state_routes.ts" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/indices/create_index_route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/create_script_route.ts" - }, { "plugin": "reporting", "path": "x-pack/plugins/reporting/server/routes/internal/deprecations/deprecations.ts" @@ -8199,6 +8167,14 @@ "plugin": "monitoring", "path": "x-pack/plugins/monitoring/server/plugin.ts" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/risk_score/indices/create_index_route.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/create_script_route.ts" + }, { "plugin": "reporting", "path": "x-pack/plugins/reporting/server/test_helpers/create_mock_reportingplugin.ts" @@ -8618,36 +8594,36 @@ "path": "x-pack/plugins/alerting/server/routes/bulk_disable_rules.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/patch_timelines/index.ts" + "plugin": "enterpriseSearch", + "path": "x-pack/plugins/enterprise_search/server/routes/workplace_search/security.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/persist_favorite/index.ts" + "plugin": "enterpriseSearch", + "path": "x-pack/plugins/enterprise_search/server/routes/workplace_search/sources.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/notes/persist_note.ts" + "plugin": "enterpriseSearch", + "path": "x-pack/plugins/enterprise_search/server/routes/workplace_search/sources.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/pinned_events/persist_pinned_event.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" }, { - "plugin": "enterpriseSearch", - "path": "x-pack/plugins/enterprise_search/server/routes/workplace_search/security.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/patch_timelines/index.ts" }, { - "plugin": "enterpriseSearch", - "path": "x-pack/plugins/enterprise_search/server/routes/workplace_search/sources.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/persist_favorite/index.ts" }, { - "plugin": "enterpriseSearch", - "path": "x-pack/plugins/enterprise_search/server/routes/workplace_search/sources.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/notes/persist_note.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/pinned_events/persist_pinned_event.ts" }, { "plugin": "@kbn/core-http-router-server-internal", @@ -8975,26 +8951,14 @@ "plugin": "alerting", "path": "x-pack/plugins/alerting/server/routes/maintenance_window/apis/delete/delete_maintenance_window_route.ts" }, - { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/server/routes/tags/delete_tag.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/delete_timelines/index.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/notes/delete_note.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/delete_script_route.ts" - }, { "plugin": "observability", "path": "x-pack/plugins/observability/server/lib/annotations/register_annotation_apis.ts" }, + { + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/server/routes/tags/delete_tag.ts" + }, { "plugin": "assetManager", "path": "x-pack/plugins/asset_manager/server/routes/sample_assets.ts" @@ -9167,6 +9131,18 @@ "plugin": "logstash", "path": "x-pack/plugins/logstash/server/routes/pipeline/delete.ts" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/delete_timelines/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/notes/delete_note.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/delete_script_route.ts" + }, { "plugin": "reporting", "path": "x-pack/plugins/reporting/server/test_helpers/create_mock_reportingplugin.ts" @@ -12925,6 +12901,10 @@ "deprecated": false, "trackAdoption": true, "references": [ + { + "plugin": "@kbn/core-http-router-server-mocks", + "path": "packages/core/http/core-http-router-server-mocks/src/versioned_router.mock.ts" + }, { "plugin": "dataViews", "path": "src/plugins/data_views/server/rest_api_routes/public/runtime_fields/get_runtime_field.ts" @@ -12981,78 +12961,6 @@ "plugin": "data", "path": "src/plugins/data/server/scripts/route.ts" }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/find_endpoint_list_item_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/find_exception_list_item_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/find_exception_list_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/list_item/find_list_item_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/list_index/find_list_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/internal/find_lists_by_size_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/read_endpoint_list_item_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/read_exception_list_item_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/read_exception_list_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/list_index/read_list_index_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/list_item/read_list_item_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/list/read_list_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/list_privileges/read_list_privileges_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/summary_exception_list_route.ts" - }, - { - "plugin": "telemetry", - "path": "src/plugins/telemetry/server/routes/telemetry_config.ts" - }, - { - "plugin": "telemetry", - "path": "src/plugins/telemetry/server/routes/telemetry_config.ts" - }, - { - "plugin": "telemetry", - "path": "src/plugins/telemetry/server/routes/telemetry_last_reported.ts" - }, - { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/security/fleet_router.ts" - }, { "plugin": "ml", "path": "x-pack/plugins/ml/server/routes/json_schema.ts" @@ -13278,304 +13186,376 @@ "path": "x-pack/plugins/ml/server/routes/management.ts" }, { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/routes/live_query/get_live_query_details_route.ts" + "plugin": "telemetry", + "path": "src/plugins/telemetry/server/routes/telemetry_config.ts" }, { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/routes/live_query/get_live_query_results_route.ts" + "plugin": "telemetry", + "path": "src/plugins/telemetry/server/routes/telemetry_config.ts" }, { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/routes/live_query/find_live_query_route.ts" + "plugin": "telemetry", + "path": "src/plugins/telemetry/server/routes/telemetry_last_reported.ts" }, { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/routes/saved_query/find_saved_query_route.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/security/fleet_router.ts" }, { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/routes/saved_query/read_saved_query_route.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/custom_elements/find.ts" }, { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/routes/status/create_status_route.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/custom_elements/get.ts" }, { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/routes/fleet_wrapper/get_agent_policies.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/shareables/download.ts" }, { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/routes/fleet_wrapper/get_agent_policy.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/workpad/find.ts" }, { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/routes/fleet_wrapper/get_agent_status_for_agent_policy.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/workpad/get.ts" }, { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/routes/fleet_wrapper/get_package_policies.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/workpad/resolve.ts" }, { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/routes/fleet_wrapper/get_agents.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/templates/list.ts" }, { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/routes/fleet_wrapper/get_agent_details.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/functions/functions.ts" }, { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/routes/pack/find_pack_route.ts" + "plugin": "cloudDefend", + "path": "x-pack/plugins/cloud_defend/server/routes/policies/policies.ts" }, { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/routes/pack/read_pack_route.ts" + "plugin": "cloudDefend", + "path": "x-pack/plugins/cloud_defend/server/routes/status/status.ts" }, { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/routes/privileges_check/privileges_check_route.ts" + "plugin": "cloudSecurityPosture", + "path": "x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.ts" }, { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/routes/asset/get_assets_status_route.ts" + "plugin": "cloudSecurityPosture", + "path": "x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_and_timelines_status/get_prebuilt_rules_and_timelines_status_route.ts" + "plugin": "cloudSecurityPosture", + "path": "x-pack/plugins/cloud_security_posture/server/routes/status/status.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_status/get_prebuilt_rules_status_route.ts" + "plugin": "cloudSecurityPosture", + "path": "x-pack/plugins/cloud_security_posture/server/routes/csp_rule_template/get_csp_rule_template.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_route.ts" + "plugin": "cloudSecurityPosture", + "path": "x-pack/plugins/cloud_security_posture/server/routes/detection_engine/get_detection_engine_alerts_count_by_rule_tags.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_space_health/get_space_health_route.ts" + "plugin": "logsShared", + "path": "x-pack/plugins/logs_shared/server/lib/adapters/framework/kibana_framework_adapter.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.ts" + "plugin": "fileUpload", + "path": "x-pack/plugins/file_upload/server/routes.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/find_rules/route.ts" + "plugin": "kubernetesSecurity", + "path": "x-pack/plugins/kubernetes_security/server/routes/aggregate.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/filters/route.ts" + "plugin": "kubernetesSecurity", + "path": "x-pack/plugins/kubernetes_security/server/routes/count.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/read_rule/route.ts" + "plugin": "kubernetesSecurity", + "path": "x-pack/plugins/kubernetes_security/server/routes/multi_terms_aggregate.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/tags/read_tags/route.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/find_endpoint_list_item_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_installed_integrations/route.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/find_exception_list_item_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/find_exception_references/route.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/find_exception_list_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/read_index_route.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/list_item/find_list_item_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/get_signals_migration_status_route.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/list_index/find_list_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/privileges/read_privileges_route.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/internal/find_lists_by_size_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/telemetry/telemetry_detection_rules_preview_route.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/read_endpoint_list_item_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/read_alerts_index_exists_route.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/read_exception_list_item_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/tags/routes/get_tags_by_name.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/read_exception_list_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/list_index/read_list_index_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/list_item/read_list_item_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/list/read_list_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/policy/index.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/list_privileges/read_list_privileges_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/policy/index.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/summary_exception_list_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/server/mvt/mvt_routes.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/file_download_handler.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/server/mvt/mvt_routes.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/details.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/server/data_indexing/indexing_routes.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/status.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/server/data_indexing/indexing_routes.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/server/routes.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/server/routes.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/routes/live_query/get_live_query_details_route.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/routes/live_query/get_live_query_results_route.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/routes/live_query/find_live_query_route.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/routes/saved_query/find_saved_query_route.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/routes/saved_query/read_saved_query_route.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/routes/status/create_status_route.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/routes/fleet_wrapper/get_agent_policies.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/routes/fleet_wrapper/get_agent_policy.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/routes/fleet_wrapper/get_agent_status_for_agent_policy.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/routes/fleet_wrapper/get_package_policies.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/routes/fleet_wrapper/get_agents.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/routes/fleet_wrapper/get_agent_details.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/routes/pack/find_pack_route.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/routes/pack/read_pack_route.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/routes/privileges_check/privileges_check_route.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/routes/asset/get_assets_status_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/state.ts" + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_and_timelines_status/get_prebuilt_rules_and_timelines_status_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/audit_log.ts" + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_status/get_prebuilt_rules_status_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/list.ts" + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts" + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_space_health/get_space_health_route.ts" }, { - "plugin": "@kbn/core-http-router-server-mocks", - "path": "packages/core/http/core-http-router-server-mocks/src/versioned_router.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/server/routes/custom_elements/find.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/server/routes/custom_elements/get.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/find_rules/route.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/server/routes/shareables/download.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/filters/route.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/server/routes/workpad/find.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/read_rule/route.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/server/routes/workpad/get.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/tags/read_tags/route.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/server/routes/workpad/resolve.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_installed_integrations/route.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/server/routes/templates/list.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/find_exception_references/route.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/server/routes/functions/functions.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/read_index_route.ts" }, { - "plugin": "cloudDefend", - "path": "x-pack/plugins/cloud_defend/server/routes/policies/policies.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/get_signals_migration_status_route.ts" }, { - "plugin": "cloudDefend", - "path": "x-pack/plugins/cloud_defend/server/routes/status/status.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/privileges/read_privileges_route.ts" }, { - "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/telemetry/telemetry_detection_rules_preview_route.ts" }, { - "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/read_alerts_index_exists_route.ts" }, { - "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/server/routes/status/status.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/tags/routes/get_tags_by_name.ts" }, { - "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/server/routes/csp_rule_template/get_csp_rule_template.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_status_route.ts" }, { - "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/server/routes/detection_engine/get_detection_engine_alerts_count_by_rule_tags.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts" }, { - "plugin": "logsShared", - "path": "x-pack/plugins/logs_shared/server/lib/adapters/framework/kibana_framework_adapter.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts" }, { - "plugin": "fileUpload", - "path": "x-pack/plugins/file_upload/server/routes.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/policy/index.ts" }, { - "plugin": "kubernetesSecurity", - "path": "x-pack/plugins/kubernetes_security/server/routes/aggregate.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/policy/index.ts" }, { - "plugin": "kubernetesSecurity", - "path": "x-pack/plugins/kubernetes_security/server/routes/count.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.ts" }, { - "plugin": "kubernetesSecurity", - "path": "x-pack/plugins/kubernetes_security/server/routes/multi_terms_aggregate.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/file_download_handler.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/server/mvt/mvt_routes.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/details.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/server/mvt/mvt_routes.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/status.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/server/data_indexing/indexing_routes.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/state.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/server/data_indexing/indexing_routes.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/audit_log.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/server/routes.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/list.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/server/routes.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts" }, { "plugin": "sessionView", @@ -13821,6 +13801,10 @@ "plugin": "@kbn/core-apps-server-internal", "path": "packages/core/apps/core-apps-server-internal/src/core_app.ts" }, + { + "plugin": "@kbn/core-http-router-server-mocks", + "path": "packages/core/http/core-http-router-server-mocks/src/versioned_router.mock.ts" + }, { "plugin": "dataViews", "path": "src/plugins/data_views/server/rest_api_routes/public/runtime_fields/put_runtime_field.ts" @@ -13846,24 +13830,44 @@ "path": "src/plugins/data/server/query/routes.ts" }, { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/update_endpoint_list_item_route.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/annotations.ts" }, { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/update_exception_list_item_route.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/calendars.ts" }, { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/update_exception_list_route.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/calendars.ts" }, { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/list_item/update_list_item_route.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/datafeeds.ts" }, { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/list/update_list_route.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/trained_models.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/data_frame_analytics.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/filters.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/filters.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/job_audit_messages.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/anomaly_detectors.ts" }, { "plugin": "telemetry", @@ -13878,48 +13882,52 @@ "path": "x-pack/plugins/fleet/server/services/security/fleet_router.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/custom_elements/update.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/annotations.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/workpad/update.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/calendars.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/workpad/update.ts" + }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/workpad/update.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/calendars.ts" + "plugin": "logsShared", + "path": "x-pack/plugins/logs_shared/server/lib/adapters/framework/kibana_framework_adapter.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/datafeeds.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/trained_models.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/update_endpoint_list_item_route.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/data_frame_analytics.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/update_exception_list_item_route.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/filters.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/update_exception_list_route.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/filters.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/list_item/update_list_item_route.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/job_audit_messages.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/list/update_list_route.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/anomaly_detectors.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.ts" }, { "plugin": "osquery", @@ -13941,34 +13949,6 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/tags/routes/create_tag.ts" }, - { - "plugin": "@kbn/core-http-router-server-mocks", - "path": "packages/core/http/core-http-router-server-mocks/src/versioned_router.mock.ts" - }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/server/routes/custom_elements/update.ts" - }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/server/routes/workpad/update.ts" - }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/server/routes/workpad/update.ts" - }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/server/routes/workpad/update.ts" - }, - { - "plugin": "logsShared", - "path": "x-pack/plugins/logs_shared/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, { "plugin": "transform", "path": "x-pack/plugins/transform/server/routes/api/transforms.ts" @@ -14065,6 +14045,10 @@ "deprecated": false, "trackAdoption": true, "references": [ + { + "plugin": "@kbn/core-http-router-server-mocks", + "path": "packages/core/http/core-http-router-server-mocks/src/versioned_router.mock.ts" + }, { "plugin": "dataViews", "path": "src/plugins/data_views/server/rest_api_routes/public/fields/update_fields.ts" @@ -14150,76 +14134,12 @@ "path": "src/plugins/unified_search/server/autocomplete/value_suggestions_route.ts" }, { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/create_endpoint_list_item_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/create_endpoint_list_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/create_exception_list_item_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/create_exception_list_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/list_index/create_list_index_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/list_item/create_list_item_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/list/create_list_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/duplicate_exception_list_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/export_exception_list_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/list_index/export_list_item_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/internal/create_exception_filter_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/import_exceptions_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/list/import_list_item_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/internal/create_exceptions_list_route.ts" - }, - { - "plugin": "telemetry", - "path": "src/plugins/telemetry/server/routes/telemetry_opt_in_stats.ts" - }, - { - "plugin": "telemetry", - "path": "src/plugins/telemetry/server/routes/telemetry_opt_in.ts" - }, - { - "plugin": "telemetry", - "path": "src/plugins/telemetry/server/routes/telemetry_usage_stats.ts" + "plugin": "aiops", + "path": "x-pack/plugins/aiops/server/routes/log_rate_analysis.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/security/fleet_router.ts" + "plugin": "aiops", + "path": "x-pack/plugins/aiops/server/routes/log_categorization.ts" }, { "plugin": "ml", @@ -14470,52 +14390,172 @@ "path": "x-pack/plugins/ml/server/routes/results_service.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/results_service.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/results_service.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/results_service.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/results_service.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/results_service.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/results_service.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/results_service.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/results_service.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/system.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/system.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/system.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/system.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/routes/alerting.ts" + }, + { + "plugin": "telemetry", + "path": "src/plugins/telemetry/server/routes/telemetry_opt_in_stats.ts" + }, + { + "plugin": "telemetry", + "path": "src/plugins/telemetry/server/routes/telemetry_opt_in.ts" + }, + { + "plugin": "telemetry", + "path": "src/plugins/telemetry/server/routes/telemetry_usage_stats.ts" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/security/fleet_router.ts" + }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/custom_elements/create.ts" + }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/shareables/zip.ts" + }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/workpad/create.ts" + }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/workpad/import.ts" + }, + { + "plugin": "logsShared", + "path": "x-pack/plugins/logs_shared/server/lib/adapters/framework/kibana_framework_adapter.ts" + }, + { + "plugin": "fileUpload", + "path": "x-pack/plugins/file_upload/server/routes.ts" + }, + { + "plugin": "fileUpload", + "path": "x-pack/plugins/file_upload/server/routes.ts" + }, + { + "plugin": "fileUpload", + "path": "x-pack/plugins/file_upload/server/routes.ts" + }, + { + "plugin": "fileUpload", + "path": "x-pack/plugins/file_upload/server/routes.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/create_endpoint_list_item_route.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/create_endpoint_list_route.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/create_exception_list_item_route.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/create_exception_list_route.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/list_index/create_list_index_route.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/results_service.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/list_item/create_list_item_route.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/results_service.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/list/create_list_route.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/results_service.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/duplicate_exception_list_route.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/results_service.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/export_exception_list_route.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/results_service.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/list_index/export_list_item_route.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/results_service.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/internal/create_exception_filter_route.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/system.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/import_exceptions_route.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/system.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/list/import_list_item_route.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/system.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/internal/create_exceptions_list_route.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/system.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/server/data_indexing/indexing_routes.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/server/routes/alerting.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/server/data_indexing/indexing_routes.ts" }, { "plugin": "osquery", @@ -14639,27 +14679,27 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/file_upload_handler.ts" + "path": "x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_score_preview_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_init_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_enable_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_engine_disable_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/plugins/security_solution/server/lib/risk_engine/routes/risk_score_calculation_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/file_upload_handler.ts" }, { "plugin": "securitySolution", @@ -14679,71 +14719,31 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/suggestions/index.ts" + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts" - }, - { - "plugin": "@kbn/core-http-router-server-mocks", - "path": "packages/core/http/core-http-router-server-mocks/src/versioned_router.mock.ts" - }, - { - "plugin": "aiops", - "path": "x-pack/plugins/aiops/server/routes/log_rate_analysis.ts" - }, - { - "plugin": "aiops", - "path": "x-pack/plugins/aiops/server/routes/log_categorization.ts" - }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/server/routes/custom_elements/create.ts" - }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/server/routes/shareables/zip.ts" - }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/server/routes/workpad/create.ts" - }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/server/routes/workpad/import.ts" - }, - { - "plugin": "logsShared", - "path": "x-pack/plugins/logs_shared/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, - { - "plugin": "fileUpload", - "path": "x-pack/plugins/file_upload/server/routes.ts" - }, - { - "plugin": "fileUpload", - "path": "x-pack/plugins/file_upload/server/routes.ts" + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { - "plugin": "fileUpload", - "path": "x-pack/plugins/file_upload/server/routes.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { - "plugin": "fileUpload", - "path": "x-pack/plugins/file_upload/server/routes.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/server/data_indexing/indexing_routes.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/suggestions/index.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/server/data_indexing/indexing_routes.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts" }, { "plugin": "transform", @@ -14906,36 +14906,36 @@ "trackAdoption": true, "references": [ { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/list_item/patch_list_item_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/list/patch_list_route.ts" + "plugin": "@kbn/core-http-router-server-mocks", + "path": "packages/core/http/core-http-router-server-mocks/src/versioned_router.mock.ts" }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/security/fleet_router.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_patch_rules/route.ts" + "plugin": "logsShared", + "path": "x-pack/plugins/logs_shared/server/lib/adapters/framework/kibana_framework_adapter.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/patch_rule/route.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" }, { - "plugin": "@kbn/core-http-router-server-mocks", - "path": "packages/core/http/core-http-router-server-mocks/src/versioned_router.mock.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/list_item/patch_list_item_route.ts" }, { - "plugin": "logsShared", - "path": "x-pack/plugins/logs_shared/server/lib/adapters/framework/kibana_framework_adapter.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/list/patch_list_route.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_patch_rules/route.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/patch_rule/route.ts" }, { "plugin": "@kbn/core-http-router-server-internal", @@ -15009,6 +15009,10 @@ "deprecated": false, "trackAdoption": true, "references": [ + { + "plugin": "@kbn/core-http-router-server-mocks", + "path": "packages/core/http/core-http-router-server-mocks/src/versioned_router.mock.ts" + }, { "plugin": "dataViews", "path": "src/plugins/data_views/server/rest_api_routes/public/runtime_fields/delete_runtime_field.ts" @@ -15037,34 +15041,6 @@ "plugin": "data", "path": "src/plugins/data/server/query/routes.ts" }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/delete_endpoint_list_item_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/delete_exception_list_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/delete_exception_list_item_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/list_index/delete_list_index_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/list_item/delete_list_item_route.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/routes/list/delete_list_route.ts" - }, - { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/security/fleet_router.ts" - }, { "plugin": "ml", "path": "x-pack/plugins/ml/server/routes/annotations.ts" @@ -15098,53 +15074,77 @@ "path": "x-pack/plugins/ml/server/routes/anomaly_detectors.ts" }, { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/routes/saved_query/delete_saved_query_route.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/security/fleet_router.ts" }, { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/routes/pack/delete_pack_route.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/custom_elements/delete.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_delete_rules/route.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/workpad/delete.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/delete_rule/route.ts" + "plugin": "logsShared", + "path": "x-pack/plugins/logs_shared/server/lib/adapters/framework/kibana_framework_adapter.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/delete_signals_migration_route.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/delete_index_route.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/delete_endpoint_list_item_route.ts" }, { - "plugin": "@kbn/core-http-router-server-mocks", - "path": "packages/core/http/core-http-router-server-mocks/src/versioned_router.mock.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/delete_exception_list_route.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/server/routes/custom_elements/delete.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/delete_exception_list_item_route.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/server/routes/workpad/delete.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/list_index/delete_list_index_route.ts" }, { - "plugin": "logsShared", - "path": "x-pack/plugins/logs_shared/server/lib/adapters/framework/kibana_framework_adapter.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/list_item/delete_list_item_route.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/routes/list/delete_list_route.ts" }, { "plugin": "maps", "path": "x-pack/plugins/maps/server/data_indexing/indexing_routes.ts" }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/routes/saved_query/delete_saved_query_route.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/routes/pack/delete_pack_route.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_delete_rules/route.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/delete_rule/route.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/delete_signals_migration_route.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/delete_index_route.ts" + }, { "plugin": "@kbn/core-http-router-server-internal", "path": "packages/core/http/core-http-router-server-internal/src/versioned_router/core_versioned_router.ts" diff --git a/api_docs/kbn_core_http_server.mdx b/api_docs/kbn_core_http_server.mdx index e0eaf478c499a..2971749df7f57 100644 --- a/api_docs/kbn_core_http_server.mdx +++ b/api_docs/kbn_core_http_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server title: "@kbn/core-http-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server'] --- import kbnCoreHttpServerObj from './kbn_core_http_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_internal.mdx b/api_docs/kbn_core_http_server_internal.mdx index d9f7d3ef1fae1..4b0d36968860e 100644 --- a/api_docs/kbn_core_http_server_internal.mdx +++ b/api_docs/kbn_core_http_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-internal title: "@kbn/core-http-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-internal'] --- import kbnCoreHttpServerInternalObj from './kbn_core_http_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_mocks.mdx b/api_docs/kbn_core_http_server_mocks.mdx index d925d4100f069..bd95d0b895f3c 100644 --- a/api_docs/kbn_core_http_server_mocks.mdx +++ b/api_docs/kbn_core_http_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-mocks title: "@kbn/core-http-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-mocks'] --- import kbnCoreHttpServerMocksObj from './kbn_core_http_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_browser.mdx b/api_docs/kbn_core_i18n_browser.mdx index b5a81b286b2b6..97fa7c6ced711 100644 --- a/api_docs/kbn_core_i18n_browser.mdx +++ b/api_docs/kbn_core_i18n_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser title: "@kbn/core-i18n-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser'] --- import kbnCoreI18nBrowserObj from './kbn_core_i18n_browser.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_browser_mocks.mdx b/api_docs/kbn_core_i18n_browser_mocks.mdx index 53f70c4a7067b..45d387b5c7a78 100644 --- a/api_docs/kbn_core_i18n_browser_mocks.mdx +++ b/api_docs/kbn_core_i18n_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser-mocks title: "@kbn/core-i18n-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser-mocks'] --- import kbnCoreI18nBrowserMocksObj from './kbn_core_i18n_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server.mdx b/api_docs/kbn_core_i18n_server.mdx index 2e1acd5b5c686..40d9ff86ef5ea 100644 --- a/api_docs/kbn_core_i18n_server.mdx +++ b/api_docs/kbn_core_i18n_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server title: "@kbn/core-i18n-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server'] --- import kbnCoreI18nServerObj from './kbn_core_i18n_server.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server_internal.mdx b/api_docs/kbn_core_i18n_server_internal.mdx index d4ef78d2e4bb2..24bf8c52ec0c3 100644 --- a/api_docs/kbn_core_i18n_server_internal.mdx +++ b/api_docs/kbn_core_i18n_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server-internal title: "@kbn/core-i18n-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server-internal'] --- import kbnCoreI18nServerInternalObj from './kbn_core_i18n_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server_mocks.mdx b/api_docs/kbn_core_i18n_server_mocks.mdx index d5bc893b541ef..dbcb7ca4fd050 100644 --- a/api_docs/kbn_core_i18n_server_mocks.mdx +++ b/api_docs/kbn_core_i18n_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server-mocks title: "@kbn/core-i18n-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server-mocks'] --- import kbnCoreI18nServerMocksObj from './kbn_core_i18n_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx index 7e8c40e7227b6..dd8968a086e2b 100644 --- a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx +++ b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx @@ -8,7 +8,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 description: API docs for the @kbn/core-injected-metadata-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-injected-metadata-browser-mocks'] --- import kbnCoreInjectedMetadataBrowserMocksObj from './kbn_core_injected_metadata_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_integrations_browser_internal.mdx b/api_docs/kbn_core_integrations_browser_internal.mdx index b4981db68a843..78f7410cfd3a4 100644 --- a/api_docs/kbn_core_integrations_browser_internal.mdx +++ b/api_docs/kbn_core_integrations_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-integrations-browser-internal title: "@kbn/core-integrations-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-integrations-browser-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-integrations-browser-internal'] --- import kbnCoreIntegrationsBrowserInternalObj from './kbn_core_integrations_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_integrations_browser_mocks.mdx b/api_docs/kbn_core_integrations_browser_mocks.mdx index 8085232ced3d1..ec6b9feb1e2d0 100644 --- a/api_docs/kbn_core_integrations_browser_mocks.mdx +++ b/api_docs/kbn_core_integrations_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-integrations-browser-mocks title: "@kbn/core-integrations-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-integrations-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-integrations-browser-mocks'] --- import kbnCoreIntegrationsBrowserMocksObj from './kbn_core_integrations_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_browser.mdx b/api_docs/kbn_core_lifecycle_browser.mdx index 51e705652da35..a493c0e5334a3 100644 --- a/api_docs/kbn_core_lifecycle_browser.mdx +++ b/api_docs/kbn_core_lifecycle_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-browser title: "@kbn/core-lifecycle-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-browser'] --- import kbnCoreLifecycleBrowserObj from './kbn_core_lifecycle_browser.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_browser_mocks.mdx b/api_docs/kbn_core_lifecycle_browser_mocks.mdx index fade0b9f8fb83..1f4696ed11f62 100644 --- a/api_docs/kbn_core_lifecycle_browser_mocks.mdx +++ b/api_docs/kbn_core_lifecycle_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-browser-mocks title: "@kbn/core-lifecycle-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-browser-mocks'] --- import kbnCoreLifecycleBrowserMocksObj from './kbn_core_lifecycle_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_server.mdx b/api_docs/kbn_core_lifecycle_server.mdx index 75da07f2d130f..3ef0f38596b4f 100644 --- a/api_docs/kbn_core_lifecycle_server.mdx +++ b/api_docs/kbn_core_lifecycle_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-server title: "@kbn/core-lifecycle-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-server'] --- import kbnCoreLifecycleServerObj from './kbn_core_lifecycle_server.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_server_mocks.mdx b/api_docs/kbn_core_lifecycle_server_mocks.mdx index 4145c5fa61f34..87cc81d0b8bba 100644 --- a/api_docs/kbn_core_lifecycle_server_mocks.mdx +++ b/api_docs/kbn_core_lifecycle_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-server-mocks title: "@kbn/core-lifecycle-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-server-mocks'] --- import kbnCoreLifecycleServerMocksObj from './kbn_core_lifecycle_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_logging_browser_mocks.mdx b/api_docs/kbn_core_logging_browser_mocks.mdx index 4a5ec19f755ed..d08a60b489db4 100644 --- a/api_docs/kbn_core_logging_browser_mocks.mdx +++ b/api_docs/kbn_core_logging_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-browser-mocks title: "@kbn/core-logging-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-browser-mocks'] --- import kbnCoreLoggingBrowserMocksObj from './kbn_core_logging_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_logging_common_internal.mdx b/api_docs/kbn_core_logging_common_internal.mdx index 37676b8b0969b..bc6d9ecb3e153 100644 --- a/api_docs/kbn_core_logging_common_internal.mdx +++ b/api_docs/kbn_core_logging_common_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-common-internal title: "@kbn/core-logging-common-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-common-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-common-internal'] --- import kbnCoreLoggingCommonInternalObj from './kbn_core_logging_common_internal.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server.mdx b/api_docs/kbn_core_logging_server.mdx index 70460cdc478df..f477ef76c4243 100644 --- a/api_docs/kbn_core_logging_server.mdx +++ b/api_docs/kbn_core_logging_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server title: "@kbn/core-logging-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server'] --- import kbnCoreLoggingServerObj from './kbn_core_logging_server.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server_internal.mdx b/api_docs/kbn_core_logging_server_internal.mdx index 69c8469cd0eea..b487cca153c23 100644 --- a/api_docs/kbn_core_logging_server_internal.mdx +++ b/api_docs/kbn_core_logging_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-internal title: "@kbn/core-logging-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-internal'] --- import kbnCoreLoggingServerInternalObj from './kbn_core_logging_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server_mocks.mdx b/api_docs/kbn_core_logging_server_mocks.mdx index 69c71f0185656..9ea86eb5df8e1 100644 --- a/api_docs/kbn_core_logging_server_mocks.mdx +++ b/api_docs/kbn_core_logging_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-mocks title: "@kbn/core-logging-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-mocks'] --- import kbnCoreLoggingServerMocksObj from './kbn_core_logging_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_collectors_server_internal.mdx b/api_docs/kbn_core_metrics_collectors_server_internal.mdx index 554df492d406c..23ca9727a73e0 100644 --- a/api_docs/kbn_core_metrics_collectors_server_internal.mdx +++ b/api_docs/kbn_core_metrics_collectors_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-collectors-server-internal title: "@kbn/core-metrics-collectors-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-collectors-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-collectors-server-internal'] --- import kbnCoreMetricsCollectorsServerInternalObj from './kbn_core_metrics_collectors_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_collectors_server_mocks.mdx b/api_docs/kbn_core_metrics_collectors_server_mocks.mdx index 6bff36848c721..4f33cc6e9ec6f 100644 --- a/api_docs/kbn_core_metrics_collectors_server_mocks.mdx +++ b/api_docs/kbn_core_metrics_collectors_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-collectors-server-mocks title: "@kbn/core-metrics-collectors-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-collectors-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-collectors-server-mocks'] --- import kbnCoreMetricsCollectorsServerMocksObj from './kbn_core_metrics_collectors_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server.mdx b/api_docs/kbn_core_metrics_server.mdx index 5cc136ae0749e..906fa991b32cf 100644 --- a/api_docs/kbn_core_metrics_server.mdx +++ b/api_docs/kbn_core_metrics_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server title: "@kbn/core-metrics-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server'] --- import kbnCoreMetricsServerObj from './kbn_core_metrics_server.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server_internal.mdx b/api_docs/kbn_core_metrics_server_internal.mdx index e13dcfdb9f38e..0c97643526f22 100644 --- a/api_docs/kbn_core_metrics_server_internal.mdx +++ b/api_docs/kbn_core_metrics_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server-internal title: "@kbn/core-metrics-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server-internal'] --- import kbnCoreMetricsServerInternalObj from './kbn_core_metrics_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server_mocks.mdx b/api_docs/kbn_core_metrics_server_mocks.mdx index 683c297324edb..a09397f446b14 100644 --- a/api_docs/kbn_core_metrics_server_mocks.mdx +++ b/api_docs/kbn_core_metrics_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server-mocks title: "@kbn/core-metrics-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server-mocks'] --- import kbnCoreMetricsServerMocksObj from './kbn_core_metrics_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_mount_utils_browser.mdx b/api_docs/kbn_core_mount_utils_browser.mdx index aa8f917ab4d34..0303dac409020 100644 --- a/api_docs/kbn_core_mount_utils_browser.mdx +++ b/api_docs/kbn_core_mount_utils_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-mount-utils-browser title: "@kbn/core-mount-utils-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-mount-utils-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-mount-utils-browser'] --- import kbnCoreMountUtilsBrowserObj from './kbn_core_mount_utils_browser.devdocs.json'; diff --git a/api_docs/kbn_core_node_server.mdx b/api_docs/kbn_core_node_server.mdx index 2c8699f1e02dd..15144d2551835 100644 --- a/api_docs/kbn_core_node_server.mdx +++ b/api_docs/kbn_core_node_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server title: "@kbn/core-node-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server'] --- import kbnCoreNodeServerObj from './kbn_core_node_server.devdocs.json'; diff --git a/api_docs/kbn_core_node_server_internal.mdx b/api_docs/kbn_core_node_server_internal.mdx index 8fdb9d50e0ba9..296549f5f1596 100644 --- a/api_docs/kbn_core_node_server_internal.mdx +++ b/api_docs/kbn_core_node_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-internal title: "@kbn/core-node-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-internal'] --- import kbnCoreNodeServerInternalObj from './kbn_core_node_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_node_server_mocks.mdx b/api_docs/kbn_core_node_server_mocks.mdx index fb873a0f272db..48726f958a835 100644 --- a/api_docs/kbn_core_node_server_mocks.mdx +++ b/api_docs/kbn_core_node_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-mocks title: "@kbn/core-node-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-mocks'] --- import kbnCoreNodeServerMocksObj from './kbn_core_node_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser.mdx b/api_docs/kbn_core_notifications_browser.mdx index a1fcea7abe8ea..92b552846f846 100644 --- a/api_docs/kbn_core_notifications_browser.mdx +++ b/api_docs/kbn_core_notifications_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser title: "@kbn/core-notifications-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser'] --- import kbnCoreNotificationsBrowserObj from './kbn_core_notifications_browser.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser_internal.mdx b/api_docs/kbn_core_notifications_browser_internal.mdx index cc6a60953615c..42e1e5f3eb01b 100644 --- a/api_docs/kbn_core_notifications_browser_internal.mdx +++ b/api_docs/kbn_core_notifications_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser-internal title: "@kbn/core-notifications-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser-internal'] --- import kbnCoreNotificationsBrowserInternalObj from './kbn_core_notifications_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser_mocks.mdx b/api_docs/kbn_core_notifications_browser_mocks.mdx index 0438a2af691aa..c0f7ab2382d9c 100644 --- a/api_docs/kbn_core_notifications_browser_mocks.mdx +++ b/api_docs/kbn_core_notifications_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser-mocks title: "@kbn/core-notifications-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser-mocks'] --- import kbnCoreNotificationsBrowserMocksObj from './kbn_core_notifications_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser.mdx b/api_docs/kbn_core_overlays_browser.mdx index a26e2e5ffac28..289bac4cf07e9 100644 --- a/api_docs/kbn_core_overlays_browser.mdx +++ b/api_docs/kbn_core_overlays_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser title: "@kbn/core-overlays-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser'] --- import kbnCoreOverlaysBrowserObj from './kbn_core_overlays_browser.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser_internal.mdx b/api_docs/kbn_core_overlays_browser_internal.mdx index fa66fe5c3dbc4..fa9fffd5503b6 100644 --- a/api_docs/kbn_core_overlays_browser_internal.mdx +++ b/api_docs/kbn_core_overlays_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser-internal title: "@kbn/core-overlays-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser-internal'] --- import kbnCoreOverlaysBrowserInternalObj from './kbn_core_overlays_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser_mocks.mdx b/api_docs/kbn_core_overlays_browser_mocks.mdx index 078908ff2deb9..f76a699e6eb21 100644 --- a/api_docs/kbn_core_overlays_browser_mocks.mdx +++ b/api_docs/kbn_core_overlays_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser-mocks title: "@kbn/core-overlays-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser-mocks'] --- import kbnCoreOverlaysBrowserMocksObj from './kbn_core_overlays_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_browser.mdx b/api_docs/kbn_core_plugins_browser.mdx index 4e77f9399ccab..5e24dbc5d3da3 100644 --- a/api_docs/kbn_core_plugins_browser.mdx +++ b/api_docs/kbn_core_plugins_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-browser title: "@kbn/core-plugins-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-browser'] --- import kbnCorePluginsBrowserObj from './kbn_core_plugins_browser.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_browser_mocks.mdx b/api_docs/kbn_core_plugins_browser_mocks.mdx index c69637f7b4ddf..4fca5e182ad3b 100644 --- a/api_docs/kbn_core_plugins_browser_mocks.mdx +++ b/api_docs/kbn_core_plugins_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-browser-mocks title: "@kbn/core-plugins-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-browser-mocks'] --- import kbnCorePluginsBrowserMocksObj from './kbn_core_plugins_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_server.mdx b/api_docs/kbn_core_plugins_server.mdx index 2825529c4cf74..16cef2f58d579 100644 --- a/api_docs/kbn_core_plugins_server.mdx +++ b/api_docs/kbn_core_plugins_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-server title: "@kbn/core-plugins-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-server'] --- import kbnCorePluginsServerObj from './kbn_core_plugins_server.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_server_mocks.mdx b/api_docs/kbn_core_plugins_server_mocks.mdx index 521bd387a4f57..864516cf44463 100644 --- a/api_docs/kbn_core_plugins_server_mocks.mdx +++ b/api_docs/kbn_core_plugins_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-server-mocks title: "@kbn/core-plugins-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-server-mocks'] --- import kbnCorePluginsServerMocksObj from './kbn_core_plugins_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_preboot_server.mdx b/api_docs/kbn_core_preboot_server.mdx index e14718e6bc06e..445fda7700bb8 100644 --- a/api_docs/kbn_core_preboot_server.mdx +++ b/api_docs/kbn_core_preboot_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server title: "@kbn/core-preboot-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-preboot-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server'] --- import kbnCorePrebootServerObj from './kbn_core_preboot_server.devdocs.json'; diff --git a/api_docs/kbn_core_preboot_server_mocks.mdx b/api_docs/kbn_core_preboot_server_mocks.mdx index 73c970639051d..21e1af399b9bf 100644 --- a/api_docs/kbn_core_preboot_server_mocks.mdx +++ b/api_docs/kbn_core_preboot_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server-mocks title: "@kbn/core-preboot-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-preboot-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server-mocks'] --- import kbnCorePrebootServerMocksObj from './kbn_core_preboot_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_browser_mocks.mdx b/api_docs/kbn_core_rendering_browser_mocks.mdx index 70ba2d2f95c16..540dfb5013a57 100644 --- a/api_docs/kbn_core_rendering_browser_mocks.mdx +++ b/api_docs/kbn_core_rendering_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-browser-mocks title: "@kbn/core-rendering-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-browser-mocks'] --- import kbnCoreRenderingBrowserMocksObj from './kbn_core_rendering_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_server_internal.mdx b/api_docs/kbn_core_rendering_server_internal.mdx index 3edb04efa0512..f2d4c1bb00eee 100644 --- a/api_docs/kbn_core_rendering_server_internal.mdx +++ b/api_docs/kbn_core_rendering_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-server-internal title: "@kbn/core-rendering-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-server-internal'] --- import kbnCoreRenderingServerInternalObj from './kbn_core_rendering_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_server_mocks.mdx b/api_docs/kbn_core_rendering_server_mocks.mdx index ba406dbd6c411..6c9e18231375c 100644 --- a/api_docs/kbn_core_rendering_server_mocks.mdx +++ b/api_docs/kbn_core_rendering_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-server-mocks title: "@kbn/core-rendering-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-server-mocks'] --- import kbnCoreRenderingServerMocksObj from './kbn_core_rendering_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_root_server_internal.mdx b/api_docs/kbn_core_root_server_internal.mdx index 7000629209ee6..2ae84e6bfa9b2 100644 --- a/api_docs/kbn_core_root_server_internal.mdx +++ b/api_docs/kbn_core_root_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-root-server-internal title: "@kbn/core-root-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-root-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-root-server-internal'] --- import kbnCoreRootServerInternalObj from './kbn_core_root_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_browser.devdocs.json b/api_docs/kbn_core_saved_objects_api_browser.devdocs.json index 30d81791476eb..6094383b06ca3 100644 --- a/api_docs/kbn_core_saved_objects_api_browser.devdocs.json +++ b/api_docs/kbn_core_saved_objects_api_browser.devdocs.json @@ -65,22 +65,6 @@ "plugin": "@kbn/core", "path": "src/core/public/index.ts" }, - { - "plugin": "cases", - "path": "x-pack/plugins/cases/common/ui/types.ts" - }, - { - "plugin": "cases", - "path": "x-pack/plugins/cases/common/ui/types.ts" - }, - { - "plugin": "cases", - "path": "x-pack/plugins/cases/common/ui/types.ts" - }, - { - "plugin": "cases", - "path": "x-pack/plugins/cases/common/ui/types.ts" - }, { "plugin": "spaces", "path": "x-pack/plugins/spaces/public/legacy_urls/types.ts" @@ -137,6 +121,22 @@ "plugin": "lens", "path": "x-pack/plugins/lens/public/types.ts" }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/common/ui/types.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/common/ui/types.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/common/ui/types.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/common/ui/types.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/public/map_attribute_service.ts" @@ -1054,6 +1054,10 @@ "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts" }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/saved_objects_service.mock.ts" + }, { "plugin": "savedObjects", "path": "src/plugins/saved_objects/public/saved_object/helpers/create_source.ts" @@ -1074,10 +1078,6 @@ "plugin": "savedObjects", "path": "src/plugins/saved_objects/public/saved_object/helpers/save_with_confirmation.ts" }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/saved_objects_service.mock.ts" - }, { "plugin": "savedObjects", "path": "src/plugins/saved_objects/public/saved_object/saved_object.test.ts" @@ -1269,14 +1269,14 @@ "deprecated": true, "trackAdoption": false, "references": [ - { - "plugin": "home", - "path": "src/plugins/home/public/application/components/home_app.js" - }, { "plugin": "@kbn/core-saved-objects-browser-mocks", "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/saved_objects_service.mock.ts" }, + { + "plugin": "home", + "path": "src/plugins/home/public/application/components/home_app.js" + }, { "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/saved_objects_client.ts" @@ -1378,6 +1378,10 @@ "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts" }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/saved_objects_service.mock.ts" + }, { "plugin": "savedObjects", "path": "src/plugins/saved_objects/public/saved_object/helpers/build_saved_object.ts" @@ -1386,10 +1390,6 @@ "plugin": "visualizations", "path": "src/plugins/visualizations/public/visualize_app/components/visualize_listing.tsx" }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/saved_objects_service.mock.ts" - }, { "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/saved_objects_client.ts" @@ -1623,14 +1623,14 @@ "deprecated": true, "trackAdoption": false, "references": [ - { - "plugin": "savedObjects", - "path": "src/plugins/saved_objects/public/saved_object/helpers/find_object_by_title.ts" - }, { "plugin": "@kbn/core-saved-objects-browser-mocks", "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/saved_objects_service.mock.ts" }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/helpers/find_object_by_title.ts" + }, { "plugin": "dashboardEnhanced", "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/abstract_dashboard_drilldown/components/collect_config_container.tsx" @@ -1719,14 +1719,14 @@ "deprecated": true, "trackAdoption": false, "references": [ - { - "plugin": "savedObjects", - "path": "src/plugins/saved_objects/public/saved_object/helpers/initialize_saved_object.ts" - }, { "plugin": "@kbn/core-saved-objects-browser-mocks", "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/saved_objects_service.mock.ts" }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/helpers/initialize_saved_object.ts" + }, { "plugin": "dashboardEnhanced", "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/abstract_dashboard_drilldown/components/collect_config_container.tsx" @@ -2988,12 +2988,12 @@ "path": "src/plugins/visualizations/public/vis_types/vis_type_alias_registry.ts" }, { - "plugin": "dataVisualizer", - "path": "x-pack/plugins/data_visualizer/common/types/index.ts" + "plugin": "aiops", + "path": "x-pack/plugins/aiops/public/application/utils/search_utils.ts" }, { - "plugin": "dataVisualizer", - "path": "x-pack/plugins/data_visualizer/common/types/index.ts" + "plugin": "aiops", + "path": "x-pack/plugins/aiops/public/application/utils/search_utils.ts" }, { "plugin": "ml", @@ -3004,12 +3004,12 @@ "path": "x-pack/plugins/ml/common/types/kibana.ts" }, { - "plugin": "aiops", - "path": "x-pack/plugins/aiops/public/application/utils/search_utils.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/common/types/index.ts" }, { - "plugin": "aiops", - "path": "x-pack/plugins/aiops/public/application/utils/search_utils.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/common/types/index.ts" }, { "plugin": "dashboardEnhanced", diff --git a/api_docs/kbn_core_saved_objects_api_browser.mdx b/api_docs/kbn_core_saved_objects_api_browser.mdx index 5ad6a91fe4d29..77a987b7ca3e4 100644 --- a/api_docs/kbn_core_saved_objects_api_browser.mdx +++ b/api_docs/kbn_core_saved_objects_api_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-browser title: "@kbn/core-saved-objects-api-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-browser'] --- import kbnCoreSavedObjectsApiBrowserObj from './kbn_core_saved_objects_api_browser.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_server.devdocs.json b/api_docs/kbn_core_saved_objects_api_server.devdocs.json index de1ed3a7811b1..4047fe32a2f08 100644 --- a/api_docs/kbn_core_saved_objects_api_server.devdocs.json +++ b/api_docs/kbn_core_saved_objects_api_server.devdocs.json @@ -2294,18 +2294,6 @@ "deprecated": true, "trackAdoption": false, "references": [ - { - "plugin": "@kbn/core-saved-objects-api-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/utils/internal_utils.ts" - }, - { - "plugin": "@kbn/core-saved-objects-import-export-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/lib/collect_saved_objects.ts" - }, - { - "plugin": "@kbn/core-saved-objects-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/import_dashboards.ts" - }, { "plugin": "@kbn/core-saved-objects-api-browser", "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts" @@ -2318,6 +2306,22 @@ "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts" }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" + }, + { + "plugin": "@kbn/core-saved-objects-api-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/utils/internal_utils.ts" + }, + { + "plugin": "@kbn/core-saved-objects-import-export-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/lib/collect_saved_objects.ts" + }, + { + "plugin": "@kbn/core-saved-objects-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/import_dashboards.ts" + }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts" @@ -2330,6 +2334,22 @@ "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts" }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/server/sample_data/logs.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/server/sample_data/ecommerce.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/server/sample_data/flights.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" + }, { "plugin": "osquery", "path": "x-pack/plugins/osquery/server/routes/pack/read_pack_route.ts" @@ -2418,26 +2438,6 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/server/sample_data/logs.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/server/sample_data/ecommerce.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/server/sample_data/flights.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" - }, { "plugin": "alerting", "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" @@ -2754,22 +2754,6 @@ "plugin": "alerting", "path": "x-pack/plugins/alerting/server/types.ts" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts" - }, { "plugin": "savedSearch", "path": "src/plugins/saved_search/server/saved_objects/search_migrations.ts" @@ -2806,6 +2790,22 @@ "plugin": "enterpriseSearch", "path": "x-pack/plugins/enterprise_search/server/collectors/lib/telemetry.ts" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts" + }, { "plugin": "taskManager", "path": "x-pack/plugins/task_manager/server/task_store.test.ts" diff --git a/api_docs/kbn_core_saved_objects_api_server.mdx b/api_docs/kbn_core_saved_objects_api_server.mdx index 6d59ee4a06204..179461e160ac4 100644 --- a/api_docs/kbn_core_saved_objects_api_server.mdx +++ b/api_docs/kbn_core_saved_objects_api_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-server title: "@kbn/core-saved-objects-api-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-server'] --- import kbnCoreSavedObjectsApiServerObj from './kbn_core_saved_objects_api_server.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_server_mocks.mdx b/api_docs/kbn_core_saved_objects_api_server_mocks.mdx index 76d077788665b..d6bc8d9f745f1 100644 --- a/api_docs/kbn_core_saved_objects_api_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_api_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-server-mocks title: "@kbn/core-saved-objects-api-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-server-mocks'] --- import kbnCoreSavedObjectsApiServerMocksObj from './kbn_core_saved_objects_api_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_base_server_internal.mdx b/api_docs/kbn_core_saved_objects_base_server_internal.mdx index 3562e84112af1..fe6bc5508d884 100644 --- a/api_docs/kbn_core_saved_objects_base_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_base_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-base-server-internal title: "@kbn/core-saved-objects-base-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-base-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-base-server-internal'] --- import kbnCoreSavedObjectsBaseServerInternalObj from './kbn_core_saved_objects_base_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_base_server_mocks.mdx b/api_docs/kbn_core_saved_objects_base_server_mocks.mdx index c5f3fa6010e07..d881aba9ce9ca 100644 --- a/api_docs/kbn_core_saved_objects_base_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_base_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-base-server-mocks title: "@kbn/core-saved-objects-base-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-base-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-base-server-mocks'] --- import kbnCoreSavedObjectsBaseServerMocksObj from './kbn_core_saved_objects_base_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser.devdocs.json b/api_docs/kbn_core_saved_objects_browser.devdocs.json index c36309dcf903d..487ebe0921108 100644 --- a/api_docs/kbn_core_saved_objects_browser.devdocs.json +++ b/api_docs/kbn_core_saved_objects_browser.devdocs.json @@ -33,10 +33,6 @@ "deprecated": true, "trackAdoption": false, "references": [ - { - "plugin": "@kbn/core", - "path": "src/core/server/index.ts" - }, { "plugin": "@kbn/core-lifecycle-browser", "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts" @@ -92,6 +88,10 @@ { "plugin": "@kbn/core-saved-objects-browser-mocks", "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/saved_objects_service.mock.ts" + }, + { + "plugin": "@kbn/core", + "path": "src/core/server/index.ts" } ], "children": [ diff --git a/api_docs/kbn_core_saved_objects_browser.mdx b/api_docs/kbn_core_saved_objects_browser.mdx index 80e5ed5b00cf7..66d59c49a4069 100644 --- a/api_docs/kbn_core_saved_objects_browser.mdx +++ b/api_docs/kbn_core_saved_objects_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser title: "@kbn/core-saved-objects-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser'] --- import kbnCoreSavedObjectsBrowserObj from './kbn_core_saved_objects_browser.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser_internal.mdx b/api_docs/kbn_core_saved_objects_browser_internal.mdx index 6e07557688821..6ec662e559200 100644 --- a/api_docs/kbn_core_saved_objects_browser_internal.mdx +++ b/api_docs/kbn_core_saved_objects_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser-internal title: "@kbn/core-saved-objects-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser-internal'] --- import kbnCoreSavedObjectsBrowserInternalObj from './kbn_core_saved_objects_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser_mocks.mdx b/api_docs/kbn_core_saved_objects_browser_mocks.mdx index 4e67b70507a85..9de9bfc7cb243 100644 --- a/api_docs/kbn_core_saved_objects_browser_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser-mocks title: "@kbn/core-saved-objects-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser-mocks'] --- import kbnCoreSavedObjectsBrowserMocksObj from './kbn_core_saved_objects_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_common.devdocs.json b/api_docs/kbn_core_saved_objects_common.devdocs.json index 00d5b87de088b..4e83ddfc44888 100644 --- a/api_docs/kbn_core_saved_objects_common.devdocs.json +++ b/api_docs/kbn_core_saved_objects_common.devdocs.json @@ -1045,194 +1045,6 @@ "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts" }, - { - "plugin": "@kbn/core", - "path": "src/core/types/index.ts" - }, - { - "plugin": "savedObjectsTaggingOss", - "path": "src/plugins/saved_objects_tagging_oss/public/api.ts" - }, - { - "plugin": "savedObjectsTaggingOss", - "path": "src/plugins/saved_objects_tagging_oss/public/api.ts" - }, - { - "plugin": "savedObjectsTaggingOss", - "path": "src/plugins/saved_objects_tagging_oss/public/api.ts" - }, - { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/common/types.ts" - }, - { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/common/types.ts" - }, - { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/public/utils.ts" - }, - { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/public/utils.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" - }, - { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/public/utils.test.ts" - }, - { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/public/utils.test.ts" - }, - { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/public/utils.test.ts" - }, - { - "plugin": "upgradeAssistant", - "path": "x-pack/plugins/upgrade_assistant/common/types.ts" - }, - { - "plugin": "upgradeAssistant", - "path": "x-pack/plugins/upgrade_assistant/common/types.ts" - }, - { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/common/test_utils/index.ts" - }, - { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/common/test_utils/index.ts" - }, - { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/common/test_utils/index.ts" - }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/server/lib/find_relationships.test.ts" - }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/server/lib/find_relationships.test.ts" - }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/server/lib/find_relationships.test.ts" - }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/server/lib/find_relationships.test.ts" - }, - { - "plugin": "@kbn/core-saved-objects-api-server", - "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts" - }, - { - "plugin": "@kbn/core-saved-objects-api-server", - "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts" - }, - { - "plugin": "@kbn/core-saved-objects-api-server", - "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts" - }, - { - "plugin": "@kbn/core-saved-objects-api-server", - "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts" - }, - { - "plugin": "@kbn/core-saved-objects-import-export-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/errors.ts" - }, - { - "plugin": "@kbn/core-saved-objects-import-export-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/errors.ts" - }, - { - "plugin": "@kbn/core-saved-objects-import-export-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/lib/regenerate_ids.ts" - }, - { - "plugin": "@kbn/core-saved-objects-import-export-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/lib/regenerate_ids.ts" - }, - { - "plugin": "@kbn/core-saved-objects-import-export-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" - }, - { - "plugin": "@kbn/core-saved-objects-import-export-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" - }, - { - "plugin": "@kbn/core-saved-objects-import-export-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" - }, - { - "plugin": "@kbn/core-saved-objects-import-export-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" - }, - { - "plugin": "@kbn/core-saved-objects-import-export-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" - }, - { - "plugin": "@kbn/core-saved-objects-import-export-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" - }, - { - "plugin": "@kbn/core-saved-objects-import-export-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" - }, - { - "plugin": "@kbn/core-saved-objects-import-export-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" - }, - { - "plugin": "@kbn/core-saved-objects-import-export-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" - }, - { - "plugin": "@kbn/core-saved-objects-import-export-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" - }, { "plugin": "@kbn/core-saved-objects-api-browser", "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts" @@ -1285,6 +1097,22 @@ "plugin": "@kbn/core-saved-objects-api-browser", "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts" }, + { + "plugin": "@kbn/core-saved-objects-api-server", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts" + }, + { + "plugin": "@kbn/core-saved-objects-api-server", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts" + }, + { + "plugin": "@kbn/core-saved-objects-api-server", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts" + }, + { + "plugin": "@kbn/core-saved-objects-api-server", + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts" + }, { "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts" @@ -1442,58 +1270,230 @@ "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" }, { - "plugin": "@kbn/core-saved-objects-browser-internal", - "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.test.ts" + "plugin": "@kbn/core-saved-objects-import-export-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/errors.ts" }, { - "plugin": "@kbn/core-saved-objects-browser-internal", - "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.test.ts" + "plugin": "@kbn/core-saved-objects-import-export-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/errors.ts" }, { - "plugin": "@kbn/core-saved-objects-browser-internal", - "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.test.ts" + "plugin": "@kbn/core-saved-objects-import-export-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/lib/regenerate_ids.ts" }, { - "plugin": "@kbn/core-saved-objects-browser-internal", - "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.test.ts" + "plugin": "@kbn/core-saved-objects-import-export-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/lib/regenerate_ids.ts" }, { - "plugin": "@kbn/core-saved-objects-browser-internal", - "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.test.ts" + "plugin": "@kbn/core-saved-objects-import-export-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" }, { - "plugin": "@kbn/core-saved-objects-browser-internal", - "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.test.ts" + "plugin": "@kbn/core-saved-objects-import-export-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" }, { - "plugin": "@kbn/core-saved-objects-browser-internal", - "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.test.ts" + "plugin": "@kbn/core-saved-objects-import-export-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" }, { - "plugin": "@kbn/core-saved-objects-browser-internal", - "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.test.ts" + "plugin": "@kbn/core-saved-objects-import-export-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" }, { - "plugin": "@kbn/core-ui-settings-server-internal", - "path": "packages/core/ui-settings/core-ui-settings-server-internal/src/saved_objects/transforms.test.ts" + "plugin": "@kbn/core-saved-objects-import-export-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" }, { - "plugin": "@kbn/core-ui-settings-server-internal", - "path": "packages/core/ui-settings/core-ui-settings-server-internal/src/saved_objects/transforms.test.ts" + "plugin": "@kbn/core-saved-objects-import-export-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" }, { - "plugin": "@kbn/core-ui-settings-server-internal", - "path": "packages/core/ui-settings/core-ui-settings-server-internal/src/saved_objects/transforms.test.ts" - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/core-saved-objects-common", - "id": "def-common.SavedObjectAttribute", - "type": "Type", - "tags": [ - "deprecated" + "plugin": "@kbn/core-saved-objects-import-export-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" + }, + { + "plugin": "@kbn/core-saved-objects-import-export-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" + }, + { + "plugin": "@kbn/core-saved-objects-import-export-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" + }, + { + "plugin": "@kbn/core-saved-objects-import-export-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" + }, + { + "plugin": "@kbn/core", + "path": "src/core/types/index.ts" + }, + { + "plugin": "savedObjectsTaggingOss", + "path": "src/plugins/saved_objects_tagging_oss/public/api.ts" + }, + { + "plugin": "savedObjectsTaggingOss", + "path": "src/plugins/saved_objects_tagging_oss/public/api.ts" + }, + { + "plugin": "savedObjectsTaggingOss", + "path": "src/plugins/saved_objects_tagging_oss/public/api.ts" + }, + { + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/common/types.ts" + }, + { + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/common/types.ts" + }, + { + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/public/utils.ts" + }, + { + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/public/utils.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + }, + { + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/public/utils.test.ts" + }, + { + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/public/utils.test.ts" + }, + { + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/public/utils.test.ts" + }, + { + "plugin": "upgradeAssistant", + "path": "x-pack/plugins/upgrade_assistant/common/types.ts" + }, + { + "plugin": "upgradeAssistant", + "path": "x-pack/plugins/upgrade_assistant/common/types.ts" + }, + { + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/common/test_utils/index.ts" + }, + { + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/common/test_utils/index.ts" + }, + { + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/common/test_utils/index.ts" + }, + { + "plugin": "savedObjectsManagement", + "path": "src/plugins/saved_objects_management/server/lib/find_relationships.test.ts" + }, + { + "plugin": "savedObjectsManagement", + "path": "src/plugins/saved_objects_management/server/lib/find_relationships.test.ts" + }, + { + "plugin": "savedObjectsManagement", + "path": "src/plugins/saved_objects_management/server/lib/find_relationships.test.ts" + }, + { + "plugin": "savedObjectsManagement", + "path": "src/plugins/saved_objects_management/server/lib/find_relationships.test.ts" + }, + { + "plugin": "@kbn/core-saved-objects-browser-internal", + "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.test.ts" + }, + { + "plugin": "@kbn/core-saved-objects-browser-internal", + "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.test.ts" + }, + { + "plugin": "@kbn/core-saved-objects-browser-internal", + "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.test.ts" + }, + { + "plugin": "@kbn/core-saved-objects-browser-internal", + "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.test.ts" + }, + { + "plugin": "@kbn/core-saved-objects-browser-internal", + "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.test.ts" + }, + { + "plugin": "@kbn/core-saved-objects-browser-internal", + "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.test.ts" + }, + { + "plugin": "@kbn/core-saved-objects-browser-internal", + "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.test.ts" + }, + { + "plugin": "@kbn/core-saved-objects-browser-internal", + "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.test.ts" + }, + { + "plugin": "@kbn/core-ui-settings-server-internal", + "path": "packages/core/ui-settings/core-ui-settings-server-internal/src/saved_objects/transforms.test.ts" + }, + { + "plugin": "@kbn/core-ui-settings-server-internal", + "path": "packages/core/ui-settings/core-ui-settings-server-internal/src/saved_objects/transforms.test.ts" + }, + { + "plugin": "@kbn/core-ui-settings-server-internal", + "path": "packages/core/ui-settings/core-ui-settings-server-internal/src/saved_objects/transforms.test.ts" + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-saved-objects-common", + "id": "def-common.SavedObjectAttribute", + "type": "Type", + "tags": [ + "deprecated" ], "label": "SavedObjectAttribute", "description": [], @@ -1519,10 +1519,6 @@ "deprecated": true, "trackAdoption": false, "references": [ - { - "plugin": "@kbn/core", - "path": "src/core/types/index.ts" - }, { "plugin": "@kbn/core", "path": "src/core/public/index.ts" @@ -1558,6 +1554,10 @@ { "plugin": "advancedSettings", "path": "src/plugins/advanced_settings/public/management_app/lib/to_editable_config.ts" + }, + { + "plugin": "@kbn/core", + "path": "src/core/types/index.ts" } ], "initialIsOpen": false @@ -1575,18 +1575,6 @@ "deprecated": true, "trackAdoption": false, "references": [ - { - "plugin": "@kbn/core", - "path": "src/core/types/index.ts" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/common/types/modules.ts" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/common/types/modules.ts" - }, { "plugin": "@kbn/core", "path": "src/core/public/index.ts" @@ -1754,6 +1742,18 @@ { "plugin": "savedObjects", "path": "src/plugins/saved_objects/public/saved_object/helpers/save_with_confirmation.test.ts" + }, + { + "plugin": "@kbn/core", + "path": "src/core/types/index.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/common/types/modules.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/common/types/modules.ts" } ], "initialIsOpen": false @@ -1784,11 +1784,11 @@ "references": [ { "plugin": "@kbn/core", - "path": "src/core/types/index.ts" + "path": "src/core/public/index.ts" }, { "plugin": "@kbn/core", - "path": "src/core/public/index.ts" + "path": "src/core/types/index.ts" } ], "initialIsOpen": false @@ -1807,836 +1807,836 @@ "trackAdoption": false, "references": [ { - "plugin": "@kbn/core", - "path": "src/core/types/index.ts" + "plugin": "@kbn/core-saved-objects-api-browser", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/create.ts" }, { - "plugin": "kibanaUtils", - "path": "src/plugins/kibana_utils/common/persistable_state/types.ts" + "plugin": "@kbn/core-saved-objects-api-browser", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/create.ts" }, { - "plugin": "kibanaUtils", - "path": "src/plugins/kibana_utils/common/persistable_state/types.ts" + "plugin": "@kbn/core-saved-objects-api-browser", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_update.ts" }, { - "plugin": "kibanaUtils", - "path": "src/plugins/kibana_utils/common/persistable_state/types.ts" + "plugin": "@kbn/core-saved-objects-api-browser", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_update.ts" }, { - "plugin": "kibanaUtils", - "path": "src/plugins/kibana_utils/common/persistable_state/types.ts" + "plugin": "@kbn/core-saved-objects-api-browser", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/update.ts" }, { - "plugin": "kibanaUtils", - "path": "src/plugins/kibana_utils/common/persistable_state/types.ts" + "plugin": "@kbn/core-saved-objects-api-browser", + "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/update.ts" }, { - "plugin": "expressions", - "path": "src/plugins/expressions/common/expression_functions/expression_function.ts" + "plugin": "@kbn/core", + "path": "src/core/public/index.ts" }, { - "plugin": "expressions", - "path": "src/plugins/expressions/common/expression_functions/expression_function.ts" + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/types.ts" }, { - "plugin": "expressions", - "path": "src/plugins/expressions/common/expression_functions/expression_function.ts" + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/types.ts" }, { - "plugin": "expressions", - "path": "src/plugins/expressions/common/service/expressions_services.ts" + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/types.ts" }, { - "plugin": "expressions", - "path": "src/plugins/expressions/common/service/expressions_services.ts" + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/types.ts" }, { - "plugin": "expressions", - "path": "src/plugins/expressions/common/service/expressions_services.ts" + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/types.ts" }, { - "plugin": "expressions", - "path": "src/plugins/expressions/common/service/expressions_services.ts" + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/types.ts" }, { - "plugin": "expressions", - "path": "src/plugins/expressions/common/executor/executor.ts" + "plugin": "savedObjectsManagement", + "path": "src/plugins/saved_objects_management/public/services/types/record.ts" }, { - "plugin": "expressions", - "path": "src/plugins/expressions/common/executor/executor.ts" + "plugin": "savedObjectsManagement", + "path": "src/plugins/saved_objects_management/public/services/types/record.ts" }, { - "plugin": "expressions", - "path": "src/plugins/expressions/common/executor/executor.ts" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts" }, { - "plugin": "data", - "path": "src/plugins/data/common/query/filters/persistable_state.ts" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts" }, { - "plugin": "data", - "path": "src/plugins/data/common/query/filters/persistable_state.ts" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts" }, { - "plugin": "data", - "path": "src/plugins/data/common/query/filters/persistable_state.ts" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_visualize_utils.ts" }, { - "plugin": "data", - "path": "src/plugins/data/common/query/persistable_state.ts" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_visualize_utils.ts" }, { - "plugin": "data", - "path": "src/plugins/data/common/query/persistable_state.ts" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_visualize_utils.ts" }, { - "plugin": "data", - "path": "src/plugins/data/common/query/persistable_state.ts" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_visualize_utils.ts" }, { - "plugin": "savedObjectsTaggingOss", - "path": "src/plugins/saved_objects_tagging_oss/public/api.ts" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_visualize_utils.ts" }, { - "plugin": "savedObjectsTaggingOss", - "path": "src/plugins/saved_objects_tagging_oss/public/api.ts" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/utils/saved_visualize_utils.ts" }, { - "plugin": "savedObjectsTaggingOss", - "path": "src/plugins/saved_objects_tagging_oss/public/api.ts" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx" }, { - "plugin": "savedObjectsTaggingOss", - "path": "src/plugins/saved_objects_tagging_oss/public/api.ts" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx" }, { - "plugin": "embeddable", - "path": "src/plugins/embeddable/common/lib/migrate_base_input.ts" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/visualize_app/components/visualize_listing.tsx" }, { - "plugin": "embeddable", - "path": "src/plugins/embeddable/common/lib/migrate_base_input.ts" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/visualize_app/components/visualize_listing.tsx" }, { - "plugin": "embeddable", - "path": "src/plugins/embeddable/common/lib/migrate_base_input.ts" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/visualize_app/components/visualize_listing.tsx" }, { - "plugin": "embeddable", - "path": "src/plugins/embeddable/common/lib/inject.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/public/ui_api/get_table_column_definition.tsx" }, { - "plugin": "embeddable", - "path": "src/plugins/embeddable/common/lib/inject.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/public/ui_api/get_table_column_definition.tsx" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/utils/saved_visualization_references/controls_references.ts" + "plugin": "eventAnnotation", + "path": "src/plugins/event_annotation/public/event_annotation_service/service.tsx" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/utils/saved_visualization_references/controls_references.ts" + "plugin": "eventAnnotation", + "path": "src/plugins/event_annotation/public/event_annotation_service/service.tsx" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/utils/saved_visualization_references/controls_references.ts" + "plugin": "eventAnnotation", + "path": "src/plugins/event_annotation/public/event_annotation_service/service.tsx" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/utils/saved_visualization_references/timeseries_references.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/persistence/saved_object_store.ts" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/utils/saved_visualization_references/timeseries_references.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/persistence/saved_object_store.ts" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/utils/saved_visualization_references/timeseries_references.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/persistence/saved_object_store.ts" }, { - "plugin": "controls", - "path": "src/plugins/controls/common/options_list/options_list_persistable_state.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/state_management/selectors.ts" }, { - "plugin": "controls", - "path": "src/plugins/controls/common/options_list/options_list_persistable_state.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/state_management/selectors.ts" }, { - "plugin": "controls", - "path": "src/plugins/controls/common/options_list/options_list_persistable_state.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/state_management/selectors.ts" }, { - "plugin": "controls", - "path": "src/plugins/controls/common/range_slider/range_slider_persistable_state.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts" }, { - "plugin": "controls", - "path": "src/plugins/controls/common/range_slider/range_slider_persistable_state.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts" }, { - "plugin": "controls", - "path": "src/plugins/controls/common/range_slider/range_slider_persistable_state.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts" }, { - "plugin": "controls", - "path": "src/plugins/controls/common/time_slider/time_slider_persistable_state.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts" }, { - "plugin": "controls", - "path": "src/plugins/controls/common/time_slider/time_slider_persistable_state.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts" }, { - "plugin": "controls", - "path": "src/plugins/controls/common/time_slider/time_slider_persistable_state.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts" }, { - "plugin": "controls", - "path": "src/plugins/controls/common/control_group/control_group_persistable_state.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts" }, { - "plugin": "controls", - "path": "src/plugins/controls/common/control_group/control_group_persistable_state.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/utils.ts" }, { - "plugin": "controls", - "path": "src/plugins/controls/common/control_group/control_group_persistable_state.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/utils.ts" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/common/references.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/utils.ts" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/common/references.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/utils.ts" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/common/references.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/datasources/form_based/loader.ts" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/common/references.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/datasources/form_based/loader.ts" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/common/references.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/datasources/form_based/loader.ts" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/common/references.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/datasources/form_based/loader.ts" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/public/utils.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/datasources/form_based/loader.ts" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/public/utils.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.tsx" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/public/utils.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.tsx" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/public/utils.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.tsx" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/public/components/connected/tag_list.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.tsx" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/public/components/connected/tag_list.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/visualizations/xy/state_helpers.ts" }, { - "plugin": "uiActionsEnhanced", - "path": "src/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/visualizations/xy/state_helpers.ts" }, { - "plugin": "uiActionsEnhanced", - "path": "src/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/visualizations/xy/state_helpers.ts" }, { - "plugin": "uiActionsEnhanced", - "path": "src/plugins/ui_actions_enhanced/public/services/ui_actions_service_enhancements.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/visualizations/xy/visualization.tsx" }, { - "plugin": "uiActionsEnhanced", - "path": "src/plugins/ui_actions_enhanced/public/services/ui_actions_service_enhancements.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/visualizations/xy/visualization.tsx" }, { - "plugin": "uiActionsEnhanced", - "path": "src/plugins/ui_actions_enhanced/public/services/ui_actions_service_enhancements.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/datasources/text_based/text_based_languages.tsx" }, { - "plugin": "uiActionsEnhanced", - "path": "src/plugins/ui_actions_enhanced/public/dynamic_actions/dynamic_action_enhancement.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/datasources/text_based/text_based_languages.tsx" }, { - "plugin": "uiActionsEnhanced", - "path": "src/plugins/ui_actions_enhanced/public/dynamic_actions/dynamic_action_enhancement.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/datasources/text_based/text_based_languages.tsx" }, { "plugin": "lens", - "path": "x-pack/plugins/lens/common/embeddable_factory/index.ts" + "path": "x-pack/plugins/lens/public/datasources/text_based/text_based_languages.tsx" }, { "plugin": "lens", - "path": "x-pack/plugins/lens/common/embeddable_factory/index.ts" + "path": "x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx" }, { "plugin": "lens", - "path": "x-pack/plugins/lens/common/embeddable_factory/index.ts" + "path": "x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx" }, { "plugin": "lens", - "path": "x-pack/plugins/lens/common/embeddable_factory/index.ts" + "path": "x-pack/plugins/lens/public/types.ts" }, { "plugin": "lens", - "path": "x-pack/plugins/lens/common/embeddable_factory/index.ts" + "path": "x-pack/plugins/lens/public/types.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/common/migrations/references.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/types.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/common/migrations/references.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/types.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/common/migrations/references.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/types.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/common/migrations/references.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/types.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/common/migrations/references.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/types.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/map_attribute_service.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/types.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/map_attribute_service.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/types.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/types.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/types.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_map.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/saved_workspace_references.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_map.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/saved_workspace_references.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_search.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/saved_workspace_references.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_search.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/types/persistence.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_visualization.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/types/persistence.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_visualization.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.test.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/embeddable.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.test.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/embeddable.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.test.ts" }, { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/common/drilldowns/dashboard_drilldown/dashboard_drilldown_persistable_state.ts" + "plugin": "dashboard", + "path": "src/plugins/dashboard/common/bwc/types.ts" }, { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/common/drilldowns/dashboard_drilldown/dashboard_drilldown_persistable_state.ts" + "plugin": "dashboard", + "path": "src/plugins/dashboard/common/bwc/types.ts" }, { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/common/drilldowns/dashboard_drilldown/dashboard_drilldown_persistable_state.ts" + "plugin": "savedObjectsTaggingOss", + "path": "src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts" }, { - "plugin": "uiActionsEnhanced", - "path": "src/plugins/ui_actions_enhanced/server/dynamic_action_enhancement.ts" + "plugin": "savedObjectsTaggingOss", + "path": "src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts" }, { - "plugin": "uiActionsEnhanced", - "path": "src/plugins/ui_actions_enhanced/server/dynamic_action_enhancement.ts" + "plugin": "savedObjectsTaggingOss", + "path": "src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts" }, { - "plugin": "uiActionsEnhanced", - "path": "src/plugins/ui_actions_enhanced/server/dynamic_action_enhancement.ts" + "plugin": "savedObjectsTaggingOss", + "path": "src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/common/references.test.ts" + "plugin": "savedObjectsTaggingOss", + "path": "src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/common/references.test.ts" + "plugin": "savedObjectsTaggingOss", + "path": "src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/public/utils.test.ts" + "plugin": "savedObjectsTaggingOss", + "path": "src/plugins/saved_objects_tagging_oss/public/decorator/inject_tag_references.test.ts" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/public/utils.test.ts" + "plugin": "savedObjectsTaggingOss", + "path": "src/plugins/saved_objects_tagging_oss/public/decorator/inject_tag_references.test.ts" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/public/utils.test.ts" + "plugin": "@kbn/core", + "path": "src/core/types/index.ts" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/common/test_utils/index.ts" + "plugin": "kibanaUtils", + "path": "src/plugins/kibana_utils/common/persistable_state/types.ts" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/common/test_utils/index.ts" + "plugin": "kibanaUtils", + "path": "src/plugins/kibana_utils/common/persistable_state/types.ts" }, { - "plugin": "globalSearchProviders", - "path": "x-pack/plugins/global_search_providers/server/providers/saved_objects/map_object_to_result.test.ts" + "plugin": "kibanaUtils", + "path": "src/plugins/kibana_utils/common/persistable_state/types.ts" }, { - "plugin": "globalSearchProviders", - "path": "x-pack/plugins/global_search_providers/server/providers/saved_objects/map_object_to_result.test.ts" + "plugin": "kibanaUtils", + "path": "src/plugins/kibana_utils/common/persistable_state/types.ts" }, { - "plugin": "expressions", - "path": "src/plugins/expressions/common/executor/executor.test.ts" + "plugin": "kibanaUtils", + "path": "src/plugins/kibana_utils/common/persistable_state/types.ts" }, { "plugin": "expressions", - "path": "src/plugins/expressions/common/executor/executor.test.ts" + "path": "src/plugins/expressions/common/expression_functions/expression_function.ts" }, { "plugin": "expressions", - "path": "src/plugins/expressions/common/executor/executor.test.ts" + "path": "src/plugins/expressions/common/expression_functions/expression_function.ts" }, { - "plugin": "@kbn/core-saved-objects-api-browser", - "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/create.ts" + "plugin": "expressions", + "path": "src/plugins/expressions/common/expression_functions/expression_function.ts" }, { - "plugin": "@kbn/core-saved-objects-api-browser", - "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/create.ts" + "plugin": "expressions", + "path": "src/plugins/expressions/common/service/expressions_services.ts" }, { - "plugin": "@kbn/core-saved-objects-api-browser", - "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_update.ts" + "plugin": "expressions", + "path": "src/plugins/expressions/common/service/expressions_services.ts" }, { - "plugin": "@kbn/core-saved-objects-api-browser", - "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/bulk_update.ts" + "plugin": "expressions", + "path": "src/plugins/expressions/common/service/expressions_services.ts" }, { - "plugin": "@kbn/core-saved-objects-api-browser", - "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/update.ts" + "plugin": "expressions", + "path": "src/plugins/expressions/common/service/expressions_services.ts" }, { - "plugin": "@kbn/core-saved-objects-api-browser", - "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/apis/update.ts" + "plugin": "expressions", + "path": "src/plugins/expressions/common/executor/executor.ts" }, { - "plugin": "@kbn/core", - "path": "src/core/public/index.ts" + "plugin": "expressions", + "path": "src/plugins/expressions/common/executor/executor.ts" }, { - "plugin": "savedObjects", - "path": "src/plugins/saved_objects/public/types.ts" + "plugin": "expressions", + "path": "src/plugins/expressions/common/executor/executor.ts" }, { - "plugin": "savedObjects", - "path": "src/plugins/saved_objects/public/types.ts" + "plugin": "data", + "path": "src/plugins/data/common/query/filters/persistable_state.ts" }, { - "plugin": "savedObjects", - "path": "src/plugins/saved_objects/public/types.ts" + "plugin": "data", + "path": "src/plugins/data/common/query/filters/persistable_state.ts" }, { - "plugin": "savedObjects", - "path": "src/plugins/saved_objects/public/types.ts" + "plugin": "data", + "path": "src/plugins/data/common/query/filters/persistable_state.ts" }, { - "plugin": "savedObjects", - "path": "src/plugins/saved_objects/public/types.ts" + "plugin": "data", + "path": "src/plugins/data/common/query/persistable_state.ts" }, { - "plugin": "savedObjects", - "path": "src/plugins/saved_objects/public/types.ts" + "plugin": "data", + "path": "src/plugins/data/common/query/persistable_state.ts" }, { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/services/types/record.ts" + "plugin": "data", + "path": "src/plugins/data/common/query/persistable_state.ts" }, { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/services/types/record.ts" + "plugin": "savedObjectsTaggingOss", + "path": "src/plugins/saved_objects_tagging_oss/public/api.ts" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts" + "plugin": "savedObjectsTaggingOss", + "path": "src/plugins/saved_objects_tagging_oss/public/api.ts" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts" + "plugin": "savedObjectsTaggingOss", + "path": "src/plugins/saved_objects_tagging_oss/public/api.ts" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts" + "plugin": "savedObjectsTaggingOss", + "path": "src/plugins/saved_objects_tagging_oss/public/api.ts" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/utils/saved_visualize_utils.ts" + "plugin": "embeddable", + "path": "src/plugins/embeddable/common/lib/migrate_base_input.ts" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/utils/saved_visualize_utils.ts" + "plugin": "embeddable", + "path": "src/plugins/embeddable/common/lib/migrate_base_input.ts" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/utils/saved_visualize_utils.ts" + "plugin": "embeddable", + "path": "src/plugins/embeddable/common/lib/migrate_base_input.ts" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/utils/saved_visualize_utils.ts" + "plugin": "embeddable", + "path": "src/plugins/embeddable/common/lib/inject.ts" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/utils/saved_visualize_utils.ts" + "plugin": "embeddable", + "path": "src/plugins/embeddable/common/lib/inject.ts" }, { "plugin": "visualizations", - "path": "src/plugins/visualizations/public/utils/saved_visualize_utils.ts" + "path": "src/plugins/visualizations/public/utils/saved_visualization_references/controls_references.ts" }, { "plugin": "visualizations", - "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx" + "path": "src/plugins/visualizations/public/utils/saved_visualization_references/controls_references.ts" }, { "plugin": "visualizations", - "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx" + "path": "src/plugins/visualizations/public/utils/saved_visualization_references/controls_references.ts" }, { "plugin": "visualizations", - "path": "src/plugins/visualizations/public/visualize_app/components/visualize_listing.tsx" + "path": "src/plugins/visualizations/public/utils/saved_visualization_references/timeseries_references.ts" }, { "plugin": "visualizations", - "path": "src/plugins/visualizations/public/visualize_app/components/visualize_listing.tsx" + "path": "src/plugins/visualizations/public/utils/saved_visualization_references/timeseries_references.ts" }, { "plugin": "visualizations", - "path": "src/plugins/visualizations/public/visualize_app/components/visualize_listing.tsx" + "path": "src/plugins/visualizations/public/utils/saved_visualization_references/timeseries_references.ts" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/public/ui_api/get_table_column_definition.tsx" + "plugin": "controls", + "path": "src/plugins/controls/common/options_list/options_list_persistable_state.ts" }, { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/public/ui_api/get_table_column_definition.tsx" + "plugin": "controls", + "path": "src/plugins/controls/common/options_list/options_list_persistable_state.ts" }, { - "plugin": "eventAnnotation", - "path": "src/plugins/event_annotation/public/event_annotation_service/service.tsx" + "plugin": "controls", + "path": "src/plugins/controls/common/options_list/options_list_persistable_state.ts" }, { - "plugin": "eventAnnotation", - "path": "src/plugins/event_annotation/public/event_annotation_service/service.tsx" + "plugin": "controls", + "path": "src/plugins/controls/common/range_slider/range_slider_persistable_state.ts" }, { - "plugin": "eventAnnotation", - "path": "src/plugins/event_annotation/public/event_annotation_service/service.tsx" + "plugin": "controls", + "path": "src/plugins/controls/common/range_slider/range_slider_persistable_state.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/persistence/saved_object_store.ts" + "plugin": "controls", + "path": "src/plugins/controls/common/range_slider/range_slider_persistable_state.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/persistence/saved_object_store.ts" + "plugin": "controls", + "path": "src/plugins/controls/common/time_slider/time_slider_persistable_state.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/persistence/saved_object_store.ts" + "plugin": "controls", + "path": "src/plugins/controls/common/time_slider/time_slider_persistable_state.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/state_management/selectors.ts" + "plugin": "controls", + "path": "src/plugins/controls/common/time_slider/time_slider_persistable_state.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/state_management/selectors.ts" + "plugin": "controls", + "path": "src/plugins/controls/common/control_group/control_group_persistable_state.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/state_management/selectors.ts" + "plugin": "controls", + "path": "src/plugins/controls/common/control_group/control_group_persistable_state.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts" + "plugin": "controls", + "path": "src/plugins/controls/common/control_group/control_group_persistable_state.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/common/references.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/common/references.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/common/references.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/common/references.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/common/references.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_helpers.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/common/references.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/utils.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/public/utils.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/utils.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/public/utils.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/utils.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/public/utils.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/utils.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/public/utils.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/form_based/loader.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/public/components/connected/tag_list.tsx" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/form_based/loader.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/public/components/connected/tag_list.tsx" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/form_based/loader.ts" + "plugin": "uiActionsEnhanced", + "path": "src/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/form_based/loader.ts" + "plugin": "uiActionsEnhanced", + "path": "src/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/form_based/loader.ts" + "plugin": "uiActionsEnhanced", + "path": "src/plugins/ui_actions_enhanced/public/services/ui_actions_service_enhancements.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.tsx" + "plugin": "uiActionsEnhanced", + "path": "src/plugins/ui_actions_enhanced/public/services/ui_actions_service_enhancements.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.tsx" + "plugin": "uiActionsEnhanced", + "path": "src/plugins/ui_actions_enhanced/public/services/ui_actions_service_enhancements.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.tsx" + "plugin": "uiActionsEnhanced", + "path": "src/plugins/ui_actions_enhanced/public/dynamic_actions/dynamic_action_enhancement.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.tsx" + "plugin": "uiActionsEnhanced", + "path": "src/plugins/ui_actions_enhanced/public/dynamic_actions/dynamic_action_enhancement.ts" }, { "plugin": "lens", - "path": "x-pack/plugins/lens/public/visualizations/xy/state_helpers.ts" + "path": "x-pack/plugins/lens/common/embeddable_factory/index.ts" }, { "plugin": "lens", - "path": "x-pack/plugins/lens/public/visualizations/xy/state_helpers.ts" + "path": "x-pack/plugins/lens/common/embeddable_factory/index.ts" }, { "plugin": "lens", - "path": "x-pack/plugins/lens/public/visualizations/xy/state_helpers.ts" + "path": "x-pack/plugins/lens/common/embeddable_factory/index.ts" }, { "plugin": "lens", - "path": "x-pack/plugins/lens/public/visualizations/xy/visualization.tsx" + "path": "x-pack/plugins/lens/common/embeddable_factory/index.ts" }, { "plugin": "lens", - "path": "x-pack/plugins/lens/public/visualizations/xy/visualization.tsx" + "path": "x-pack/plugins/lens/common/embeddable_factory/index.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/text_based/text_based_languages.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/common/migrations/references.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/text_based/text_based_languages.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/common/migrations/references.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/text_based/text_based_languages.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/common/migrations/references.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/text_based/text_based_languages.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/common/migrations/references.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/common/migrations/references.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/map_attribute_service.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/types.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/map_attribute_service.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/types.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/types.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/types.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_map.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/types.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_map.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/types.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_search.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/types.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_search.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/types.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_visualization.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/types.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_visualization.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/types.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/embeddable.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/types.ts" + "plugin": "canvas", + "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/embeddable.ts" }, { - "plugin": "graph", - "path": "x-pack/plugins/graph/public/services/persistence/saved_workspace_references.ts" + "plugin": "dashboardEnhanced", + "path": "x-pack/plugins/dashboard_enhanced/common/drilldowns/dashboard_drilldown/dashboard_drilldown_persistable_state.ts" }, { - "plugin": "graph", - "path": "x-pack/plugins/graph/public/services/persistence/saved_workspace_references.ts" + "plugin": "dashboardEnhanced", + "path": "x-pack/plugins/dashboard_enhanced/common/drilldowns/dashboard_drilldown/dashboard_drilldown_persistable_state.ts" }, { - "plugin": "graph", - "path": "x-pack/plugins/graph/public/services/persistence/saved_workspace_references.ts" + "plugin": "dashboardEnhanced", + "path": "x-pack/plugins/dashboard_enhanced/common/drilldowns/dashboard_drilldown/dashboard_drilldown_persistable_state.ts" }, { - "plugin": "graph", - "path": "x-pack/plugins/graph/public/types/persistence.ts" + "plugin": "uiActionsEnhanced", + "path": "src/plugins/ui_actions_enhanced/server/dynamic_action_enhancement.ts" }, { - "plugin": "graph", - "path": "x-pack/plugins/graph/public/types/persistence.ts" + "plugin": "uiActionsEnhanced", + "path": "src/plugins/ui_actions_enhanced/server/dynamic_action_enhancement.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.test.ts" + "plugin": "uiActionsEnhanced", + "path": "src/plugins/ui_actions_enhanced/server/dynamic_action_enhancement.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.test.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/common/references.test.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/datasources/form_based/form_based.test.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/common/references.test.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/common/bwc/types.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/public/utils.test.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/common/bwc/types.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/public/utils.test.ts" }, { - "plugin": "savedObjectsTaggingOss", - "path": "src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/public/utils.test.ts" }, { - "plugin": "savedObjectsTaggingOss", - "path": "src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/common/test_utils/index.ts" }, { - "plugin": "savedObjectsTaggingOss", - "path": "src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts" + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/common/test_utils/index.ts" }, { - "plugin": "savedObjectsTaggingOss", - "path": "src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts" + "plugin": "globalSearchProviders", + "path": "x-pack/plugins/global_search_providers/server/providers/saved_objects/map_object_to_result.test.ts" }, { - "plugin": "savedObjectsTaggingOss", - "path": "src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts" + "plugin": "globalSearchProviders", + "path": "x-pack/plugins/global_search_providers/server/providers/saved_objects/map_object_to_result.test.ts" }, { - "plugin": "savedObjectsTaggingOss", - "path": "src/plugins/saved_objects_tagging_oss/public/decorator/extract_tag_references.test.ts" + "plugin": "expressions", + "path": "src/plugins/expressions/common/executor/executor.test.ts" }, { - "plugin": "savedObjectsTaggingOss", - "path": "src/plugins/saved_objects_tagging_oss/public/decorator/inject_tag_references.test.ts" + "plugin": "expressions", + "path": "src/plugins/expressions/common/executor/executor.test.ts" }, { - "plugin": "savedObjectsTaggingOss", - "path": "src/plugins/saved_objects_tagging_oss/public/decorator/inject_tag_references.test.ts" + "plugin": "expressions", + "path": "src/plugins/expressions/common/executor/executor.test.ts" }, { "plugin": "lens", diff --git a/api_docs/kbn_core_saved_objects_common.mdx b/api_docs/kbn_core_saved_objects_common.mdx index c5f492f5106dc..d59ae94970407 100644 --- a/api_docs/kbn_core_saved_objects_common.mdx +++ b/api_docs/kbn_core_saved_objects_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-common title: "@kbn/core-saved-objects-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-common plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-common'] --- import kbnCoreSavedObjectsCommonObj from './kbn_core_saved_objects_common.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx b/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx index 59b3f1336b5b0..a1fb4fe9a5797 100644 --- a/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-import-export-server-internal title: "@kbn/core-saved-objects-import-export-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-import-export-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-import-export-server-internal'] --- import kbnCoreSavedObjectsImportExportServerInternalObj from './kbn_core_saved_objects_import_export_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx b/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx index a717ce03a9ddf..52b002a91ff53 100644 --- a/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-import-export-server-mocks title: "@kbn/core-saved-objects-import-export-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-import-export-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-import-export-server-mocks'] --- import kbnCoreSavedObjectsImportExportServerMocksObj from './kbn_core_saved_objects_import_export_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_migration_server_internal.mdx b/api_docs/kbn_core_saved_objects_migration_server_internal.mdx index 8e7fd5914071c..2bd9034fc1dda 100644 --- a/api_docs/kbn_core_saved_objects_migration_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_migration_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-migration-server-internal title: "@kbn/core-saved-objects-migration-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-migration-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-migration-server-internal'] --- import kbnCoreSavedObjectsMigrationServerInternalObj from './kbn_core_saved_objects_migration_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx b/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx index cf77d20409705..8bcc9ce47af1a 100644 --- a/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-migration-server-mocks title: "@kbn/core-saved-objects-migration-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-migration-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-migration-server-mocks'] --- import kbnCoreSavedObjectsMigrationServerMocksObj from './kbn_core_saved_objects_migration_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server.devdocs.json b/api_docs/kbn_core_saved_objects_server.devdocs.json index 5f59c9dd45cd7..5b9051d7275bd 100644 --- a/api_docs/kbn_core_saved_objects_server.devdocs.json +++ b/api_docs/kbn_core_saved_objects_server.devdocs.json @@ -5759,18 +5759,6 @@ "deprecated": true, "trackAdoption": false, "references": [ - { - "plugin": "@kbn/core-saved-objects-api-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/utils/internal_utils.ts" - }, - { - "plugin": "@kbn/core-saved-objects-import-export-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/lib/collect_saved_objects.ts" - }, - { - "plugin": "@kbn/core-saved-objects-server-internal", - "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/import_dashboards.ts" - }, { "plugin": "@kbn/core-saved-objects-api-browser", "path": "packages/core/saved-objects/core-saved-objects-api-browser/src/simple_saved_object.ts" @@ -5783,6 +5771,22 @@ "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts" }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" + }, + { + "plugin": "@kbn/core-saved-objects-api-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/utils/internal_utils.ts" + }, + { + "plugin": "@kbn/core-saved-objects-import-export-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/import/lib/collect_saved_objects.ts" + }, + { + "plugin": "@kbn/core-saved-objects-server-internal", + "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/import_dashboards.ts" + }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts" @@ -5795,6 +5799,22 @@ "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts" }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/server/sample_data/logs.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/server/sample_data/ecommerce.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/server/sample_data/flights.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" + }, { "plugin": "osquery", "path": "x-pack/plugins/osquery/server/routes/pack/read_pack_route.ts" @@ -5883,26 +5903,6 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/server/sample_data/logs.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/server/sample_data/ecommerce.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/server/sample_data/flights.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" - }, { "plugin": "alerting", "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" @@ -6219,22 +6219,6 @@ "plugin": "alerting", "path": "x-pack/plugins/alerting/server/types.ts" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts" - }, { "plugin": "savedSearch", "path": "src/plugins/saved_search/server/saved_objects/search_migrations.ts" @@ -6271,6 +6255,22 @@ "plugin": "enterpriseSearch", "path": "x-pack/plugins/enterprise_search/server/collectors/lib/telemetry.ts" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts" + }, { "plugin": "taskManager", "path": "x-pack/plugins/task_manager/server/task_store.test.ts" @@ -10471,10 +10471,6 @@ "plugin": "lens", "path": "x-pack/plugins/lens/server/saved_objects.ts" }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/saved_objects/exception_list.ts" - }, { "plugin": "cases", "path": "x-pack/plugins/cases/server/saved_object_types/cases.ts" @@ -10499,22 +10495,6 @@ "plugin": "savedObjectsTagging", "path": "x-pack/plugins/saved_objects_tagging/server/saved_objects/tag.ts" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/notes.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/pinned_events.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_saved_object_mappings.ts" - }, { "plugin": "savedSearch", "path": "src/plugins/saved_search/server/saved_objects/search.ts" @@ -10535,10 +10515,30 @@ "plugin": "visualizations", "path": "src/plugins/visualizations/server/saved_objects/visualization.ts" }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/server/saved_objects/exception_list.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/server/saved_objects/setup_saved_objects.ts" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/notes.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/pinned_events.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_saved_object_mappings.ts" + }, { "plugin": "dashboard", "path": "src/plugins/dashboard/server/dashboard_saved_object/dashboard_saved_object.ts" diff --git a/api_docs/kbn_core_saved_objects_server.mdx b/api_docs/kbn_core_saved_objects_server.mdx index 121f306390d37..70b04885fe3ab 100644 --- a/api_docs/kbn_core_saved_objects_server.mdx +++ b/api_docs/kbn_core_saved_objects_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server title: "@kbn/core-saved-objects-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server'] --- import kbnCoreSavedObjectsServerObj from './kbn_core_saved_objects_server.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server_internal.mdx b/api_docs/kbn_core_saved_objects_server_internal.mdx index d54314765ee07..32d46b9143941 100644 --- a/api_docs/kbn_core_saved_objects_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server-internal title: "@kbn/core-saved-objects-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server-internal'] --- import kbnCoreSavedObjectsServerInternalObj from './kbn_core_saved_objects_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server_mocks.mdx b/api_docs/kbn_core_saved_objects_server_mocks.mdx index e674795bb7d7a..ae066637e1e24 100644 --- a/api_docs/kbn_core_saved_objects_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server-mocks title: "@kbn/core-saved-objects-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server-mocks'] --- import kbnCoreSavedObjectsServerMocksObj from './kbn_core_saved_objects_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_utils_server.mdx b/api_docs/kbn_core_saved_objects_utils_server.mdx index 2e66dac37ee41..689014dd59e00 100644 --- a/api_docs/kbn_core_saved_objects_utils_server.mdx +++ b/api_docs/kbn_core_saved_objects_utils_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-utils-server title: "@kbn/core-saved-objects-utils-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-utils-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-utils-server'] --- import kbnCoreSavedObjectsUtilsServerObj from './kbn_core_saved_objects_utils_server.devdocs.json'; diff --git a/api_docs/kbn_core_status_common.mdx b/api_docs/kbn_core_status_common.mdx index bdbfa32906cba..1f39d43e95de6 100644 --- a/api_docs/kbn_core_status_common.mdx +++ b/api_docs/kbn_core_status_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-common title: "@kbn/core-status-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-common plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-common'] --- import kbnCoreStatusCommonObj from './kbn_core_status_common.devdocs.json'; diff --git a/api_docs/kbn_core_status_common_internal.mdx b/api_docs/kbn_core_status_common_internal.mdx index d4e797164e721..286ad8ba080bc 100644 --- a/api_docs/kbn_core_status_common_internal.mdx +++ b/api_docs/kbn_core_status_common_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-common-internal title: "@kbn/core-status-common-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-common-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-common-internal'] --- import kbnCoreStatusCommonInternalObj from './kbn_core_status_common_internal.devdocs.json'; diff --git a/api_docs/kbn_core_status_server.mdx b/api_docs/kbn_core_status_server.mdx index 49c68f88fe825..1a6e4f8e6bb56 100644 --- a/api_docs/kbn_core_status_server.mdx +++ b/api_docs/kbn_core_status_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server title: "@kbn/core-status-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server'] --- import kbnCoreStatusServerObj from './kbn_core_status_server.devdocs.json'; diff --git a/api_docs/kbn_core_status_server_internal.mdx b/api_docs/kbn_core_status_server_internal.mdx index 1403d0bbce110..256ea08539b82 100644 --- a/api_docs/kbn_core_status_server_internal.mdx +++ b/api_docs/kbn_core_status_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server-internal title: "@kbn/core-status-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server-internal'] --- import kbnCoreStatusServerInternalObj from './kbn_core_status_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_status_server_mocks.mdx b/api_docs/kbn_core_status_server_mocks.mdx index 624d513b8121b..29cb50c7ec525 100644 --- a/api_docs/kbn_core_status_server_mocks.mdx +++ b/api_docs/kbn_core_status_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server-mocks title: "@kbn/core-status-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server-mocks'] --- import kbnCoreStatusServerMocksObj from './kbn_core_status_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_deprecations_getters.mdx b/api_docs/kbn_core_test_helpers_deprecations_getters.mdx index a6a09ae1ca817..caac093bbf325 100644 --- a/api_docs/kbn_core_test_helpers_deprecations_getters.mdx +++ b/api_docs/kbn_core_test_helpers_deprecations_getters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-deprecations-getters title: "@kbn/core-test-helpers-deprecations-getters" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-deprecations-getters plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-deprecations-getters'] --- import kbnCoreTestHelpersDeprecationsGettersObj from './kbn_core_test_helpers_deprecations_getters.devdocs.json'; 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 7f83d01655e64..c36935bfd0886 100644 --- a/api_docs/kbn_core_test_helpers_http_setup_browser.mdx +++ b/api_docs/kbn_core_test_helpers_http_setup_browser.mdx @@ -8,7 +8,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 description: API docs for the @kbn/core-test-helpers-http-setup-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-http-setup-browser'] --- import kbnCoreTestHelpersHttpSetupBrowserObj from './kbn_core_test_helpers_http_setup_browser.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_kbn_server.mdx b/api_docs/kbn_core_test_helpers_kbn_server.mdx index 2b331379945b2..200c6e65f0d76 100644 --- a/api_docs/kbn_core_test_helpers_kbn_server.mdx +++ b/api_docs/kbn_core_test_helpers_kbn_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-kbn-server title: "@kbn/core-test-helpers-kbn-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-kbn-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-kbn-server'] --- import kbnCoreTestHelpersKbnServerObj from './kbn_core_test_helpers_kbn_server.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_so_type_serializer.mdx b/api_docs/kbn_core_test_helpers_so_type_serializer.mdx index 46d2ba4365b33..6a47dbeae8269 100644 --- a/api_docs/kbn_core_test_helpers_so_type_serializer.mdx +++ b/api_docs/kbn_core_test_helpers_so_type_serializer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-so-type-serializer title: "@kbn/core-test-helpers-so-type-serializer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-so-type-serializer plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-so-type-serializer'] --- import kbnCoreTestHelpersSoTypeSerializerObj from './kbn_core_test_helpers_so_type_serializer.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_test_utils.mdx b/api_docs/kbn_core_test_helpers_test_utils.mdx index 9858dae8af699..c0202a74dc94f 100644 --- a/api_docs/kbn_core_test_helpers_test_utils.mdx +++ b/api_docs/kbn_core_test_helpers_test_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-test-utils title: "@kbn/core-test-helpers-test-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-test-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-test-utils'] --- import kbnCoreTestHelpersTestUtilsObj from './kbn_core_test_helpers_test_utils.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser.mdx b/api_docs/kbn_core_theme_browser.mdx index e90a3fe9e3be7..a47a7534b0770 100644 --- a/api_docs/kbn_core_theme_browser.mdx +++ b/api_docs/kbn_core_theme_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser title: "@kbn/core-theme-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser'] --- import kbnCoreThemeBrowserObj from './kbn_core_theme_browser.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser_mocks.mdx b/api_docs/kbn_core_theme_browser_mocks.mdx index e66d8531ab745..192518b56e633 100644 --- a/api_docs/kbn_core_theme_browser_mocks.mdx +++ b/api_docs/kbn_core_theme_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser-mocks title: "@kbn/core-theme-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser-mocks'] --- import kbnCoreThemeBrowserMocksObj from './kbn_core_theme_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser.mdx b/api_docs/kbn_core_ui_settings_browser.mdx index ce753601db8cd..03525a56c98f1 100644 --- a/api_docs/kbn_core_ui_settings_browser.mdx +++ b/api_docs/kbn_core_ui_settings_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser title: "@kbn/core-ui-settings-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser'] --- import kbnCoreUiSettingsBrowserObj from './kbn_core_ui_settings_browser.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser_internal.mdx b/api_docs/kbn_core_ui_settings_browser_internal.mdx index 4f2e72185c5f2..b5a503a3efe5f 100644 --- a/api_docs/kbn_core_ui_settings_browser_internal.mdx +++ b/api_docs/kbn_core_ui_settings_browser_internal.mdx @@ -8,7 +8,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 description: API docs for the @kbn/core-ui-settings-browser-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-internal'] --- import kbnCoreUiSettingsBrowserInternalObj from './kbn_core_ui_settings_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser_mocks.mdx b/api_docs/kbn_core_ui_settings_browser_mocks.mdx index ed51b6f61c185..d8c3b442ca770 100644 --- a/api_docs/kbn_core_ui_settings_browser_mocks.mdx +++ b/api_docs/kbn_core_ui_settings_browser_mocks.mdx @@ -8,7 +8,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 description: API docs for the @kbn/core-ui-settings-browser-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-mocks'] --- import kbnCoreUiSettingsBrowserMocksObj from './kbn_core_ui_settings_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_common.mdx b/api_docs/kbn_core_ui_settings_common.mdx index aa314d6075295..70c142af81abd 100644 --- a/api_docs/kbn_core_ui_settings_common.mdx +++ b/api_docs/kbn_core_ui_settings_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-common title: "@kbn/core-ui-settings-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-common plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-common'] --- import kbnCoreUiSettingsCommonObj from './kbn_core_ui_settings_common.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server.mdx b/api_docs/kbn_core_ui_settings_server.mdx index 188f58f540939..109f02899902f 100644 --- a/api_docs/kbn_core_ui_settings_server.mdx +++ b/api_docs/kbn_core_ui_settings_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server title: "@kbn/core-ui-settings-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server'] --- import kbnCoreUiSettingsServerObj from './kbn_core_ui_settings_server.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server_internal.mdx b/api_docs/kbn_core_ui_settings_server_internal.mdx index 8b5bdae1113e7..15a8580c08a17 100644 --- a/api_docs/kbn_core_ui_settings_server_internal.mdx +++ b/api_docs/kbn_core_ui_settings_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server-internal title: "@kbn/core-ui-settings-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server-internal'] --- import kbnCoreUiSettingsServerInternalObj from './kbn_core_ui_settings_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server_mocks.mdx b/api_docs/kbn_core_ui_settings_server_mocks.mdx index 47eedb089d877..1658f8bdf4568 100644 --- a/api_docs/kbn_core_ui_settings_server_mocks.mdx +++ b/api_docs/kbn_core_ui_settings_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server-mocks title: "@kbn/core-ui-settings-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server-mocks'] --- import kbnCoreUiSettingsServerMocksObj from './kbn_core_ui_settings_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server.mdx b/api_docs/kbn_core_usage_data_server.mdx index 208a9a0feb9d7..faab580278775 100644 --- a/api_docs/kbn_core_usage_data_server.mdx +++ b/api_docs/kbn_core_usage_data_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server title: "@kbn/core-usage-data-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server'] --- import kbnCoreUsageDataServerObj from './kbn_core_usage_data_server.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server_internal.mdx b/api_docs/kbn_core_usage_data_server_internal.mdx index 88af0ad6e5597..029bce44b1fec 100644 --- a/api_docs/kbn_core_usage_data_server_internal.mdx +++ b/api_docs/kbn_core_usage_data_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server-internal title: "@kbn/core-usage-data-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server-internal'] --- import kbnCoreUsageDataServerInternalObj from './kbn_core_usage_data_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server_mocks.mdx b/api_docs/kbn_core_usage_data_server_mocks.mdx index e29baf4b5494d..787775f128ffa 100644 --- a/api_docs/kbn_core_usage_data_server_mocks.mdx +++ b/api_docs/kbn_core_usage_data_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server-mocks title: "@kbn/core-usage-data-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server-mocks'] --- import kbnCoreUsageDataServerMocksObj from './kbn_core_usage_data_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_user_settings_server.mdx b/api_docs/kbn_core_user_settings_server.mdx index 0a443c6756438..ad3047731f232 100644 --- a/api_docs/kbn_core_user_settings_server.mdx +++ b/api_docs/kbn_core_user_settings_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-settings-server title: "@kbn/core-user-settings-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-settings-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-settings-server'] --- import kbnCoreUserSettingsServerObj from './kbn_core_user_settings_server.devdocs.json'; diff --git a/api_docs/kbn_core_user_settings_server_internal.mdx b/api_docs/kbn_core_user_settings_server_internal.mdx index f634383349b8f..a9fcd75ad6497 100644 --- a/api_docs/kbn_core_user_settings_server_internal.mdx +++ b/api_docs/kbn_core_user_settings_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-settings-server-internal title: "@kbn/core-user-settings-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-settings-server-internal plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-settings-server-internal'] --- import kbnCoreUserSettingsServerInternalObj from './kbn_core_user_settings_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_user_settings_server_mocks.mdx b/api_docs/kbn_core_user_settings_server_mocks.mdx index f72ac8aa54458..be32949305a9e 100644 --- a/api_docs/kbn_core_user_settings_server_mocks.mdx +++ b/api_docs/kbn_core_user_settings_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-settings-server-mocks title: "@kbn/core-user-settings-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-settings-server-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-settings-server-mocks'] --- import kbnCoreUserSettingsServerMocksObj from './kbn_core_user_settings_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_crypto.mdx b/api_docs/kbn_crypto.mdx index 18ebf327740a8..4497b3eb19a44 100644 --- a/api_docs/kbn_crypto.mdx +++ b/api_docs/kbn_crypto.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-crypto title: "@kbn/crypto" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/crypto plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto'] --- import kbnCryptoObj from './kbn_crypto.devdocs.json'; diff --git a/api_docs/kbn_crypto_browser.mdx b/api_docs/kbn_crypto_browser.mdx index 4fe2c6c812b6f..b31d73f908450 100644 --- a/api_docs/kbn_crypto_browser.mdx +++ b/api_docs/kbn_crypto_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-crypto-browser title: "@kbn/crypto-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/crypto-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto-browser'] --- import kbnCryptoBrowserObj from './kbn_crypto_browser.devdocs.json'; diff --git a/api_docs/kbn_custom_integrations.mdx b/api_docs/kbn_custom_integrations.mdx index 34164c39ab444..3f0d89d516ec6 100644 --- a/api_docs/kbn_custom_integrations.mdx +++ b/api_docs/kbn_custom_integrations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-custom-integrations title: "@kbn/custom-integrations" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/custom-integrations plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/custom-integrations'] --- import kbnCustomIntegrationsObj from './kbn_custom_integrations.devdocs.json'; diff --git a/api_docs/kbn_cypress_config.mdx b/api_docs/kbn_cypress_config.mdx index 3c21c81eaf4da..df52bad4c1261 100644 --- a/api_docs/kbn_cypress_config.mdx +++ b/api_docs/kbn_cypress_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cypress-config title: "@kbn/cypress-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cypress-config plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cypress-config'] --- import kbnCypressConfigObj from './kbn_cypress_config.devdocs.json'; diff --git a/api_docs/kbn_data_service.mdx b/api_docs/kbn_data_service.mdx index d692dd9599aa2..7f1b3fb85d9b1 100644 --- a/api_docs/kbn_data_service.mdx +++ b/api_docs/kbn_data_service.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-data-service title: "@kbn/data-service" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/data-service plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/data-service'] --- import kbnDataServiceObj from './kbn_data_service.devdocs.json'; diff --git a/api_docs/kbn_datemath.mdx b/api_docs/kbn_datemath.mdx index 55ca0a7bf80c2..342e5d9bedbad 100644 --- a/api_docs/kbn_datemath.mdx +++ b/api_docs/kbn_datemath.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-datemath title: "@kbn/datemath" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/datemath plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/datemath'] --- import kbnDatemathObj from './kbn_datemath.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_analytics.mdx b/api_docs/kbn_deeplinks_analytics.mdx index 3d2af8fc0751a..b0f2cd6c9b08e 100644 --- a/api_docs/kbn_deeplinks_analytics.mdx +++ b/api_docs/kbn_deeplinks_analytics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-analytics title: "@kbn/deeplinks-analytics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-analytics plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-analytics'] --- import kbnDeeplinksAnalyticsObj from './kbn_deeplinks_analytics.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_devtools.mdx b/api_docs/kbn_deeplinks_devtools.mdx index 6c08dce9ef598..21c3a22630bca 100644 --- a/api_docs/kbn_deeplinks_devtools.mdx +++ b/api_docs/kbn_deeplinks_devtools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-devtools title: "@kbn/deeplinks-devtools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-devtools plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-devtools'] --- import kbnDeeplinksDevtoolsObj from './kbn_deeplinks_devtools.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_management.mdx b/api_docs/kbn_deeplinks_management.mdx index 41d649fd4c062..f2840ad34ccba 100644 --- a/api_docs/kbn_deeplinks_management.mdx +++ b/api_docs/kbn_deeplinks_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-management title: "@kbn/deeplinks-management" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-management plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-management'] --- import kbnDeeplinksManagementObj from './kbn_deeplinks_management.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_ml.mdx b/api_docs/kbn_deeplinks_ml.mdx index 292b91c3856ff..38092e91037ae 100644 --- a/api_docs/kbn_deeplinks_ml.mdx +++ b/api_docs/kbn_deeplinks_ml.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-ml title: "@kbn/deeplinks-ml" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-ml plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-ml'] --- import kbnDeeplinksMlObj from './kbn_deeplinks_ml.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_observability.mdx b/api_docs/kbn_deeplinks_observability.mdx index 5aba148d03168..0783cc2c7f8fc 100644 --- a/api_docs/kbn_deeplinks_observability.mdx +++ b/api_docs/kbn_deeplinks_observability.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-observability title: "@kbn/deeplinks-observability" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-observability plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-observability'] --- import kbnDeeplinksObservabilityObj from './kbn_deeplinks_observability.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_search.mdx b/api_docs/kbn_deeplinks_search.mdx index 29b10d15a5087..ecca6716215ff 100644 --- a/api_docs/kbn_deeplinks_search.mdx +++ b/api_docs/kbn_deeplinks_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-search title: "@kbn/deeplinks-search" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-search plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-search'] --- import kbnDeeplinksSearchObj from './kbn_deeplinks_search.devdocs.json'; diff --git a/api_docs/kbn_default_nav_analytics.mdx b/api_docs/kbn_default_nav_analytics.mdx index 2c47c2d916687..65930ba1d60fc 100644 --- a/api_docs/kbn_default_nav_analytics.mdx +++ b/api_docs/kbn_default_nav_analytics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-default-nav-analytics title: "@kbn/default-nav-analytics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/default-nav-analytics plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/default-nav-analytics'] --- import kbnDefaultNavAnalyticsObj from './kbn_default_nav_analytics.devdocs.json'; diff --git a/api_docs/kbn_default_nav_devtools.mdx b/api_docs/kbn_default_nav_devtools.mdx index d1a02ac85a818..f4a71a7d8e0ae 100644 --- a/api_docs/kbn_default_nav_devtools.mdx +++ b/api_docs/kbn_default_nav_devtools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-default-nav-devtools title: "@kbn/default-nav-devtools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/default-nav-devtools plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/default-nav-devtools'] --- import kbnDefaultNavDevtoolsObj from './kbn_default_nav_devtools.devdocs.json'; diff --git a/api_docs/kbn_default_nav_management.mdx b/api_docs/kbn_default_nav_management.mdx index 56a49ae0cc9a2..ea83086eb0cbf 100644 --- a/api_docs/kbn_default_nav_management.mdx +++ b/api_docs/kbn_default_nav_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-default-nav-management title: "@kbn/default-nav-management" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/default-nav-management plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/default-nav-management'] --- import kbnDefaultNavManagementObj from './kbn_default_nav_management.devdocs.json'; diff --git a/api_docs/kbn_default_nav_ml.mdx b/api_docs/kbn_default_nav_ml.mdx index 46926535b1dc2..723aa76fe7479 100644 --- a/api_docs/kbn_default_nav_ml.mdx +++ b/api_docs/kbn_default_nav_ml.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-default-nav-ml title: "@kbn/default-nav-ml" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/default-nav-ml plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/default-nav-ml'] --- import kbnDefaultNavMlObj from './kbn_default_nav_ml.devdocs.json'; diff --git a/api_docs/kbn_dev_cli_errors.mdx b/api_docs/kbn_dev_cli_errors.mdx index 1e62370f1b7e9..46ffe58d4a72d 100644 --- a/api_docs/kbn_dev_cli_errors.mdx +++ b/api_docs/kbn_dev_cli_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-errors title: "@kbn/dev-cli-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-cli-errors plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-errors'] --- import kbnDevCliErrorsObj from './kbn_dev_cli_errors.devdocs.json'; diff --git a/api_docs/kbn_dev_cli_runner.mdx b/api_docs/kbn_dev_cli_runner.mdx index b744a4276ad00..cd2dd7e811430 100644 --- a/api_docs/kbn_dev_cli_runner.mdx +++ b/api_docs/kbn_dev_cli_runner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-runner title: "@kbn/dev-cli-runner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-cli-runner plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-runner'] --- import kbnDevCliRunnerObj from './kbn_dev_cli_runner.devdocs.json'; diff --git a/api_docs/kbn_dev_proc_runner.mdx b/api_docs/kbn_dev_proc_runner.mdx index 9cecd22fdc35f..6678205080986 100644 --- a/api_docs/kbn_dev_proc_runner.mdx +++ b/api_docs/kbn_dev_proc_runner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-proc-runner title: "@kbn/dev-proc-runner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-proc-runner plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-proc-runner'] --- import kbnDevProcRunnerObj from './kbn_dev_proc_runner.devdocs.json'; diff --git a/api_docs/kbn_dev_utils.mdx b/api_docs/kbn_dev_utils.mdx index 116e08ece3b4f..c71393e968224 100644 --- a/api_docs/kbn_dev_utils.mdx +++ b/api_docs/kbn_dev_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-utils title: "@kbn/dev-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-utils'] --- import kbnDevUtilsObj from './kbn_dev_utils.devdocs.json'; diff --git a/api_docs/kbn_discover_utils.mdx b/api_docs/kbn_discover_utils.mdx index 8e23446898bb5..2fc9d4f7a89b4 100644 --- a/api_docs/kbn_discover_utils.mdx +++ b/api_docs/kbn_discover_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-discover-utils title: "@kbn/discover-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/discover-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/discover-utils'] --- import kbnDiscoverUtilsObj from './kbn_discover_utils.devdocs.json'; diff --git a/api_docs/kbn_doc_links.mdx b/api_docs/kbn_doc_links.mdx index 22f5ecedc367f..136ba4b0c21c3 100644 --- a/api_docs/kbn_doc_links.mdx +++ b/api_docs/kbn_doc_links.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-doc-links title: "@kbn/doc-links" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/doc-links plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/doc-links'] --- import kbnDocLinksObj from './kbn_doc_links.devdocs.json'; diff --git a/api_docs/kbn_docs_utils.mdx b/api_docs/kbn_docs_utils.mdx index bc589ba587925..50b119ba41e99 100644 --- a/api_docs/kbn_docs_utils.mdx +++ b/api_docs/kbn_docs_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-docs-utils title: "@kbn/docs-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/docs-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/docs-utils'] --- import kbnDocsUtilsObj from './kbn_docs_utils.devdocs.json'; diff --git a/api_docs/kbn_dom_drag_drop.mdx b/api_docs/kbn_dom_drag_drop.mdx index bd8452f3a6102..b642b7946e3ea 100644 --- a/api_docs/kbn_dom_drag_drop.mdx +++ b/api_docs/kbn_dom_drag_drop.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dom-drag-drop title: "@kbn/dom-drag-drop" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dom-drag-drop plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dom-drag-drop'] --- import kbnDomDragDropObj from './kbn_dom_drag_drop.devdocs.json'; diff --git a/api_docs/kbn_ebt_tools.mdx b/api_docs/kbn_ebt_tools.mdx index f886d9e1f72fe..e81b4fa73f615 100644 --- a/api_docs/kbn_ebt_tools.mdx +++ b/api_docs/kbn_ebt_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ebt-tools title: "@kbn/ebt-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ebt-tools plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ebt-tools'] --- import kbnEbtToolsObj from './kbn_ebt_tools.devdocs.json'; diff --git a/api_docs/kbn_ecs.mdx b/api_docs/kbn_ecs.mdx index 531b4047d8102..f4d963b816f06 100644 --- a/api_docs/kbn_ecs.mdx +++ b/api_docs/kbn_ecs.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ecs title: "@kbn/ecs" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ecs plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ecs'] --- import kbnEcsObj from './kbn_ecs.devdocs.json'; diff --git a/api_docs/kbn_ecs_data_quality_dashboard.mdx b/api_docs/kbn_ecs_data_quality_dashboard.mdx index da4278b0f24e0..91210949e7616 100644 --- a/api_docs/kbn_ecs_data_quality_dashboard.mdx +++ b/api_docs/kbn_ecs_data_quality_dashboard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ecs-data-quality-dashboard title: "@kbn/ecs-data-quality-dashboard" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ecs-data-quality-dashboard plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ecs-data-quality-dashboard'] --- import kbnEcsDataQualityDashboardObj from './kbn_ecs_data_quality_dashboard.devdocs.json'; diff --git a/api_docs/kbn_elastic_assistant.mdx b/api_docs/kbn_elastic_assistant.mdx index 66e87a962a939..e4616e38d7bfa 100644 --- a/api_docs/kbn_elastic_assistant.mdx +++ b/api_docs/kbn_elastic_assistant.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-elastic-assistant title: "@kbn/elastic-assistant" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/elastic-assistant plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/elastic-assistant'] --- import kbnElasticAssistantObj from './kbn_elastic_assistant.devdocs.json'; diff --git a/api_docs/kbn_es.mdx b/api_docs/kbn_es.mdx index a21f177dd1087..c4d0ef6962312 100644 --- a/api_docs/kbn_es.mdx +++ b/api_docs/kbn_es.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es title: "@kbn/es" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es'] --- import kbnEsObj from './kbn_es.devdocs.json'; diff --git a/api_docs/kbn_es_archiver.mdx b/api_docs/kbn_es_archiver.mdx index dfee656986ba3..80762f37ca6f1 100644 --- a/api_docs/kbn_es_archiver.mdx +++ b/api_docs/kbn_es_archiver.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-archiver title: "@kbn/es-archiver" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-archiver plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-archiver'] --- import kbnEsArchiverObj from './kbn_es_archiver.devdocs.json'; diff --git a/api_docs/kbn_es_errors.mdx b/api_docs/kbn_es_errors.mdx index 472297928e76c..2907bf47ab431 100644 --- a/api_docs/kbn_es_errors.mdx +++ b/api_docs/kbn_es_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-errors title: "@kbn/es-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-errors plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-errors'] --- import kbnEsErrorsObj from './kbn_es_errors.devdocs.json'; diff --git a/api_docs/kbn_es_query.mdx b/api_docs/kbn_es_query.mdx index a4dd3216a0b01..71facb56985d0 100644 --- a/api_docs/kbn_es_query.mdx +++ b/api_docs/kbn_es_query.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-query title: "@kbn/es-query" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-query plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-query'] --- import kbnEsQueryObj from './kbn_es_query.devdocs.json'; diff --git a/api_docs/kbn_es_types.mdx b/api_docs/kbn_es_types.mdx index 90a8ed9e98666..7936b0f8f1f1c 100644 --- a/api_docs/kbn_es_types.mdx +++ b/api_docs/kbn_es_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-types title: "@kbn/es-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-types plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-types'] --- import kbnEsTypesObj from './kbn_es_types.devdocs.json'; diff --git a/api_docs/kbn_eslint_plugin_imports.mdx b/api_docs/kbn_eslint_plugin_imports.mdx index 7e3a61cda6952..1f5f4fc5b97be 100644 --- a/api_docs/kbn_eslint_plugin_imports.mdx +++ b/api_docs/kbn_eslint_plugin_imports.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-eslint-plugin-imports title: "@kbn/eslint-plugin-imports" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/eslint-plugin-imports plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/eslint-plugin-imports'] --- import kbnEslintPluginImportsObj from './kbn_eslint_plugin_imports.devdocs.json'; diff --git a/api_docs/kbn_event_annotation_common.mdx b/api_docs/kbn_event_annotation_common.mdx index 6a2505c663d65..908935fb3ad9d 100644 --- a/api_docs/kbn_event_annotation_common.mdx +++ b/api_docs/kbn_event_annotation_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-event-annotation-common title: "@kbn/event-annotation-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/event-annotation-common plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/event-annotation-common'] --- import kbnEventAnnotationCommonObj from './kbn_event_annotation_common.devdocs.json'; diff --git a/api_docs/kbn_event_annotation_components.mdx b/api_docs/kbn_event_annotation_components.mdx index 4ff534569925c..37a70ef64fbf0 100644 --- a/api_docs/kbn_event_annotation_components.mdx +++ b/api_docs/kbn_event_annotation_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-event-annotation-components title: "@kbn/event-annotation-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/event-annotation-components plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/event-annotation-components'] --- import kbnEventAnnotationComponentsObj from './kbn_event_annotation_components.devdocs.json'; diff --git a/api_docs/kbn_expandable_flyout.mdx b/api_docs/kbn_expandable_flyout.mdx index 9f07c4635c4a7..f5830fef0e457 100644 --- a/api_docs/kbn_expandable_flyout.mdx +++ b/api_docs/kbn_expandable_flyout.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-expandable-flyout title: "@kbn/expandable-flyout" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/expandable-flyout plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/expandable-flyout'] --- import kbnExpandableFlyoutObj from './kbn_expandable_flyout.devdocs.json'; diff --git a/api_docs/kbn_field_types.mdx b/api_docs/kbn_field_types.mdx index 69ab90341b498..172d1601be401 100644 --- a/api_docs/kbn_field_types.mdx +++ b/api_docs/kbn_field_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-field-types title: "@kbn/field-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/field-types plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/field-types'] --- import kbnFieldTypesObj from './kbn_field_types.devdocs.json'; diff --git a/api_docs/kbn_find_used_node_modules.mdx b/api_docs/kbn_find_used_node_modules.mdx index f17ad7ae6202e..92fbe0bbd3f1e 100644 --- a/api_docs/kbn_find_used_node_modules.mdx +++ b/api_docs/kbn_find_used_node_modules.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-find-used-node-modules title: "@kbn/find-used-node-modules" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/find-used-node-modules plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/find-used-node-modules'] --- import kbnFindUsedNodeModulesObj from './kbn_find_used_node_modules.devdocs.json'; diff --git a/api_docs/kbn_ftr_common_functional_services.mdx b/api_docs/kbn_ftr_common_functional_services.mdx index 40777ac9193b4..286efea1b631c 100644 --- a/api_docs/kbn_ftr_common_functional_services.mdx +++ b/api_docs/kbn_ftr_common_functional_services.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ftr-common-functional-services title: "@kbn/ftr-common-functional-services" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ftr-common-functional-services plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ftr-common-functional-services'] --- import kbnFtrCommonFunctionalServicesObj from './kbn_ftr_common_functional_services.devdocs.json'; diff --git a/api_docs/kbn_generate.mdx b/api_docs/kbn_generate.mdx index e343b48f3a7fc..01b83dc267fc5 100644 --- a/api_docs/kbn_generate.mdx +++ b/api_docs/kbn_generate.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-generate title: "@kbn/generate" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/generate plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate'] --- import kbnGenerateObj from './kbn_generate.devdocs.json'; diff --git a/api_docs/kbn_generate_console_definitions.mdx b/api_docs/kbn_generate_console_definitions.mdx index 9843c4d219c1e..9b98854e98509 100644 --- a/api_docs/kbn_generate_console_definitions.mdx +++ b/api_docs/kbn_generate_console_definitions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-generate-console-definitions title: "@kbn/generate-console-definitions" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/generate-console-definitions plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate-console-definitions'] --- import kbnGenerateConsoleDefinitionsObj from './kbn_generate_console_definitions.devdocs.json'; diff --git a/api_docs/kbn_generate_csv.mdx b/api_docs/kbn_generate_csv.mdx index 79e1f9c19fb71..9fe22e68f2e53 100644 --- a/api_docs/kbn_generate_csv.mdx +++ b/api_docs/kbn_generate_csv.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-generate-csv title: "@kbn/generate-csv" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/generate-csv plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate-csv'] --- import kbnGenerateCsvObj from './kbn_generate_csv.devdocs.json'; diff --git a/api_docs/kbn_generate_csv_types.mdx b/api_docs/kbn_generate_csv_types.mdx index b9702b01d7c45..f132075bec29d 100644 --- a/api_docs/kbn_generate_csv_types.mdx +++ b/api_docs/kbn_generate_csv_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-generate-csv-types title: "@kbn/generate-csv-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/generate-csv-types plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate-csv-types'] --- import kbnGenerateCsvTypesObj from './kbn_generate_csv_types.devdocs.json'; diff --git a/api_docs/kbn_guided_onboarding.mdx b/api_docs/kbn_guided_onboarding.mdx index 071db8d4ad27d..a0cf51023448f 100644 --- a/api_docs/kbn_guided_onboarding.mdx +++ b/api_docs/kbn_guided_onboarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-guided-onboarding title: "@kbn/guided-onboarding" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/guided-onboarding plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/guided-onboarding'] --- import kbnGuidedOnboardingObj from './kbn_guided_onboarding.devdocs.json'; diff --git a/api_docs/kbn_handlebars.mdx b/api_docs/kbn_handlebars.mdx index ac79c85fa8ec6..a68b7d49ca68c 100644 --- a/api_docs/kbn_handlebars.mdx +++ b/api_docs/kbn_handlebars.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-handlebars title: "@kbn/handlebars" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/handlebars plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/handlebars'] --- import kbnHandlebarsObj from './kbn_handlebars.devdocs.json'; diff --git a/api_docs/kbn_hapi_mocks.mdx b/api_docs/kbn_hapi_mocks.mdx index dcc6fb20b9bcb..8bd961931dbdb 100644 --- a/api_docs/kbn_hapi_mocks.mdx +++ b/api_docs/kbn_hapi_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-hapi-mocks title: "@kbn/hapi-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/hapi-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/hapi-mocks'] --- import kbnHapiMocksObj from './kbn_hapi_mocks.devdocs.json'; diff --git a/api_docs/kbn_health_gateway_server.mdx b/api_docs/kbn_health_gateway_server.mdx index c8634f2261ce5..2be1caed5f96b 100644 --- a/api_docs/kbn_health_gateway_server.mdx +++ b/api_docs/kbn_health_gateway_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-health-gateway-server title: "@kbn/health-gateway-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/health-gateway-server plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/health-gateway-server'] --- import kbnHealthGatewayServerObj from './kbn_health_gateway_server.devdocs.json'; diff --git a/api_docs/kbn_home_sample_data_card.mdx b/api_docs/kbn_home_sample_data_card.mdx index d31168b65d591..a4940591dad6e 100644 --- a/api_docs/kbn_home_sample_data_card.mdx +++ b/api_docs/kbn_home_sample_data_card.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-home-sample-data-card title: "@kbn/home-sample-data-card" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/home-sample-data-card plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/home-sample-data-card'] --- import kbnHomeSampleDataCardObj from './kbn_home_sample_data_card.devdocs.json'; diff --git a/api_docs/kbn_home_sample_data_tab.mdx b/api_docs/kbn_home_sample_data_tab.mdx index d0fe5ae21bbd3..3806b3ccc74f4 100644 --- a/api_docs/kbn_home_sample_data_tab.mdx +++ b/api_docs/kbn_home_sample_data_tab.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-home-sample-data-tab title: "@kbn/home-sample-data-tab" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/home-sample-data-tab plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/home-sample-data-tab'] --- import kbnHomeSampleDataTabObj from './kbn_home_sample_data_tab.devdocs.json'; diff --git a/api_docs/kbn_i18n.mdx b/api_docs/kbn_i18n.mdx index 6365ba964cd7f..9f4326312c679 100644 --- a/api_docs/kbn_i18n.mdx +++ b/api_docs/kbn_i18n.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-i18n title: "@kbn/i18n" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/i18n plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n'] --- import kbnI18nObj from './kbn_i18n.devdocs.json'; diff --git a/api_docs/kbn_i18n_react.mdx b/api_docs/kbn_i18n_react.mdx index 83826ec32c075..a7c3193494afc 100644 --- a/api_docs/kbn_i18n_react.mdx +++ b/api_docs/kbn_i18n_react.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-i18n-react title: "@kbn/i18n-react" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/i18n-react plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n-react'] --- import kbnI18nReactObj from './kbn_i18n_react.devdocs.json'; diff --git a/api_docs/kbn_import_resolver.mdx b/api_docs/kbn_import_resolver.mdx index 4defa432ad86e..7555b145fd94a 100644 --- a/api_docs/kbn_import_resolver.mdx +++ b/api_docs/kbn_import_resolver.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-import-resolver title: "@kbn/import-resolver" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/import-resolver plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/import-resolver'] --- import kbnImportResolverObj from './kbn_import_resolver.devdocs.json'; diff --git a/api_docs/kbn_infra_forge.mdx b/api_docs/kbn_infra_forge.mdx index e02b981ea3546..089d05d8f7d78 100644 --- a/api_docs/kbn_infra_forge.mdx +++ b/api_docs/kbn_infra_forge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-infra-forge title: "@kbn/infra-forge" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/infra-forge plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/infra-forge'] --- import kbnInfraForgeObj from './kbn_infra_forge.devdocs.json'; diff --git a/api_docs/kbn_interpreter.mdx b/api_docs/kbn_interpreter.mdx index 4abcf85aaf870..f8d89d50711a0 100644 --- a/api_docs/kbn_interpreter.mdx +++ b/api_docs/kbn_interpreter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-interpreter title: "@kbn/interpreter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/interpreter plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/interpreter'] --- import kbnInterpreterObj from './kbn_interpreter.devdocs.json'; diff --git a/api_docs/kbn_io_ts_utils.mdx b/api_docs/kbn_io_ts_utils.mdx index f0e6c22e99717..5dd1cc44caa8d 100644 --- a/api_docs/kbn_io_ts_utils.mdx +++ b/api_docs/kbn_io_ts_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-io-ts-utils title: "@kbn/io-ts-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/io-ts-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/io-ts-utils'] --- import kbnIoTsUtilsObj from './kbn_io_ts_utils.devdocs.json'; diff --git a/api_docs/kbn_jest_serializers.mdx b/api_docs/kbn_jest_serializers.mdx index c25eb7c8bf940..17f274a3728b5 100644 --- a/api_docs/kbn_jest_serializers.mdx +++ b/api_docs/kbn_jest_serializers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-jest-serializers title: "@kbn/jest-serializers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/jest-serializers plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/jest-serializers'] --- import kbnJestSerializersObj from './kbn_jest_serializers.devdocs.json'; diff --git a/api_docs/kbn_journeys.devdocs.json b/api_docs/kbn_journeys.devdocs.json index 24a4280bfdb1a..fe8ff4a3f4d5e 100644 --- a/api_docs/kbn_journeys.devdocs.json +++ b/api_docs/kbn_journeys.devdocs.json @@ -276,13 +276,7 @@ ], "signature": [ "({ getService }: ", - { - "pluginId": "@kbn/ftr-common-functional-services", - "scope": "common", - "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", - "section": "def-common.FtrProviderContext", - "text": "FtrProviderContext" - }, + "FtrProviderContext", ") => void" ], "path": "packages/kbn-journeys/journey/journey.ts", @@ -297,13 +291,7 @@ "label": "{ getService }", "description": [], "signature": [ - { - "pluginId": "@kbn/ftr-common-functional-services", - "scope": "common", - "docId": "kibKbnFtrCommonFunctionalServicesPluginApi", - "section": "def-common.FtrProviderContext", - "text": "FtrProviderContext" - } + "FtrProviderContext" ], "path": "packages/kbn-journeys/journey/journey.ts", "deprecated": false, diff --git a/api_docs/kbn_journeys.mdx b/api_docs/kbn_journeys.mdx index e94e0c092caae..60109153e09ab 100644 --- a/api_docs/kbn_journeys.mdx +++ b/api_docs/kbn_journeys.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-journeys title: "@kbn/journeys" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/journeys plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/journeys'] --- import kbnJourneysObj from './kbn_journeys.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kiban | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 85 | 0 | 77 | 5 | +| 85 | 0 | 77 | 6 | ## Common diff --git a/api_docs/kbn_json_ast.mdx b/api_docs/kbn_json_ast.mdx index 2e7231863ff76..92e4e3b55fd0a 100644 --- a/api_docs/kbn_json_ast.mdx +++ b/api_docs/kbn_json_ast.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-json-ast title: "@kbn/json-ast" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/json-ast plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/json-ast'] --- import kbnJsonAstObj from './kbn_json_ast.devdocs.json'; diff --git a/api_docs/kbn_kibana_manifest_schema.mdx b/api_docs/kbn_kibana_manifest_schema.mdx index 8fd5a7ef11ae4..4884895d9a740 100644 --- a/api_docs/kbn_kibana_manifest_schema.mdx +++ b/api_docs/kbn_kibana_manifest_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-kibana-manifest-schema title: "@kbn/kibana-manifest-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/kibana-manifest-schema plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/kibana-manifest-schema'] --- import kbnKibanaManifestSchemaObj from './kbn_kibana_manifest_schema.devdocs.json'; diff --git a/api_docs/kbn_language_documentation_popover.mdx b/api_docs/kbn_language_documentation_popover.mdx index bdcf9b2f52415..8031cb830ad63 100644 --- a/api_docs/kbn_language_documentation_popover.mdx +++ b/api_docs/kbn_language_documentation_popover.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-language-documentation-popover title: "@kbn/language-documentation-popover" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/language-documentation-popover plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/language-documentation-popover'] --- import kbnLanguageDocumentationPopoverObj from './kbn_language_documentation_popover.devdocs.json'; diff --git a/api_docs/kbn_lens_embeddable_utils.mdx b/api_docs/kbn_lens_embeddable_utils.mdx index 9489ac900110d..d06fc4e82f387 100644 --- a/api_docs/kbn_lens_embeddable_utils.mdx +++ b/api_docs/kbn_lens_embeddable_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-lens-embeddable-utils title: "@kbn/lens-embeddable-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/lens-embeddable-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/lens-embeddable-utils'] --- import kbnLensEmbeddableUtilsObj from './kbn_lens_embeddable_utils.devdocs.json'; diff --git a/api_docs/kbn_logging.mdx b/api_docs/kbn_logging.mdx index a0146c7960242..0da5205f99557 100644 --- a/api_docs/kbn_logging.mdx +++ b/api_docs/kbn_logging.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-logging title: "@kbn/logging" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/logging plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging'] --- import kbnLoggingObj from './kbn_logging.devdocs.json'; diff --git a/api_docs/kbn_logging_mocks.mdx b/api_docs/kbn_logging_mocks.mdx index b96907067c4db..c8931bc3b557b 100644 --- a/api_docs/kbn_logging_mocks.mdx +++ b/api_docs/kbn_logging_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-logging-mocks title: "@kbn/logging-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/logging-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging-mocks'] --- import kbnLoggingMocksObj from './kbn_logging_mocks.devdocs.json'; diff --git a/api_docs/kbn_managed_vscode_config.mdx b/api_docs/kbn_managed_vscode_config.mdx index e9feca276bc8e..b7e654a927bb1 100644 --- a/api_docs/kbn_managed_vscode_config.mdx +++ b/api_docs/kbn_managed_vscode_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-managed-vscode-config title: "@kbn/managed-vscode-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/managed-vscode-config plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/managed-vscode-config'] --- import kbnManagedVscodeConfigObj from './kbn_managed_vscode_config.devdocs.json'; diff --git a/api_docs/kbn_management_cards_navigation.mdx b/api_docs/kbn_management_cards_navigation.mdx index ec1bcf3885a36..c323548b3de0b 100644 --- a/api_docs/kbn_management_cards_navigation.mdx +++ b/api_docs/kbn_management_cards_navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-cards-navigation title: "@kbn/management-cards-navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-cards-navigation plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-cards-navigation'] --- import kbnManagementCardsNavigationObj from './kbn_management_cards_navigation.devdocs.json'; diff --git a/api_docs/kbn_management_settings_components_field_category.devdocs.json b/api_docs/kbn_management_settings_components_field_category.devdocs.json new file mode 100644 index 0000000000000..5489d44497e63 --- /dev/null +++ b/api_docs/kbn_management_settings_components_field_category.devdocs.json @@ -0,0 +1,569 @@ +{ + "id": "@kbn/management-settings-components-field-category", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.FieldCategories", + "type": "Function", + "tags": [], + "label": "FieldCategories", + "description": [ + "\nConvenience component for displaying a set of {@link FieldCategory} components, given\na set of categorized fields.\n" + ], + "signature": [ + "({ categorizedFields, unsavedChanges, onClearQuery, isSavingEnabled, onFieldChange, }: ", + { + "pluginId": "@kbn/management-settings-components-field-category", + "scope": "common", + "docId": "kibKbnManagementSettingsComponentsFieldCategoryPluginApi", + "section": "def-common.FieldCategoriesProps", + "text": "FieldCategoriesProps" + }, + ") => JSX.Element" + ], + "path": "packages/kbn-management/settings/components/field_category/categories.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.FieldCategories.$1", + "type": "Object", + "tags": [], + "label": "{\n categorizedFields,\n unsavedChanges = {},\n onClearQuery,\n isSavingEnabled,\n onFieldChange,\n}", + "description": [], + "signature": [ + { + "pluginId": "@kbn/management-settings-components-field-category", + "scope": "common", + "docId": "kibKbnManagementSettingsComponentsFieldCategoryPluginApi", + "section": "def-common.FieldCategoriesProps", + "text": "FieldCategoriesProps" + } + ], + "path": "packages/kbn-management/settings/components/field_category/categories.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.FieldCategory", + "type": "Function", + "tags": [], + "label": "FieldCategory", + "description": [ + "\nComponent for displaying a container of fields pertaining to a single\ncategory." + ], + "signature": [ + "(props: ", + { + "pluginId": "@kbn/management-settings-components-field-category", + "scope": "common", + "docId": "kibKbnManagementSettingsComponentsFieldCategoryPluginApi", + "section": "def-common.FieldCategoryProps", + "text": "FieldCategoryProps" + }, + ") => JSX.Element" + ], + "path": "packages/kbn-management/settings/components/field_category/category.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.FieldCategory.$1", + "type": "Object", + "tags": [], + "label": "props", + "description": [ + "- the props to pass to the {@link FieldCategory } component." + ], + "signature": [ + { + "pluginId": "@kbn/management-settings-components-field-category", + "scope": "common", + "docId": "kibKbnManagementSettingsComponentsFieldCategoryPluginApi", + "section": "def-common.FieldCategoryProps", + "text": "FieldCategoryProps" + } + ], + "path": "packages/kbn-management/settings/components/field_category/category.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.FieldCategoryKibanaProvider", + "type": "Function", + "tags": [], + "label": "FieldCategoryKibanaProvider", + "description": [ + "\nKibana-specific Provider that maps Kibana plugins and services to a {@link FieldCategoryProvider}." + ], + "signature": [ + "React.FunctionComponent<", + { + "pluginId": "@kbn/management-settings-components-field-row", + "scope": "common", + "docId": "kibKbnManagementSettingsComponentsFieldRowPluginApi", + "section": "def-common.FieldRowKibanaDependencies", + "text": "FieldRowKibanaDependencies" + }, + ">" + ], + "path": "packages/kbn-management/settings/components/field_category/services.tsx", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.FieldCategoryKibanaProvider.$1", + "type": "CompoundType", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "P & { children?: React.ReactNode; }" + ], + "path": "node_modules/@types/react/index.d.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.FieldCategoryKibanaProvider.$2", + "type": "Any", + "tags": [], + "label": "context", + "description": [], + "signature": [ + "any" + ], + "path": "node_modules/@types/react/index.d.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.FieldCategoryProvider", + "type": "Function", + "tags": [], + "label": "FieldCategoryProvider", + "description": [ + "\nReact Provider that provides services to a {@link FieldCategory} component and its dependents." + ], + "signature": [ + "({ children, ...services }: ", + { + "pluginId": "@kbn/management-settings-components-field-row", + "scope": "common", + "docId": "kibKbnManagementSettingsComponentsFieldRowPluginApi", + "section": "def-common.FieldRowProviderProps", + "text": "FieldRowProviderProps" + }, + ") => JSX.Element" + ], + "path": "packages/kbn-management/settings/components/field_category/services.tsx", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.FieldCategoryProvider.$1", + "type": "Object", + "tags": [], + "label": "__0", + "description": [], + "signature": [ + { + "pluginId": "@kbn/management-settings-components-field-row", + "scope": "common", + "docId": "kibKbnManagementSettingsComponentsFieldRowPluginApi", + "section": "def-common.FieldRowProviderProps", + "text": "FieldRowProviderProps" + } + ], + "path": "packages/kbn-management/settings/components/field_row/services.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.ClearQueryLinkProps", + "type": "Interface", + "tags": [], + "label": "ClearQueryLinkProps", + "description": [ + "\nProps for the {@link ClearQueryLink} component." + ], + "path": "packages/kbn-management/settings/components/field_category/clear_query_link.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.ClearQueryLinkProps.fieldCount", + "type": "number", + "tags": [], + "label": "fieldCount", + "description": [ + "The total number of fields in the category." + ], + "path": "packages/kbn-management/settings/components/field_category/clear_query_link.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.ClearQueryLinkProps.displayCount", + "type": "number", + "tags": [], + "label": "displayCount", + "description": [ + "The number of fields currently being displayed." + ], + "path": "packages/kbn-management/settings/components/field_category/clear_query_link.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.ClearQueryLinkProps.onClearQuery", + "type": "Function", + "tags": [], + "label": "onClearQuery", + "description": [ + "Handler to invoke when clearing the current filtering query." + ], + "signature": [ + "() => void" + ], + "path": "packages/kbn-management/settings/components/field_category/clear_query_link.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.FieldCategoriesProps", + "type": "Interface", + "tags": [], + "label": "FieldCategoriesProps", + "description": [ + "\nProps for the {@link FieldCategories} component." + ], + "signature": [ + { + "pluginId": "@kbn/management-settings-components-field-category", + "scope": "common", + "docId": "kibKbnManagementSettingsComponentsFieldCategoryPluginApi", + "section": "def-common.FieldCategoriesProps", + "text": "FieldCategoriesProps" + }, + " extends Pick<", + { + "pluginId": "@kbn/management-settings-components-field-category", + "scope": "common", + "docId": "kibKbnManagementSettingsComponentsFieldCategoryPluginApi", + "section": "def-common.FieldCategoryProps", + "text": "FieldCategoryProps" + }, + ", \"onClearQuery\">,Pick<", + { + "pluginId": "@kbn/management-settings-components-field-row", + "scope": "common", + "docId": "kibKbnManagementSettingsComponentsFieldRowPluginApi", + "section": "def-common.FieldRowProps", + "text": "FieldRowProps" + }, + ", \"onFieldChange\" | \"isSavingEnabled\">" + ], + "path": "packages/kbn-management/settings/components/field_category/categories.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.FieldCategoriesProps.categorizedFields", + "type": "Object", + "tags": [], + "label": "categorizedFields", + "description": [ + "Categorized fields for display." + ], + "signature": [ + { + "pluginId": "@kbn/management-settings-types", + "scope": "common", + "docId": "kibKbnManagementSettingsTypesPluginApi", + "section": "def-common.CategorizedFields", + "text": "CategorizedFields" + } + ], + "path": "packages/kbn-management/settings/components/field_category/categories.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.FieldCategoriesProps.unsavedChanges", + "type": "Object", + "tags": [], + "label": "unsavedChanges", + "description": [ + "And unsaved changes currently managed by the parent component." + ], + "signature": [ + { + "pluginId": "@kbn/management-settings-types", + "scope": "common", + "docId": "kibKbnManagementSettingsTypesPluginApi", + "section": "def-common.UnsavedFieldChanges", + "text": "UnsavedFieldChanges" + }, + " | undefined" + ], + "path": "packages/kbn-management/settings/components/field_category/categories.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.FieldCategoryProps", + "type": "Interface", + "tags": [], + "label": "FieldCategoryProps", + "description": [ + "\nProps for a {@link FieldCategory} component." + ], + "signature": [ + { + "pluginId": "@kbn/management-settings-components-field-category", + "scope": "common", + "docId": "kibKbnManagementSettingsComponentsFieldCategoryPluginApi", + "section": "def-common.FieldCategoryProps", + "text": "FieldCategoryProps" + }, + " extends Pick<", + { + "pluginId": "@kbn/management-settings-components-field-category", + "scope": "common", + "docId": "kibKbnManagementSettingsComponentsFieldCategoryPluginApi", + "section": "def-common.ClearQueryLinkProps", + "text": "ClearQueryLinkProps" + }, + ", \"onClearQuery\" | \"fieldCount\">" + ], + "path": "packages/kbn-management/settings/components/field_category/category.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.FieldCategoryProps.category", + "type": "string", + "tags": [], + "label": "category", + "description": [ + "The name of the category." + ], + "path": "packages/kbn-management/settings/components/field_category/category.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.FieldCategoryProps.children", + "type": "CompoundType", + "tags": [], + "label": "children", + "description": [ + "Children-- should be {@link FieldRow} components." + ], + "signature": [ + "React.ReactElement<", + { + "pluginId": "@kbn/management-settings-components-field-row", + "scope": "common", + "docId": "kibKbnManagementSettingsComponentsFieldRowPluginApi", + "section": "def-common.FieldRowProps", + "text": "FieldRowProps" + }, + ", \"FieldRow\"> | React.ReactElement<", + { + "pluginId": "@kbn/management-settings-components-field-row", + "scope": "common", + "docId": "kibKbnManagementSettingsComponentsFieldRowPluginApi", + "section": "def-common.FieldRowProps", + "text": "FieldRowProps" + }, + ", \"FieldRow\">[]" + ], + "path": "packages/kbn-management/settings/components/field_category/category.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.FieldCategoryProviderProps", + "type": "Interface", + "tags": [], + "label": "FieldCategoryProviderProps", + "description": [ + "\nProps for {@link FieldCategoryProvider}." + ], + "signature": [ + { + "pluginId": "@kbn/management-settings-components-field-category", + "scope": "common", + "docId": "kibKbnManagementSettingsComponentsFieldCategoryPluginApi", + "section": "def-common.FieldCategoryProviderProps", + "text": "FieldCategoryProviderProps" + }, + " extends ", + { + "pluginId": "@kbn/management-settings-components-field-row", + "scope": "common", + "docId": "kibKbnManagementSettingsComponentsFieldRowPluginApi", + "section": "def-common.FieldRowServices", + "text": "FieldRowServices" + } + ], + "path": "packages/kbn-management/settings/components/field_category/services.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.FieldCategoryProviderProps.children", + "type": "CompoundType", + "tags": [], + "label": "children", + "description": [], + "signature": [ + "boolean | React.ReactChild | React.ReactFragment | React.ReactPortal | null | undefined" + ], + "path": "packages/kbn-management/settings/components/field_category/services.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.FieldCategoryKibanaDependencies", + "type": "Type", + "tags": [], + "label": "FieldCategoryKibanaDependencies", + "description": [ + "\nAn interface containing a collection of Kibana plugins and services required to\nrender a {@link FieldCategory} component and its dependents." + ], + "signature": [ + { + "pluginId": "@kbn/management-settings-components-field-row", + "scope": "common", + "docId": "kibKbnManagementSettingsComponentsFieldRowPluginApi", + "section": "def-common.KibanaDependencies", + "text": "KibanaDependencies" + }, + " & ", + { + "pluginId": "@kbn/management-settings-components-field-input", + "scope": "common", + "docId": "kibKbnManagementSettingsComponentsFieldInputPluginApi", + "section": "def-common.FieldInputKibanaDependencies", + "text": "FieldInputKibanaDependencies" + } + ], + "path": "packages/kbn-management/settings/components/field_category/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/management-settings-components-field-category", + "id": "def-common.FieldCategoryServices", + "type": "Type", + "tags": [], + "label": "FieldCategoryServices", + "description": [ + "\nContextual services used by a {@link FieldCategory} component and its dependents." + ], + "signature": [ + { + "pluginId": "@kbn/management-settings-components-field-input", + "scope": "common", + "docId": "kibKbnManagementSettingsComponentsFieldInputPluginApi", + "section": "def-common.FieldInputServices", + "text": "FieldInputServices" + }, + " & ", + { + "pluginId": "@kbn/management-settings-components-field-row", + "scope": "common", + "docId": "kibKbnManagementSettingsComponentsFieldRowPluginApi", + "section": "def-common.Services", + "text": "Services" + } + ], + "path": "packages/kbn-management/settings/components/field_category/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_management_settings_components_field_category.mdx b/api_docs/kbn_management_settings_components_field_category.mdx new file mode 100644 index 0000000000000..f60ad79408a16 --- /dev/null +++ b/api_docs/kbn_management_settings_components_field_category.mdx @@ -0,0 +1,36 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnManagementSettingsComponentsFieldCategoryPluginApi +slug: /kibana-dev-docs/api/kbn-management-settings-components-field-category +title: "@kbn/management-settings-components-field-category" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/management-settings-components-field-category plugin +date: 2023-09-29 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-components-field-category'] +--- +import kbnManagementSettingsComponentsFieldCategoryObj from './kbn_management_settings_components_field_category.devdocs.json'; + + + +Contact [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 23 | 0 | 3 | 0 | + +## Common + +### Functions + + +### Interfaces + + +### Consts, variables and types + + diff --git a/api_docs/kbn_management_settings_components_field_input.devdocs.json b/api_docs/kbn_management_settings_components_field_input.devdocs.json index 3209874b93880..0111313c651b3 100644 --- a/api_docs/kbn_management_settings_components_field_input.devdocs.json +++ b/api_docs/kbn_management_settings_components_field_input.devdocs.json @@ -193,12 +193,12 @@ }, { "parentPluginId": "@kbn/management-settings-components-field-input", - "id": "def-common.FieldInputProps.onChange", + "id": "def-common.FieldInputProps.onInputChange", "type": "Function", "tags": [], - "label": "onChange", + "label": "onInputChange", "description": [ - "The `onChange` handler for the input." + "The `onInputChange` handler for the input." ], "signature": [ "(change?: ", @@ -218,7 +218,7 @@ "children": [ { "parentPluginId": "@kbn/management-settings-components-field-input", - "id": "def-common.FieldInputProps.onChange.$1", + "id": "def-common.FieldInputProps.onInputChange.$1", "type": "Object", "tags": [], "label": "change", @@ -410,12 +410,12 @@ }, { "parentPluginId": "@kbn/management-settings-components-field-input", - "id": "def-common.InputProps.onChange", + "id": "def-common.InputProps.onInputChange", "type": "Function", "tags": [], - "label": "onChange", + "label": "onInputChange", "description": [ - "The `onChange` handler." + "The `onInputChange` handler." ], "signature": [ "(change?: ", @@ -435,7 +435,7 @@ "children": [ { "parentPluginId": "@kbn/management-settings-components-field-input", - "id": "def-common.InputProps.onChange.$1", + "id": "def-common.InputProps.onInputChange.$1", "type": "Object", "tags": [], "label": "change", diff --git a/api_docs/kbn_management_settings_components_field_input.mdx b/api_docs/kbn_management_settings_components_field_input.mdx index 148678fdfa01f..b8ca13d665b69 100644 --- a/api_docs/kbn_management_settings_components_field_input.mdx +++ b/api_docs/kbn_management_settings_components_field_input.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-components-field-input title: "@kbn/management-settings-components-field-input" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-components-field-input plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-components-field-input'] --- import kbnManagementSettingsComponentsFieldInputObj from './kbn_management_settings_components_field_input.devdocs.json'; diff --git a/api_docs/kbn_management_settings_components_field_row.devdocs.json b/api_docs/kbn_management_settings_components_field_row.devdocs.json index c1f7c49ed5c67..e41adc6ff1164 100644 --- a/api_docs/kbn_management_settings_components_field_row.devdocs.json +++ b/api_docs/kbn_management_settings_components_field_row.devdocs.json @@ -224,12 +224,12 @@ }, { "parentPluginId": "@kbn/management-settings-components-field-row", - "id": "def-common.FieldRowProps.onChange", + "id": "def-common.FieldRowProps.onFieldChange", "type": "Function", "tags": [], - "label": "onChange", + "label": "onFieldChange", "description": [ - "The {@link OnChangeFn} handler." + "The {@link OnInputChangeFn} handler." ], "signature": [ "(id: string, change?: ", @@ -257,18 +257,18 @@ "children": [ { "parentPluginId": "@kbn/management-settings-components-field-row", - "id": "def-common.FieldRowProps.onChange.$1", + "id": "def-common.FieldRowProps.onFieldChange.$1", "type": "string", "tags": [], "label": "id", "description": [], - "path": "packages/kbn-management/settings/components/field_row/types.ts", + "path": "packages/kbn-management/settings/types/index.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/management-settings-components-field-row", - "id": "def-common.FieldRowProps.onChange.$2", + "id": "def-common.FieldRowProps.onFieldChange.$2", "type": "Object", "tags": [], "label": "change", @@ -283,7 +283,7 @@ }, " | undefined" ], - "path": "packages/kbn-management/settings/components/field_row/types.ts", + "path": "packages/kbn-management/settings/types/index.ts", "deprecated": false, "trackAdoption": false } @@ -530,70 +530,6 @@ "deprecated": false, "trackAdoption": false, "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/management-settings-components-field-row", - "id": "def-common.RowOnChangeFn", - "type": "Type", - "tags": [], - "label": "RowOnChangeFn", - "description": [ - "\nAn `onChange` handler for a {@link FieldRow} component." - ], - "signature": [ - "(id: string, change?: ", - { - "pluginId": "@kbn/management-settings-types", - "scope": "common", - "docId": "kibKbnManagementSettingsTypesPluginApi", - "section": "def-common.UnsavedFieldChange", - "text": "UnsavedFieldChange" - }, - " | undefined) => void" - ], - "path": "packages/kbn-management/settings/components/field_row/types.ts", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/management-settings-components-field-row", - "id": "def-common.RowOnChangeFn.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [ - "A unique id corresponding to the particular setting being changed." - ], - "path": "packages/kbn-management/settings/components/field_row/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/management-settings-components-field-row", - "id": "def-common.RowOnChangeFn.$2", - "type": "Object", - "tags": [], - "label": "change", - "description": [ - "The {@link UnsavedFieldChange } corresponding to any unsaved change to the field." - ], - "signature": [ - { - "pluginId": "@kbn/management-settings-types", - "scope": "common", - "docId": "kibKbnManagementSettingsTypesPluginApi", - "section": "def-common.UnsavedFieldChange", - "text": "UnsavedFieldChange" - }, - " | undefined" - ], - "path": "packages/kbn-management/settings/components/field_row/types.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false } ], "objects": [] diff --git a/api_docs/kbn_management_settings_components_field_row.mdx b/api_docs/kbn_management_settings_components_field_row.mdx index 6fe1b473d3b0c..623b3aa9bf02e 100644 --- a/api_docs/kbn_management_settings_components_field_row.mdx +++ b/api_docs/kbn_management_settings_components_field_row.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-components-field-row title: "@kbn/management-settings-components-field-row" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-components-field-row plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-components-field-row'] --- import kbnManagementSettingsComponentsFieldRowObj from './kbn_management_settings_components_field_row.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/platform-deployment-management](https://github.com/orgs/elasti | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 26 | 0 | 7 | 0 | +| 23 | 0 | 7 | 0 | ## Common diff --git a/api_docs/kbn_management_settings_components_form.mdx b/api_docs/kbn_management_settings_components_form.mdx index 91c5441bebc84..c51ef707e7061 100644 --- a/api_docs/kbn_management_settings_components_form.mdx +++ b/api_docs/kbn_management_settings_components_form.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-components-form title: "@kbn/management-settings-components-form" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-components-form plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-components-form'] --- import kbnManagementSettingsComponentsFormObj from './kbn_management_settings_components_form.devdocs.json'; diff --git a/api_docs/kbn_management_settings_field_definition.mdx b/api_docs/kbn_management_settings_field_definition.mdx index 23a1088ee7ef3..9e6532a974c2a 100644 --- a/api_docs/kbn_management_settings_field_definition.mdx +++ b/api_docs/kbn_management_settings_field_definition.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-field-definition title: "@kbn/management-settings-field-definition" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-field-definition plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-field-definition'] --- import kbnManagementSettingsFieldDefinitionObj from './kbn_management_settings_field_definition.devdocs.json'; diff --git a/api_docs/kbn_management_settings_ids.mdx b/api_docs/kbn_management_settings_ids.mdx index 30bd79f1b35ae..e59878f21b59a 100644 --- a/api_docs/kbn_management_settings_ids.mdx +++ b/api_docs/kbn_management_settings_ids.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-ids title: "@kbn/management-settings-ids" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-ids plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-ids'] --- import kbnManagementSettingsIdsObj from './kbn_management_settings_ids.devdocs.json'; diff --git a/api_docs/kbn_management_settings_section_registry.mdx b/api_docs/kbn_management_settings_section_registry.mdx index dd8052acb1b98..0ff86124acdb0 100644 --- a/api_docs/kbn_management_settings_section_registry.mdx +++ b/api_docs/kbn_management_settings_section_registry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-section-registry title: "@kbn/management-settings-section-registry" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-section-registry plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-section-registry'] --- import kbnManagementSettingsSectionRegistryObj from './kbn_management_settings_section_registry.devdocs.json'; diff --git a/api_docs/kbn_management_settings_types.devdocs.json b/api_docs/kbn_management_settings_types.devdocs.json index 1cb92153d5159..c4ac18ed37f62 100644 --- a/api_docs/kbn_management_settings_types.devdocs.json +++ b/api_docs/kbn_management_settings_types.devdocs.json @@ -20,6 +20,50 @@ "classes": [], "functions": [], "interfaces": [ + { + "parentPluginId": "@kbn/management-settings-types", + "id": "def-common.CategorizedFields", + "type": "Interface", + "tags": [], + "label": "CategorizedFields", + "description": [], + "path": "packages/kbn-management/settings/types/category.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/management-settings-types", + "id": "def-common.CategorizedFields.Unnamed", + "type": "IndexSignature", + "tags": [], + "label": "[category: string]: { count: number; fields: FieldDefinition[]; }", + "description": [], + "signature": [ + "[category: string]: { count: number; fields: ", + { + "pluginId": "@kbn/management-settings-types", + "scope": "common", + "docId": "kibKbnManagementSettingsTypesPluginApi", + "section": "def-common.FieldDefinition", + "text": "FieldDefinition" + }, + "<", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.UiSettingsType", + "text": "UiSettingsType" + }, + ", string | number | boolean | (string | number)[] | null | undefined>[]; }" + ], + "path": "packages/kbn-management/settings/types/category.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/management-settings-types", "id": "def-common.FieldDefinition", @@ -1267,10 +1311,74 @@ }, { "parentPluginId": "@kbn/management-settings-types", - "id": "def-common.OnChangeFn", + "id": "def-common.OnFieldChangeFn", "type": "Type", "tags": [], - "label": "OnChangeFn", + "label": "OnFieldChangeFn", + "description": [ + "\nAn `onFieldChange` handler when a Field changes." + ], + "signature": [ + "(id: string, change?: ", + { + "pluginId": "@kbn/management-settings-types", + "scope": "common", + "docId": "kibKbnManagementSettingsTypesPluginApi", + "section": "def-common.UnsavedFieldChange", + "text": "UnsavedFieldChange" + }, + " | undefined) => void" + ], + "path": "packages/kbn-management/settings/types/index.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/management-settings-types", + "id": "def-common.OnFieldChangeFn.$1", + "type": "string", + "tags": [], + "label": "id", + "description": [ + "A unique id corresponding to the particular setting being changed." + ], + "path": "packages/kbn-management/settings/types/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/management-settings-types", + "id": "def-common.OnFieldChangeFn.$2", + "type": "Object", + "tags": [], + "label": "change", + "description": [ + "The {@link UnsavedFieldChange } corresponding to any unsaved change to the field." + ], + "signature": [ + { + "pluginId": "@kbn/management-settings-types", + "scope": "common", + "docId": "kibKbnManagementSettingsTypesPluginApi", + "section": "def-common.UnsavedFieldChange", + "text": "UnsavedFieldChange" + }, + " | undefined" + ], + "path": "packages/kbn-management/settings/types/index.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/management-settings-types", + "id": "def-common.OnInputChangeFn", + "type": "Type", + "tags": [], + "label": "OnInputChangeFn", "description": [ "\nA function that is called when the value of a {@link FieldInput} changes." ], @@ -1292,7 +1400,7 @@ "children": [ { "parentPluginId": "@kbn/management-settings-types", - "id": "def-common.OnChangeFn.$1", + "id": "def-common.OnInputChangeFn.$1", "type": "Object", "tags": [], "label": "change", @@ -1608,6 +1716,37 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/management-settings-types", + "id": "def-common.UnsavedFieldChanges", + "type": "Type", + "tags": [], + "label": "UnsavedFieldChanges", + "description": [], + "signature": [ + "{ [x: string]: ", + { + "pluginId": "@kbn/management-settings-types", + "scope": "common", + "docId": "kibKbnManagementSettingsTypesPluginApi", + "section": "def-common.UnsavedFieldChange", + "text": "UnsavedFieldChange" + }, + "<", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.UiSettingsType", + "text": "UiSettingsType" + }, + ">; }" + ], + "path": "packages/kbn-management/settings/types/unsaved_change.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/management-settings-types", "id": "def-common.Value", diff --git a/api_docs/kbn_management_settings_types.mdx b/api_docs/kbn_management_settings_types.mdx index 4cdcb7214472a..8c87ae69ad7da 100644 --- a/api_docs/kbn_management_settings_types.mdx +++ b/api_docs/kbn_management_settings_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-types title: "@kbn/management-settings-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-types plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-types'] --- import kbnManagementSettingsTypesObj from './kbn_management_settings_types.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/platform-deployment-management](https://github.com/orgs/elasti | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 75 | 0 | 0 | 0 | +| 81 | 0 | 3 | 0 | ## Common diff --git a/api_docs/kbn_management_settings_utilities.devdocs.json b/api_docs/kbn_management_settings_utilities.devdocs.json index 5412a77029610..b443c15d3ee17 100644 --- a/api_docs/kbn_management_settings_utilities.devdocs.json +++ b/api_docs/kbn_management_settings_utilities.devdocs.json @@ -19,6 +19,110 @@ "common": { "classes": [], "functions": [ + { + "parentPluginId": "@kbn/management-settings-utilities", + "id": "def-common.categorizeFields", + "type": "Function", + "tags": [], + "label": "categorizeFields", + "description": [], + "signature": [ + "(fields: ", + { + "pluginId": "@kbn/management-settings-types", + "scope": "common", + "docId": "kibKbnManagementSettingsTypesPluginApi", + "section": "def-common.FieldDefinition", + "text": "FieldDefinition" + }, + "<", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.UiSettingsType", + "text": "UiSettingsType" + }, + ", string | number | boolean | (string | number)[] | null | undefined>[]) => ", + { + "pluginId": "@kbn/management-settings-types", + "scope": "common", + "docId": "kibKbnManagementSettingsTypesPluginApi", + "section": "def-common.CategorizedFields", + "text": "CategorizedFields" + } + ], + "path": "packages/kbn-management/settings/utilities/category/categorize_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/management-settings-utilities", + "id": "def-common.categorizeFields.$1", + "type": "Array", + "tags": [], + "label": "fields", + "description": [], + "signature": [ + { + "pluginId": "@kbn/management-settings-types", + "scope": "common", + "docId": "kibKbnManagementSettingsTypesPluginApi", + "section": "def-common.FieldDefinition", + "text": "FieldDefinition" + }, + "<", + { + "pluginId": "@kbn/core-ui-settings-common", + "scope": "common", + "docId": "kibKbnCoreUiSettingsCommonPluginApi", + "section": "def-common.UiSettingsType", + "text": "UiSettingsType" + }, + ", string | number | boolean | (string | number)[] | null | undefined>[]" + ], + "path": "packages/kbn-management/settings/utilities/category/categorize_fields.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/management-settings-utilities", + "id": "def-common.getCategoryName", + "type": "Function", + "tags": [], + "label": "getCategoryName", + "description": [], + "signature": [ + "(category: string | undefined) => string" + ], + "path": "packages/kbn-management/settings/utilities/category/get_category_name.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/management-settings-utilities", + "id": "def-common.getCategoryName.$1", + "type": "string", + "tags": [], + "label": "category", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-management/settings/utilities/category/get_category_name.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/management-settings-utilities", "id": "def-common.getFieldInputValue", @@ -948,7 +1052,7 @@ "tags": [], "label": "useUpdate", "description": [ - "\nHook to provide a standard {@link OnChangeFn} that will send an update to the\nfield.\n" + "\nHook to provide a standard {@link OnInputChangeFn} that will send an update to the\nfield.\n" ], "signature": [ "" ], @@ -1007,7 +1111,7 @@ } ], "returnComment": [ - "An {@link OnChangeFn } that will send an update to the field." + "An {@link OnInputChangeFn } that will send an update to the field." ], "initialIsOpen": false } @@ -1036,12 +1140,12 @@ "children": [ { "parentPluginId": "@kbn/management-settings-utilities", - "id": "def-common.UseUpdateParameters.onChange", + "id": "def-common.UseUpdateParameters.onInputChange", "type": "Function", "tags": [], - "label": "onChange", + "label": "onInputChange", "description": [ - "The {@link OnChangeFn} to invoke." + "The {@link OnInputChangeFn} to invoke." ], "signature": [ "(change?: ", @@ -1061,7 +1165,7 @@ "children": [ { "parentPluginId": "@kbn/management-settings-utilities", - "id": "def-common.UseUpdateParameters.onChange.$1", + "id": "def-common.UseUpdateParameters.onInputChange.$1", "type": "Object", "tags": [], "label": "change", diff --git a/api_docs/kbn_management_settings_utilities.mdx b/api_docs/kbn_management_settings_utilities.mdx index 9b7e11335d67a..0f38cb53fefcd 100644 --- a/api_docs/kbn_management_settings_utilities.mdx +++ b/api_docs/kbn_management_settings_utilities.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-utilities title: "@kbn/management-settings-utilities" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-utilities plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-utilities'] --- import kbnManagementSettingsUtilitiesObj from './kbn_management_settings_utilities.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/platform-deployment-management](https://github.com/orgs/elasti | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 50 | 0 | 2 | 0 | +| 54 | 0 | 6 | 0 | ## Common diff --git a/api_docs/kbn_management_storybook_config.mdx b/api_docs/kbn_management_storybook_config.mdx index 4ad452c18fe8d..083b61fb6bdb8 100644 --- a/api_docs/kbn_management_storybook_config.mdx +++ b/api_docs/kbn_management_storybook_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-storybook-config title: "@kbn/management-storybook-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-storybook-config plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-storybook-config'] --- import kbnManagementStorybookConfigObj from './kbn_management_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_mapbox_gl.mdx b/api_docs/kbn_mapbox_gl.mdx index be8f0fec4c0a4..864edee504b59 100644 --- a/api_docs/kbn_mapbox_gl.mdx +++ b/api_docs/kbn_mapbox_gl.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-mapbox-gl title: "@kbn/mapbox-gl" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/mapbox-gl plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/mapbox-gl'] --- import kbnMapboxGlObj from './kbn_mapbox_gl.devdocs.json'; diff --git a/api_docs/kbn_maps_vector_tile_utils.mdx b/api_docs/kbn_maps_vector_tile_utils.mdx index 171172230f811..c3d3e2317a749 100644 --- a/api_docs/kbn_maps_vector_tile_utils.mdx +++ b/api_docs/kbn_maps_vector_tile_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-maps-vector-tile-utils title: "@kbn/maps-vector-tile-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/maps-vector-tile-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/maps-vector-tile-utils'] --- import kbnMapsVectorTileUtilsObj from './kbn_maps_vector_tile_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_agg_utils.mdx b/api_docs/kbn_ml_agg_utils.mdx index 54c67af908275..7cde657693b7d 100644 --- a/api_docs/kbn_ml_agg_utils.mdx +++ b/api_docs/kbn_ml_agg_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-agg-utils title: "@kbn/ml-agg-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-agg-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-agg-utils'] --- import kbnMlAggUtilsObj from './kbn_ml_agg_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_anomaly_utils.mdx b/api_docs/kbn_ml_anomaly_utils.mdx index 0c892a58f1818..3046aace99741 100644 --- a/api_docs/kbn_ml_anomaly_utils.mdx +++ b/api_docs/kbn_ml_anomaly_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-anomaly-utils title: "@kbn/ml-anomaly-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-anomaly-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-anomaly-utils'] --- import kbnMlAnomalyUtilsObj from './kbn_ml_anomaly_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_category_validator.mdx b/api_docs/kbn_ml_category_validator.mdx index bb895312ff958..608f604dc1bb8 100644 --- a/api_docs/kbn_ml_category_validator.mdx +++ b/api_docs/kbn_ml_category_validator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-category-validator title: "@kbn/ml-category-validator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-category-validator plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-category-validator'] --- import kbnMlCategoryValidatorObj from './kbn_ml_category_validator.devdocs.json'; diff --git a/api_docs/kbn_ml_chi2test.mdx b/api_docs/kbn_ml_chi2test.mdx index e6db0c8150575..6fcc0ae3533e6 100644 --- a/api_docs/kbn_ml_chi2test.mdx +++ b/api_docs/kbn_ml_chi2test.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-chi2test title: "@kbn/ml-chi2test" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-chi2test plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-chi2test'] --- import kbnMlChi2testObj from './kbn_ml_chi2test.devdocs.json'; diff --git a/api_docs/kbn_ml_data_frame_analytics_utils.mdx b/api_docs/kbn_ml_data_frame_analytics_utils.mdx index 08aff6980d248..c38aa26fb6746 100644 --- a/api_docs/kbn_ml_data_frame_analytics_utils.mdx +++ b/api_docs/kbn_ml_data_frame_analytics_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-data-frame-analytics-utils title: "@kbn/ml-data-frame-analytics-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-data-frame-analytics-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-data-frame-analytics-utils'] --- import kbnMlDataFrameAnalyticsUtilsObj from './kbn_ml_data_frame_analytics_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_data_grid.mdx b/api_docs/kbn_ml_data_grid.mdx index 4133de8b78c3c..d0538d1d60ca0 100644 --- a/api_docs/kbn_ml_data_grid.mdx +++ b/api_docs/kbn_ml_data_grid.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-data-grid title: "@kbn/ml-data-grid" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-data-grid plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-data-grid'] --- import kbnMlDataGridObj from './kbn_ml_data_grid.devdocs.json'; diff --git a/api_docs/kbn_ml_date_picker.mdx b/api_docs/kbn_ml_date_picker.mdx index 65355d8ab5c04..dd49227cd2a8e 100644 --- a/api_docs/kbn_ml_date_picker.mdx +++ b/api_docs/kbn_ml_date_picker.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-date-picker title: "@kbn/ml-date-picker" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-date-picker plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-date-picker'] --- import kbnMlDatePickerObj from './kbn_ml_date_picker.devdocs.json'; diff --git a/api_docs/kbn_ml_date_utils.mdx b/api_docs/kbn_ml_date_utils.mdx index 9b406da6dcad9..da9794499f023 100644 --- a/api_docs/kbn_ml_date_utils.mdx +++ b/api_docs/kbn_ml_date_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-date-utils title: "@kbn/ml-date-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-date-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-date-utils'] --- import kbnMlDateUtilsObj from './kbn_ml_date_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_error_utils.mdx b/api_docs/kbn_ml_error_utils.mdx index 22ad62d73b583..37871b7fc2d07 100644 --- a/api_docs/kbn_ml_error_utils.mdx +++ b/api_docs/kbn_ml_error_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-error-utils title: "@kbn/ml-error-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-error-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-error-utils'] --- import kbnMlErrorUtilsObj from './kbn_ml_error_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_in_memory_table.mdx b/api_docs/kbn_ml_in_memory_table.mdx index 77bf076f4abfd..38c65cb482dd8 100644 --- a/api_docs/kbn_ml_in_memory_table.mdx +++ b/api_docs/kbn_ml_in_memory_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-in-memory-table title: "@kbn/ml-in-memory-table" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-in-memory-table plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-in-memory-table'] --- import kbnMlInMemoryTableObj from './kbn_ml_in_memory_table.devdocs.json'; diff --git a/api_docs/kbn_ml_is_defined.mdx b/api_docs/kbn_ml_is_defined.mdx index 07d9aedac5526..80f18b3a38fa4 100644 --- a/api_docs/kbn_ml_is_defined.mdx +++ b/api_docs/kbn_ml_is_defined.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-is-defined title: "@kbn/ml-is-defined" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-is-defined plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-is-defined'] --- import kbnMlIsDefinedObj from './kbn_ml_is_defined.devdocs.json'; diff --git a/api_docs/kbn_ml_is_populated_object.mdx b/api_docs/kbn_ml_is_populated_object.mdx index b24f60582ea29..45fdaed1a1d1a 100644 --- a/api_docs/kbn_ml_is_populated_object.mdx +++ b/api_docs/kbn_ml_is_populated_object.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-is-populated-object title: "@kbn/ml-is-populated-object" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-is-populated-object plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-is-populated-object'] --- import kbnMlIsPopulatedObjectObj from './kbn_ml_is_populated_object.devdocs.json'; diff --git a/api_docs/kbn_ml_kibana_theme.mdx b/api_docs/kbn_ml_kibana_theme.mdx index 445daff4e58f6..dc9836770aa04 100644 --- a/api_docs/kbn_ml_kibana_theme.mdx +++ b/api_docs/kbn_ml_kibana_theme.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-kibana-theme title: "@kbn/ml-kibana-theme" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-kibana-theme plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-kibana-theme'] --- import kbnMlKibanaThemeObj from './kbn_ml_kibana_theme.devdocs.json'; diff --git a/api_docs/kbn_ml_local_storage.mdx b/api_docs/kbn_ml_local_storage.mdx index 1e8eef4aafa4a..196c5eaad86ca 100644 --- a/api_docs/kbn_ml_local_storage.mdx +++ b/api_docs/kbn_ml_local_storage.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-local-storage title: "@kbn/ml-local-storage" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-local-storage plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-local-storage'] --- import kbnMlLocalStorageObj from './kbn_ml_local_storage.devdocs.json'; diff --git a/api_docs/kbn_ml_nested_property.mdx b/api_docs/kbn_ml_nested_property.mdx index 5c55088883f20..3cae9cbc51cad 100644 --- a/api_docs/kbn_ml_nested_property.mdx +++ b/api_docs/kbn_ml_nested_property.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-nested-property title: "@kbn/ml-nested-property" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-nested-property plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-nested-property'] --- import kbnMlNestedPropertyObj from './kbn_ml_nested_property.devdocs.json'; diff --git a/api_docs/kbn_ml_number_utils.mdx b/api_docs/kbn_ml_number_utils.mdx index 7b21c59ef5a46..8f412c9a0cc72 100644 --- a/api_docs/kbn_ml_number_utils.mdx +++ b/api_docs/kbn_ml_number_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-number-utils title: "@kbn/ml-number-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-number-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-number-utils'] --- import kbnMlNumberUtilsObj from './kbn_ml_number_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_query_utils.mdx b/api_docs/kbn_ml_query_utils.mdx index 57446eff69ef4..fffaf0f85bc79 100644 --- a/api_docs/kbn_ml_query_utils.mdx +++ b/api_docs/kbn_ml_query_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-query-utils title: "@kbn/ml-query-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-query-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-query-utils'] --- import kbnMlQueryUtilsObj from './kbn_ml_query_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_random_sampler_utils.mdx b/api_docs/kbn_ml_random_sampler_utils.mdx index bcae0b67f88b0..07fbd73031b21 100644 --- a/api_docs/kbn_ml_random_sampler_utils.mdx +++ b/api_docs/kbn_ml_random_sampler_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-random-sampler-utils title: "@kbn/ml-random-sampler-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-random-sampler-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-random-sampler-utils'] --- import kbnMlRandomSamplerUtilsObj from './kbn_ml_random_sampler_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_route_utils.mdx b/api_docs/kbn_ml_route_utils.mdx index 3eefcc9e9ca40..c4ef5249fef01 100644 --- a/api_docs/kbn_ml_route_utils.mdx +++ b/api_docs/kbn_ml_route_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-route-utils title: "@kbn/ml-route-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-route-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-route-utils'] --- import kbnMlRouteUtilsObj from './kbn_ml_route_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_runtime_field_utils.mdx b/api_docs/kbn_ml_runtime_field_utils.mdx index e4f86dcbb89a8..c84f96606da67 100644 --- a/api_docs/kbn_ml_runtime_field_utils.mdx +++ b/api_docs/kbn_ml_runtime_field_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-runtime-field-utils title: "@kbn/ml-runtime-field-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-runtime-field-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-runtime-field-utils'] --- import kbnMlRuntimeFieldUtilsObj from './kbn_ml_runtime_field_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_string_hash.mdx b/api_docs/kbn_ml_string_hash.mdx index af3dab5b7ccd8..983f230906b4a 100644 --- a/api_docs/kbn_ml_string_hash.mdx +++ b/api_docs/kbn_ml_string_hash.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-string-hash title: "@kbn/ml-string-hash" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-string-hash plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-string-hash'] --- import kbnMlStringHashObj from './kbn_ml_string_hash.devdocs.json'; diff --git a/api_docs/kbn_ml_trained_models_utils.mdx b/api_docs/kbn_ml_trained_models_utils.mdx index 27108572f4e4b..60203a7bdf744 100644 --- a/api_docs/kbn_ml_trained_models_utils.mdx +++ b/api_docs/kbn_ml_trained_models_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-trained-models-utils title: "@kbn/ml-trained-models-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-trained-models-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-trained-models-utils'] --- import kbnMlTrainedModelsUtilsObj from './kbn_ml_trained_models_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_url_state.mdx b/api_docs/kbn_ml_url_state.mdx index d9f4892631de7..8030c55f05a4b 100644 --- a/api_docs/kbn_ml_url_state.mdx +++ b/api_docs/kbn_ml_url_state.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-url-state title: "@kbn/ml-url-state" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-url-state plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-url-state'] --- import kbnMlUrlStateObj from './kbn_ml_url_state.devdocs.json'; diff --git a/api_docs/kbn_monaco.mdx b/api_docs/kbn_monaco.mdx index 699938fc3fbe3..2ae8a0a5385ee 100644 --- a/api_docs/kbn_monaco.mdx +++ b/api_docs/kbn_monaco.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-monaco title: "@kbn/monaco" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/monaco plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/monaco'] --- import kbnMonacoObj from './kbn_monaco.devdocs.json'; diff --git a/api_docs/kbn_object_versioning.mdx b/api_docs/kbn_object_versioning.mdx index 61e53db7164ca..3e3e9c2f1eee7 100644 --- a/api_docs/kbn_object_versioning.mdx +++ b/api_docs/kbn_object_versioning.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-object-versioning title: "@kbn/object-versioning" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/object-versioning plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/object-versioning'] --- import kbnObjectVersioningObj from './kbn_object_versioning.devdocs.json'; diff --git a/api_docs/kbn_observability_alert_details.mdx b/api_docs/kbn_observability_alert_details.mdx index db29880d10a29..94d09b3992ba4 100644 --- a/api_docs/kbn_observability_alert_details.mdx +++ b/api_docs/kbn_observability_alert_details.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-observability-alert-details title: "@kbn/observability-alert-details" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/observability-alert-details plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/observability-alert-details'] --- import kbnObservabilityAlertDetailsObj from './kbn_observability_alert_details.devdocs.json'; diff --git a/api_docs/kbn_openapi_generator.mdx b/api_docs/kbn_openapi_generator.mdx index e34b9e16604cb..a8c0daf05a769 100644 --- a/api_docs/kbn_openapi_generator.mdx +++ b/api_docs/kbn_openapi_generator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-openapi-generator title: "@kbn/openapi-generator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/openapi-generator plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/openapi-generator'] --- import kbnOpenapiGeneratorObj from './kbn_openapi_generator.devdocs.json'; diff --git a/api_docs/kbn_optimizer.mdx b/api_docs/kbn_optimizer.mdx index a70d81ee2c979..ed38d77779844 100644 --- a/api_docs/kbn_optimizer.mdx +++ b/api_docs/kbn_optimizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer title: "@kbn/optimizer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/optimizer plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer'] --- import kbnOptimizerObj from './kbn_optimizer.devdocs.json'; diff --git a/api_docs/kbn_optimizer_webpack_helpers.mdx b/api_docs/kbn_optimizer_webpack_helpers.mdx index 5bb7a5a3a3c9f..3fbd1fa558d96 100644 --- a/api_docs/kbn_optimizer_webpack_helpers.mdx +++ b/api_docs/kbn_optimizer_webpack_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer-webpack-helpers title: "@kbn/optimizer-webpack-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/optimizer-webpack-helpers plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer-webpack-helpers'] --- import kbnOptimizerWebpackHelpersObj from './kbn_optimizer_webpack_helpers.devdocs.json'; diff --git a/api_docs/kbn_osquery_io_ts_types.mdx b/api_docs/kbn_osquery_io_ts_types.mdx index 1d4e68e64d45c..79192eb71b7e2 100644 --- a/api_docs/kbn_osquery_io_ts_types.mdx +++ b/api_docs/kbn_osquery_io_ts_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-osquery-io-ts-types title: "@kbn/osquery-io-ts-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/osquery-io-ts-types plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/osquery-io-ts-types'] --- import kbnOsqueryIoTsTypesObj from './kbn_osquery_io_ts_types.devdocs.json'; diff --git a/api_docs/kbn_performance_testing_dataset_extractor.mdx b/api_docs/kbn_performance_testing_dataset_extractor.mdx index 878129557b2d4..73ee007b9cb3b 100644 --- a/api_docs/kbn_performance_testing_dataset_extractor.mdx +++ b/api_docs/kbn_performance_testing_dataset_extractor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-performance-testing-dataset-extractor title: "@kbn/performance-testing-dataset-extractor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/performance-testing-dataset-extractor plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/performance-testing-dataset-extractor'] --- import kbnPerformanceTestingDatasetExtractorObj from './kbn_performance_testing_dataset_extractor.devdocs.json'; diff --git a/api_docs/kbn_plugin_generator.mdx b/api_docs/kbn_plugin_generator.mdx index 082f1de03f775..60f6a7ab452bb 100644 --- a/api_docs/kbn_plugin_generator.mdx +++ b/api_docs/kbn_plugin_generator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-generator title: "@kbn/plugin-generator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-generator plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-generator'] --- import kbnPluginGeneratorObj from './kbn_plugin_generator.devdocs.json'; diff --git a/api_docs/kbn_plugin_helpers.mdx b/api_docs/kbn_plugin_helpers.mdx index 56b6a83cce3a3..d58ebc476ebc1 100644 --- a/api_docs/kbn_plugin_helpers.mdx +++ b/api_docs/kbn_plugin_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-helpers title: "@kbn/plugin-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-helpers plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-helpers'] --- import kbnPluginHelpersObj from './kbn_plugin_helpers.devdocs.json'; diff --git a/api_docs/kbn_profiling_utils.mdx b/api_docs/kbn_profiling_utils.mdx index 3ad2e3cf41108..ed4465de6cf4d 100644 --- a/api_docs/kbn_profiling_utils.mdx +++ b/api_docs/kbn_profiling_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-profiling-utils title: "@kbn/profiling-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/profiling-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/profiling-utils'] --- import kbnProfilingUtilsObj from './kbn_profiling_utils.devdocs.json'; diff --git a/api_docs/kbn_random_sampling.mdx b/api_docs/kbn_random_sampling.mdx index 3179689b14c3f..65a5d07e4b570 100644 --- a/api_docs/kbn_random_sampling.mdx +++ b/api_docs/kbn_random_sampling.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-random-sampling title: "@kbn/random-sampling" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/random-sampling plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/random-sampling'] --- import kbnRandomSamplingObj from './kbn_random_sampling.devdocs.json'; diff --git a/api_docs/kbn_react_field.mdx b/api_docs/kbn_react_field.mdx index 8a2d417fae7f3..4839b9481d219 100644 --- a/api_docs/kbn_react_field.mdx +++ b/api_docs/kbn_react_field.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-field title: "@kbn/react-field" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-field plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-field'] --- import kbnReactFieldObj from './kbn_react_field.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_common.mdx b/api_docs/kbn_react_kibana_context_common.mdx index 1876ea26da9e7..17eb17dd82a96 100644 --- a/api_docs/kbn_react_kibana_context_common.mdx +++ b/api_docs/kbn_react_kibana_context_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-context-common title: "@kbn/react-kibana-context-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-context-common plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-common'] --- import kbnReactKibanaContextCommonObj from './kbn_react_kibana_context_common.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_render.mdx b/api_docs/kbn_react_kibana_context_render.mdx index cc294d648fc00..70cb410c7a0c5 100644 --- a/api_docs/kbn_react_kibana_context_render.mdx +++ b/api_docs/kbn_react_kibana_context_render.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-context-render title: "@kbn/react-kibana-context-render" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-context-render plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-render'] --- import kbnReactKibanaContextRenderObj from './kbn_react_kibana_context_render.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_root.mdx b/api_docs/kbn_react_kibana_context_root.mdx index 7aa5a465ee3d6..c9e8b32593c6b 100644 --- a/api_docs/kbn_react_kibana_context_root.mdx +++ b/api_docs/kbn_react_kibana_context_root.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-context-root title: "@kbn/react-kibana-context-root" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-context-root plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-root'] --- import kbnReactKibanaContextRootObj from './kbn_react_kibana_context_root.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_styled.mdx b/api_docs/kbn_react_kibana_context_styled.mdx index f0b1e85101131..6fb6a39070c85 100644 --- a/api_docs/kbn_react_kibana_context_styled.mdx +++ b/api_docs/kbn_react_kibana_context_styled.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-context-styled title: "@kbn/react-kibana-context-styled" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-context-styled plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-styled'] --- import kbnReactKibanaContextStyledObj from './kbn_react_kibana_context_styled.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_theme.mdx b/api_docs/kbn_react_kibana_context_theme.mdx index dd39572ba4528..5e6c032eff53b 100644 --- a/api_docs/kbn_react_kibana_context_theme.mdx +++ b/api_docs/kbn_react_kibana_context_theme.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-context-theme title: "@kbn/react-kibana-context-theme" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-context-theme plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-theme'] --- import kbnReactKibanaContextThemeObj from './kbn_react_kibana_context_theme.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_mount.mdx b/api_docs/kbn_react_kibana_mount.mdx index 973cc4c906c30..6d4841287fd10 100644 --- a/api_docs/kbn_react_kibana_mount.mdx +++ b/api_docs/kbn_react_kibana_mount.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-mount title: "@kbn/react-kibana-mount" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-mount plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-mount'] --- import kbnReactKibanaMountObj from './kbn_react_kibana_mount.devdocs.json'; diff --git a/api_docs/kbn_repo_file_maps.mdx b/api_docs/kbn_repo_file_maps.mdx index 94853405f382e..de0a35d6602aa 100644 --- a/api_docs/kbn_repo_file_maps.mdx +++ b/api_docs/kbn_repo_file_maps.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-file-maps title: "@kbn/repo-file-maps" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-file-maps plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-file-maps'] --- import kbnRepoFileMapsObj from './kbn_repo_file_maps.devdocs.json'; diff --git a/api_docs/kbn_repo_linter.mdx b/api_docs/kbn_repo_linter.mdx index fcae8cf410506..2db643c3cd2e6 100644 --- a/api_docs/kbn_repo_linter.mdx +++ b/api_docs/kbn_repo_linter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-linter title: "@kbn/repo-linter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-linter plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-linter'] --- import kbnRepoLinterObj from './kbn_repo_linter.devdocs.json'; diff --git a/api_docs/kbn_repo_path.mdx b/api_docs/kbn_repo_path.mdx index da97d5b115301..2372a19c177e5 100644 --- a/api_docs/kbn_repo_path.mdx +++ b/api_docs/kbn_repo_path.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-path title: "@kbn/repo-path" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-path plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-path'] --- import kbnRepoPathObj from './kbn_repo_path.devdocs.json'; diff --git a/api_docs/kbn_repo_source_classifier.mdx b/api_docs/kbn_repo_source_classifier.mdx index 06a952bee9d6a..0310ba7914f22 100644 --- a/api_docs/kbn_repo_source_classifier.mdx +++ b/api_docs/kbn_repo_source_classifier.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-source-classifier title: "@kbn/repo-source-classifier" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-source-classifier plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-source-classifier'] --- import kbnRepoSourceClassifierObj from './kbn_repo_source_classifier.devdocs.json'; diff --git a/api_docs/kbn_reporting_common.mdx b/api_docs/kbn_reporting_common.mdx index 5b4a284402274..927214b056e06 100644 --- a/api_docs/kbn_reporting_common.mdx +++ b/api_docs/kbn_reporting_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-common title: "@kbn/reporting-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-common plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-common'] --- import kbnReportingCommonObj from './kbn_reporting_common.devdocs.json'; diff --git a/api_docs/kbn_resizable_layout.mdx b/api_docs/kbn_resizable_layout.mdx index 0da03531014de..bb30d48332cf0 100644 --- a/api_docs/kbn_resizable_layout.mdx +++ b/api_docs/kbn_resizable_layout.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-resizable-layout title: "@kbn/resizable-layout" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/resizable-layout plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/resizable-layout'] --- import kbnResizableLayoutObj from './kbn_resizable_layout.devdocs.json'; diff --git a/api_docs/kbn_rison.mdx b/api_docs/kbn_rison.mdx index 31a2117d123f7..72b9cac89ff05 100644 --- a/api_docs/kbn_rison.mdx +++ b/api_docs/kbn_rison.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rison title: "@kbn/rison" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rison plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rison'] --- import kbnRisonObj from './kbn_rison.devdocs.json'; diff --git a/api_docs/kbn_rrule.mdx b/api_docs/kbn_rrule.mdx index a3b899296fc13..f95a79ba52157 100644 --- a/api_docs/kbn_rrule.mdx +++ b/api_docs/kbn_rrule.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rrule title: "@kbn/rrule" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rrule plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rrule'] --- import kbnRruleObj from './kbn_rrule.devdocs.json'; diff --git a/api_docs/kbn_rule_data_utils.mdx b/api_docs/kbn_rule_data_utils.mdx index 571272bb62c8c..2d06cc7970dee 100644 --- a/api_docs/kbn_rule_data_utils.mdx +++ b/api_docs/kbn_rule_data_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rule-data-utils title: "@kbn/rule-data-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rule-data-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rule-data-utils'] --- import kbnRuleDataUtilsObj from './kbn_rule_data_utils.devdocs.json'; diff --git a/api_docs/kbn_saved_objects_settings.mdx b/api_docs/kbn_saved_objects_settings.mdx index be6f5455c1eb9..e22f74fe32c39 100644 --- a/api_docs/kbn_saved_objects_settings.mdx +++ b/api_docs/kbn_saved_objects_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-saved-objects-settings title: "@kbn/saved-objects-settings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/saved-objects-settings plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/saved-objects-settings'] --- import kbnSavedObjectsSettingsObj from './kbn_saved_objects_settings.devdocs.json'; diff --git a/api_docs/kbn_search_api_panels.mdx b/api_docs/kbn_search_api_panels.mdx index cd554311196ea..6bdfa0d95f213 100644 --- a/api_docs/kbn_search_api_panels.mdx +++ b/api_docs/kbn_search_api_panels.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-api-panels title: "@kbn/search-api-panels" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-api-panels plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-api-panels'] --- import kbnSearchApiPanelsObj from './kbn_search_api_panels.devdocs.json'; diff --git a/api_docs/kbn_search_connectors.mdx b/api_docs/kbn_search_connectors.mdx index f9d60b8f9830e..88b69b4f2396d 100644 --- a/api_docs/kbn_search_connectors.mdx +++ b/api_docs/kbn_search_connectors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-connectors title: "@kbn/search-connectors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-connectors plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-connectors'] --- import kbnSearchConnectorsObj from './kbn_search_connectors.devdocs.json'; diff --git a/api_docs/kbn_search_response_warnings.mdx b/api_docs/kbn_search_response_warnings.mdx index 3add0cf0ca91a..0818eb25e355a 100644 --- a/api_docs/kbn_search_response_warnings.mdx +++ b/api_docs/kbn_search_response_warnings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-response-warnings title: "@kbn/search-response-warnings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-response-warnings plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-response-warnings'] --- import kbnSearchResponseWarningsObj from './kbn_search_response_warnings.devdocs.json'; diff --git a/api_docs/kbn_security_solution_features.mdx b/api_docs/kbn_security_solution_features.mdx index 9f0b5946914d2..9f9c2ad006ef2 100644 --- a/api_docs/kbn_security_solution_features.mdx +++ b/api_docs/kbn_security_solution_features.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-solution-features title: "@kbn/security-solution-features" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-solution-features plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-features'] --- import kbnSecuritySolutionFeaturesObj from './kbn_security_solution_features.devdocs.json'; diff --git a/api_docs/kbn_security_solution_navigation.mdx b/api_docs/kbn_security_solution_navigation.mdx index e71b6e751bcec..34dade8357a5d 100644 --- a/api_docs/kbn_security_solution_navigation.mdx +++ b/api_docs/kbn_security_solution_navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-solution-navigation title: "@kbn/security-solution-navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-solution-navigation plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-navigation'] --- import kbnSecuritySolutionNavigationObj from './kbn_security_solution_navigation.devdocs.json'; diff --git a/api_docs/kbn_security_solution_side_nav.mdx b/api_docs/kbn_security_solution_side_nav.mdx index 46ca52301541c..012479726cea2 100644 --- a/api_docs/kbn_security_solution_side_nav.mdx +++ b/api_docs/kbn_security_solution_side_nav.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-solution-side-nav title: "@kbn/security-solution-side-nav" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-solution-side-nav plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-side-nav'] --- import kbnSecuritySolutionSideNavObj from './kbn_security_solution_side_nav.devdocs.json'; diff --git a/api_docs/kbn_security_solution_storybook_config.mdx b/api_docs/kbn_security_solution_storybook_config.mdx index acb13a49106ee..0dfca522dd17e 100644 --- a/api_docs/kbn_security_solution_storybook_config.mdx +++ b/api_docs/kbn_security_solution_storybook_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-solution-storybook-config title: "@kbn/security-solution-storybook-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-solution-storybook-config plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-storybook-config'] --- import kbnSecuritySolutionStorybookConfigObj from './kbn_security_solution_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_autocomplete.mdx b/api_docs/kbn_securitysolution_autocomplete.mdx index e0742f90564be..0d4b69efe68d8 100644 --- a/api_docs/kbn_securitysolution_autocomplete.mdx +++ b/api_docs/kbn_securitysolution_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-autocomplete title: "@kbn/securitysolution-autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-autocomplete plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-autocomplete'] --- import kbnSecuritysolutionAutocompleteObj from './kbn_securitysolution_autocomplete.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_data_table.mdx b/api_docs/kbn_securitysolution_data_table.mdx index 67ef3bc677b5a..791fd5cd50c04 100644 --- a/api_docs/kbn_securitysolution_data_table.mdx +++ b/api_docs/kbn_securitysolution_data_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-data-table title: "@kbn/securitysolution-data-table" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-data-table plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-data-table'] --- import kbnSecuritysolutionDataTableObj from './kbn_securitysolution_data_table.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_ecs.mdx b/api_docs/kbn_securitysolution_ecs.mdx index 7ad20ca135080..39e77934d87ff 100644 --- a/api_docs/kbn_securitysolution_ecs.mdx +++ b/api_docs/kbn_securitysolution_ecs.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-ecs title: "@kbn/securitysolution-ecs" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-ecs plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-ecs'] --- import kbnSecuritysolutionEcsObj from './kbn_securitysolution_ecs.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_es_utils.mdx b/api_docs/kbn_securitysolution_es_utils.mdx index 9c4763df268d3..70c9104c028ae 100644 --- a/api_docs/kbn_securitysolution_es_utils.mdx +++ b/api_docs/kbn_securitysolution_es_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-es-utils title: "@kbn/securitysolution-es-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-es-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-es-utils'] --- import kbnSecuritysolutionEsUtilsObj from './kbn_securitysolution_es_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_exception_list_components.mdx b/api_docs/kbn_securitysolution_exception_list_components.mdx index adbb7f980e1d1..5d4e92558db06 100644 --- a/api_docs/kbn_securitysolution_exception_list_components.mdx +++ b/api_docs/kbn_securitysolution_exception_list_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-exception-list-components title: "@kbn/securitysolution-exception-list-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-exception-list-components plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-exception-list-components'] --- import kbnSecuritysolutionExceptionListComponentsObj from './kbn_securitysolution_exception_list_components.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_grouping.mdx b/api_docs/kbn_securitysolution_grouping.mdx index 9546f1027f1fd..0333399968008 100644 --- a/api_docs/kbn_securitysolution_grouping.mdx +++ b/api_docs/kbn_securitysolution_grouping.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-grouping title: "@kbn/securitysolution-grouping" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-grouping plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-grouping'] --- import kbnSecuritysolutionGroupingObj from './kbn_securitysolution_grouping.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_hook_utils.mdx b/api_docs/kbn_securitysolution_hook_utils.mdx index 474ab33badccb..24ce9104b395a 100644 --- a/api_docs/kbn_securitysolution_hook_utils.mdx +++ b/api_docs/kbn_securitysolution_hook_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-hook-utils title: "@kbn/securitysolution-hook-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-hook-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-hook-utils'] --- import kbnSecuritysolutionHookUtilsObj from './kbn_securitysolution_hook_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx index fb9fa1691cfb8..c51675bcbbcff 100644 --- a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx @@ -8,7 +8,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 description: API docs for the @kbn/securitysolution-io-ts-alerting-types plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-alerting-types'] --- import kbnSecuritysolutionIoTsAlertingTypesObj from './kbn_securitysolution_io_ts_alerting_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_list_types.mdx b/api_docs/kbn_securitysolution_io_ts_list_types.mdx index e6f0e5883981b..6d79d253e80e1 100644 --- a/api_docs/kbn_securitysolution_io_ts_list_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_list_types.mdx @@ -8,7 +8,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 description: API docs for the @kbn/securitysolution-io-ts-list-types plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-list-types'] --- import kbnSecuritysolutionIoTsListTypesObj from './kbn_securitysolution_io_ts_list_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_types.mdx b/api_docs/kbn_securitysolution_io_ts_types.mdx index 1b3c5205203cd..8ed1210a0eaaa 100644 --- a/api_docs/kbn_securitysolution_io_ts_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-types title: "@kbn/securitysolution-io-ts-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-types plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-types'] --- import kbnSecuritysolutionIoTsTypesObj from './kbn_securitysolution_io_ts_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_utils.mdx b/api_docs/kbn_securitysolution_io_ts_utils.mdx index 5db08ab670b0f..f670520fade95 100644 --- a/api_docs/kbn_securitysolution_io_ts_utils.mdx +++ b/api_docs/kbn_securitysolution_io_ts_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-utils title: "@kbn/securitysolution-io-ts-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-utils'] --- import kbnSecuritysolutionIoTsUtilsObj from './kbn_securitysolution_io_ts_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_api.mdx b/api_docs/kbn_securitysolution_list_api.mdx index 5f1cbfae2ddce..5c3afa69ac668 100644 --- a/api_docs/kbn_securitysolution_list_api.mdx +++ b/api_docs/kbn_securitysolution_list_api.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-api title: "@kbn/securitysolution-list-api" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-api plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-api'] --- import kbnSecuritysolutionListApiObj from './kbn_securitysolution_list_api.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_constants.devdocs.json b/api_docs/kbn_securitysolution_list_constants.devdocs.json index c3f2279e6ccde..1c3812564f68e 100644 --- a/api_docs/kbn_securitysolution_list_constants.devdocs.json +++ b/api_docs/kbn_securitysolution_list_constants.devdocs.json @@ -868,6 +868,14 @@ "plugin": "lists", "path": "x-pack/plugins/lists/server/saved_objects/migrations.ts" }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/common/schemas/response/exception_list_schema.mock.ts" + }, + { + "plugin": "lists", + "path": "x-pack/plugins/lists/common/schemas/response/exception_list_schema.mock.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts" @@ -900,14 +908,6 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/telemetry/receiver.ts" }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/common/schemas/response/exception_list_schema.mock.ts" - }, - { - "plugin": "lists", - "path": "x-pack/plugins/lists/common/schemas/response/exception_list_schema.mock.ts" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts" diff --git a/api_docs/kbn_securitysolution_list_constants.mdx b/api_docs/kbn_securitysolution_list_constants.mdx index 04c4bac4bc6f0..a1ff78417f32f 100644 --- a/api_docs/kbn_securitysolution_list_constants.mdx +++ b/api_docs/kbn_securitysolution_list_constants.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-constants title: "@kbn/securitysolution-list-constants" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-constants plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-constants'] --- import kbnSecuritysolutionListConstantsObj from './kbn_securitysolution_list_constants.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_hooks.mdx b/api_docs/kbn_securitysolution_list_hooks.mdx index 8a9f50538250a..a116645613ed0 100644 --- a/api_docs/kbn_securitysolution_list_hooks.mdx +++ b/api_docs/kbn_securitysolution_list_hooks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-hooks title: "@kbn/securitysolution-list-hooks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-hooks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-hooks'] --- import kbnSecuritysolutionListHooksObj from './kbn_securitysolution_list_hooks.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_utils.mdx b/api_docs/kbn_securitysolution_list_utils.mdx index 80ce37577fd67..aff6891fcb3f5 100644 --- a/api_docs/kbn_securitysolution_list_utils.mdx +++ b/api_docs/kbn_securitysolution_list_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-utils title: "@kbn/securitysolution-list-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-utils'] --- import kbnSecuritysolutionListUtilsObj from './kbn_securitysolution_list_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_rules.mdx b/api_docs/kbn_securitysolution_rules.mdx index 03851b463ee33..f934866b961eb 100644 --- a/api_docs/kbn_securitysolution_rules.mdx +++ b/api_docs/kbn_securitysolution_rules.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-rules title: "@kbn/securitysolution-rules" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-rules plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-rules'] --- import kbnSecuritysolutionRulesObj from './kbn_securitysolution_rules.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_t_grid.mdx b/api_docs/kbn_securitysolution_t_grid.mdx index 79452d333e00f..4637d5f856e16 100644 --- a/api_docs/kbn_securitysolution_t_grid.mdx +++ b/api_docs/kbn_securitysolution_t_grid.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-t-grid title: "@kbn/securitysolution-t-grid" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-t-grid plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-t-grid'] --- import kbnSecuritysolutionTGridObj from './kbn_securitysolution_t_grid.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_utils.mdx b/api_docs/kbn_securitysolution_utils.mdx index 1c49012c189ae..7863df67af3e2 100644 --- a/api_docs/kbn_securitysolution_utils.mdx +++ b/api_docs/kbn_securitysolution_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-utils title: "@kbn/securitysolution-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-utils'] --- import kbnSecuritysolutionUtilsObj from './kbn_securitysolution_utils.devdocs.json'; diff --git a/api_docs/kbn_server_http_tools.mdx b/api_docs/kbn_server_http_tools.mdx index b044d07b2b74e..da8767f287bb6 100644 --- a/api_docs/kbn_server_http_tools.mdx +++ b/api_docs/kbn_server_http_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-http-tools title: "@kbn/server-http-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-http-tools plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-http-tools'] --- import kbnServerHttpToolsObj from './kbn_server_http_tools.devdocs.json'; diff --git a/api_docs/kbn_server_route_repository.mdx b/api_docs/kbn_server_route_repository.mdx index 6fc1397f9e250..0cffd43313ee8 100644 --- a/api_docs/kbn_server_route_repository.mdx +++ b/api_docs/kbn_server_route_repository.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-route-repository title: "@kbn/server-route-repository" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-route-repository plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository'] --- import kbnServerRouteRepositoryObj from './kbn_server_route_repository.devdocs.json'; diff --git a/api_docs/kbn_serverless_common_settings.mdx b/api_docs/kbn_serverless_common_settings.mdx index e72917480c3d1..36937664f6fe9 100644 --- a/api_docs/kbn_serverless_common_settings.mdx +++ b/api_docs/kbn_serverless_common_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-common-settings title: "@kbn/serverless-common-settings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-common-settings plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-common-settings'] --- import kbnServerlessCommonSettingsObj from './kbn_serverless_common_settings.devdocs.json'; diff --git a/api_docs/kbn_serverless_observability_settings.mdx b/api_docs/kbn_serverless_observability_settings.mdx index 0ab2efeebeb3b..e80322eda73a4 100644 --- a/api_docs/kbn_serverless_observability_settings.mdx +++ b/api_docs/kbn_serverless_observability_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-observability-settings title: "@kbn/serverless-observability-settings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-observability-settings plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-observability-settings'] --- import kbnServerlessObservabilitySettingsObj from './kbn_serverless_observability_settings.devdocs.json'; diff --git a/api_docs/kbn_serverless_project_switcher.mdx b/api_docs/kbn_serverless_project_switcher.mdx index cb1d60f3c5472..e3eff6fed9e17 100644 --- a/api_docs/kbn_serverless_project_switcher.mdx +++ b/api_docs/kbn_serverless_project_switcher.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-project-switcher title: "@kbn/serverless-project-switcher" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-project-switcher plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-project-switcher'] --- import kbnServerlessProjectSwitcherObj from './kbn_serverless_project_switcher.devdocs.json'; diff --git a/api_docs/kbn_serverless_search_settings.mdx b/api_docs/kbn_serverless_search_settings.mdx index 5f925879b8bc1..a8e3b2037418b 100644 --- a/api_docs/kbn_serverless_search_settings.mdx +++ b/api_docs/kbn_serverless_search_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-search-settings title: "@kbn/serverless-search-settings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-search-settings plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-search-settings'] --- import kbnServerlessSearchSettingsObj from './kbn_serverless_search_settings.devdocs.json'; diff --git a/api_docs/kbn_serverless_security_settings.mdx b/api_docs/kbn_serverless_security_settings.mdx index 0895892d63e29..37229631c2a92 100644 --- a/api_docs/kbn_serverless_security_settings.mdx +++ b/api_docs/kbn_serverless_security_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-security-settings title: "@kbn/serverless-security-settings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-security-settings plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-security-settings'] --- import kbnServerlessSecuritySettingsObj from './kbn_serverless_security_settings.devdocs.json'; diff --git a/api_docs/kbn_serverless_storybook_config.mdx b/api_docs/kbn_serverless_storybook_config.mdx index 9ac7afdbc7c12..e4fb0cd37e717 100644 --- a/api_docs/kbn_serverless_storybook_config.mdx +++ b/api_docs/kbn_serverless_storybook_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-storybook-config title: "@kbn/serverless-storybook-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-storybook-config plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-storybook-config'] --- import kbnServerlessStorybookConfigObj from './kbn_serverless_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_shared_svg.mdx b/api_docs/kbn_shared_svg.mdx index 552a5a364b893..52760d2af01b3 100644 --- a/api_docs/kbn_shared_svg.mdx +++ b/api_docs/kbn_shared_svg.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-svg title: "@kbn/shared-svg" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-svg plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-svg'] --- import kbnSharedSvgObj from './kbn_shared_svg.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_avatar_solution.mdx b/api_docs/kbn_shared_ux_avatar_solution.mdx index ce7f3112ea9d8..081cb29dabbcb 100644 --- a/api_docs/kbn_shared_ux_avatar_solution.mdx +++ b/api_docs/kbn_shared_ux_avatar_solution.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-avatar-solution title: "@kbn/shared-ux-avatar-solution" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-avatar-solution plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-avatar-solution'] --- import kbnSharedUxAvatarSolutionObj from './kbn_shared_ux_avatar_solution.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_avatar_user_profile_components.mdx b/api_docs/kbn_shared_ux_avatar_user_profile_components.mdx index 82a2143f27a8c..896a0c9248ff5 100644 --- a/api_docs/kbn_shared_ux_avatar_user_profile_components.mdx +++ b/api_docs/kbn_shared_ux_avatar_user_profile_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-avatar-user-profile-components title: "@kbn/shared-ux-avatar-user-profile-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-avatar-user-profile-components plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-avatar-user-profile-components'] --- import kbnSharedUxAvatarUserProfileComponentsObj from './kbn_shared_ux_avatar_user_profile_components.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_exit_full_screen.mdx b/api_docs/kbn_shared_ux_button_exit_full_screen.mdx index 23983a88ea976..f26787a857047 100644 --- a/api_docs/kbn_shared_ux_button_exit_full_screen.mdx +++ b/api_docs/kbn_shared_ux_button_exit_full_screen.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-exit-full-screen title: "@kbn/shared-ux-button-exit-full-screen" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-exit-full-screen plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-exit-full-screen'] --- import kbnSharedUxButtonExitFullScreenObj from './kbn_shared_ux_button_exit_full_screen.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx b/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx index 319220a3e38bf..9cd52db2056c1 100644 --- a/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx +++ b/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-exit-full-screen-mocks title: "@kbn/shared-ux-button-exit-full-screen-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-exit-full-screen-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-exit-full-screen-mocks'] --- import kbnSharedUxButtonExitFullScreenMocksObj from './kbn_shared_ux_button_exit_full_screen_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_toolbar.mdx b/api_docs/kbn_shared_ux_button_toolbar.mdx index 2df6d918959e9..c8fca7c9bd619 100644 --- a/api_docs/kbn_shared_ux_button_toolbar.mdx +++ b/api_docs/kbn_shared_ux_button_toolbar.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-toolbar title: "@kbn/shared-ux-button-toolbar" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-toolbar plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-toolbar'] --- import kbnSharedUxButtonToolbarObj from './kbn_shared_ux_button_toolbar.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_card_no_data.mdx b/api_docs/kbn_shared_ux_card_no_data.mdx index 77506da9858ea..3ca961dfe5b23 100644 --- a/api_docs/kbn_shared_ux_card_no_data.mdx +++ b/api_docs/kbn_shared_ux_card_no_data.mdx @@ -8,7 +8,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 description: API docs for the @kbn/shared-ux-card-no-data plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data'] --- import kbnSharedUxCardNoDataObj from './kbn_shared_ux_card_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_card_no_data_mocks.mdx b/api_docs/kbn_shared_ux_card_no_data_mocks.mdx index 6395c0006637d..571f32a28c440 100644 --- a/api_docs/kbn_shared_ux_card_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_card_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-card-no-data-mocks title: "@kbn/shared-ux-card-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-card-no-data-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data-mocks'] --- import kbnSharedUxCardNoDataMocksObj from './kbn_shared_ux_card_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_chrome_navigation.mdx b/api_docs/kbn_shared_ux_chrome_navigation.mdx index e55302bbe8eab..822debcb9ae37 100644 --- a/api_docs/kbn_shared_ux_chrome_navigation.mdx +++ b/api_docs/kbn_shared_ux_chrome_navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-chrome-navigation title: "@kbn/shared-ux-chrome-navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-chrome-navigation plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-chrome-navigation'] --- import kbnSharedUxChromeNavigationObj from './kbn_shared_ux_chrome_navigation.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_context.mdx b/api_docs/kbn_shared_ux_file_context.mdx index 7649034f0d3e8..a6a25cd431e68 100644 --- a/api_docs/kbn_shared_ux_file_context.mdx +++ b/api_docs/kbn_shared_ux_file_context.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-context title: "@kbn/shared-ux-file-context" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-context plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-context'] --- import kbnSharedUxFileContextObj from './kbn_shared_ux_file_context.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_image.mdx b/api_docs/kbn_shared_ux_file_image.mdx index c6f19cb0fbf6d..8f630ff215a64 100644 --- a/api_docs/kbn_shared_ux_file_image.mdx +++ b/api_docs/kbn_shared_ux_file_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-image title: "@kbn/shared-ux-file-image" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-image plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-image'] --- import kbnSharedUxFileImageObj from './kbn_shared_ux_file_image.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_image_mocks.mdx b/api_docs/kbn_shared_ux_file_image_mocks.mdx index 51a59254e147c..87eb4e827c6fe 100644 --- a/api_docs/kbn_shared_ux_file_image_mocks.mdx +++ b/api_docs/kbn_shared_ux_file_image_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-image-mocks title: "@kbn/shared-ux-file-image-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-image-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-image-mocks'] --- import kbnSharedUxFileImageMocksObj from './kbn_shared_ux_file_image_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_mocks.mdx b/api_docs/kbn_shared_ux_file_mocks.mdx index 40f59765cbf29..90942969afa8a 100644 --- a/api_docs/kbn_shared_ux_file_mocks.mdx +++ b/api_docs/kbn_shared_ux_file_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-mocks title: "@kbn/shared-ux-file-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-mocks'] --- import kbnSharedUxFileMocksObj from './kbn_shared_ux_file_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_picker.mdx b/api_docs/kbn_shared_ux_file_picker.mdx index 29352f31681b7..85668cca9d2fd 100644 --- a/api_docs/kbn_shared_ux_file_picker.mdx +++ b/api_docs/kbn_shared_ux_file_picker.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-picker title: "@kbn/shared-ux-file-picker" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-picker plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-picker'] --- import kbnSharedUxFilePickerObj from './kbn_shared_ux_file_picker.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_types.mdx b/api_docs/kbn_shared_ux_file_types.mdx index d2a767e9edcda..d553c2892b065 100644 --- a/api_docs/kbn_shared_ux_file_types.mdx +++ b/api_docs/kbn_shared_ux_file_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-types title: "@kbn/shared-ux-file-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-types plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-types'] --- import kbnSharedUxFileTypesObj from './kbn_shared_ux_file_types.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_upload.mdx b/api_docs/kbn_shared_ux_file_upload.mdx index a667bfd932d2c..2f10d4a1d216b 100644 --- a/api_docs/kbn_shared_ux_file_upload.mdx +++ b/api_docs/kbn_shared_ux_file_upload.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-upload title: "@kbn/shared-ux-file-upload" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-upload plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-upload'] --- import kbnSharedUxFileUploadObj from './kbn_shared_ux_file_upload.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_util.mdx b/api_docs/kbn_shared_ux_file_util.mdx index c75b5fe1da2f8..62ad417a20599 100644 --- a/api_docs/kbn_shared_ux_file_util.mdx +++ b/api_docs/kbn_shared_ux_file_util.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-util title: "@kbn/shared-ux-file-util" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-util plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-util'] --- import kbnSharedUxFileUtilObj from './kbn_shared_ux_file_util.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_link_redirect_app.mdx b/api_docs/kbn_shared_ux_link_redirect_app.mdx index cc0af31e59b71..512dab55b1ebb 100644 --- a/api_docs/kbn_shared_ux_link_redirect_app.mdx +++ b/api_docs/kbn_shared_ux_link_redirect_app.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-link-redirect-app title: "@kbn/shared-ux-link-redirect-app" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-link-redirect-app plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-link-redirect-app'] --- import kbnSharedUxLinkRedirectAppObj from './kbn_shared_ux_link_redirect_app.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx b/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx index 65a44d4a48c00..7f9e4ce10b8bb 100644 --- a/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx +++ b/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-link-redirect-app-mocks title: "@kbn/shared-ux-link-redirect-app-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-link-redirect-app-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-link-redirect-app-mocks'] --- import kbnSharedUxLinkRedirectAppMocksObj from './kbn_shared_ux_link_redirect_app_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_markdown.mdx b/api_docs/kbn_shared_ux_markdown.mdx index f9f156e651358..a7f6e42447a34 100644 --- a/api_docs/kbn_shared_ux_markdown.mdx +++ b/api_docs/kbn_shared_ux_markdown.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-markdown title: "@kbn/shared-ux-markdown" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-markdown plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-markdown'] --- import kbnSharedUxMarkdownObj from './kbn_shared_ux_markdown.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_markdown_mocks.mdx b/api_docs/kbn_shared_ux_markdown_mocks.mdx index 616baf9109a57..f98231bb1a794 100644 --- a/api_docs/kbn_shared_ux_markdown_mocks.mdx +++ b/api_docs/kbn_shared_ux_markdown_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-markdown-mocks title: "@kbn/shared-ux-markdown-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-markdown-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-markdown-mocks'] --- import kbnSharedUxMarkdownMocksObj from './kbn_shared_ux_markdown_mocks.devdocs.json'; 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 583fdd1db6d2c..5850af1a94f3a 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx @@ -8,7 +8,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 description: API docs for the @kbn/shared-ux-page-analytics-no-data plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data'] --- import kbnSharedUxPageAnalyticsNoDataObj from './kbn_shared_ux_page_analytics_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx index dbce4f323217f..6f28d4d7082f6 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-analytics-no-data-mocks title: "@kbn/shared-ux-page-analytics-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-analytics-no-data-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data-mocks'] --- import kbnSharedUxPageAnalyticsNoDataMocksObj from './kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json'; 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 98e62180b45ec..22206566a0dab 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx @@ -8,7 +8,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 description: API docs for the @kbn/shared-ux-page-kibana-no-data plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-no-data'] --- import kbnSharedUxPageKibanaNoDataObj from './kbn_shared_ux_page_kibana_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx index 0adf36511eb07..a5e43b17f1a5f 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-no-data-mocks title: "@kbn/shared-ux-page-kibana-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-no-data-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-no-data-mocks'] --- import kbnSharedUxPageKibanaNoDataMocksObj from './kbn_shared_ux_page_kibana_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_template.mdx b/api_docs/kbn_shared_ux_page_kibana_template.mdx index f5a50185c0738..ce1b91a05caef 100644 --- a/api_docs/kbn_shared_ux_page_kibana_template.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_template.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-template title: "@kbn/shared-ux-page-kibana-template" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-template plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-template'] --- import kbnSharedUxPageKibanaTemplateObj from './kbn_shared_ux_page_kibana_template.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx b/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx index 028d2eda96e25..44ef897575f3b 100644 --- a/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-template-mocks title: "@kbn/shared-ux-page-kibana-template-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-template-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-template-mocks'] --- import kbnSharedUxPageKibanaTemplateMocksObj from './kbn_shared_ux_page_kibana_template_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data.mdx b/api_docs/kbn_shared_ux_page_no_data.mdx index 4d90a29ad9f5f..c165a6f7c0c9a 100644 --- a/api_docs/kbn_shared_ux_page_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data title: "@kbn/shared-ux-page-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data'] --- import kbnSharedUxPageNoDataObj from './kbn_shared_ux_page_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_config.mdx b/api_docs/kbn_shared_ux_page_no_data_config.mdx index fe65189ee48d1..655c8fe8205e1 100644 --- a/api_docs/kbn_shared_ux_page_no_data_config.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-config title: "@kbn/shared-ux-page-no-data-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-config plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-config'] --- import kbnSharedUxPageNoDataConfigObj from './kbn_shared_ux_page_no_data_config.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx b/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx index ee0280596d634..8da0ccaf455f2 100644 --- a/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-config-mocks title: "@kbn/shared-ux-page-no-data-config-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-config-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-config-mocks'] --- import kbnSharedUxPageNoDataConfigMocksObj from './kbn_shared_ux_page_no_data_config_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_no_data_mocks.mdx index 8ac62210d250e..af34ade1331ca 100644 --- a/api_docs/kbn_shared_ux_page_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-mocks title: "@kbn/shared-ux-page-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-mocks'] --- import kbnSharedUxPageNoDataMocksObj from './kbn_shared_ux_page_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_solution_nav.mdx b/api_docs/kbn_shared_ux_page_solution_nav.mdx index 412a2d5d73aa7..5da3fe5e06257 100644 --- a/api_docs/kbn_shared_ux_page_solution_nav.mdx +++ b/api_docs/kbn_shared_ux_page_solution_nav.mdx @@ -8,7 +8,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 description: API docs for the @kbn/shared-ux-page-solution-nav plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-solution-nav'] --- import kbnSharedUxPageSolutionNavObj from './kbn_shared_ux_page_solution_nav.devdocs.json'; 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 e4ece5d3de0c7..b9db7a4f6c05f 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx +++ b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx @@ -8,7 +8,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 description: API docs for the @kbn/shared-ux-prompt-no-data-views plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views'] --- import kbnSharedUxPromptNoDataViewsObj from './kbn_shared_ux_prompt_no_data_views.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx index 966e55209aa84..37013a45f827e 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx +++ b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-no-data-views-mocks title: "@kbn/shared-ux-prompt-no-data-views-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-no-data-views-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views-mocks'] --- import kbnSharedUxPromptNoDataViewsMocksObj from './kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_not_found.mdx b/api_docs/kbn_shared_ux_prompt_not_found.mdx index ac49b887bb51e..c007901293341 100644 --- a/api_docs/kbn_shared_ux_prompt_not_found.mdx +++ b/api_docs/kbn_shared_ux_prompt_not_found.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-not-found title: "@kbn/shared-ux-prompt-not-found" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-not-found plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-not-found'] --- import kbnSharedUxPromptNotFoundObj from './kbn_shared_ux_prompt_not_found.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_router.mdx b/api_docs/kbn_shared_ux_router.mdx index 27e0fad1c5e26..d6863ce4df443 100644 --- a/api_docs/kbn_shared_ux_router.mdx +++ b/api_docs/kbn_shared_ux_router.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-router title: "@kbn/shared-ux-router" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-router plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-router'] --- import kbnSharedUxRouterObj from './kbn_shared_ux_router.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_router_mocks.mdx b/api_docs/kbn_shared_ux_router_mocks.mdx index 521fcbc571547..85973185b8530 100644 --- a/api_docs/kbn_shared_ux_router_mocks.mdx +++ b/api_docs/kbn_shared_ux_router_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-router-mocks title: "@kbn/shared-ux-router-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-router-mocks plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-router-mocks'] --- import kbnSharedUxRouterMocksObj from './kbn_shared_ux_router_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_storybook_config.mdx b/api_docs/kbn_shared_ux_storybook_config.mdx index d741b88cd5183..503b99d35c39e 100644 --- a/api_docs/kbn_shared_ux_storybook_config.mdx +++ b/api_docs/kbn_shared_ux_storybook_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-storybook-config title: "@kbn/shared-ux-storybook-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-storybook-config plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook-config'] --- import kbnSharedUxStorybookConfigObj from './kbn_shared_ux_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_storybook_mock.mdx b/api_docs/kbn_shared_ux_storybook_mock.mdx index c2bb310e7b829..c4640492cc279 100644 --- a/api_docs/kbn_shared_ux_storybook_mock.mdx +++ b/api_docs/kbn_shared_ux_storybook_mock.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-storybook-mock title: "@kbn/shared-ux-storybook-mock" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-storybook-mock plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook-mock'] --- import kbnSharedUxStorybookMockObj from './kbn_shared_ux_storybook_mock.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_utility.mdx b/api_docs/kbn_shared_ux_utility.mdx index 8c30da909d203..9e7b0e3b24804 100644 --- a/api_docs/kbn_shared_ux_utility.mdx +++ b/api_docs/kbn_shared_ux_utility.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-utility title: "@kbn/shared-ux-utility" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-utility plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-utility'] --- import kbnSharedUxUtilityObj from './kbn_shared_ux_utility.devdocs.json'; diff --git a/api_docs/kbn_slo_schema.mdx b/api_docs/kbn_slo_schema.mdx index 708169be81a99..ba3906658c3b4 100644 --- a/api_docs/kbn_slo_schema.mdx +++ b/api_docs/kbn_slo_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-slo-schema title: "@kbn/slo-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/slo-schema plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/slo-schema'] --- import kbnSloSchemaObj from './kbn_slo_schema.devdocs.json'; diff --git a/api_docs/kbn_some_dev_log.mdx b/api_docs/kbn_some_dev_log.mdx index 9302f6be993c2..456f2444342a7 100644 --- a/api_docs/kbn_some_dev_log.mdx +++ b/api_docs/kbn_some_dev_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-some-dev-log title: "@kbn/some-dev-log" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/some-dev-log plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/some-dev-log'] --- import kbnSomeDevLogObj from './kbn_some_dev_log.devdocs.json'; diff --git a/api_docs/kbn_std.mdx b/api_docs/kbn_std.mdx index d7f33b386aac3..3277bce5f33e5 100644 --- a/api_docs/kbn_std.mdx +++ b/api_docs/kbn_std.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-std title: "@kbn/std" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/std plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/std'] --- import kbnStdObj from './kbn_std.devdocs.json'; diff --git a/api_docs/kbn_stdio_dev_helpers.mdx b/api_docs/kbn_stdio_dev_helpers.mdx index 55b91e59b0a75..02a93e0f68f8e 100644 --- a/api_docs/kbn_stdio_dev_helpers.mdx +++ b/api_docs/kbn_stdio_dev_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-stdio-dev-helpers title: "@kbn/stdio-dev-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/stdio-dev-helpers plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/stdio-dev-helpers'] --- import kbnStdioDevHelpersObj from './kbn_stdio_dev_helpers.devdocs.json'; diff --git a/api_docs/kbn_storybook.mdx b/api_docs/kbn_storybook.mdx index bc5ad8eae4f36..132b0b1999339 100644 --- a/api_docs/kbn_storybook.mdx +++ b/api_docs/kbn_storybook.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-storybook title: "@kbn/storybook" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/storybook plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/storybook'] --- import kbnStorybookObj from './kbn_storybook.devdocs.json'; diff --git a/api_docs/kbn_subscription_tracking.mdx b/api_docs/kbn_subscription_tracking.mdx index ab081a92b82fb..8dc6bfd56bb05 100644 --- a/api_docs/kbn_subscription_tracking.mdx +++ b/api_docs/kbn_subscription_tracking.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-subscription-tracking title: "@kbn/subscription-tracking" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/subscription-tracking plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/subscription-tracking'] --- import kbnSubscriptionTrackingObj from './kbn_subscription_tracking.devdocs.json'; diff --git a/api_docs/kbn_telemetry_tools.mdx b/api_docs/kbn_telemetry_tools.mdx index 64c7815d0b597..f44ec985300e4 100644 --- a/api_docs/kbn_telemetry_tools.mdx +++ b/api_docs/kbn_telemetry_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-telemetry-tools title: "@kbn/telemetry-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/telemetry-tools plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/telemetry-tools'] --- import kbnTelemetryToolsObj from './kbn_telemetry_tools.devdocs.json'; diff --git a/api_docs/kbn_test.mdx b/api_docs/kbn_test.mdx index 35e27bc8564f2..b330a0fce33a4 100644 --- a/api_docs/kbn_test.mdx +++ b/api_docs/kbn_test.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test title: "@kbn/test" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test'] --- import kbnTestObj from './kbn_test.devdocs.json'; diff --git a/api_docs/kbn_test_jest_helpers.mdx b/api_docs/kbn_test_jest_helpers.mdx index 346b18ef1d64e..6038c0e7e756c 100644 --- a/api_docs/kbn_test_jest_helpers.mdx +++ b/api_docs/kbn_test_jest_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test-jest-helpers title: "@kbn/test-jest-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test-jest-helpers plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-jest-helpers'] --- import kbnTestJestHelpersObj from './kbn_test_jest_helpers.devdocs.json'; diff --git a/api_docs/kbn_test_subj_selector.mdx b/api_docs/kbn_test_subj_selector.mdx index e10be8a87ee40..e3768c69b3aeb 100644 --- a/api_docs/kbn_test_subj_selector.mdx +++ b/api_docs/kbn_test_subj_selector.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test-subj-selector title: "@kbn/test-subj-selector" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test-subj-selector plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-subj-selector'] --- import kbnTestSubjSelectorObj from './kbn_test_subj_selector.devdocs.json'; diff --git a/api_docs/kbn_text_based_editor.mdx b/api_docs/kbn_text_based_editor.mdx index 9adda79f97a43..a6d0100a80ce2 100644 --- a/api_docs/kbn_text_based_editor.mdx +++ b/api_docs/kbn_text_based_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-text-based-editor title: "@kbn/text-based-editor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/text-based-editor plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/text-based-editor'] --- import kbnTextBasedEditorObj from './kbn_text_based_editor.devdocs.json'; diff --git a/api_docs/kbn_tooling_log.mdx b/api_docs/kbn_tooling_log.mdx index 60522e9769d40..084755a45106c 100644 --- a/api_docs/kbn_tooling_log.mdx +++ b/api_docs/kbn_tooling_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-tooling-log title: "@kbn/tooling-log" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/tooling-log plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/tooling-log'] --- import kbnToolingLogObj from './kbn_tooling_log.devdocs.json'; diff --git a/api_docs/kbn_ts_projects.mdx b/api_docs/kbn_ts_projects.mdx index b06bc32a5fd00..dfeb0de58a918 100644 --- a/api_docs/kbn_ts_projects.mdx +++ b/api_docs/kbn_ts_projects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ts-projects title: "@kbn/ts-projects" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ts-projects plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ts-projects'] --- import kbnTsProjectsObj from './kbn_ts_projects.devdocs.json'; diff --git a/api_docs/kbn_typed_react_router_config.mdx b/api_docs/kbn_typed_react_router_config.mdx index e939c892ed6c6..01d0e604593b5 100644 --- a/api_docs/kbn_typed_react_router_config.mdx +++ b/api_docs/kbn_typed_react_router_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-typed-react-router-config title: "@kbn/typed-react-router-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/typed-react-router-config plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/typed-react-router-config'] --- import kbnTypedReactRouterConfigObj from './kbn_typed_react_router_config.devdocs.json'; diff --git a/api_docs/kbn_ui_actions_browser.mdx b/api_docs/kbn_ui_actions_browser.mdx index 16594f38fdecc..8d04c57bc0ff3 100644 --- a/api_docs/kbn_ui_actions_browser.mdx +++ b/api_docs/kbn_ui_actions_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ui-actions-browser title: "@kbn/ui-actions-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ui-actions-browser plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-actions-browser'] --- import kbnUiActionsBrowserObj from './kbn_ui_actions_browser.devdocs.json'; diff --git a/api_docs/kbn_ui_shared_deps_src.mdx b/api_docs/kbn_ui_shared_deps_src.mdx index a62c37fd2c017..89fc6c55035e2 100644 --- a/api_docs/kbn_ui_shared_deps_src.mdx +++ b/api_docs/kbn_ui_shared_deps_src.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ui-shared-deps-src title: "@kbn/ui-shared-deps-src" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ui-shared-deps-src plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-shared-deps-src'] --- import kbnUiSharedDepsSrcObj from './kbn_ui_shared_deps_src.devdocs.json'; diff --git a/api_docs/kbn_ui_theme.mdx b/api_docs/kbn_ui_theme.mdx index 8d192906ea3e6..c6a37714db12e 100644 --- a/api_docs/kbn_ui_theme.mdx +++ b/api_docs/kbn_ui_theme.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ui-theme title: "@kbn/ui-theme" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ui-theme plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-theme'] --- import kbnUiThemeObj from './kbn_ui_theme.devdocs.json'; diff --git a/api_docs/kbn_unified_data_table.mdx b/api_docs/kbn_unified_data_table.mdx index 0a24e5335869b..84f06fff28c36 100644 --- a/api_docs/kbn_unified_data_table.mdx +++ b/api_docs/kbn_unified_data_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-unified-data-table title: "@kbn/unified-data-table" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/unified-data-table plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unified-data-table'] --- import kbnUnifiedDataTableObj from './kbn_unified_data_table.devdocs.json'; diff --git a/api_docs/kbn_unified_doc_viewer.mdx b/api_docs/kbn_unified_doc_viewer.mdx index 1068b890ff107..2962a7bedd9bb 100644 --- a/api_docs/kbn_unified_doc_viewer.mdx +++ b/api_docs/kbn_unified_doc_viewer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-unified-doc-viewer title: "@kbn/unified-doc-viewer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/unified-doc-viewer plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unified-doc-viewer'] --- import kbnUnifiedDocViewerObj from './kbn_unified_doc_viewer.devdocs.json'; diff --git a/api_docs/kbn_unified_field_list.mdx b/api_docs/kbn_unified_field_list.mdx index 6a49b4646622c..4cb52585e7603 100644 --- a/api_docs/kbn_unified_field_list.mdx +++ b/api_docs/kbn_unified_field_list.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-unified-field-list title: "@kbn/unified-field-list" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/unified-field-list plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unified-field-list'] --- import kbnUnifiedFieldListObj from './kbn_unified_field_list.devdocs.json'; diff --git a/api_docs/kbn_url_state.mdx b/api_docs/kbn_url_state.mdx index 26e402080d3fc..cb5ca866a664f 100644 --- a/api_docs/kbn_url_state.mdx +++ b/api_docs/kbn_url_state.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-url-state title: "@kbn/url-state" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/url-state plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/url-state'] --- import kbnUrlStateObj from './kbn_url_state.devdocs.json'; diff --git a/api_docs/kbn_use_tracked_promise.mdx b/api_docs/kbn_use_tracked_promise.mdx index 28b2af411cb4f..25538aede5ca1 100644 --- a/api_docs/kbn_use_tracked_promise.mdx +++ b/api_docs/kbn_use_tracked_promise.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-use-tracked-promise title: "@kbn/use-tracked-promise" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/use-tracked-promise plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/use-tracked-promise'] --- import kbnUseTrackedPromiseObj from './kbn_use_tracked_promise.devdocs.json'; diff --git a/api_docs/kbn_user_profile_components.mdx b/api_docs/kbn_user_profile_components.mdx index 16be8cdc9c8e0..18339a3df9781 100644 --- a/api_docs/kbn_user_profile_components.mdx +++ b/api_docs/kbn_user_profile_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-user-profile-components title: "@kbn/user-profile-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/user-profile-components plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/user-profile-components'] --- import kbnUserProfileComponentsObj from './kbn_user_profile_components.devdocs.json'; diff --git a/api_docs/kbn_utility_types.mdx b/api_docs/kbn_utility_types.mdx index d07714300e6b0..01f4bcc0782e8 100644 --- a/api_docs/kbn_utility_types.mdx +++ b/api_docs/kbn_utility_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types title: "@kbn/utility-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utility-types plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types'] --- import kbnUtilityTypesObj from './kbn_utility_types.devdocs.json'; diff --git a/api_docs/kbn_utility_types_jest.mdx b/api_docs/kbn_utility_types_jest.mdx index 33c9bc9df91a5..0a3371065d4e4 100644 --- a/api_docs/kbn_utility_types_jest.mdx +++ b/api_docs/kbn_utility_types_jest.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types-jest title: "@kbn/utility-types-jest" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utility-types-jest plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types-jest'] --- import kbnUtilityTypesJestObj from './kbn_utility_types_jest.devdocs.json'; diff --git a/api_docs/kbn_utils.mdx b/api_docs/kbn_utils.mdx index 8a747ed52c558..0fd6842e455ed 100644 --- a/api_docs/kbn_utils.mdx +++ b/api_docs/kbn_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utils title: "@kbn/utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utils'] --- import kbnUtilsObj from './kbn_utils.devdocs.json'; diff --git a/api_docs/kbn_visualization_ui_components.mdx b/api_docs/kbn_visualization_ui_components.mdx index e60503ecae387..c0085a267d64f 100644 --- a/api_docs/kbn_visualization_ui_components.mdx +++ b/api_docs/kbn_visualization_ui_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-visualization-ui-components title: "@kbn/visualization-ui-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/visualization-ui-components plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/visualization-ui-components'] --- import kbnVisualizationUiComponentsObj from './kbn_visualization_ui_components.devdocs.json'; diff --git a/api_docs/kbn_xstate_utils.mdx b/api_docs/kbn_xstate_utils.mdx index c64bf054548aa..f1011adceb424 100644 --- a/api_docs/kbn_xstate_utils.mdx +++ b/api_docs/kbn_xstate_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-xstate-utils title: "@kbn/xstate-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/xstate-utils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/xstate-utils'] --- import kbnXstateUtilsObj from './kbn_xstate_utils.devdocs.json'; diff --git a/api_docs/kbn_yarn_lock_validator.mdx b/api_docs/kbn_yarn_lock_validator.mdx index 74c8140a1348d..c7dd8ed74a200 100644 --- a/api_docs/kbn_yarn_lock_validator.mdx +++ b/api_docs/kbn_yarn_lock_validator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-yarn-lock-validator title: "@kbn/yarn-lock-validator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/yarn-lock-validator plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/yarn-lock-validator'] --- import kbnYarnLockValidatorObj from './kbn_yarn_lock_validator.devdocs.json'; diff --git a/api_docs/kibana_overview.mdx b/api_docs/kibana_overview.mdx index ec4bd0cba68c0..636f70a4f5c64 100644 --- a/api_docs/kibana_overview.mdx +++ b/api_docs/kibana_overview.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaOverview title: "kibanaOverview" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaOverview plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaOverview'] --- import kibanaOverviewObj from './kibana_overview.devdocs.json'; diff --git a/api_docs/kibana_react.devdocs.json b/api_docs/kibana_react.devdocs.json index bf5d418cd5014..969cebfb62b9e 100644 --- a/api_docs/kibana_react.devdocs.json +++ b/api_docs/kibana_react.devdocs.json @@ -699,126 +699,6 @@ "plugin": "spaces", "path": "x-pack/plugins/spaces/public/space_selector/space_selector.tsx" }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/authentication/access_agreement/access_agreement_page.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/authentication/access_agreement/access_agreement_page.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/authentication/access_agreement/access_agreement_page.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/authentication/logged_out/logged_out_page.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/authentication/logged_out/logged_out_page.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/authentication/logged_out/logged_out_page.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/authentication/login/login_page.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/authentication/login/login_page.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/authentication/login/login_page.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_page.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_page.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_page.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/management/api_keys/api_keys_management_app.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/management/api_keys/api_keys_management_app.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/management/api_keys/api_keys_management_app.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/management/users/users_management_app.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/management/users/users_management_app.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/management/users/users_management_app.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/management/roles/roles_management_app.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/management/roles/roles_management_app.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/management/roles/roles_management_app.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/account_management/account_management_app.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/account_management/account_management_app.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/account_management/account_management_app.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/nav_control/nav_control_service.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/nav_control/nav_control_service.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/nav_control/nav_control_service.tsx" - }, { "plugin": "savedObjects", "path": "src/plugins/saved_objects/public/save_modal/show_saved_object_save_modal.tsx" @@ -1115,6 +995,126 @@ "plugin": "lens", "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx" }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/authentication/access_agreement/access_agreement_page.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/authentication/access_agreement/access_agreement_page.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/authentication/access_agreement/access_agreement_page.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/authentication/logged_out/logged_out_page.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/authentication/logged_out/logged_out_page.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/authentication/logged_out/logged_out_page.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/authentication/login/login_page.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/authentication/login/login_page.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/authentication/login/login_page.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_page.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_page.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_page.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/api_keys/api_keys_management_app.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/api_keys/api_keys_management_app.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/api_keys/api_keys_management_app.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/users/users_management_app.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/users/users_management_app.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/users/users_management_app.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/roles/roles_management_app.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/roles/roles_management_app.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/roles/roles_management_app.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/account_management/account_management_app.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/account_management/account_management_app.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/account_management/account_management_app.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/nav_control/nav_control_service.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/nav_control/nav_control_service.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/nav_control/nav_control_service.tsx" + }, { "plugin": "alerting", "path": "x-pack/plugins/alerting/public/application/maintenance_windows.tsx" @@ -1163,6 +1163,54 @@ "plugin": "cases", "path": "x-pack/plugins/cases/public/application.tsx" }, + { + "plugin": "aiops", + "path": "x-pack/plugins/aiops/public/embeddable/embeddable_change_point_chart.tsx" + }, + { + "plugin": "aiops", + "path": "x-pack/plugins/aiops/public/embeddable/embeddable_change_point_chart.tsx" + }, + { + "plugin": "aiops", + "path": "x-pack/plugins/aiops/public/embeddable/embeddable_change_point_chart.tsx" + }, + { + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/application/index.tsx" + }, + { + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/application/index.tsx" + }, + { + "plugin": "exploratoryView", + "path": "x-pack/plugins/exploratory_view/public/application/index.tsx" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/integrations/app.tsx" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/integrations/app.tsx" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/integrations/app.tsx" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/fleet/app.tsx" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/fleet/app.tsx" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/fleet/app.tsx" + }, { "plugin": "licenseManagement", "path": "x-pack/plugins/license_management/public/shared_imports.ts" @@ -1263,18 +1311,6 @@ "plugin": "dataVisualizer", "path": "x-pack/plugins/data_visualizer/public/application/data_drift/data_drift_app_state.tsx" }, - { - "plugin": "aiops", - "path": "x-pack/plugins/aiops/public/embeddable/embeddable_change_point_chart.tsx" - }, - { - "plugin": "aiops", - "path": "x-pack/plugins/aiops/public/embeddable/embeddable_change_point_chart.tsx" - }, - { - "plugin": "aiops", - "path": "x-pack/plugins/aiops/public/embeddable/embeddable_change_point_chart.tsx" - }, { "plugin": "ml", "path": "x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable.tsx" @@ -1323,42 +1359,6 @@ "plugin": "ml", "path": "x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx" }, - { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/application/index.tsx" - }, - { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/application/index.tsx" - }, - { - "plugin": "exploratoryView", - "path": "x-pack/plugins/exploratory_view/public/application/index.tsx" - }, - { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/integrations/app.tsx" - }, - { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/integrations/app.tsx" - }, - { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/integrations/app.tsx" - }, - { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/app.tsx" - }, - { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/app.tsx" - }, - { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/app.tsx" - }, { "plugin": "infra", "path": "x-pack/plugins/infra/public/apps/common_providers.tsx" @@ -2676,18 +2676,6 @@ "plugin": "savedObjectsManagement", "path": "src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx" }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx" - }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx" - }, { "plugin": "exploratoryView", "path": "x-pack/plugins/exploratory_view/public/application/index.tsx" @@ -2772,6 +2760,18 @@ "plugin": "observability", "path": "x-pack/plugins/observability/public/application/index.tsx" }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx" + }, { "plugin": "apm", "path": "x-pack/plugins/apm/public/components/routing/app_root/index.tsx" @@ -3033,30 +3033,6 @@ "plugin": "data", "path": "src/plugins/data/public/search/search_service.ts" }, - { - "plugin": "licensing", - "path": "x-pack/plugins/licensing/public/expired_banner.tsx" - }, - { - "plugin": "licensing", - "path": "x-pack/plugins/licensing/public/expired_banner.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/account_management/account_management_app.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/account_management/account_management_app.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/session/session_expiration_toast.tsx" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/public/session/session_expiration_toast.tsx" - }, { "plugin": "savedObjects", "path": "src/plugins/saved_objects/public/saved_object/helpers/confirm_modal_promise.tsx" @@ -3217,6 +3193,14 @@ "plugin": "dashboard", "path": "src/plugins/dashboard/public/dashboard_listing/dashboard_listing_table.tsx" }, + { + "plugin": "licensing", + "path": "x-pack/plugins/licensing/public/expired_banner.tsx" + }, + { + "plugin": "licensing", + "path": "x-pack/plugins/licensing/public/expired_banner.tsx" + }, { "plugin": "savedObjectsTagging", "path": "x-pack/plugins/saved_objects_tagging/public/components/edition_modal/open_modal.tsx" @@ -3281,6 +3265,22 @@ "plugin": "lens", "path": "x-pack/plugins/lens/public/trigger_actions/open_lens_config/helpers.ts" }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/account_management/account_management_app.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/account_management/account_management_app.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/session/session_expiration_toast.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/session/session_expiration_toast.tsx" + }, { "plugin": "triggersActionsUi", "path": "x-pack/plugins/triggers_actions_ui/public/application/hooks/use_bulk_edit_response.tsx" @@ -3349,30 +3349,6 @@ "plugin": "observabilityShared", "path": "x-pack/plugins/observability_shared/public/components/header_menu/header_menu_portal.tsx" }, - { - "plugin": "telemetry", - "path": "src/plugins/telemetry/public/services/telemetry_notifications/render_opt_in_status_notice_banner.tsx" - }, - { - "plugin": "telemetry", - "path": "src/plugins/telemetry/public/services/telemetry_notifications/render_opt_in_status_notice_banner.tsx" - }, - { - "plugin": "advancedSettings", - "path": "src/plugins/advanced_settings/public/management_app/components/form/form.tsx" - }, - { - "plugin": "advancedSettings", - "path": "src/plugins/advanced_settings/public/management_app/components/form/form.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/render_app.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/render_app.tsx" - }, { "plugin": "exploratoryView", "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/header/add_to_case_action.tsx" @@ -3470,12 +3446,28 @@ "path": "x-pack/plugins/fleet/public/applications/integrations/components/header/header_portal.tsx" }, { - "plugin": "observability", - "path": "x-pack/plugins/observability/public/pages/overview/components/header_menu/header_menu_portal.tsx" + "plugin": "telemetry", + "path": "src/plugins/telemetry/public/services/telemetry_notifications/render_opt_in_status_notice_banner.tsx" }, { - "plugin": "observability", - "path": "x-pack/plugins/observability/public/pages/overview/components/header_menu/header_menu_portal.tsx" + "plugin": "telemetry", + "path": "src/plugins/telemetry/public/services/telemetry_notifications/render_opt_in_status_notice_banner.tsx" + }, + { + "plugin": "advancedSettings", + "path": "src/plugins/advanced_settings/public/management_app/components/form/form.tsx" + }, + { + "plugin": "advancedSettings", + "path": "src/plugins/advanced_settings/public/management_app/components/form/form.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/render_app.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/render_app.tsx" }, { "plugin": "banners", diff --git a/api_docs/kibana_react.mdx b/api_docs/kibana_react.mdx index 80d17157a337c..9b32c6e03b32d 100644 --- a/api_docs/kibana_react.mdx +++ b/api_docs/kibana_react.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaReact title: "kibanaReact" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaReact plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaReact'] --- import kibanaReactObj from './kibana_react.devdocs.json'; diff --git a/api_docs/kibana_utils.devdocs.json b/api_docs/kibana_utils.devdocs.json index 49a839d4e4d8c..a0c1a249a615d 100644 --- a/api_docs/kibana_utils.devdocs.json +++ b/api_docs/kibana_utils.devdocs.json @@ -7095,21 +7095,6 @@ "deprecated": false, "trackAdoption": false }, - { - "parentPluginId": "kibanaUtils", - "id": "def-server.KbnServerError.requestParams", - "type": "Object", - "tags": [], - "label": "requestParams", - "description": [], - "signature": [ - "ConnectionRequestParams", - " | undefined" - ], - "path": "src/plugins/kibana_utils/server/report_server_error.ts", - "deprecated": false, - "trackAdoption": false - }, { "parentPluginId": "kibanaUtils", "id": "def-server.KbnServerError.Unnamed", @@ -7168,22 +7153,6 @@ "deprecated": false, "trackAdoption": false, "isRequired": false - }, - { - "parentPluginId": "kibanaUtils", - "id": "def-server.KbnServerError.Unnamed.$4", - "type": "Object", - "tags": [], - "label": "requestParams", - "description": [], - "signature": [ - "ConnectionRequestParams", - " | undefined" - ], - "path": "src/plugins/kibana_utils/server/report_server_error.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false } ], "returnComment": [] diff --git a/api_docs/kibana_utils.mdx b/api_docs/kibana_utils.mdx index 6701b3646dc85..dae5ccb5c4700 100644 --- a/api_docs/kibana_utils.mdx +++ b/api_docs/kibana_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaUtils title: "kibanaUtils" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaUtils plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaUtils'] --- import kibanaUtilsObj from './kibana_utils.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-app-services](https://github.com/orgs/elastic/teams/kib | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 612 | 3 | 419 | 9 | +| 610 | 3 | 417 | 9 | ## Client diff --git a/api_docs/kubernetes_security.mdx b/api_docs/kubernetes_security.mdx index c64e263d41078..9b164c0bcc748 100644 --- a/api_docs/kubernetes_security.mdx +++ b/api_docs/kubernetes_security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kubernetesSecurity title: "kubernetesSecurity" image: https://source.unsplash.com/400x175/?github description: API docs for the kubernetesSecurity plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kubernetesSecurity'] --- import kubernetesSecurityObj from './kubernetes_security.devdocs.json'; diff --git a/api_docs/lens.devdocs.json b/api_docs/lens.devdocs.json index c3d51198daa32..85fcc29954018 100644 --- a/api_docs/lens.devdocs.json +++ b/api_docs/lens.devdocs.json @@ -1636,6 +1636,20 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "lens", + "id": "def-public.DataLayerArgs.colorMapping", + "type": "string", + "tags": [], + "label": "colorMapping", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "lens", "id": "def-public.DataLayerArgs.decorations", @@ -4673,6 +4687,21 @@ "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "lens", + "id": "def-public.SharedPieLayerState.colorMapping", + "type": "Object", + "tags": [], + "label": "colorMapping", + "description": [], + "signature": [ + "Config", + " | undefined" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -4998,11 +5027,14 @@ { "parentPluginId": "lens", "id": "def-public.SuggestionRequest.mainPalette", - "type": "Object", + "type": "CompoundType", "tags": [], "label": "mainPalette", - "description": [], + "description": [ + "\nPassing the legacy palette or the new color mapping if available" + ], "signature": [ + "{ type: \"legacyPalette\"; value: ", { "pluginId": "@kbn/coloring", "scope": "common", @@ -5010,7 +5042,9 @@ "section": "def-common.PaletteOutput", "text": "PaletteOutput" }, - "<{ [key: string]: unknown; }> | undefined" + "<{ [key: string]: unknown; }>; } | { type: \"colorMapping\"; value: ", + "Config", + "; } | undefined" ], "path": "x-pack/plugins/lens/public/types.ts", "deprecated": false, @@ -5319,7 +5353,7 @@ "\nInitialize is allowed to modify the state stored in memory. The initialize function\nis called with a previous state in two cases:\n- Loading from a saved visualization\n- When using suggestions, the suggested state is passed in" ], "signature": [ - "{ (addNewLayer: () => string, nonPersistedState?: T | undefined, mainPalette?: ", + "{ (addNewLayer: () => string, nonPersistedState?: T | undefined, mainPalette?: { type: \"legacyPalette\"; value: ", { "pluginId": "@kbn/coloring", "scope": "common", @@ -5327,7 +5361,9 @@ "section": "def-common.PaletteOutput", "text": "PaletteOutput" }, - "<{ [key: string]: unknown; }> | undefined): T; (addNewLayer: () => string, persistedState: P, mainPalette?: ", + "<{ [key: string]: unknown; }>; } | { type: \"colorMapping\"; value: ", + "Config", + "; } | undefined): T; (addNewLayer: () => string, persistedState: P, mainPalette?: { type: \"legacyPalette\"; value: ", { "pluginId": "@kbn/coloring", "scope": "common", @@ -5335,7 +5371,9 @@ "section": "def-common.PaletteOutput", "text": "PaletteOutput" }, - "<{ [key: string]: unknown; }> | undefined, annotationGroups?: ", + "<{ [key: string]: unknown; }>; } | { type: \"colorMapping\"; value: ", + "Config", + "; } | undefined, annotationGroups?: ", "AnnotationGroups", " | undefined, references?: ", { @@ -5440,7 +5478,7 @@ "label": "getMainPalette", "description": [], "signature": [ - "((state: T) => ", + "((state: T) => { type: \"legacyPalette\"; value: ", { "pluginId": "@kbn/coloring", "scope": "common", @@ -5448,7 +5486,9 @@ "section": "def-common.PaletteOutput", "text": "PaletteOutput" }, - "<{ [key: string]: unknown; }> | undefined) | undefined" + "<{ [key: string]: unknown; }>; } | { type: \"colorMapping\"; value: ", + "Config", + "; } | undefined) | undefined" ], "path": "x-pack/plugins/lens/public/types.ts", "deprecated": false, @@ -8821,6 +8861,21 @@ "path": "x-pack/plugins/lens/public/visualizations/xy/types.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "lens", + "id": "def-public.XYDataLayerConfig.colorMapping", + "type": "Object", + "tags": [], + "label": "colorMapping", + "description": [], + "signature": [ + "Config", + " | undefined" + ], + "path": "x-pack/plugins/lens/public/visualizations/xy/types.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/lens.mdx b/api_docs/lens.mdx index 7cd4770929227..985cb7981efcc 100644 --- a/api_docs/lens.mdx +++ b/api_docs/lens.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/lens title: "lens" image: https://source.unsplash.com/400x175/?github description: API docs for the lens plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lens'] --- import lensObj from './lens.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/k | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 622 | 0 | 524 | 60 | +| 625 | 0 | 526 | 60 | ## Client diff --git a/api_docs/license_api_guard.mdx b/api_docs/license_api_guard.mdx index 13ef1ab394700..3a4f26745ce44 100644 --- a/api_docs/license_api_guard.mdx +++ b/api_docs/license_api_guard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licenseApiGuard title: "licenseApiGuard" image: https://source.unsplash.com/400x175/?github description: API docs for the licenseApiGuard plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseApiGuard'] --- import licenseApiGuardObj from './license_api_guard.devdocs.json'; diff --git a/api_docs/license_management.mdx b/api_docs/license_management.mdx index 9781e2e619806..166199eb57f63 100644 --- a/api_docs/license_management.mdx +++ b/api_docs/license_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licenseManagement title: "licenseManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the licenseManagement plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseManagement'] --- import licenseManagementObj from './license_management.devdocs.json'; diff --git a/api_docs/licensing.devdocs.json b/api_docs/licensing.devdocs.json index a11ca0da7cead..d041c80cac66d 100644 --- a/api_docs/licensing.devdocs.json +++ b/api_docs/licensing.devdocs.json @@ -810,14 +810,14 @@ "plugin": "security", "path": "x-pack/plugins/security/public/plugin.tsx" }, - { - "plugin": "licenseManagement", - "path": "x-pack/plugins/license_management/public/plugin.ts" - }, { "plugin": "aiops", "path": "x-pack/plugins/aiops/public/plugin.tsx" }, + { + "plugin": "licenseManagement", + "path": "x-pack/plugins/license_management/public/plugin.ts" + }, { "plugin": "ml", "path": "x-pack/plugins/ml/public/plugin.ts" @@ -2190,14 +2190,6 @@ "plugin": "ml", "path": "x-pack/plugins/ml/server/plugin.ts" }, - { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/server/handlers/action/create_action_service.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/query.ts" - }, { "plugin": "remoteClusters", "path": "x-pack/plugins/remote_clusters/server/plugin.ts" @@ -2214,6 +2206,14 @@ "plugin": "mapsEms", "path": "src/plugins/maps_ems/server/index.ts" }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/server/handlers/action/create_action_service.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/query.ts" + }, { "plugin": "painlessLab", "path": "x-pack/plugins/painless_lab/server/services/license.ts" diff --git a/api_docs/licensing.mdx b/api_docs/licensing.mdx index bdd5ae761633e..e100967683857 100644 --- a/api_docs/licensing.mdx +++ b/api_docs/licensing.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licensing title: "licensing" image: https://source.unsplash.com/400x175/?github description: API docs for the licensing plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licensing'] --- import licensingObj from './licensing.devdocs.json'; diff --git a/api_docs/lists.mdx b/api_docs/lists.mdx index b972f26d53fd9..5553f80e523e9 100644 --- a/api_docs/lists.mdx +++ b/api_docs/lists.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/lists title: "lists" image: https://source.unsplash.com/400x175/?github description: API docs for the lists plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lists'] --- import listsObj from './lists.devdocs.json'; diff --git a/api_docs/log_explorer.mdx b/api_docs/log_explorer.mdx index f469f093223bd..0cc6984dc390a 100644 --- a/api_docs/log_explorer.mdx +++ b/api_docs/log_explorer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/logExplorer title: "logExplorer" image: https://source.unsplash.com/400x175/?github description: API docs for the logExplorer plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'logExplorer'] --- import logExplorerObj from './log_explorer.devdocs.json'; diff --git a/api_docs/logs_shared.mdx b/api_docs/logs_shared.mdx index 8e828de602d64..f00996e75cca2 100644 --- a/api_docs/logs_shared.mdx +++ b/api_docs/logs_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/logsShared title: "logsShared" image: https://source.unsplash.com/400x175/?github description: API docs for the logsShared plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'logsShared'] --- import logsSharedObj from './logs_shared.devdocs.json'; diff --git a/api_docs/management.mdx b/api_docs/management.mdx index cd14617fdec7f..0e0c46c53764e 100644 --- a/api_docs/management.mdx +++ b/api_docs/management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/management title: "management" image: https://source.unsplash.com/400x175/?github description: API docs for the management plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'management'] --- import managementObj from './management.devdocs.json'; diff --git a/api_docs/maps.mdx b/api_docs/maps.mdx index 36a72da7410e0..67b4b584ef31a 100644 --- a/api_docs/maps.mdx +++ b/api_docs/maps.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/maps title: "maps" image: https://source.unsplash.com/400x175/?github description: API docs for the maps plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'maps'] --- import mapsObj from './maps.devdocs.json'; diff --git a/api_docs/maps_ems.mdx b/api_docs/maps_ems.mdx index 76b8ca25f50b5..8bf18655e1d6e 100644 --- a/api_docs/maps_ems.mdx +++ b/api_docs/maps_ems.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/mapsEms title: "mapsEms" image: https://source.unsplash.com/400x175/?github description: API docs for the mapsEms plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mapsEms'] --- import mapsEmsObj from './maps_ems.devdocs.json'; diff --git a/api_docs/metrics_data_access.mdx b/api_docs/metrics_data_access.mdx index 178fb946707a7..ad459244c6ab1 100644 --- a/api_docs/metrics_data_access.mdx +++ b/api_docs/metrics_data_access.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/metricsDataAccess title: "metricsDataAccess" image: https://source.unsplash.com/400x175/?github description: API docs for the metricsDataAccess plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'metricsDataAccess'] --- import metricsDataAccessObj from './metrics_data_access.devdocs.json'; diff --git a/api_docs/ml.devdocs.json b/api_docs/ml.devdocs.json index 1b83537191f21..8dfd6b380c2a4 100644 --- a/api_docs/ml.devdocs.json +++ b/api_docs/ml.devdocs.json @@ -1681,7 +1681,9 @@ "label": "AlertingService", "description": [], "signature": [ - "{ preview: (args_0: Readonly<{} & { timeRange: string; alertParams: Readonly<{} & { severity: number; jobSelection: Readonly<{} & { groupIds: string[]; jobIds: string[]; }>; resultType: \"bucket\" | \"record\" | \"influencer\"; includeInterim: boolean; lookbackInterval: string | null; topNBuckets: number | null; }>; sampleSize: number; }>) => Promise; execute: (params: Readonly<{} & { severity: number; jobSelection: Readonly<{} & { groupIds: string[]; jobIds: string[]; }>; resultType: \"bucket\" | \"record\" | \"influencer\"; includeInterim: boolean; lookbackInterval: string | null; topNBuckets: number | null; }>, spaceId: string) => Promise<{ context: ", + "{ preview: (args_0: Readonly<{} & { timeRange: string; alertParams: Readonly<{} & { severity: number; jobSelection: Readonly<{} & { groupIds: string[]; jobIds: string[]; }>; resultType: \"bucket\" | \"record\" | \"influencer\"; includeInterim: boolean; lookbackInterval: string | null; topNBuckets: number | null; }>; sampleSize: number; }>) => Promise; execute: (params: Readonly<{} & { severity: number; jobSelection: Readonly<{} & { groupIds: string[]; jobIds: string[]; }>; resultType: \"bucket\" | \"record\" | \"influencer\"; includeInterim: boolean; lookbackInterval: string | null; topNBuckets: number | null; }>, spaceId: string) => Promise<{ payload: ", + "AnomalyDetectionAlertPayload", + "; context: ", "AnomalyDetectionAlertContext", "; name: string; isHealthy: boolean; } | undefined>; }" ], @@ -1942,7 +1944,9 @@ "section": "def-common.KibanaRequest", "text": "KibanaRequest" }, - "): { preview: (args_0: Readonly<{} & { timeRange: string; alertParams: Readonly<{} & { severity: number; jobSelection: Readonly<{} & { groupIds: string[]; jobIds: string[]; }>; resultType: \"bucket\" | \"record\" | \"influencer\"; includeInterim: boolean; lookbackInterval: string | null; topNBuckets: number | null; }>; sampleSize: number; }>) => Promise; execute: (params: Readonly<{} & { severity: number; jobSelection: Readonly<{} & { groupIds: string[]; jobIds: string[]; }>; resultType: \"bucket\" | \"record\" | \"influencer\"; includeInterim: boolean; lookbackInterval: string | null; topNBuckets: number | null; }>, spaceId: string) => Promise<{ context: ", + "): { preview: (args_0: Readonly<{} & { timeRange: string; alertParams: Readonly<{} & { severity: number; jobSelection: Readonly<{} & { groupIds: string[]; jobIds: string[]; }>; resultType: \"bucket\" | \"record\" | \"influencer\"; includeInterim: boolean; lookbackInterval: string | null; topNBuckets: number | null; }>; sampleSize: number; }>) => Promise; execute: (params: Readonly<{} & { severity: number; jobSelection: Readonly<{} & { groupIds: string[]; jobIds: string[]; }>; resultType: \"bucket\" | \"record\" | \"influencer\"; includeInterim: boolean; lookbackInterval: string | null; topNBuckets: number | null; }>, spaceId: string) => Promise<{ payload: ", + "AnomalyDetectionAlertPayload", + "; context: ", "AnomalyDetectionAlertContext", "; name: string; isHealthy: boolean; } | undefined>; }; } & ", "TrainedModelsProvider" diff --git a/api_docs/ml.mdx b/api_docs/ml.mdx index 7500ed2c47a7e..7f91d6b944dbe 100644 --- a/api_docs/ml.mdx +++ b/api_docs/ml.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ml title: "ml" image: https://source.unsplash.com/400x175/?github description: API docs for the ml plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ml'] --- import mlObj from './ml.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) for questi | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 150 | 3 | 64 | 32 | +| 150 | 3 | 64 | 33 | ## Client diff --git a/api_docs/monitoring.mdx b/api_docs/monitoring.mdx index 291bb72d31061..9ee00ebe90cfb 100644 --- a/api_docs/monitoring.mdx +++ b/api_docs/monitoring.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/monitoring title: "monitoring" image: https://source.unsplash.com/400x175/?github description: API docs for the monitoring plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoring'] --- import monitoringObj from './monitoring.devdocs.json'; diff --git a/api_docs/monitoring_collection.mdx b/api_docs/monitoring_collection.mdx index 844304f01844e..cbd0e058b798e 100644 --- a/api_docs/monitoring_collection.mdx +++ b/api_docs/monitoring_collection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/monitoringCollection title: "monitoringCollection" image: https://source.unsplash.com/400x175/?github description: API docs for the monitoringCollection plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoringCollection'] --- import monitoringCollectionObj from './monitoring_collection.devdocs.json'; diff --git a/api_docs/navigation.mdx b/api_docs/navigation.mdx index 414f2b1627203..aa14168f5b778 100644 --- a/api_docs/navigation.mdx +++ b/api_docs/navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/navigation title: "navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the navigation plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'navigation'] --- import navigationObj from './navigation.devdocs.json'; diff --git a/api_docs/newsfeed.mdx b/api_docs/newsfeed.mdx index 1cd5f89d0c173..cb9db6673f83b 100644 --- a/api_docs/newsfeed.mdx +++ b/api_docs/newsfeed.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/newsfeed title: "newsfeed" image: https://source.unsplash.com/400x175/?github description: API docs for the newsfeed plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'newsfeed'] --- import newsfeedObj from './newsfeed.devdocs.json'; diff --git a/api_docs/no_data_page.mdx b/api_docs/no_data_page.mdx index 4ec525a2ec936..740b21f583fe0 100644 --- a/api_docs/no_data_page.mdx +++ b/api_docs/no_data_page.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/noDataPage title: "noDataPage" image: https://source.unsplash.com/400x175/?github description: API docs for the noDataPage plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'noDataPage'] --- import noDataPageObj from './no_data_page.devdocs.json'; diff --git a/api_docs/notifications.mdx b/api_docs/notifications.mdx index 107420ea385ed..f24145e25f2bc 100644 --- a/api_docs/notifications.mdx +++ b/api_docs/notifications.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/notifications title: "notifications" image: https://source.unsplash.com/400x175/?github description: API docs for the notifications plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'notifications'] --- import notificationsObj from './notifications.devdocs.json'; diff --git a/api_docs/observability.devdocs.json b/api_docs/observability.devdocs.json index 09cf4af27f97a..2ae7a710d02df 100644 --- a/api_docs/observability.devdocs.json +++ b/api_docs/observability.devdocs.json @@ -2616,6 +2616,26 @@ "path": "x-pack/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-public.ObservabilityPublicPluginsSetup.embeddable", + "type": "Object", + "tags": [], + "label": "embeddable", + "description": [], + "signature": [ + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.EmbeddableSetup", + "text": "EmbeddableSetup" + } + ], + "path": "x-pack/plugins/observability/public/plugin.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/observability.mdx b/api_docs/observability.mdx index 87179ca428b7d..d98f5662cb072 100644 --- a/api_docs/observability.mdx +++ b/api_docs/observability.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observability title: "observability" image: https://source.unsplash.com/400x175/?github description: API docs for the observability plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observability'] --- import observabilityObj from './observability.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/actionable-observability](https://github.com/orgs/elastic/team | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 546 | 2 | 537 | 14 | +| 547 | 2 | 538 | 14 | ## Client diff --git a/api_docs/observability_a_i_assistant.mdx b/api_docs/observability_a_i_assistant.mdx index a0db24e96fce2..ed59dd6f0cc68 100644 --- a/api_docs/observability_a_i_assistant.mdx +++ b/api_docs/observability_a_i_assistant.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityAIAssistant title: "observabilityAIAssistant" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityAIAssistant plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityAIAssistant'] --- import observabilityAIAssistantObj from './observability_a_i_assistant.devdocs.json'; diff --git a/api_docs/observability_log_explorer.mdx b/api_docs/observability_log_explorer.mdx index 2f938cef67d2d..07124026c43f9 100644 --- a/api_docs/observability_log_explorer.mdx +++ b/api_docs/observability_log_explorer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityLogExplorer title: "observabilityLogExplorer" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityLogExplorer plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityLogExplorer'] --- import observabilityLogExplorerObj from './observability_log_explorer.devdocs.json'; diff --git a/api_docs/observability_onboarding.mdx b/api_docs/observability_onboarding.mdx index f6704135387e0..68fb50c89b8c6 100644 --- a/api_docs/observability_onboarding.mdx +++ b/api_docs/observability_onboarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityOnboarding title: "observabilityOnboarding" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityOnboarding plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityOnboarding'] --- import observabilityOnboardingObj from './observability_onboarding.devdocs.json'; diff --git a/api_docs/observability_shared.mdx b/api_docs/observability_shared.mdx index dc78585ca3eaf..b176cfb1a6711 100644 --- a/api_docs/observability_shared.mdx +++ b/api_docs/observability_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityShared title: "observabilityShared" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityShared plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityShared'] --- import observabilitySharedObj from './observability_shared.devdocs.json'; diff --git a/api_docs/osquery.mdx b/api_docs/osquery.mdx index cfe2bee7e2387..90976d82c5165 100644 --- a/api_docs/osquery.mdx +++ b/api_docs/osquery.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/osquery title: "osquery" image: https://source.unsplash.com/400x175/?github description: API docs for the osquery plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'osquery'] --- import osqueryObj from './osquery.devdocs.json'; diff --git a/api_docs/painless_lab.mdx b/api_docs/painless_lab.mdx index 12a11dfc21a7a..afa934f145373 100644 --- a/api_docs/painless_lab.mdx +++ b/api_docs/painless_lab.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/painlessLab title: "painlessLab" image: https://source.unsplash.com/400x175/?github description: API docs for the painlessLab plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'painlessLab'] --- import painlessLabObj from './painless_lab.devdocs.json'; diff --git a/api_docs/plugin_directory.mdx b/api_docs/plugin_directory.mdx index aedae05cb938b..a1a9daff5a970 100644 --- a/api_docs/plugin_directory.mdx +++ b/api_docs/plugin_directory.mdx @@ -7,7 +7,7 @@ id: kibDevDocsPluginDirectory slug: /kibana-dev-docs/api-meta/plugin-api-directory title: Directory description: Directory of public APIs available through plugins or packages. -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -15,13 +15,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Count | Plugins or Packages with a
      public API | Number of teams | |--------------|----------|------------------------| -| 695 | 587 | 42 | +| 697 | 588 | 42 | ### Public API health stats | API Count | Any Count | Missing comments | Missing exports | |--------------|----------|-----------------|--------| -| 75054 | 223 | 63991 | 1543 | +| 75211 | 223 | 64115 | 1555 | ## Plugin Directory @@ -33,7 +33,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 773 | 1 | 742 | 50 | | | [@elastic/apm-ui](https://github.com/orgs/elastic/teams/apm-ui) | The user interface for Elastic APM | 29 | 0 | 29 | 119 | | | [@elastic/apm-ui](https://github.com/orgs/elastic/teams/apm-ui) | - | 9 | 0 | 9 | 0 | -| | [@elastic/infra-monitoring-ui](https://github.com/orgs/elastic/teams/infra-monitoring-ui) | Asset manager plugin for entity assets (inventory, topology, etc) | 2 | 0 | 2 | 0 | +| | [@elastic/infra-monitoring-ui](https://github.com/orgs/elastic/teams/infra-monitoring-ui) | Asset manager plugin for entity assets (inventory, topology, etc) | 9 | 0 | 9 | 2 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 9 | 0 | 9 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | Considering using bfetch capabilities when fetching large amounts of data. This services supports batching HTTP requests and streaming responses back. | 91 | 1 | 75 | 2 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds Canvas application to Kibana | 9 | 0 | 8 | 3 | @@ -57,14 +57,14 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/fleet](https://github.com/orgs/elastic/teams/fleet) | Add custom data integrations so they can be displayed in the Fleet integrations app | 268 | 0 | 249 | 1 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds the Dashboard app to Kibana | 101 | 0 | 98 | 9 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | - | 54 | 0 | 51 | 0 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | 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. | 3310 | 33 | 2575 | 24 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | 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. | 3311 | 33 | 2577 | 24 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin provides the ability to create data views via a modal flyout inside Kibana apps | 35 | 0 | 25 | 5 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | Reusable data view field editor across Kibana | 72 | 0 | 33 | 0 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | Data view management app | 2 | 0 | 2 | 0 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | 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. | 1037 | 0 | 257 | 2 | | | [@elastic/ml-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. | 31 | 3 | 25 | 1 | | | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 12 | 0 | 10 | 3 | -| | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the Discover application and the saved search embeddable. | 116 | 0 | 75 | 17 | +| | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the Discover application and the saved search embeddable. | 117 | 0 | 75 | 18 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 37 | 0 | 35 | 2 | | | [@elastic/security-threat-hunting-investigations](https://github.com/orgs/elastic/teams/security-threat-hunting-investigations) | APIs used to assess the quality of data in Elasticsearch indexes | 2 | 0 | 0 | 0 | | | [@elastic/security-solution](https://github.com/orgs/elastic/teams/security-solution) | Server APIs for the Elastic AI Assistant | 4 | 0 | 2 | 0 | @@ -89,7 +89,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'revealImage' function and renderer to expressions | 14 | 0 | 14 | 3 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'shape' function and renderer to expressions | 148 | 0 | 146 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Expression Tagcloud plugin adds a `tagcloud` renderer and function to the expression plugin. The renderer will display the `Wordcloud` chart. | 6 | 0 | 6 | 2 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Expression XY plugin adds a `xy` renderer and function to the expression plugin. The renderer will display the `xy` chart. | 175 | 0 | 165 | 13 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Expression XY plugin adds a `xy` renderer and function to the expression plugin. The renderer will display the `xy` chart. | 176 | 0 | 166 | 13 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Adds expression runtime to Kibana | 2208 | 17 | 1749 | 5 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 235 | 0 | 99 | 2 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | Index pattern fields and ambiguous values formatters | 292 | 5 | 253 | 3 | @@ -116,9 +116,9 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 6 | 0 | 6 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 176 | 0 | 138 | 4 | | kibanaUsageCollection | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | -| | [@elastic/kibana-app-services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 612 | 3 | 419 | 9 | +| | [@elastic/kibana-app-services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 610 | 3 | 417 | 9 | | | [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic/teams/kibana-cloud-security-posture) | - | 5 | 0 | 5 | 1 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Visualization editor allowing to quickly and easily configure compelling visualizations to use on dashboards and canvas workpads. Exposes components to embed visualizations and link into the Lens editor from within other apps in Kibana. | 622 | 0 | 524 | 60 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Visualization editor allowing to quickly and easily configure compelling visualizations to use on dashboards and canvas workpads. Exposes components to embed visualizations and link into the Lens editor from within other apps in Kibana. | 625 | 0 | 526 | 60 | | | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 8 | 0 | 8 | 0 | | | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 4 | 0 | 4 | 1 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 117 | 0 | 42 | 10 | @@ -130,14 +130,14 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-gis](https://github.com/orgs/elastic/teams/kibana-gis) | - | 259 | 0 | 258 | 28 | | | [@elastic/kibana-gis](https://github.com/orgs/elastic/teams/kibana-gis) | - | 67 | 0 | 67 | 0 | | | [@elastic/infra-monitoring-ui](https://github.com/orgs/elastic/teams/infra-monitoring-ui) | Exposes utilities for accessing metrics data | 14 | 0 | 14 | 0 | -| | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the machine learning features provided by Elastic. | 150 | 3 | 64 | 32 | +| | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the machine learning features provided by Elastic. | 150 | 3 | 64 | 33 | | | [@elastic/infra-monitoring-ui](https://github.com/orgs/elastic/teams/infra-monitoring-ui) | - | 15 | 3 | 13 | 1 | | | [@elastic/infra-monitoring-ui](https://github.com/orgs/elastic/teams/infra-monitoring-ui) | - | 9 | 0 | 9 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 34 | 0 | 34 | 2 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 17 | 0 | 17 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 3 | 0 | 3 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 2 | 0 | 2 | 1 | -| | [@elastic/actionable-observability](https://github.com/orgs/elastic/teams/actionable-observability) | - | 546 | 2 | 537 | 14 | +| | [@elastic/actionable-observability](https://github.com/orgs/elastic/teams/actionable-observability) | - | 547 | 2 | 538 | 14 | | | [@elastic/obs-ai-assistant](https://github.com/orgs/elastic/teams/obs-ai-assistant) | - | 42 | 0 | 39 | 7 | | | [@elastic/infra-monitoring-ui](https://github.com/orgs/elastic/teams/infra-monitoring-ui) | This plugin exposes and registers observability log consumption features. | 15 | 0 | 15 | 1 | | | [@elastic/apm-ui](https://github.com/orgs/elastic/teams/apm-ui) | - | 14 | 0 | 14 | 0 | @@ -155,14 +155,14 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 129 | 2 | 118 | 4 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 25 | 0 | 25 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 161 | 0 | 147 | 2 | -| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 79 | 0 | 73 | 3 | -| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 100 | 0 | 52 | 1 | +| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 87 | 0 | 81 | 3 | +| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 104 | 0 | 56 | 1 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the definition and helper methods around saved searches, used by discover and visualizations. | 72 | 0 | 71 | 3 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 32 | 0 | 13 | 0 | | | [@elastic/kibana-reporting-services](https://github.com/orgs/elastic/teams/kibana-reporting-services) | Kibana Screenshotting Plugin | 27 | 0 | 8 | 5 | | searchprofiler | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 0 | 0 | 0 | 0 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides authentication and authorization features, and exposes functionality to understand the capabilities of the currently authenticated user. | 270 | 0 | 87 | 3 | -| | [@elastic/security-solution](https://github.com/orgs/elastic/teams/security-solution) | - | 172 | 0 | 106 | 32 | +| | [@elastic/security-solution](https://github.com/orgs/elastic/teams/security-solution) | - | 174 | 0 | 108 | 32 | | | [@elastic/security-solution](https://github.com/orgs/elastic/teams/security-solution) | ESS customizations for Security Solution. | 6 | 0 | 6 | 0 | | | [@elastic/security-solution](https://github.com/orgs/elastic/teams/security-solution) | Serverless customizations for security. | 6 | 0 | 6 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | The core Serverless plugin, providing APIs to Serverless Project plugins. | 19 | 0 | 18 | 0 | @@ -220,9 +220,9 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 11 | 5 | 11 | 0 | | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 35 | 0 | 0 | 0 | | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 20 | 0 | 0 | 0 | -| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 24 | 3 | 24 | 0 | +| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 27 | 3 | 27 | 0 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 23 | 0 | 22 | 0 | -| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 29 | 0 | 29 | 0 | +| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 30 | 0 | 30 | 0 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 10 | 0 | 9 | 1 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 73 | 0 | 73 | 2 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 98 | 0 | 0 | 0 | @@ -238,7 +238,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-qa](https://github.com/orgs/elastic/teams/kibana-qa) | - | 12 | 0 | 12 | 0 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 19 | 0 | 16 | 0 | | | [@elastic/security-threat-hunting-explore](https://github.com/orgs/elastic/teams/security-threat-hunting-explore) | - | 62 | 1 | 44 | 3 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 11 | 0 | 8 | 0 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 14 | 0 | 10 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 78 | 0 | 78 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 7 | 0 | 2 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 3 | 0 | 3 | 0 | @@ -246,7 +246,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 2 | 0 | 2 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 2 | 0 | 2 | 1 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 33 | 0 | 32 | 0 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 116 | 0 | 90 | 1 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 206 | 0 | 169 | 8 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 75 | 0 | 46 | 10 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 24 | 0 | 24 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 140 | 3 | 137 | 18 | @@ -254,7 +254,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 15 | 0 | 15 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 10 | 0 | 10 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 59 | 0 | 41 | 4 | -| | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 189 | 1 | 124 | 0 | +| | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 191 | 1 | 126 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 4 | 0 | 0 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 7 | 0 | 7 | 1 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 4 | 0 | 4 | 0 | @@ -276,7 +276,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 5 | 0 | 0 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 16 | 0 | 7 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 6 | 0 | 6 | 0 | -| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 170 | 0 | 68 | 1 | +| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 172 | 0 | 70 | 1 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 3 | 0 | 3 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 4 | 0 | 4 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 8 | 0 | 8 | 0 | @@ -468,7 +468,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 52 | 12 | 43 | 0 | | | [@elastic/apm-ui](https://github.com/orgs/elastic/teams/apm-ui) | - | 52 | 0 | 52 | 4 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 13 | 0 | 13 | 0 | -| | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 85 | 0 | 77 | 5 | +| | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 85 | 0 | 77 | 6 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 41 | 2 | 35 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 108 | 0 | 107 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 7 | 0 | 5 | 0 | @@ -477,14 +477,15 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 8 | 0 | 8 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 6 | 0 | 1 | 1 | | | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 10 | 0 | 10 | 1 | +| | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 23 | 0 | 3 | 0 | | | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 20 | 0 | 5 | 0 | -| | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 26 | 0 | 7 | 0 | +| | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 23 | 0 | 7 | 0 | | | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 8 | 0 | 2 | 3 | | | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 45 | 0 | 0 | 0 | | | [@elastic/appex-sharedux @elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/appex-sharedux ) | - | 127 | 0 | 127 | 0 | | | [@elastic/appex-sharedux @elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/appex-sharedux ) | - | 20 | 0 | 11 | 0 | -| | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 75 | 0 | 0 | 0 | -| | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 50 | 0 | 2 | 0 | +| | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 81 | 0 | 3 | 0 | +| | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 54 | 0 | 6 | 0 | | | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 2 | 0 | 0 | 0 | | | [@elastic/kibana-gis](https://github.com/orgs/elastic/teams/kibana-gis) | - | 582 | 1 | 1 | 0 | | | [@elastic/kibana-gis](https://github.com/orgs/elastic/teams/kibana-gis) | - | 2 | 0 | 2 | 0 | diff --git a/api_docs/presentation_util.mdx b/api_docs/presentation_util.mdx index a7df5dbbdc9b7..51466986c9483 100644 --- a/api_docs/presentation_util.mdx +++ b/api_docs/presentation_util.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/presentationUtil title: "presentationUtil" image: https://source.unsplash.com/400x175/?github description: API docs for the presentationUtil plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'presentationUtil'] --- import presentationUtilObj from './presentation_util.devdocs.json'; diff --git a/api_docs/profiling.mdx b/api_docs/profiling.mdx index da15a17a8701d..2695d1b6ee835 100644 --- a/api_docs/profiling.mdx +++ b/api_docs/profiling.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/profiling title: "profiling" image: https://source.unsplash.com/400x175/?github description: API docs for the profiling plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'profiling'] --- import profilingObj from './profiling.devdocs.json'; diff --git a/api_docs/profiling_data_access.mdx b/api_docs/profiling_data_access.mdx index cf17673b30abc..0cd1d97372b50 100644 --- a/api_docs/profiling_data_access.mdx +++ b/api_docs/profiling_data_access.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/profilingDataAccess title: "profilingDataAccess" image: https://source.unsplash.com/400x175/?github description: API docs for the profilingDataAccess plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'profilingDataAccess'] --- import profilingDataAccessObj from './profiling_data_access.devdocs.json'; diff --git a/api_docs/remote_clusters.mdx b/api_docs/remote_clusters.mdx index b901f9a36a529..254fc8e6dbc16 100644 --- a/api_docs/remote_clusters.mdx +++ b/api_docs/remote_clusters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/remoteClusters title: "remoteClusters" image: https://source.unsplash.com/400x175/?github description: API docs for the remoteClusters plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'remoteClusters'] --- import remoteClustersObj from './remote_clusters.devdocs.json'; diff --git a/api_docs/reporting.mdx b/api_docs/reporting.mdx index f8cb1dfda797d..3627f05b5a06b 100644 --- a/api_docs/reporting.mdx +++ b/api_docs/reporting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/reporting title: "reporting" image: https://source.unsplash.com/400x175/?github description: API docs for the reporting plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'reporting'] --- import reportingObj from './reporting.devdocs.json'; diff --git a/api_docs/rollup.mdx b/api_docs/rollup.mdx index 7b76a4472eb3d..fb3e95de87da5 100644 --- a/api_docs/rollup.mdx +++ b/api_docs/rollup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/rollup title: "rollup" image: https://source.unsplash.com/400x175/?github description: API docs for the rollup plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'rollup'] --- import rollupObj from './rollup.devdocs.json'; diff --git a/api_docs/rule_registry.mdx b/api_docs/rule_registry.mdx index dc821f68e9716..e8eab67980299 100644 --- a/api_docs/rule_registry.mdx +++ b/api_docs/rule_registry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ruleRegistry title: "ruleRegistry" image: https://source.unsplash.com/400x175/?github description: API docs for the ruleRegistry plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ruleRegistry'] --- import ruleRegistryObj from './rule_registry.devdocs.json'; diff --git a/api_docs/runtime_fields.mdx b/api_docs/runtime_fields.mdx index eabf54d9a0978..e8b54826e227f 100644 --- a/api_docs/runtime_fields.mdx +++ b/api_docs/runtime_fields.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/runtimeFields title: "runtimeFields" image: https://source.unsplash.com/400x175/?github description: API docs for the runtimeFields plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'runtimeFields'] --- import runtimeFieldsObj from './runtime_fields.devdocs.json'; diff --git a/api_docs/saved_objects.mdx b/api_docs/saved_objects.mdx index 40a29c00deff5..fc6026153c7fe 100644 --- a/api_docs/saved_objects.mdx +++ b/api_docs/saved_objects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjects title: "savedObjects" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjects plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjects'] --- import savedObjectsObj from './saved_objects.devdocs.json'; diff --git a/api_docs/saved_objects_finder.mdx b/api_docs/saved_objects_finder.mdx index 829153060eae1..e1609045307b5 100644 --- a/api_docs/saved_objects_finder.mdx +++ b/api_docs/saved_objects_finder.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsFinder title: "savedObjectsFinder" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsFinder plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsFinder'] --- import savedObjectsFinderObj from './saved_objects_finder.devdocs.json'; diff --git a/api_docs/saved_objects_management.mdx b/api_docs/saved_objects_management.mdx index 26a7be94eb550..6ff02424f663d 100644 --- a/api_docs/saved_objects_management.mdx +++ b/api_docs/saved_objects_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsManagement title: "savedObjectsManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsManagement plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsManagement'] --- import savedObjectsManagementObj from './saved_objects_management.devdocs.json'; diff --git a/api_docs/saved_objects_tagging.devdocs.json b/api_docs/saved_objects_tagging.devdocs.json index 510e34a445e1e..96983288749a3 100644 --- a/api_docs/saved_objects_tagging.devdocs.json +++ b/api_docs/saved_objects_tagging.devdocs.json @@ -339,6 +339,73 @@ ], "returnComment": [] }, + { + "parentPluginId": "savedObjectsTagging", + "id": "def-server.ITagsClient.findByName", + "type": "Function", + "tags": [], + "label": "findByName", + "description": [], + "signature": [ + "(name: string, options?: { exact?: boolean | undefined; } | undefined) => Promise<", + { + "pluginId": "savedObjectsTaggingOss", + "scope": "common", + "docId": "kibSavedObjectsTaggingOssPluginApi", + "section": "def-common.Tag", + "text": "Tag" + }, + " | null>" + ], + "path": "src/plugins/saved_objects_tagging_oss/common/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "savedObjectsTagging", + "id": "def-server.ITagsClient.findByName.$1", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/saved_objects_tagging_oss/common/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "savedObjectsTagging", + "id": "def-server.ITagsClient.findByName.$2", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "path": "src/plugins/saved_objects_tagging_oss/common/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "savedObjectsTagging", + "id": "def-server.ITagsClient.findByName.$2.exact", + "type": "CompoundType", + "tags": [], + "label": "exact", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/saved_objects_tagging_oss/common/types.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, { "parentPluginId": "savedObjectsTagging", "id": "def-server.ITagsClient.delete", @@ -931,6 +998,73 @@ ], "returnComment": [] }, + { + "parentPluginId": "savedObjectsTagging", + "id": "def-common.ITagsClient.findByName", + "type": "Function", + "tags": [], + "label": "findByName", + "description": [], + "signature": [ + "(name: string, options?: { exact?: boolean | undefined; } | undefined) => Promise<", + { + "pluginId": "savedObjectsTaggingOss", + "scope": "common", + "docId": "kibSavedObjectsTaggingOssPluginApi", + "section": "def-common.Tag", + "text": "Tag" + }, + " | null>" + ], + "path": "src/plugins/saved_objects_tagging_oss/common/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "savedObjectsTagging", + "id": "def-common.ITagsClient.findByName.$1", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/saved_objects_tagging_oss/common/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "savedObjectsTagging", + "id": "def-common.ITagsClient.findByName.$2", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "path": "src/plugins/saved_objects_tagging_oss/common/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "savedObjectsTagging", + "id": "def-common.ITagsClient.findByName.$2.exact", + "type": "CompoundType", + "tags": [], + "label": "exact", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/saved_objects_tagging_oss/common/types.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, { "parentPluginId": "savedObjectsTagging", "id": "def-common.ITagsClient.delete", diff --git a/api_docs/saved_objects_tagging.mdx b/api_docs/saved_objects_tagging.mdx index 9ce73f3b3d1e1..277693959e8c1 100644 --- a/api_docs/saved_objects_tagging.mdx +++ b/api_docs/saved_objects_tagging.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsTagging title: "savedObjectsTagging" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsTagging plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTagging'] --- import savedObjectsTaggingObj from './saved_objects_tagging.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sh | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 79 | 0 | 73 | 3 | +| 87 | 0 | 81 | 3 | ## Client diff --git a/api_docs/saved_objects_tagging_oss.devdocs.json b/api_docs/saved_objects_tagging_oss.devdocs.json index 97b83dc8f3ea2..991e3715a11d9 100644 --- a/api_docs/saved_objects_tagging_oss.devdocs.json +++ b/api_docs/saved_objects_tagging_oss.devdocs.json @@ -1829,6 +1829,73 @@ ], "returnComment": [] }, + { + "parentPluginId": "savedObjectsTaggingOss", + "id": "def-common.ITagsClient.findByName", + "type": "Function", + "tags": [], + "label": "findByName", + "description": [], + "signature": [ + "(name: string, options?: { exact?: boolean | undefined; } | undefined) => Promise<", + { + "pluginId": "savedObjectsTaggingOss", + "scope": "common", + "docId": "kibSavedObjectsTaggingOssPluginApi", + "section": "def-common.Tag", + "text": "Tag" + }, + " | null>" + ], + "path": "src/plugins/saved_objects_tagging_oss/common/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "savedObjectsTaggingOss", + "id": "def-common.ITagsClient.findByName.$1", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/saved_objects_tagging_oss/common/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "savedObjectsTaggingOss", + "id": "def-common.ITagsClient.findByName.$2", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "path": "src/plugins/saved_objects_tagging_oss/common/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "savedObjectsTaggingOss", + "id": "def-common.ITagsClient.findByName.$2.exact", + "type": "CompoundType", + "tags": [], + "label": "exact", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/saved_objects_tagging_oss/common/types.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, { "parentPluginId": "savedObjectsTaggingOss", "id": "def-common.ITagsClient.delete", diff --git a/api_docs/saved_objects_tagging_oss.mdx b/api_docs/saved_objects_tagging_oss.mdx index b8d0a2b0523bb..582c4245a32ae 100644 --- a/api_docs/saved_objects_tagging_oss.mdx +++ b/api_docs/saved_objects_tagging_oss.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsTaggingOss title: "savedObjectsTaggingOss" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsTaggingOss plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTaggingOss'] --- import savedObjectsTaggingOssObj from './saved_objects_tagging_oss.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sh | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 100 | 0 | 52 | 1 | +| 104 | 0 | 56 | 1 | ## Client diff --git a/api_docs/saved_search.mdx b/api_docs/saved_search.mdx index 7f8b2df03ff0c..cb676f293a0c8 100644 --- a/api_docs/saved_search.mdx +++ b/api_docs/saved_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedSearch title: "savedSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the savedSearch plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedSearch'] --- import savedSearchObj from './saved_search.devdocs.json'; diff --git a/api_docs/screenshot_mode.mdx b/api_docs/screenshot_mode.mdx index e979a313e3459..61d29cd983a6b 100644 --- a/api_docs/screenshot_mode.mdx +++ b/api_docs/screenshot_mode.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/screenshotMode title: "screenshotMode" image: https://source.unsplash.com/400x175/?github description: API docs for the screenshotMode plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotMode'] --- import screenshotModeObj from './screenshot_mode.devdocs.json'; diff --git a/api_docs/screenshotting.mdx b/api_docs/screenshotting.mdx index 3ce1dc31cc8d3..fead0327e73ae 100644 --- a/api_docs/screenshotting.mdx +++ b/api_docs/screenshotting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/screenshotting title: "screenshotting" image: https://source.unsplash.com/400x175/?github description: API docs for the screenshotting plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotting'] --- import screenshottingObj from './screenshotting.devdocs.json'; diff --git a/api_docs/security.devdocs.json b/api_docs/security.devdocs.json index cb7f0176a308f..f948514fa2fae 100644 --- a/api_docs/security.devdocs.json +++ b/api_docs/security.devdocs.json @@ -3210,6 +3210,10 @@ "plugin": "ml", "path": "x-pack/plugins/ml/server/routes/annotations.ts" }, + { + "plugin": "logstash", + "path": "x-pack/plugins/logstash/server/routes/pipeline/save.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/request_context_factory.ts" @@ -3234,10 +3238,6 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/open_close_signals_route.ts" }, - { - "plugin": "logstash", - "path": "x-pack/plugins/logstash/server/routes/pipeline/save.ts" - }, { "plugin": "cloudChat", "path": "x-pack/plugins/cloud_integrations/cloud_chat/server/routes/chat.ts" @@ -3278,10 +3278,6 @@ "plugin": "ml", "path": "x-pack/plugins/ml/server/saved_objects/initialization/initialization.ts" }, - { - "plugin": "savedObjectsTagging", - "path": "x-pack/plugins/saved_objects_tagging/server/request_handler_context.ts" - }, { "plugin": "ml", "path": "x-pack/plugins/ml/server/saved_objects/sync_task.ts" @@ -3294,6 +3290,10 @@ "plugin": "ml", "path": "x-pack/plugins/ml/server/plugin.ts" }, + { + "plugin": "savedObjectsTagging", + "path": "x-pack/plugins/saved_objects_tagging/server/request_handler_context.ts" + }, { "plugin": "enterpriseSearch", "path": "x-pack/plugins/enterprise_search/server/lib/check_access.ts" diff --git a/api_docs/security.mdx b/api_docs/security.mdx index a195c2e74f552..65bf6cb17b91e 100644 --- a/api_docs/security.mdx +++ b/api_docs/security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/security title: "security" image: https://source.unsplash.com/400x175/?github description: API docs for the security plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'security'] --- import securityObj from './security.devdocs.json'; diff --git a/api_docs/security_solution.devdocs.json b/api_docs/security_solution.devdocs.json index 45c4a2685ac7c..3b8de66e95315 100644 --- a/api_docs/security_solution.devdocs.json +++ b/api_docs/security_solution.devdocs.json @@ -1704,6 +1704,34 @@ "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/model.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "securitySolution", + "id": "def-public.TimelineModel.savedSearchId", + "type": "CompoundType", + "tags": [], + "label": "savedSearchId", + "description": [], + "signature": [ + "string | null" + ], + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/model.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "securitySolution", + "id": "def-public.TimelineModel.isDiscoverSavedSearchLoaded", + "type": "CompoundType", + "tags": [], + "label": "isDiscoverSavedSearchLoaded", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/model.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/security_solution.mdx b/api_docs/security_solution.mdx index fd4ffa31ac797..c0bf1d8a34f33 100644 --- a/api_docs/security_solution.mdx +++ b/api_docs/security_solution.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/securitySolution title: "securitySolution" image: https://source.unsplash.com/400x175/?github description: API docs for the securitySolution plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolution'] --- import securitySolutionObj from './security_solution.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/security-solution](https://github.com/orgs/elastic/teams/secur | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 172 | 0 | 106 | 32 | +| 174 | 0 | 108 | 32 | ## Client diff --git a/api_docs/security_solution_ess.mdx b/api_docs/security_solution_ess.mdx index ff3e12a9e7696..ff263e96cdddb 100644 --- a/api_docs/security_solution_ess.mdx +++ b/api_docs/security_solution_ess.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/securitySolutionEss title: "securitySolutionEss" image: https://source.unsplash.com/400x175/?github description: API docs for the securitySolutionEss plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolutionEss'] --- import securitySolutionEssObj from './security_solution_ess.devdocs.json'; diff --git a/api_docs/security_solution_serverless.mdx b/api_docs/security_solution_serverless.mdx index d41c003124576..348953b955195 100644 --- a/api_docs/security_solution_serverless.mdx +++ b/api_docs/security_solution_serverless.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/securitySolutionServerless title: "securitySolutionServerless" image: https://source.unsplash.com/400x175/?github description: API docs for the securitySolutionServerless plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolutionServerless'] --- import securitySolutionServerlessObj from './security_solution_serverless.devdocs.json'; diff --git a/api_docs/serverless.mdx b/api_docs/serverless.mdx index 20ec34b2ba72b..68401a17705e8 100644 --- a/api_docs/serverless.mdx +++ b/api_docs/serverless.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/serverless title: "serverless" image: https://source.unsplash.com/400x175/?github description: API docs for the serverless plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'serverless'] --- import serverlessObj from './serverless.devdocs.json'; diff --git a/api_docs/serverless_observability.mdx b/api_docs/serverless_observability.mdx index 8138b0b7690b9..788a3b9a4dc13 100644 --- a/api_docs/serverless_observability.mdx +++ b/api_docs/serverless_observability.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/serverlessObservability title: "serverlessObservability" image: https://source.unsplash.com/400x175/?github description: API docs for the serverlessObservability plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'serverlessObservability'] --- import serverlessObservabilityObj from './serverless_observability.devdocs.json'; diff --git a/api_docs/serverless_search.mdx b/api_docs/serverless_search.mdx index 8eadcba48fa53..3016c104dde64 100644 --- a/api_docs/serverless_search.mdx +++ b/api_docs/serverless_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/serverlessSearch title: "serverlessSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the serverlessSearch plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'serverlessSearch'] --- import serverlessSearchObj from './serverless_search.devdocs.json'; diff --git a/api_docs/session_view.mdx b/api_docs/session_view.mdx index 282f63bb82d95..d9b0601eeb097 100644 --- a/api_docs/session_view.mdx +++ b/api_docs/session_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/sessionView title: "sessionView" image: https://source.unsplash.com/400x175/?github description: API docs for the sessionView plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'sessionView'] --- import sessionViewObj from './session_view.devdocs.json'; diff --git a/api_docs/share.mdx b/api_docs/share.mdx index 48f9f39124c93..a562750b21305 100644 --- a/api_docs/share.mdx +++ b/api_docs/share.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/share title: "share" image: https://source.unsplash.com/400x175/?github description: API docs for the share plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'share'] --- import shareObj from './share.devdocs.json'; diff --git a/api_docs/snapshot_restore.mdx b/api_docs/snapshot_restore.mdx index e2c8c04a3183b..725af0a996d55 100644 --- a/api_docs/snapshot_restore.mdx +++ b/api_docs/snapshot_restore.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/snapshotRestore title: "snapshotRestore" image: https://source.unsplash.com/400x175/?github description: API docs for the snapshotRestore plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'snapshotRestore'] --- import snapshotRestoreObj from './snapshot_restore.devdocs.json'; diff --git a/api_docs/spaces.mdx b/api_docs/spaces.mdx index 3d0b490839d7e..f98203fc4ed2c 100644 --- a/api_docs/spaces.mdx +++ b/api_docs/spaces.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/spaces title: "spaces" image: https://source.unsplash.com/400x175/?github description: API docs for the spaces plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'spaces'] --- import spacesObj from './spaces.devdocs.json'; diff --git a/api_docs/stack_alerts.mdx b/api_docs/stack_alerts.mdx index 4f00f67a10b97..80001594777aa 100644 --- a/api_docs/stack_alerts.mdx +++ b/api_docs/stack_alerts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/stackAlerts title: "stackAlerts" image: https://source.unsplash.com/400x175/?github description: API docs for the stackAlerts plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackAlerts'] --- import stackAlertsObj from './stack_alerts.devdocs.json'; diff --git a/api_docs/stack_connectors.mdx b/api_docs/stack_connectors.mdx index a119bc016e882..071068835097e 100644 --- a/api_docs/stack_connectors.mdx +++ b/api_docs/stack_connectors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/stackConnectors title: "stackConnectors" image: https://source.unsplash.com/400x175/?github description: API docs for the stackConnectors plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackConnectors'] --- import stackConnectorsObj from './stack_connectors.devdocs.json'; diff --git a/api_docs/task_manager.mdx b/api_docs/task_manager.mdx index 2001d0871d766..604d4f203d65a 100644 --- a/api_docs/task_manager.mdx +++ b/api_docs/task_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/taskManager title: "taskManager" image: https://source.unsplash.com/400x175/?github description: API docs for the taskManager plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'taskManager'] --- import taskManagerObj from './task_manager.devdocs.json'; diff --git a/api_docs/telemetry.mdx b/api_docs/telemetry.mdx index dd882dccdfcb7..81bd42a753c47 100644 --- a/api_docs/telemetry.mdx +++ b/api_docs/telemetry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetry title: "telemetry" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetry plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetry'] --- import telemetryObj from './telemetry.devdocs.json'; diff --git a/api_docs/telemetry_collection_manager.mdx b/api_docs/telemetry_collection_manager.mdx index 5a7744abb7f3d..6befbfd938e9c 100644 --- a/api_docs/telemetry_collection_manager.mdx +++ b/api_docs/telemetry_collection_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionManager title: "telemetryCollectionManager" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryCollectionManager plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionManager'] --- import telemetryCollectionManagerObj from './telemetry_collection_manager.devdocs.json'; diff --git a/api_docs/telemetry_collection_xpack.mdx b/api_docs/telemetry_collection_xpack.mdx index ba4840e76be51..2807cb8cf865a 100644 --- a/api_docs/telemetry_collection_xpack.mdx +++ b/api_docs/telemetry_collection_xpack.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionXpack title: "telemetryCollectionXpack" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryCollectionXpack plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionXpack'] --- import telemetryCollectionXpackObj from './telemetry_collection_xpack.devdocs.json'; diff --git a/api_docs/telemetry_management_section.mdx b/api_docs/telemetry_management_section.mdx index 086eea00a7048..f17403371ed83 100644 --- a/api_docs/telemetry_management_section.mdx +++ b/api_docs/telemetry_management_section.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryManagementSection title: "telemetryManagementSection" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryManagementSection plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryManagementSection'] --- import telemetryManagementSectionObj from './telemetry_management_section.devdocs.json'; diff --git a/api_docs/text_based_languages.mdx b/api_docs/text_based_languages.mdx index 8bed3a38d9d98..fb393daae6c58 100644 --- a/api_docs/text_based_languages.mdx +++ b/api_docs/text_based_languages.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/textBasedLanguages title: "textBasedLanguages" image: https://source.unsplash.com/400x175/?github description: API docs for the textBasedLanguages plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'textBasedLanguages'] --- import textBasedLanguagesObj from './text_based_languages.devdocs.json'; diff --git a/api_docs/threat_intelligence.mdx b/api_docs/threat_intelligence.mdx index 47d5a58321822..b7afa86f87996 100644 --- a/api_docs/threat_intelligence.mdx +++ b/api_docs/threat_intelligence.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/threatIntelligence title: "threatIntelligence" image: https://source.unsplash.com/400x175/?github description: API docs for the threatIntelligence plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'threatIntelligence'] --- import threatIntelligenceObj from './threat_intelligence.devdocs.json'; diff --git a/api_docs/timelines.mdx b/api_docs/timelines.mdx index 797ddd54466a2..734e024ba4b51 100644 --- a/api_docs/timelines.mdx +++ b/api_docs/timelines.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/timelines title: "timelines" image: https://source.unsplash.com/400x175/?github description: API docs for the timelines plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'timelines'] --- import timelinesObj from './timelines.devdocs.json'; diff --git a/api_docs/transform.mdx b/api_docs/transform.mdx index 822955b338e95..0bd05395d4d03 100644 --- a/api_docs/transform.mdx +++ b/api_docs/transform.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/transform title: "transform" image: https://source.unsplash.com/400x175/?github description: API docs for the transform plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'transform'] --- import transformObj from './transform.devdocs.json'; diff --git a/api_docs/triggers_actions_ui.mdx b/api_docs/triggers_actions_ui.mdx index a0be9324233af..1ae5cd6f4d574 100644 --- a/api_docs/triggers_actions_ui.mdx +++ b/api_docs/triggers_actions_ui.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/triggersActionsUi title: "triggersActionsUi" image: https://source.unsplash.com/400x175/?github description: API docs for the triggersActionsUi plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'triggersActionsUi'] --- import triggersActionsUiObj from './triggers_actions_ui.devdocs.json'; diff --git a/api_docs/ui_actions.mdx b/api_docs/ui_actions.mdx index ccd0ffdd8d18f..64a35bf611779 100644 --- a/api_docs/ui_actions.mdx +++ b/api_docs/ui_actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uiActions title: "uiActions" image: https://source.unsplash.com/400x175/?github description: API docs for the uiActions plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActions'] --- import uiActionsObj from './ui_actions.devdocs.json'; diff --git a/api_docs/ui_actions_enhanced.mdx b/api_docs/ui_actions_enhanced.mdx index 4724b1d9fb6b1..da33951af8f66 100644 --- a/api_docs/ui_actions_enhanced.mdx +++ b/api_docs/ui_actions_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uiActionsEnhanced title: "uiActionsEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the uiActionsEnhanced plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActionsEnhanced'] --- import uiActionsEnhancedObj from './ui_actions_enhanced.devdocs.json'; diff --git a/api_docs/unified_doc_viewer.mdx b/api_docs/unified_doc_viewer.mdx index 89a392e85cd44..f139ec0e25121 100644 --- a/api_docs/unified_doc_viewer.mdx +++ b/api_docs/unified_doc_viewer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedDocViewer title: "unifiedDocViewer" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedDocViewer plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedDocViewer'] --- import unifiedDocViewerObj from './unified_doc_viewer.devdocs.json'; diff --git a/api_docs/unified_histogram.mdx b/api_docs/unified_histogram.mdx index 47af58f3b1b0a..1437cc682f137 100644 --- a/api_docs/unified_histogram.mdx +++ b/api_docs/unified_histogram.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedHistogram title: "unifiedHistogram" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedHistogram plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedHistogram'] --- import unifiedHistogramObj from './unified_histogram.devdocs.json'; diff --git a/api_docs/unified_search.mdx b/api_docs/unified_search.mdx index 3520229eed82c..87a52c34f8287 100644 --- a/api_docs/unified_search.mdx +++ b/api_docs/unified_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedSearch title: "unifiedSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedSearch plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch'] --- import unifiedSearchObj from './unified_search.devdocs.json'; diff --git a/api_docs/unified_search_autocomplete.mdx b/api_docs/unified_search_autocomplete.mdx index 1d359ea6d6ff1..67cacba2c47e4 100644 --- a/api_docs/unified_search_autocomplete.mdx +++ b/api_docs/unified_search_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedSearch-autocomplete title: "unifiedSearch.autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedSearch.autocomplete plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch.autocomplete'] --- import unifiedSearchAutocompleteObj from './unified_search_autocomplete.devdocs.json'; diff --git a/api_docs/uptime.mdx b/api_docs/uptime.mdx index 1fc2ae6dba4e3..0d3603b06fce2 100644 --- a/api_docs/uptime.mdx +++ b/api_docs/uptime.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uptime title: "uptime" image: https://source.unsplash.com/400x175/?github description: API docs for the uptime plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uptime'] --- import uptimeObj from './uptime.devdocs.json'; diff --git a/api_docs/url_forwarding.mdx b/api_docs/url_forwarding.mdx index 5db01f521053b..1bd1ecc730ec1 100644 --- a/api_docs/url_forwarding.mdx +++ b/api_docs/url_forwarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/urlForwarding title: "urlForwarding" image: https://source.unsplash.com/400x175/?github description: API docs for the urlForwarding plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'urlForwarding'] --- import urlForwardingObj from './url_forwarding.devdocs.json'; diff --git a/api_docs/usage_collection.mdx b/api_docs/usage_collection.mdx index 5fce49ae6bd22..2bf541bb0825e 100644 --- a/api_docs/usage_collection.mdx +++ b/api_docs/usage_collection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/usageCollection title: "usageCollection" image: https://source.unsplash.com/400x175/?github description: API docs for the usageCollection plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'usageCollection'] --- import usageCollectionObj from './usage_collection.devdocs.json'; diff --git a/api_docs/ux.mdx b/api_docs/ux.mdx index 4bd53cf271676..b7a111300e4b7 100644 --- a/api_docs/ux.mdx +++ b/api_docs/ux.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ux title: "ux" image: https://source.unsplash.com/400x175/?github description: API docs for the ux plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ux'] --- import uxObj from './ux.devdocs.json'; diff --git a/api_docs/vis_default_editor.mdx b/api_docs/vis_default_editor.mdx index 3ae101e66ad18..de982b3e1fd85 100644 --- a/api_docs/vis_default_editor.mdx +++ b/api_docs/vis_default_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visDefaultEditor title: "visDefaultEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the visDefaultEditor plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visDefaultEditor'] --- import visDefaultEditorObj from './vis_default_editor.devdocs.json'; diff --git a/api_docs/vis_type_gauge.mdx b/api_docs/vis_type_gauge.mdx index e3f8832deeed8..cc8974f313278 100644 --- a/api_docs/vis_type_gauge.mdx +++ b/api_docs/vis_type_gauge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeGauge title: "visTypeGauge" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeGauge plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeGauge'] --- import visTypeGaugeObj from './vis_type_gauge.devdocs.json'; diff --git a/api_docs/vis_type_heatmap.mdx b/api_docs/vis_type_heatmap.mdx index 0e9b968bcacbd..55b5ecb020689 100644 --- a/api_docs/vis_type_heatmap.mdx +++ b/api_docs/vis_type_heatmap.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeHeatmap title: "visTypeHeatmap" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeHeatmap plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeHeatmap'] --- import visTypeHeatmapObj from './vis_type_heatmap.devdocs.json'; diff --git a/api_docs/vis_type_pie.mdx b/api_docs/vis_type_pie.mdx index 74b27d1c846cd..497dc5be53ff0 100644 --- a/api_docs/vis_type_pie.mdx +++ b/api_docs/vis_type_pie.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypePie title: "visTypePie" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypePie plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypePie'] --- import visTypePieObj from './vis_type_pie.devdocs.json'; diff --git a/api_docs/vis_type_table.mdx b/api_docs/vis_type_table.mdx index bc6949ec4ca44..5b9888c3a7afc 100644 --- a/api_docs/vis_type_table.mdx +++ b/api_docs/vis_type_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTable title: "visTypeTable" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTable plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTable'] --- import visTypeTableObj from './vis_type_table.devdocs.json'; diff --git a/api_docs/vis_type_timelion.mdx b/api_docs/vis_type_timelion.mdx index 009837c964ddd..c6e72e4d2054d 100644 --- a/api_docs/vis_type_timelion.mdx +++ b/api_docs/vis_type_timelion.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTimelion title: "visTypeTimelion" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTimelion plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimelion'] --- import visTypeTimelionObj from './vis_type_timelion.devdocs.json'; diff --git a/api_docs/vis_type_timeseries.mdx b/api_docs/vis_type_timeseries.mdx index 81a64d3344162..aa734a8ec86b0 100644 --- a/api_docs/vis_type_timeseries.mdx +++ b/api_docs/vis_type_timeseries.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTimeseries title: "visTypeTimeseries" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTimeseries plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimeseries'] --- import visTypeTimeseriesObj from './vis_type_timeseries.devdocs.json'; diff --git a/api_docs/vis_type_vega.mdx b/api_docs/vis_type_vega.mdx index 1ad872a67511f..43ea8343940ed 100644 --- a/api_docs/vis_type_vega.mdx +++ b/api_docs/vis_type_vega.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeVega title: "visTypeVega" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeVega plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVega'] --- import visTypeVegaObj from './vis_type_vega.devdocs.json'; diff --git a/api_docs/vis_type_vislib.mdx b/api_docs/vis_type_vislib.mdx index 8fe84f20eb7c5..c11ae53418c07 100644 --- a/api_docs/vis_type_vislib.mdx +++ b/api_docs/vis_type_vislib.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeVislib title: "visTypeVislib" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeVislib plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVislib'] --- import visTypeVislibObj from './vis_type_vislib.devdocs.json'; diff --git a/api_docs/vis_type_xy.mdx b/api_docs/vis_type_xy.mdx index 9c678aca9289b..83f38f5fac57e 100644 --- a/api_docs/vis_type_xy.mdx +++ b/api_docs/vis_type_xy.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeXy title: "visTypeXy" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeXy plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeXy'] --- import visTypeXyObj from './vis_type_xy.devdocs.json'; diff --git a/api_docs/visualizations.mdx b/api_docs/visualizations.mdx index 709b8ba6fc23a..d2a4467bb76e9 100644 --- a/api_docs/visualizations.mdx +++ b/api_docs/visualizations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visualizations title: "visualizations" image: https://source.unsplash.com/400x175/?github description: API docs for the visualizations plugin -date: 2023-09-28 +date: 2023-09-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visualizations'] --- import visualizationsObj from './visualizations.devdocs.json'; From 7aee2e2d55cecf9380ac5ebd730981743b50bb95 Mon Sep 17 00:00:00 2001 From: Khristinin Nikita Date: Fri, 29 Sep 2023 06:42:47 +0200 Subject: [PATCH 57/61] Limit available spaces to 1 for risk engine (#167110) ## Summary Limit available spaces to 1 for risk engine Screenshot 2023-09-25 at 08 15 47 --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../security_solution/common/risk_engine/constants.ts | 2 +- .../public/entity_analytics/translations.ts | 2 +- .../lib/risk_engine/risk_engine_data_client.test.ts | 2 +- .../group10/risk_engine/init_and_status_apis.ts | 9 ++++----- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/x-pack/plugins/security_solution/common/risk_engine/constants.ts b/x-pack/plugins/security_solution/common/risk_engine/constants.ts index 21993b5532c50..2d4d208559894 100644 --- a/x-pack/plugins/security_solution/common/risk_engine/constants.ts +++ b/x-pack/plugins/security_solution/common/risk_engine/constants.ts @@ -5,4 +5,4 @@ * 2.0. */ -export const MAX_SPACES_COUNT = 2; +export const MAX_SPACES_COUNT = 1; diff --git a/x-pack/plugins/security_solution/public/entity_analytics/translations.ts b/x-pack/plugins/security_solution/public/entity_analytics/translations.ts index c3955cb133b3d..837de7ca493fd 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/translations.ts +++ b/x-pack/plugins/security_solution/public/entity_analytics/translations.ts @@ -248,7 +248,7 @@ export const UPDATE_PANEL_GO_TO_DISMISS = i18n.translate( export const getMaxSpaceTitle = (maxSpaces: number) => i18n.translate('xpack.securitySolution.riskScore.maxSpacePanel.title', { defaultMessage: - 'Entity Risk Scoring in the current version can run in {maxSpaces} Kibana spaces.', + 'Entity Risk Scoring in the current version can run in {maxSpaces, plural, =1 {# Kibana space} other {# Kibana spaces}}', values: { maxSpaces }, }); diff --git a/x-pack/plugins/security_solution/server/lib/risk_engine/risk_engine_data_client.test.ts b/x-pack/plugins/security_solution/server/lib/risk_engine/risk_engine_data_client.test.ts index ca941bcacce3a..27d297509a70a 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_engine/risk_engine_data_client.test.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_engine/risk_engine_data_client.test.ts @@ -562,7 +562,7 @@ describe('RiskEngineDataClient', () => { namespace: 'default', }); expect(status).toEqual({ - isMaxAmountOfRiskEnginesReached: false, + isMaxAmountOfRiskEnginesReached: true, riskEngineStatus: 'ENABLED', legacyRiskEngineStatus: 'NOT_INSTALLED', }); diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/init_and_status_apis.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/init_and_status_apis.ts index 5f6363ada6a29..278f82e752950 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/init_and_status_apis.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/init_and_status_apis.ts @@ -373,9 +373,8 @@ export default ({ getService }: FtrProviderContext) => { }); describe('status api', () => { - it('should disable / enable risk engige', async () => { + it('should disable / enable risk engine', async () => { const status1 = await riskEngineRoutes.getStatus(); - await riskEngineRoutes.init(); expect(status1.body).to.eql({ risk_engine_status: 'NOT_INSTALLED', @@ -390,7 +389,7 @@ export default ({ getService }: FtrProviderContext) => { expect(status2.body).to.eql({ risk_engine_status: 'ENABLED', legacy_risk_engine_status: 'NOT_INSTALLED', - is_max_amount_of_risk_engines_reached: false, + is_max_amount_of_risk_engines_reached: true, }); await riskEngineRoutes.disable(); @@ -408,7 +407,7 @@ export default ({ getService }: FtrProviderContext) => { expect(status4.body).to.eql({ risk_engine_status: 'ENABLED', legacy_risk_engine_status: 'NOT_INSTALLED', - is_max_amount_of_risk_engines_reached: false, + is_max_amount_of_risk_engines_reached: true, }); }); @@ -429,7 +428,7 @@ export default ({ getService }: FtrProviderContext) => { expect(status2.body).to.eql({ risk_engine_status: 'ENABLED', legacy_risk_engine_status: 'NOT_INSTALLED', - is_max_amount_of_risk_engines_reached: false, + is_max_amount_of_risk_engines_reached: true, }); }); }); From 98a81d1b5eb7f4aa88d45b8ef9b0bba3639ab514 Mon Sep 17 00:00:00 2001 From: Khristinin Nikita Date: Fri, 29 Sep 2023 06:46:05 +0200 Subject: [PATCH 58/61] Risk score engine telemetry (#166787) ## Summary Implement risk score engine telemetry Here we use 2 types of telemetry: Event base telemetry: - Risk execution success. With parameters `scoresWritten`, `taskCompletionTimeSeconds`, `isRunMoreThanInteval` - Risk execution error Usage telemetry: - `unique_user_risk_score_total` and `unique_host_risk_score_total` - Total amount from latest transform index for host and users - `unique_user_risk_score_day` and `unique_host_risk_score_day` - Last day amount from the latest transform index for host and users - `all_host_risk_scores_total` and `all_user_risk_scores_total` - Total amount from datastream for all risk executions for host and users - `all_host_risk_scores_total_day` and `all_user_risk_scores_total_day` - Last day amount from datastream for all risk executions for host and users - `all_risk_scores_index_size` and `unique_risk_scores_index_size` - sizes of datastream of all risk scores and latest transform index --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../common/risk_engine/indices.ts | 4 + .../lib/risk_engine/tasks/helpers.test.ts | 16 +- .../server/lib/risk_engine/tasks/helpers.ts | 13 ++ .../tasks/risk_scoring_task.test.ts | 49 +++++ .../risk_engine/tasks/risk_scoring_task.ts | 191 +++++++++++------- .../lib/telemetry/event_based/events.ts | 42 ++++ .../security_solution/server/plugin.ts | 9 + .../server/usage/collector.ts | 38 ++-- .../get_risk_engine_metrics.mocks.ts | 46 +++++ .../get_risk_engine_metrics.test.ts | 148 ++++++++++++++ .../risk_engine/get_risk_engine_metrics.ts | 188 +++++++++++++++++ .../server/usage/risk_engine/schema.ts | 72 +++++++ .../server/usage/risk_engine/types.ts | 19 ++ .../security_solution/server/usage/types.ts | 4 + .../schema/xpack_plugins.json | 64 ++++++ .../security_and_spaces/group10/index.ts | 1 + .../risk_scoring_task_execution.ts | 2 + .../group10/risk_engine/telemetry_usage.ts | 137 +++++++++++++ .../group10/risk_engine/utils.ts | 21 ++ .../utils/get_detection_metrics_from_body.ts | 18 ++ .../utils/get_stats.ts | 33 ++- 21 files changed, 1023 insertions(+), 92 deletions(-) create mode 100644 x-pack/plugins/security_solution/server/lib/telemetry/event_based/events.ts create mode 100644 x-pack/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.mocks.ts create mode 100644 x-pack/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.test.ts create mode 100644 x-pack/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.ts create mode 100644 x-pack/plugins/security_solution/server/usage/risk_engine/schema.ts create mode 100644 x-pack/plugins/security_solution/server/usage/risk_engine/types.ts create mode 100644 x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/telemetry_usage.ts diff --git a/x-pack/plugins/security_solution/common/risk_engine/indices.ts b/x-pack/plugins/security_solution/common/risk_engine/indices.ts index ec8c96e95755b..e148985b3139a 100644 --- a/x-pack/plugins/security_solution/common/risk_engine/indices.ts +++ b/x-pack/plugins/security_solution/common/risk_engine/indices.ts @@ -7,5 +7,9 @@ export const riskScoreBaseIndexName = 'risk-score'; +export const allRiskScoreIndexPattern = '.ds-risk-score*'; + +export const latestRiskScoreIndexPattern = 'risk-score.risk-score-latest-*'; + export const getRiskScoreLatestIndex = (spaceId = 'default') => `${riskScoreBaseIndexName}.risk-score-latest-${spaceId}`; diff --git a/x-pack/plugins/security_solution/server/lib/risk_engine/tasks/helpers.test.ts b/x-pack/plugins/security_solution/server/lib/risk_engine/tasks/helpers.test.ts index 20eec9fa968d9..12ae81093cae9 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_engine/tasks/helpers.test.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_engine/tasks/helpers.test.ts @@ -6,7 +6,7 @@ */ import moment from 'moment'; -import { convertDateToISOString } from './helpers'; +import { convertDateToISOString, isExecutionDurationExceededInterval } from './helpers'; moment.suppressDeprecationWarnings = true; @@ -49,3 +49,17 @@ describe('convertDateToISOString', () => { }).toThrowErrorMatchingInlineSnapshot(`"Could not convert string \\"hi mom\\" to ISO string"`); }); }); + +describe('isExecutionDurationExceededInterval', () => { + it('return false if the execution duration interval not defiend', () => { + expect(isExecutionDurationExceededInterval(undefined, 1000)).toEqual(false); + }); + + it('return false if the execution duration is less than the interval', () => { + expect(isExecutionDurationExceededInterval('1m', 59)).toEqual(false); + }); + + it('return true if the execution duration is greater than the interval', () => { + expect(isExecutionDurationExceededInterval('1m', 61)).toEqual(true); + }); +}); diff --git a/x-pack/plugins/security_solution/server/lib/risk_engine/tasks/helpers.ts b/x-pack/plugins/security_solution/server/lib/risk_engine/tasks/helpers.ts index dfacb8b78f30a..b0f77fb6a51ca 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_engine/tasks/helpers.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_engine/tasks/helpers.ts @@ -13,6 +13,7 @@ import { type CoreStart, } from '@kbn/core/server'; import { addSpaceIdToPath } from '@kbn/spaces-plugin/server'; +import { parseIntervalAsSecond } from '@kbn/task-manager-plugin/server/lib/intervals'; import type { Range } from '../../../../common/risk_engine'; @@ -72,3 +73,15 @@ export const buildScopedInternalSavedObjectsClientUnsafe = ({ excludedExtensions: [SECURITY_EXTENSION_ID], }); }; + +export const isExecutionDurationExceededInterval = ( + interval: string | undefined, + taskDurationInSeconds: number +): boolean => { + let executionDurationExceededInterval = false; + if (interval) { + executionDurationExceededInterval = taskDurationInSeconds > parseIntervalAsSecond(interval); + } + + return executionDurationExceededInterval; +}; diff --git a/x-pack/plugins/security_solution/server/lib/risk_engine/tasks/risk_scoring_task.test.ts b/x-pack/plugins/security_solution/server/lib/risk_engine/tasks/risk_scoring_task.test.ts index 37120a85f0d30..db7dbd19befc9 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_engine/tasks/risk_scoring_task.test.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_engine/tasks/risk_scoring_task.test.ts @@ -9,6 +9,7 @@ import { SavedObjectsErrorHelpers } from '@kbn/core/server'; import { coreMock } from '@kbn/core/server/mocks'; import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; import { loggerMock } from '@kbn/logging-mocks'; +import type { AnalyticsServiceSetup } from '@kbn/core/public'; import type { RiskScoreService } from '../risk_score_service'; import { riskScoreServiceMock } from '../risk_score_service.mock'; @@ -30,6 +31,7 @@ describe('Risk Scoring Task', () => { let mockTaskManagerSetup: ReturnType; let mockTaskManagerStart: ReturnType; let mockLogger: ReturnType; + let mockTelemetry: jest.Mocked; beforeEach(() => { mockCore = coreMock.createSetup(); @@ -38,6 +40,7 @@ describe('Risk Scoring Task', () => { mockTaskManagerSetup = taskManagerMock.createSetup(); mockTaskManagerStart = taskManagerMock.createStart(); mockLogger = loggerMock.create(); + mockTelemetry = mockCore.analytics; }); describe('registerRiskScoringTask()', () => { @@ -48,6 +51,7 @@ describe('Risk Scoring Task', () => { kibanaVersion: '8.10.0', taskManager: mockTaskManagerSetup, logger: mockLogger, + telemetry: mockTelemetry, }); expect(mockTaskManagerSetup.registerTaskDefinitions).toHaveBeenCalled(); }); @@ -59,6 +63,7 @@ describe('Risk Scoring Task', () => { kibanaVersion: '8.10.0', taskManager: undefined, logger: mockLogger, + telemetry: mockTelemetry, }); expect(mockTaskManagerSetup.registerTaskDefinitions).not.toHaveBeenCalled(); }); @@ -208,6 +213,7 @@ describe('Risk Scoring Task', () => { getRiskScoreService, logger: mockLogger, taskInstance: riskScoringTaskInstanceMock, + telemetry: mockTelemetry, }); expect(mockRiskScoreService.calculateAndPersistScores).toHaveBeenCalledTimes(1); }); @@ -233,6 +239,7 @@ describe('Risk Scoring Task', () => { getRiskScoreService, logger: mockLogger, taskInstance: riskScoringTaskInstanceMock, + telemetry: mockTelemetry, }); expect(mockRiskScoreService.getConfiguration).toHaveBeenCalledTimes(1); @@ -243,6 +250,7 @@ describe('Risk Scoring Task', () => { getRiskScoreService, logger: mockLogger, taskInstance: riskScoringTaskInstanceMock, + telemetry: mockTelemetry, }); expect(mockRiskScoreService.calculateAndPersistScores).toHaveBeenCalledTimes(2); }); @@ -263,6 +271,7 @@ describe('Risk Scoring Task', () => { getRiskScoreService, logger: mockLogger, taskInstance: riskScoringTaskInstanceMock, + telemetry: mockTelemetry, }); expect(mockRiskScoreService.calculateAndPersistScores).toHaveBeenCalledWith( @@ -310,6 +319,7 @@ describe('Risk Scoring Task', () => { getRiskScoreService, logger: mockLogger, taskInstance: riskScoringTaskInstanceMock, + telemetry: mockTelemetry, }); expect(mockRiskScoreService.calculateAndPersistScores).toHaveBeenCalledTimes(4); @@ -332,6 +342,7 @@ describe('Risk Scoring Task', () => { getRiskScoreService, logger: mockLogger, taskInstance: riskScoringTaskInstanceMock, + telemetry: mockTelemetry, }); expect(initialState).not.toEqual(nextState); @@ -360,6 +371,7 @@ describe('Risk Scoring Task', () => { getRiskScoreService, logger: mockLogger, taskInstance: riskScoringTaskInstanceMock, + telemetry: mockTelemetry, }); expect(mockRiskScoreService.calculateAndPersistScores).not.toHaveBeenCalled(); @@ -372,6 +384,7 @@ describe('Risk Scoring Task', () => { getRiskScoreService, logger: mockLogger, taskInstance: riskScoringTaskInstanceMock, + telemetry: mockTelemetry, }); expect(mockRiskScoreService.calculateAndPersistScores).not.toHaveBeenCalled(); @@ -385,6 +398,7 @@ describe('Risk Scoring Task', () => { getRiskScoreService: jest.fn().mockResolvedValueOnce(undefined), logger: mockLogger, taskInstance: riskScoringTaskInstanceMock, + telemetry: mockTelemetry, }); expect(mockRiskScoreService.calculateAndPersistScores).not.toHaveBeenCalled(); @@ -393,6 +407,41 @@ describe('Risk Scoring Task', () => { ); }); }); + + it('send success telemetry event', async () => { + await runTask({ + getRiskScoreService, + logger: mockLogger, + taskInstance: riskScoringTaskInstanceMock, + telemetry: mockTelemetry, + }); + + expect(mockTelemetry.reportEvent).toHaveBeenCalledTimes(1); + expect(mockTelemetry.reportEvent).toHaveBeenCalledWith('risk_score_execution_success', { + executionDurationExceededInterval: false, + scoresWritten: 10, + taskDurationInSeconds: 0, + }); + }); + + it('send error telemetry event', async () => { + mockRiskScoreService.calculateAndPersistScores.mockReset(); + mockRiskScoreService.calculateAndPersistScores.mockImplementationOnce(() => { + throw new Error(); + }); + + try { + await runTask({ + getRiskScoreService, + logger: mockLogger, + taskInstance: riskScoringTaskInstanceMock, + telemetry: mockTelemetry, + }); + } catch (err) { + expect(mockTelemetry.reportEvent).toHaveBeenCalledTimes(1); + expect(mockTelemetry.reportEvent).toHaveBeenCalledWith('risk_score_execution_error', {}); + } + }); }); }); }); diff --git a/x-pack/plugins/security_solution/server/lib/risk_engine/tasks/risk_scoring_task.ts b/x-pack/plugins/security_solution/server/lib/risk_engine/tasks/risk_scoring_task.ts index b8a9f3325f81d..4dcea92eee00d 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_engine/tasks/risk_scoring_task.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_engine/tasks/risk_scoring_task.ts @@ -18,7 +18,7 @@ import type { TaskManagerStartContract, } from '@kbn/task-manager-plugin/server'; import { getDataStreamAdapter } from '@kbn/alerting-plugin/server'; - +import type { AnalyticsServiceSetup } from '@kbn/core-analytics-server'; import type { AfterKeys, IdentifierType } from '../../../../common/risk_engine'; import type { StartPlugins } from '../../../plugin'; import { type RiskScoreService, riskScoreServiceFactory } from '../risk_score_service'; @@ -30,8 +30,16 @@ import { type LatestTaskStateSchema as RiskScoringTaskState, } from './state'; import { INTERVAL, SCOPE, TIMEOUT, TYPE, VERSION } from './constants'; -import { buildScopedInternalSavedObjectsClientUnsafe, convertRangeToISO } from './helpers'; +import { + buildScopedInternalSavedObjectsClientUnsafe, + convertRangeToISO, + isExecutionDurationExceededInterval, +} from './helpers'; import { RiskScoreEntity } from '../../../../common/risk_engine/types'; +import { + RISK_SCORE_EXECUTION_SUCCESS_EVENT, + RISK_SCORE_EXECUTION_ERROR_EVENT, +} from '../../telemetry/event_based/events'; const logFactory = (logger: Logger, taskId: string) => @@ -49,11 +57,13 @@ export const registerRiskScoringTask = ({ kibanaVersion, logger, taskManager, + telemetry, }: { getStartServices: StartServicesAccessor; kibanaVersion: string; logger: Logger; taskManager: TaskManagerSetupContract | undefined; + telemetry: AnalyticsServiceSetup; }): void => { if (!taskManager) { logger.info('Task Manager is unavailable; skipping risk engine task registration.'); @@ -91,7 +101,7 @@ export const registerRiskScoringTask = ({ title: 'Entity Analytics Risk Engine - Risk Scoring Task', timeout: TIMEOUT, stateSchemaByVersion, - createTaskRunner: createTaskRunnerFactory({ logger, getRiskScoreService }), + createTaskRunner: createTaskRunnerFactory({ logger, getRiskScoreService, telemetry }), }, }); }; @@ -153,101 +163,132 @@ export const runTask = async ({ getRiskScoreService, logger, taskInstance, + telemetry, }: { logger: Logger; getRiskScoreService: GetRiskScoreService; taskInstance: ConcreteTaskInstance; + telemetry: AnalyticsServiceSetup; }): Promise<{ state: RiskScoringTaskState; }> => { const state = taskInstance.state as RiskScoringTaskState; const taskId = taskInstance.id; const log = logFactory(logger, taskId); - const taskExecutionTime = moment().utc().toISOString(); - log('running task'); - - let scoresWritten = 0; - const updatedState = { - lastExecutionTimestamp: taskExecutionTime, - namespace: state.namespace, - runs: state.runs + 1, - scoresWritten, - }; - - if (taskId !== getTaskId(state.namespace)) { - log('outdated task; exiting'); - return { state: updatedState }; - } + try { + const taskStartTime = moment().utc().toISOString(); + log('running task'); - const riskScoreService = await getRiskScoreService(state.namespace); - if (!riskScoreService) { - log('risk score service is not available; exiting task'); - return { state: updatedState }; - } + let scoresWritten = 0; + const updatedState = { + lastExecutionTimestamp: taskStartTime, + namespace: state.namespace, + runs: state.runs + 1, + scoresWritten, + }; - const configuration = await riskScoreService.getConfiguration(); - if (configuration == null) { - log( - 'Risk engine configuration not found; exiting task. Please reinitialize the risk engine and try again' - ); - return { state: updatedState }; - } + if (taskId !== getTaskId(state.namespace)) { + log('outdated task; exiting'); + return { state: updatedState }; + } - const { - dataViewId, - enabled, - filter, - identifierType: configuredIdentifierType, - range: configuredRange, - pageSize, - } = configuration; - if (!enabled) { - log('risk engine is not enabled, exiting task'); - return { state: updatedState }; - } + const riskScoreService = await getRiskScoreService(state.namespace); + if (!riskScoreService) { + log('risk score service is not available; exiting task'); + return { state: updatedState }; + } - const range = convertRangeToISO(configuredRange); - const { index, runtimeMappings } = await riskScoreService.getRiskInputsIndex({ - dataViewId, - }); - const identifierTypes: IdentifierType[] = configuredIdentifierType - ? [configuredIdentifierType] - : [RiskScoreEntity.host, RiskScoreEntity.user]; - - await asyncForEach(identifierTypes, async (identifierType) => { - let isWorkComplete = false; - let afterKeys: AfterKeys = {}; - while (!isWorkComplete) { - const result = await riskScoreService.calculateAndPersistScores({ - afterKeys, - index, - filter, - identifierType, - pageSize, - range, - runtimeMappings, - weights: [], - }); + const configuration = await riskScoreService.getConfiguration(); + if (configuration == null) { + log( + 'Risk engine configuration not found; exiting task. Please reinitialize the risk engine and try again' + ); + return { state: updatedState }; + } - isWorkComplete = isRiskScoreCalculationComplete(result); - afterKeys = result.after_keys; - scoresWritten += result.scores_written; + const { + dataViewId, + enabled, + filter, + identifierType: configuredIdentifierType, + range: configuredRange, + pageSize, + } = configuration; + if (!enabled) { + log('risk engine is not enabled, exiting task'); + return { state: updatedState }; } - }); - updatedState.scoresWritten = scoresWritten; + const range = convertRangeToISO(configuredRange); + const { index, runtimeMappings } = await riskScoreService.getRiskInputsIndex({ + dataViewId, + }); + const identifierTypes: IdentifierType[] = configuredIdentifierType + ? [configuredIdentifierType] + : [RiskScoreEntity.host, RiskScoreEntity.user]; - log('task run completed'); - return { - state: updatedState, - }; + await asyncForEach(identifierTypes, async (identifierType) => { + let isWorkComplete = false; + let afterKeys: AfterKeys = {}; + while (!isWorkComplete) { + const result = await riskScoreService.calculateAndPersistScores({ + afterKeys, + index, + filter, + identifierType, + pageSize, + range, + runtimeMappings, + weights: [], + }); + + isWorkComplete = isRiskScoreCalculationComplete(result); + afterKeys = result.after_keys; + scoresWritten += result.scores_written; + } + }); + + updatedState.scoresWritten = scoresWritten; + + const taskCompletionTime = moment().utc().toISOString(); + + const taskDurationInSeconds = moment(taskCompletionTime).diff(moment(taskStartTime), 'seconds'); + + const telemetryEvent = { + scoresWritten, + taskDurationInSeconds, + executionDurationExceededInterval: isExecutionDurationExceededInterval( + taskInstance?.schedule?.interval, + taskDurationInSeconds + ), + }; + + telemetry.reportEvent(RISK_SCORE_EXECUTION_SUCCESS_EVENT.eventType, telemetryEvent); + + log('task run completed'); + log(JSON.stringify(telemetryEvent)); + return { + state: updatedState, + }; + } catch (e) { + telemetry.reportEvent(RISK_SCORE_EXECUTION_ERROR_EVENT.eventType, {}); + throw e; + } }; const createTaskRunnerFactory = - ({ logger, getRiskScoreService }: { logger: Logger; getRiskScoreService: GetRiskScoreService }) => + ({ + logger, + getRiskScoreService, + telemetry, + }: { + logger: Logger; + getRiskScoreService: GetRiskScoreService; + telemetry: AnalyticsServiceSetup; + }) => ({ taskInstance }: { taskInstance: ConcreteTaskInstance }) => { return { - run: async () => runTask({ getRiskScoreService, logger, taskInstance }), + run: async () => runTask({ getRiskScoreService, logger, taskInstance, telemetry }), cancel: async () => {}, }; }; diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/event_based/events.ts b/x-pack/plugins/security_solution/server/lib/telemetry/event_based/events.ts new file mode 100644 index 0000000000000..12d30eeda2079 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/telemetry/event_based/events.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import type { EventTypeOpts } from '@kbn/analytics-client'; + +export const RISK_SCORE_EXECUTION_SUCCESS_EVENT: EventTypeOpts<{ + scoresWritten: number; + taskDurationInSeconds: number; + executionDurationExceededInterval: boolean; +}> = { + eventType: 'risk_score_execution_success', + schema: { + scoresWritten: { + type: 'long', + _meta: { + description: 'Number of risk scores written during this scoring task execution', + }, + }, + taskDurationInSeconds: { + type: 'long', + _meta: { + description: 'Duration (in seconds) of the current risk scoring task execution', + }, + }, + executionDurationExceededInterval: { + type: 'boolean', + _meta: { + description: `Whether the risk scoring task's duration exceeded its allocated interval`, + }, + }, + }, +}; + +export const RISK_SCORE_EXECUTION_ERROR_EVENT: EventTypeOpts<{}> = { + eventType: 'risk_score_execution_error', + schema: {}, +}; + +export const events = [RISK_SCORE_EXECUTION_SUCCESS_EVENT, RISK_SCORE_EXECUTION_ERROR_EVENT]; diff --git a/x-pack/plugins/security_solution/server/plugin.ts b/x-pack/plugins/security_solution/server/plugin.ts index 2998854f484e4..648a461533080 100644 --- a/x-pack/plugins/security_solution/server/plugin.ts +++ b/x-pack/plugins/security_solution/server/plugin.ts @@ -96,6 +96,7 @@ import { featureUsageService } from './endpoint/services/feature_usage'; import { actionCreateService } from './endpoint/services/actions'; import { setIsElasticCloudDeployment } from './lib/telemetry/helpers'; import { artifactService } from './lib/telemetry/artifact'; +import { events } from './lib/telemetry/event_based/events'; import { endpointFieldsProvider } from './search_strategy/endpoint_fields'; import { ENDPOINT_FIELDS_SEARCH_STRATEGY, @@ -106,6 +107,7 @@ import { import { AppFeaturesService } from './lib/app_features_service/app_features_service'; import { registerRiskScoringTask } from './lib/risk_engine/tasks/risk_scoring_task'; import { registerProtectionUpdatesNoteRoutes } from './endpoint/routes/protection_updates_note'; +import { latestRiskScoreIndexPattern, allRiskScoreIndexPattern } from '../common/risk_engine'; export type { SetupPlugins, StartPlugins, PluginSetup, PluginStart } from './plugin_contract'; @@ -168,6 +170,8 @@ export class Plugin implements ISecuritySolutionPlugin { initUiSettings(core.uiSettings, experimentalFeatures); appFeaturesService.init(plugins.features); + events.forEach((eventConfig) => core.analytics.registerEventType(eventConfig)); + this.ruleMonitoringService.setup(core, plugins); if (experimentalFeatures.riskScoringPersistence) { @@ -176,6 +180,7 @@ export class Plugin implements ISecuritySolutionPlugin { kibanaVersion: pluginContext.env.packageInfo.version, logger: this.logger, taskManager: plugins.taskManager, + telemetry: core.analytics, }); } @@ -208,6 +213,10 @@ export class Plugin implements ISecuritySolutionPlugin { ml: plugins.ml, usageCollection: plugins.usageCollection, logger, + riskEngineIndexPatterns: { + all: allRiskScoreIndexPattern, + latest: latestRiskScoreIndexPattern, + }, }); this.telemetryUsageCounter = plugins.usageCollection?.createUsageCounter(APP_ID); diff --git a/x-pack/plugins/security_solution/server/usage/collector.ts b/x-pack/plugins/security_solution/server/usage/collector.ts index 9296cf44478ae..d458f280c5899 100644 --- a/x-pack/plugins/security_solution/server/usage/collector.ts +++ b/x-pack/plugins/security_solution/server/usage/collector.ts @@ -12,6 +12,8 @@ import { getDetectionsMetrics } from './detections/get_metrics'; import { getInternalSavedObjectsClient } from './get_internal_saved_objects_client'; import { getEndpointMetrics } from './endpoint/get_metrics'; import { getDashboardMetrics } from './dashboards/get_dashboards_metrics'; +import { riskEngineMetricsSchema } from './risk_engine/schema'; +import { getRiskEngineMetrics } from './risk_engine/get_risk_engine_metrics'; export type RegisterCollector = (deps: CollectorDependencies) => void; @@ -19,6 +21,7 @@ export interface UsageData { detectionMetrics: {}; endpointMetrics: {}; dashboardMetrics: DashboardMetrics; + riskEngineMetrics: {}; } export const registerCollector: RegisterCollector = ({ @@ -28,6 +31,7 @@ export const registerCollector: RegisterCollector = ({ ml, usageCollection, logger, + riskEngineIndexPatterns, }) => { if (!usageCollection) { logger.debug('Usage collection is undefined, therefore returning early without registering it'); @@ -2441,29 +2445,33 @@ export const registerCollector: RegisterCollector = ({ }, }, }, + riskEngineMetrics: riskEngineMetricsSchema, }, isReady: () => true, fetch: async ({ esClient }: CollectorFetchContext): Promise => { const savedObjectsClient = await getInternalSavedObjectsClient(core); - const [detectionMetrics, endpointMetrics, dashboardMetrics] = await Promise.allSettled([ - getDetectionsMetrics({ - eventLogIndex, - signalsIndex, - esClient, - savedObjectsClient, - logger, - mlClient: ml, - }), - getEndpointMetrics({ esClient, logger }), - getDashboardMetrics({ - savedObjectsClient, - logger, - }), - ]); + const [detectionMetrics, endpointMetrics, dashboardMetrics, riskEngineMetrics] = + await Promise.allSettled([ + getDetectionsMetrics({ + eventLogIndex, + signalsIndex, + esClient, + savedObjectsClient, + logger, + mlClient: ml, + }), + getEndpointMetrics({ esClient, logger }), + getDashboardMetrics({ + savedObjectsClient, + logger, + }), + getRiskEngineMetrics({ esClient, logger, riskEngineIndexPatterns }), + ]); return { detectionMetrics: detectionMetrics.status === 'fulfilled' ? detectionMetrics.value : {}, endpointMetrics: endpointMetrics.status === 'fulfilled' ? endpointMetrics.value : {}, dashboardMetrics: dashboardMetrics.status === 'fulfilled' ? dashboardMetrics.value : {}, + riskEngineMetrics: riskEngineMetrics.status === 'fulfilled' ? riskEngineMetrics.value : {}, }; }, }); diff --git a/x-pack/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.mocks.ts b/x-pack/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.mocks.ts new file mode 100644 index 0000000000000..3890c93d3d496 --- /dev/null +++ b/x-pack/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.mocks.ts @@ -0,0 +1,46 @@ +/* + * 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 { SearchResponse, IndicesStatsResponse } from '@elastic/elasticsearch/lib/api/types'; + +export const getAggregationResultMock = ({ + user, + host, +}: { + user: number; + host: number; +}): SearchResponse< + never, + { + user_name: { + value: number; + }; + host_name: { + value: number; + }; + } +> => ({ + took: 171, + timed_out: false, + _shards: { total: 1, successful: 1, skipped: 0, failed: 0 }, + hits: { total: { value: 10000, relation: 'gte' }, max_score: null, hits: [] }, + aggregations: { user_name: { value: user }, host_name: { value: host } }, +}); + +export const getStatsResultMock = ({ size }: { size: number }): IndicesStatsResponse => ({ + _shards: { total: 2, successful: 1, failed: 0 }, + _all: { + primaries: { + docs: { count: 200000, deleted: 0 }, + shard_stats: { total_count: 1 }, + store: { + size_in_bytes: size, + total_data_set_size_in_bytes: size, + reserved_in_bytes: 0, + }, + }, + }, +}); diff --git a/x-pack/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.test.ts b/x-pack/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.test.ts new file mode 100644 index 0000000000000..40c1ba92e70eb --- /dev/null +++ b/x-pack/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.test.ts @@ -0,0 +1,148 @@ +/* + * 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 { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; +import { getRiskEngineMetrics } from './get_risk_engine_metrics'; +import { getAggregationResultMock, getStatsResultMock } from './get_risk_engine_metrics.mocks'; + +const riskEngineIndexPatterns = { + all: 'an-index-pattern', + latest: 'another-index-pattern', +}; + +describe('risk engine metrics', () => { + let esClient: ReturnType; + let logger: ReturnType; + + describe('risk engine not installed', () => { + beforeEach(() => { + esClient = elasticsearchServiceMock.createClusterClient().asInternalUser; + logger = loggingSystemMock.createLogger(); + }); + + it('should return empty object', async () => { + esClient.indices.get.mockResponseOnce({}); + + const result = await getRiskEngineMetrics({ + esClient, + logger, + riskEngineIndexPatterns, + }); + expect(result).toEqual({}); + }); + }); + + describe('risk engine installed', () => { + beforeEach(() => { + esClient = elasticsearchServiceMock.createClusterClient().asInternalUser; + logger = loggingSystemMock.createLogger(); + }); + + it('should return metrics object', async () => { + esClient.search.mockResponseOnce( + getAggregationResultMock({ + user: 100, + host: 200, + }) + ); + esClient.search.mockResponseOnce( + getAggregationResultMock({ + user: 10, + host: 20, + }) + ); + esClient.search.mockResponseOnce( + getAggregationResultMock({ + user: 1000, + host: 2000, + }) + ); + esClient.search.mockResponseOnce( + getAggregationResultMock({ + user: 500, + host: 600, + }) + ); + esClient.indices.stats.mockResponseOnce( + getStatsResultMock({ + size: 10000, + }) + ); + esClient.indices.stats.mockResponseOnce( + getStatsResultMock({ + size: 5000, + }) + ); + const result = await getRiskEngineMetrics({ + esClient, + logger, + riskEngineIndexPatterns, + }); + expect(result).toEqual({ + unique_user_risk_score_total: 100, + unique_host_risk_score_total: 200, + unique_user_risk_score_day: 10, + unique_host_risk_score_day: 20, + all_user_risk_scores_total: 1000, + all_host_risk_scores_total: 2000, + all_user_risk_scores_total_day: 500, + all_host_risk_scores_total_day: 600, + all_risk_scores_index_size: 0.01, + unique_risk_scores_index_size: 0.005, + }); + }); + + it('should still return metrics object if some request return error', async () => { + esClient.search.mockResponseOnce( + getAggregationResultMock({ + user: 100, + host: 200, + }) + ); + esClient.search.mockResponseOnce( + getAggregationResultMock({ + user: 10, + host: 20, + }) + ); + esClient.search.mockResponseOnce( + getAggregationResultMock({ + user: 1000, + host: 2000, + }) + ); + esClient.search.mockImplementationOnce(() => { + throw new Error('Connection Error'); + }); + + esClient.indices.stats.mockResponseOnce( + getStatsResultMock({ + size: 10000, + }) + ); + esClient.indices.stats.mockResponseOnce( + getStatsResultMock({ + size: 5000, + }) + ); + const result = await getRiskEngineMetrics({ + esClient, + logger, + riskEngineIndexPatterns, + }); + expect(result).toEqual({ + unique_user_risk_score_total: 100, + unique_host_risk_score_total: 200, + unique_user_risk_score_day: 10, + unique_host_risk_score_day: 20, + all_user_risk_scores_total: 1000, + all_host_risk_scores_total: 2000, + all_risk_scores_index_size: 0.01, + unique_risk_scores_index_size: 0.005, + }); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.ts b/x-pack/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.ts new file mode 100644 index 0000000000000..272fcf0cdda3d --- /dev/null +++ b/x-pack/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.ts @@ -0,0 +1,188 @@ +/* + * 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 { Logger, ElasticsearchClient } from '@kbn/core/server'; +import type { SearchRequest } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type { RiskEngineMetrics } from './types'; + +interface GetRiskEngineMetricsOptions { + esClient: ElasticsearchClient; + logger: Logger; + riskEngineIndexPatterns: { + all: string; + latest: string; + }; +} + +const allEnititiesByTypeAggregationBody = { + size: 0, + aggs: { + user_name: { + value_count: { + field: 'user.name', + }, + }, + host_name: { + value_count: { + field: 'host.name', + }, + }, + }, +}; + +const getEntitiesAggregationData = async ({ + esClient, + index, + logger, + hostMetricField, + userMetricField, + lastDay, +}: { + esClient: ElasticsearchClient; + index: string; + logger: Logger; + hostMetricField: string; + userMetricField: string; + lastDay: boolean; +}) => { + try { + const bodyRequest: SearchRequest['body'] = { + ...allEnititiesByTypeAggregationBody, + }; + if (lastDay) { + bodyRequest.query = { + range: { + '@timestamp': { + gte: 'now-24h', + lt: 'now', + }, + }, + }; + } + const riskScoreAggsResponse = await esClient.search< + never, + { + user_name: { + value: number; + }; + host_name: { + value: number; + }; + } + >({ + index, + body: bodyRequest, + }); + + return { + [userMetricField]: riskScoreAggsResponse?.aggregations?.user_name?.value, + [hostMetricField]: riskScoreAggsResponse?.aggregations?.host_name?.value, + }; + } catch (err) { + logger.error( + `Error while fetching risk score metrics for ${hostMetricField} and ${userMetricField}: ${err}` + ); + return {}; + } +}; + +const getIndexSize = async ({ + esClient, + index, + logger, + metricField, +}: { + esClient: ElasticsearchClient; + index: string; + logger: Logger; + metricField: string; +}) => { + try { + const riskScoreIndexStats = await esClient.indices.stats({ + index, + }); + const sizeInMb = (riskScoreIndexStats?._all?.primaries?.store?.size_in_bytes ?? 0) / 1e6; + return { + [metricField]: sizeInMb, + }; + } catch (err) { + logger.error(`Error while fetching risk score metrics for ${metricField}: ${err}`); + return {}; + } +}; + +export const getRiskEngineMetrics = async ({ + esClient, + logger, + riskEngineIndexPatterns, +}: GetRiskEngineMetricsOptions): Promise => { + logger.info('Fetch risk engine metrics'); + + try { + const riskEngineIndexes = await esClient.indices.get({ + index: `${riskEngineIndexPatterns.all}`, + }); + + const isRiskEngineExists = Object.keys(riskEngineIndexes).length > 0; + + if (!isRiskEngineExists) { + return {}; + } + + const results = await Promise.all([ + getEntitiesAggregationData({ + esClient, + index: riskEngineIndexPatterns.latest, + logger, + lastDay: false, + hostMetricField: 'unique_host_risk_score_total', + userMetricField: 'unique_user_risk_score_total', + }), + getEntitiesAggregationData({ + esClient, + index: riskEngineIndexPatterns.latest, + logger, + lastDay: true, + hostMetricField: 'unique_host_risk_score_day', + userMetricField: 'unique_user_risk_score_day', + }), + getEntitiesAggregationData({ + esClient, + index: riskEngineIndexPatterns.all, + logger, + lastDay: false, + hostMetricField: 'all_host_risk_scores_total', + userMetricField: 'all_user_risk_scores_total', + }), + getEntitiesAggregationData({ + esClient, + index: riskEngineIndexPatterns.all, + logger, + lastDay: true, + hostMetricField: 'all_host_risk_scores_total_day', + userMetricField: 'all_user_risk_scores_total_day', + }), + getIndexSize({ + esClient, + logger, + index: riskEngineIndexPatterns.all, + metricField: 'all_risk_scores_index_size', + }), + getIndexSize({ + esClient, + logger, + index: riskEngineIndexPatterns.latest, + metricField: 'unique_risk_scores_index_size', + }), + ]); + + return results.reduce((acc, curr) => ({ ...acc, ...curr }), {}); + } catch (e) { + logger.error(`Error while fetching risk engine metrics: ${e.message}`); + return {}; + } +}; diff --git a/x-pack/plugins/security_solution/server/usage/risk_engine/schema.ts b/x-pack/plugins/security_solution/server/usage/risk_engine/schema.ts new file mode 100644 index 0000000000000..34918439a41bf --- /dev/null +++ b/x-pack/plugins/security_solution/server/usage/risk_engine/schema.ts @@ -0,0 +1,72 @@ +/* + * 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 { MakeSchemaFrom } from '@kbn/usage-collection-plugin/server'; +import type { RiskEngineMetrics } from './types'; + +export const riskEngineMetricsSchema: MakeSchemaFrom = { + unique_user_risk_score_total: { + type: 'long', + _meta: { + description: 'Total unique user risk scores', + }, + }, + unique_host_risk_score_total: { + type: 'long', + _meta: { + description: 'Total unique host risk scores', + }, + }, + unique_user_risk_score_day: { + type: 'long', + _meta: { + description: 'Unique user risk scores per day', + }, + }, + unique_host_risk_score_day: { + type: 'long', + _meta: { + description: 'Unique host risk scores per day', + }, + }, + all_host_risk_scores_total: { + type: 'long', + _meta: { + description: 'Total number of host risk score records', + }, + }, + all_user_risk_scores_total: { + type: 'long', + _meta: { + description: 'Total number of user risk score records', + }, + }, + all_host_risk_scores_total_day: { + type: 'long', + _meta: { + description: 'Number of host risk score records per day', + }, + }, + all_user_risk_scores_total_day: { + type: 'long', + _meta: { + description: 'Number of user risk score records per day', + }, + }, + all_risk_scores_index_size: { + type: 'long', + _meta: { + description: 'Total size of the all Risk Score indices (MB)', + }, + }, + unique_risk_scores_index_size: { + type: 'long', + _meta: { + description: 'Total size of the unique Risk Score indices (MB)', + }, + }, +}; diff --git a/x-pack/plugins/security_solution/server/usage/risk_engine/types.ts b/x-pack/plugins/security_solution/server/usage/risk_engine/types.ts new file mode 100644 index 0000000000000..fac6b24ac5a5e --- /dev/null +++ b/x-pack/plugins/security_solution/server/usage/risk_engine/types.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export interface RiskEngineMetrics { + unique_host_risk_score_total?: number; + unique_user_risk_score_total?: number; + unique_user_risk_score_day?: number; + unique_host_risk_score_day?: number; + all_user_risk_scores_total?: number; + all_host_risk_scores_total?: number; + all_user_risk_scores_total_day?: number; + all_host_risk_scores_total_day?: number; + all_risk_scores_index_size?: number; + unique_risk_scores_index_size?: number; +} diff --git a/x-pack/plugins/security_solution/server/usage/types.ts b/x-pack/plugins/security_solution/server/usage/types.ts index 4131a105a1b51..1df8f2d1388a0 100644 --- a/x-pack/plugins/security_solution/server/usage/types.ts +++ b/x-pack/plugins/security_solution/server/usage/types.ts @@ -29,6 +29,10 @@ export type CollectorDependencies = { core: CoreSetup; logger: Logger; eventLogIndex: string; + riskEngineIndexPatterns: { + all: string; + latest: string; + }; } & Pick; export interface AlertBucket { diff --git a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json index 00651944940dc..d406fb1aa5ffc 100644 --- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json +++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @@ -15866,6 +15866,70 @@ } } } + }, + "riskEngineMetrics": { + "properties": { + "unique_user_risk_score_total": { + "type": "long", + "_meta": { + "description": "Total unique user risk scores" + } + }, + "unique_host_risk_score_total": { + "type": "long", + "_meta": { + "description": "Total unique host risk scores" + } + }, + "unique_user_risk_score_day": { + "type": "long", + "_meta": { + "description": "Unique user risk scores per day" + } + }, + "unique_host_risk_score_day": { + "type": "long", + "_meta": { + "description": "Unique host risk scores per day" + } + }, + "all_host_risk_scores_total": { + "type": "long", + "_meta": { + "description": "Total number of host risk score records" + } + }, + "all_user_risk_scores_total": { + "type": "long", + "_meta": { + "description": "Total number of user risk score records" + } + }, + "all_host_risk_scores_total_day": { + "type": "long", + "_meta": { + "description": "Number of host risk score records per day" + } + }, + "all_user_risk_scores_total_day": { + "type": "long", + "_meta": { + "description": "Number of user risk score records per day" + } + }, + "all_risk_scores_index_size": { + "type": "long", + "_meta": { + "description": "Total size of the all Risk Score indices (MB)" + } + }, + "unique_risk_scores_index_size": { + "type": "long", + "_meta": { + "description": "Total size of the unique Risk Score indices (MB)" + } + } + } } } }, diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/index.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/index.ts index cea1ccd419d80..8844107744854 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/index.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/index.ts @@ -41,6 +41,7 @@ export default ({ loadTestFile }: FtrProviderContext): void => { loadTestFile(require.resolve('./risk_engine/risk_score_preview')); loadTestFile(require.resolve('./risk_engine/risk_score_calculation')); loadTestFile(require.resolve('./risk_engine/risk_scoring_task_execution')); + loadTestFile(require.resolve('./risk_engine/telemetry_usage')); loadTestFile(require.resolve('./set_alert_tags')); }); }; diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/risk_scoring_task_execution.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/risk_scoring_task_execution.ts index 06e55aa1556d0..5617ed340a7c0 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/risk_scoring_task_execution.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/risk_scoring_task_execution.ts @@ -23,6 +23,7 @@ import { getRiskEngineTask, cleanRiskEngineConfig, waitForRiskEngineTaskToBeGone, + deleteRiskScoreIndices, } from './utils'; // eslint-disable-next-line import/no-default-export @@ -270,6 +271,7 @@ export default ({ getService }: FtrProviderContext): void => { afterEach(async () => { await getService('spaces').delete(namespace); + await deleteRiskScoreIndices({ log, es, namespace }); }); it('calculates and persists risk scores for alert documents', async () => { diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/telemetry_usage.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/telemetry_usage.ts new file mode 100644 index 0000000000000..9135879f3e2eb --- /dev/null +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/telemetry_usage.ts @@ -0,0 +1,137 @@ +/* + * 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 expect from '@kbn/expect'; +import { v4 as uuidv4 } from 'uuid'; +import type { FtrProviderContext } from '../../../../common/ftr_provider_context'; +import { deleteAllRules, deleteAllAlerts, getRiskEngineStats } from '../../../utils'; +import { + buildDocument, + createAndSyncRuleAndAlertsFactory, + deleteRiskEngineTask, + deleteRiskScoreIndices, + waitForRiskScoresToBePresent, + riskEngineRouteHelpersFactory, + cleanRiskEngineConfig, +} from './utils'; +import { dataGeneratorFactory } from '../../../utils/data_generator'; + +// eslint-disable-next-line import/no-default-export +export default ({ getService }: FtrProviderContext) => { + const supertest = getService('supertest'); + const esArchiver = getService('esArchiver'); + const log = getService('log'); + const retry = getService('retry'); + const es = getService('es'); + + const createAndSyncRuleAndAlerts = createAndSyncRuleAndAlertsFactory({ supertest, log }); + const riskEngineRoutes = riskEngineRouteHelpersFactory(supertest); + + describe('Risk engine telemetry', async () => { + const { indexListOfDocuments } = dataGeneratorFactory({ + es, + index: 'ecs_compliant', + log, + }); + const kibanaServer = getService('kibanaServer'); + + before(async () => { + await esArchiver.load('x-pack/test/functional/es_archives/security_solution/ecs_compliant'); + }); + + after(async () => { + await esArchiver.unload('x-pack/test/functional/es_archives/security_solution/ecs_compliant'); + }); + + beforeEach(async () => { + await cleanRiskEngineConfig({ kibanaServer }); + await deleteRiskEngineTask({ es, log }); + await deleteRiskScoreIndices({ log, es }); + await deleteAllAlerts(supertest, log, es); + await deleteAllRules(supertest, log); + }); + + describe('Risk engine not enabled', () => { + it('should has empty riskEngineMetrics', async () => { + await retry.try(async () => { + const stats = await getRiskEngineStats(supertest, log); + const expected = {}; + expect(stats).to.eql(expected); + }); + }); + }); + + describe('Risk engine enabled', () => { + let hostId: string; + let userId: string; + + beforeEach(async () => { + hostId = uuidv4(); + const hostEvent = buildDocument({ host: { name: 'host-1' } }, hostId); + await indexListOfDocuments( + Array(10) + .fill(hostEvent) + .map((event, index) => ({ + ...event, + 'host.name': `host-${index}`, + })) + ); + + userId = uuidv4(); + const userEvent = buildDocument({ user: { name: 'user-1' } }, userId); + await indexListOfDocuments( + Array(10) + .fill(userEvent) + .map((event, index) => ({ + ...event, + 'user.name': `user-${index}`, + })) + ); + + await createAndSyncRuleAndAlerts({ + query: `id: ${userId} or id: ${hostId}`, + alerts: 20, + riskScore: 40, + }); + + await riskEngineRoutes.init(); + }); + + afterEach(async () => { + await cleanRiskEngineConfig({ kibanaServer }); + await deleteRiskEngineTask({ es, log }); + await deleteRiskScoreIndices({ log, es }); + await deleteAllAlerts(supertest, log, es); + await deleteAllRules(supertest, log); + }); + + it('should return riskEngineMetrics with expected values', async () => { + await waitForRiskScoresToBePresent({ es, log, scoreCount: 20 }); + await retry.try(async () => { + const { + all_risk_scores_index_size: allRiskScoreIndexSize, + unique_risk_scores_index_size: uniqueRiskScoreIndexSize, + ...otherStats + } = await getRiskEngineStats(supertest, log); + const expected = { + unique_host_risk_score_total: 0, + unique_user_risk_score_total: 0, + unique_user_risk_score_day: 0, + unique_host_risk_score_day: 0, + all_user_risk_scores_total: 10, + all_host_risk_scores_total: 10, + all_user_risk_scores_total_day: 10, + all_host_risk_scores_total_day: 10, + }; + expect(otherStats).to.eql(expected); + expect(allRiskScoreIndexSize).to.be.greaterThan(0); + expect(uniqueRiskScoreIndexSize).to.be.greaterThan(0); + }); + }); + }); + }); +}; diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/utils.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/utils.ts index 4671c0006113c..48549059d0e90 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/utils.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/utils.ts @@ -101,6 +101,27 @@ export const createAndSyncRuleAndAlertsFactory = await waitForSignalsToBePresent(supertest, log, alerts, [id], namespace); }; +export const deleteRiskScoreIndices = async ({ + log, + es, + namespace = 'default', +}: { + log: ToolingLog; + es: Client; + namespace?: string; +}) => { + try { + await Promise.allSettled([ + es.indices.deleteDataStream({ name: [`risk-score.risk-score-${namespace}`] }), + es.indices.delete({ + index: [`risk-score.risk-score-latest-${namespace}`], + }), + ]); + } catch (e) { + log.error(`Error deleting risk score indices: ${e.message}`); + } +}; + /** * Deletes all risk scores from a given index or indices, defaults to `risk-score.risk-score-*` * For use inside of afterEach blocks of tests diff --git a/x-pack/test/detection_engine_api_integration/utils/get_detection_metrics_from_body.ts b/x-pack/test/detection_engine_api_integration/utils/get_detection_metrics_from_body.ts index 20febd5e9180f..92e17ba61fe03 100644 --- a/x-pack/test/detection_engine_api_integration/utils/get_detection_metrics_from_body.ts +++ b/x-pack/test/detection_engine_api_integration/utils/get_detection_metrics_from_body.ts @@ -6,6 +6,7 @@ */ import type { DetectionMetrics } from '@kbn/security-solution-plugin/server/usage/detections/types'; +import type { RiskEngineMetrics } from '@kbn/security-solution-plugin/server/usage/risk_engine/types'; /** * Given a body this will return the detection metrics from it. @@ -23,3 +24,20 @@ export const getDetectionMetricsFromBody = ( ): DetectionMetrics => { return body[0].stats.stack_stats.kibana.plugins.security_solution.detectionMetrics; }; + +/** + * Given a body this will return the risk engine metrics from it. + * @param body The Stats body + * @returns Detection metrics + */ +export const getRiskEngineMetricsFromBody = ( + body: Array<{ + stats: { + stack_stats: { + kibana: { plugins: { security_solution: { riskEngineMetrics: {} } } }; + }; + }; + }> +): RiskEngineMetrics => { + return body[0].stats.stack_stats.kibana.plugins.security_solution.riskEngineMetrics; +}; diff --git a/x-pack/test/detection_engine_api_integration/utils/get_stats.ts b/x-pack/test/detection_engine_api_integration/utils/get_stats.ts index 7f4a2bddbd833..d042bdc4d53f7 100644 --- a/x-pack/test/detection_engine_api_integration/utils/get_stats.ts +++ b/x-pack/test/detection_engine_api_integration/utils/get_stats.ts @@ -8,13 +8,17 @@ import type { ToolingLog } from '@kbn/tooling-log'; import type SuperTest from 'supertest'; import type { DetectionMetrics } from '@kbn/security-solution-plugin/server/usage/detections/types'; +import type { RiskEngineMetrics } from '@kbn/security-solution-plugin/server/usage/risk_engine/types'; import { ELASTIC_HTTP_VERSION_HEADER, X_ELASTIC_INTERNAL_ORIGIN_REQUEST, } from '@kbn/core-http-common'; import { getStatsUrl } from './get_stats_url'; -import { getDetectionMetricsFromBody } from './get_detection_metrics_from_body'; +import { + getDetectionMetricsFromBody, + getRiskEngineMetricsFromBody, +} from './get_detection_metrics_from_body'; /** * Gets the stats from the stats endpoint. @@ -38,5 +42,32 @@ export const getStats = async ( )}, status: ${JSON.stringify(response.status)}` ); } + return getDetectionMetricsFromBody(response.body); }; + +/** + * Gets the stats from the stats endpoint. + * @param supertest The supertest agent. + * @returns The detection metrics + */ +export const getRiskEngineStats = async ( + supertest: SuperTest.SuperTest, + log: ToolingLog +): Promise => { + const response = await supertest + .post(getStatsUrl()) + .set('kbn-xsrf', 'true') + .set(ELASTIC_HTTP_VERSION_HEADER, '2') + .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') + .send({ unencrypted: true, refreshCache: true }); + if (response.status !== 200) { + log.error( + `Did not get an expected 200 "ok" when getting the stats for risk engine. CI issues could happen. Suspect this line if you are seeing CI issues. body: ${JSON.stringify( + response.body + )}, status: ${JSON.stringify(response.status)}` + ); + } + + return getRiskEngineMetricsFromBody(response.body); +}; From d7978461081fcade206678d16f2a9efce855e241 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Fri, 29 Sep 2023 08:41:08 +0300 Subject: [PATCH 59/61] [ES|QL] Resets selected columns when changing query (#167492) ## Summary Fixes a bug in ES|QL mode where you: - have a query of index pattern 1 and select some fields - change the query by using a different index pattern - the selected columns do not reset **BUG** ![withbug](https://github.com/elastic/kibana/assets/17003240/5f3fdf89-5d17-443d-b50b-f802e44482c3) **NOW** ![now](https://github.com/elastic/kibana/assets/17003240/0c1f8b05-0e22-4708-85e8-9387c9a5d5fa) ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --- .../use_test_based_query_language.test.tsx | 32 +++++++++++++++++++ .../hooks/use_text_based_query_language.ts | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/plugins/discover/public/application/main/hooks/use_test_based_query_language.test.tsx b/src/plugins/discover/public/application/main/hooks/use_test_based_query_language.test.tsx index a6dcafad11757..3b14bf3b80fcb 100644 --- a/src/plugins/discover/public/application/main/hooks/use_test_based_query_language.test.tsx +++ b/src/plugins/discover/public/application/main/hooks/use_test_based_query_language.test.tsx @@ -106,6 +106,7 @@ describe('useTextBasedQueryLanguage', () => { await waitFor(() => { expect(replaceUrlState).toHaveBeenCalledWith({ index: 'the-data-view-id', + columns: [], }); }); @@ -123,6 +124,7 @@ describe('useTextBasedQueryLanguage', () => { expect(replaceUrlState).toHaveBeenCalledWith({ index: 'the-data-view-id', viewMode: VIEW_MODE.DOCUMENT_LEVEL, + columns: [], }); }); test('changing a text based query with different result columns should change state when loading and finished', async () => { @@ -155,6 +157,35 @@ describe('useTextBasedQueryLanguage', () => { }); }); + test('changing a text based query with same result columns should change state when loading and finished', async () => { + const { replaceUrlState, stateContainer } = renderHookWithContext(false); + const documents$ = stateContainer.dataState.data$.documents$; + stateContainer.dataState.data$.documents$.next(msgComplete); + await waitFor(() => expect(replaceUrlState).toHaveBeenCalledTimes(1)); + replaceUrlState.mockReset(); + + documents$.next({ + recordRawType: RecordRawType.PLAIN, + fetchStatus: FetchStatus.PARTIAL, + result: [ + { + id: '1', + raw: { field1: 1 }, + flattened: { field1: 1 }, + } as unknown as DataTableRecord, + ], + query: { esql: 'from the-data-view-2' }, + }); + await waitFor(() => expect(replaceUrlState).toHaveBeenCalledTimes(1)); + + await waitFor(() => { + expect(replaceUrlState).toHaveBeenCalledWith({ + index: 'the-data-view-id', + columns: [], + }); + }); + }); + test('changing a text based query with no transformational commands should only change dataview state when loading and finished', async () => { const { replaceUrlState, stateContainer } = renderHookWithContext(false); const documents$ = stateContainer.dataState.data$.documents$; @@ -180,6 +211,7 @@ describe('useTextBasedQueryLanguage', () => { await waitFor(() => { expect(replaceUrlState).toHaveBeenCalledWith({ index: 'the-data-view-id', + columns: [], }); }); }); diff --git a/src/plugins/discover/public/application/main/hooks/use_text_based_query_language.ts b/src/plugins/discover/public/application/main/hooks/use_text_based_query_language.ts index fb3725d12b1e1..01f3491809fb0 100644 --- a/src/plugins/discover/public/application/main/hooks/use_text_based_query_language.ts +++ b/src/plugins/discover/public/application/main/hooks/use_text_based_query_language.ts @@ -119,7 +119,7 @@ export function useTextBasedQueryLanguage({ } const nextState = { ...(addDataViewToState && { index: dataViewObj.id }), - ...(addColumnsToState && { columns: nextColumns }), + ...((addColumnsToState || queryChanged) && { columns: nextColumns }), ...(viewMode === VIEW_MODE.AGGREGATED_LEVEL && { viewMode: getValidViewMode({ viewMode, isTextBasedQueryMode: true }), }), From 788dae973a1deee7427a4b4cc139d0692a642a5a Mon Sep 17 00:00:00 2001 From: GitStart <1501599+gitstart@users.noreply.github.com> Date: Fri, 29 Sep 2023 07:10:27 +0100 Subject: [PATCH 60/61] [ML] Improves display for long descriptions in transforms (#165149) Improves the display of long descriptions of transforms in the Transform management page and when editing the description in the transform wizard or edit flyout. Previously If there was a long description, the text would not be wrapped in the table on the management page, and it would not be possible to view the full text in the text input when editing. This PR adds line wrapping for the description column, and uses a text area for editing the text. Part of https://github.com/elastic/kibana/issues/163147 --- .../step_details/step_details_form.tsx | 3 +- .../capitalize_first_letter.ts | 10 +++ .../edit_transform_flyout_form.tsx | 3 +- .../edit_transform_flyout_form_text_area.tsx | 61 +++++++++++++++++++ .../edit_transform_flyout_form_text_input.tsx | 5 +- .../components/transform_list/use_columns.tsx | 15 ++++- 6 files changed, 90 insertions(+), 7 deletions(-) create mode 100644 x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/capitalize_first_letter.ts create mode 100644 x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/edit_transform_flyout_form_text_area.tsx diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx index da9ebbf9b2ef7..0d93a31f9e3f2 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx @@ -22,6 +22,7 @@ import { EuiSpacer, EuiCallOut, EuiText, + EuiTextArea, } from '@elastic/eui'; import { KBN_FIELD_TYPES } from '@kbn/field-types'; @@ -421,7 +422,7 @@ export const StepDetailsForm: FC = React.memo( defaultMessage: 'Transform description', })} > - ( - = ({ + field, + label, + helpText, + placeHolder = false, +}) => { + const { defaultValue, errorMessages, value } = useEditTransformFlyout(field); + const { formField } = useEditTransformFlyout('actions'); + const upperCaseField = capitalizeFirstLetter(field); + + return ( + 0} + error={errorMessages} + > + 0} + value={value} + onChange={(e) => formField({ field, value: e.target.value })} + aria-label={label} + /> + + ); +}; diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/edit_transform_flyout_form_text_input.tsx b/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/edit_transform_flyout_form_text_input.tsx index d9310762ef3e0..9c93d286cb9c4 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/edit_transform_flyout_form_text_input.tsx +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/edit_transform_flyout_form_text_input.tsx @@ -15,10 +15,7 @@ import { useEditTransformFlyout, type EditTransformHookTextInputSelectors, } from './use_edit_transform_flyout'; - -function capitalizeFirstLetter(str: string) { - return str.charAt(0).toUpperCase() + str.slice(1); -} +import { capitalizeFirstLetter } from './capitalize_first_letter'; interface EditTransformFlyoutFormTextInputProps { field: EditTransformHookTextInputSelectors; diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/use_columns.tsx b/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/use_columns.tsx index fb578ec06aa3c..732261bde89d2 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/use_columns.tsx +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/use_columns.tsx @@ -222,7 +222,20 @@ export const useColumns = ( 'data-test-subj': 'transformListColumnDescription', name: i18n.translate('xpack.transform.description', { defaultMessage: 'Description' }), sortable: true, - truncateText: true, + render(text: string) { + return ( + + {text} + + ); + }, }, { name: i18n.translate('xpack.transform.type', { defaultMessage: 'Type' }), From 8768b9d9c61fdeafe009de53375cab7f64203073 Mon Sep 17 00:00:00 2001 From: Kevin Qualters <56408403+kqualters-elastic@users.noreply.github.com> Date: Fri, 29 Sep 2023 03:10:24 -0400 Subject: [PATCH 61/61] [Security Solution] [Alerts] Fix close alerts test looking for rendered but hidden element instead of non existant (#167594) --- x-pack/test/security_solution_cypress/cypress/tasks/alerts.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/alerts.ts b/x-pack/test/security_solution_cypress/cypress/tasks/alerts.ts index de6b4b95deea7..fee36ce79faff 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/alerts.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/alerts.ts @@ -122,7 +122,7 @@ export const closeAlerts = () => { cy.get(TAKE_ACTION_POPOVER_BTN).first().click(); cy.get(TAKE_ACTION_POPOVER_BTN).should('be.visible'); cy.get(CLOSE_SELECTED_ALERTS_BTN).click(); - cy.get(CLOSE_SELECTED_ALERTS_BTN).should('not.be.visible'); + cy.get(CLOSE_SELECTED_ALERTS_BTN).should('not.exist'); }; export const expandFirstAlertActions = () => {